Skip to content

Commit 7b94d07

Browse files
committed
refactor(env): consolidate environment variable system with AsyncLocalStorage rewire
Complete rewrite of environment variable access patterns, consolidating 60+ individual env constant files into grouped getter modules with AsyncLocalStorage-based test rewiring. Changes: - Add env/rewire.ts with AsyncLocalStorage-based test isolation - Add grouped env modules: github.ts, socket.ts, socket-cli.ts, socket-cli-shadow.ts, npm.ts, locale.ts, windows.ts, xdg.ts, temp-dir.ts, test.ts - Convert all env constants to getter functions using getEnvValue() - Delete 60+ individual env constant files - Add comprehensive test suite in test/env/
1 parent 6c913d5 commit 7b94d07

79 files changed

Lines changed: 922 additions & 745 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/env/appdata.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/env/ci.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/**
2-
* CI environment variable snapshot.
2+
* CI environment variable getter.
33
* Determines if code is running in a Continuous Integration environment.
44
*/
55

6-
import { env } from 'node:process'
7-
86
import { envAsBoolean } from '#env/helpers'
7+
import { getEnvValue } from '#env/rewire'
98

10-
export const CI = envAsBoolean(env['CI'])
9+
export function getCI(): boolean {
10+
return envAsBoolean(getEnvValue('CI'))
11+
}

src/env/comspec.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/env/debug.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/**
2-
* DEBUG environment variable snapshot.
2+
* DEBUG environment variable getter.
33
* Controls debug output for the debug package.
44
*/
55

6-
import { env } from 'node:process'
6+
import { getEnvValue } from '#env/rewire'
77

8-
export const DEBUG = env['DEBUG']
8+
export function getDebug(): string | undefined {
9+
return getEnvValue('DEBUG')
10+
}

src/env/getters.ts

Lines changed: 0 additions & 222 deletions
This file was deleted.

src/env/github-api-url.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/env/github-base-ref.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/env/github-ref-name.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/env/github-ref-type.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/env/github-repository.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)