Skip to content

Commit a01b649

Browse files
authored
chore: disable vitest interopDefault, remove dotenvx (#1207)
* chore: remove disabled dependabot config * chore: disable vitest interopDefault, remove dotenvx Set deps.interopDefault: false in all vitest configs for native CJS resolution matching Node runtime behavior. Remove dotenvx from pre-commit hook, workspace catalog, and devDependencies. Inline SOCKET_CLI_NO_API_TOKEN=1 directly. * fix: remove remaining dotenvx references causing ENOENT in CI * fix: bump socket-registry action SHA to bbe46386
1 parent 91cd811 commit a01b649

20 files changed

+112
-182
lines changed

.config/vitest.config.base.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export default defineConfig({
6868
useAtomics: true,
6969
},
7070
},
71+
deps: {
72+
interopDefault: false,
73+
},
7174
testTimeout: 30_000,
7275
hookTimeout: 30_000,
7376
coverage: {

.config/vitest.config.isolated.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export default defineConfig({
3636
minForks: isCoverageEnabled ? 1 : 2,
3737
},
3838
},
39+
deps: {
40+
interopDefault: false,
41+
},
3942
testTimeout: 30_000,
4043
hookTimeout: 10_000,
4144
coverage: {

.env.precommit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Socket CLI Pre-commit Test Environment
2-
# This file is loaded by dotenvx during pre-commit hooks.
2+
# This file is loaded during pre-commit hooks.
33

44
# Disable API token requirement for unit tests.
55
SOCKET_CLI_NO_API_TOKEN=1

.github/dependabot.yml

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

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
export default { text, view, renderToString, renderToStringWithWidth, printComponent, eprintComponent, getTerminalSize, TuiRenderer, init }
110110
CODE
111111
112-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
112+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
113113
with:
114114
checkout: 'false'
115115

@@ -168,7 +168,7 @@ jobs:
168168
export default { text, view, renderToString, renderToStringWithWidth, printComponent, eprintComponent, getTerminalSize, TuiRenderer, init }
169169
CODE
170170
171-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
171+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
172172
with:
173173
checkout: 'false'
174174

@@ -234,7 +234,7 @@ jobs:
234234
export default { text, view, renderToString, renderToStringWithWidth, printComponent, eprintComponent, getTerminalSize, TuiRenderer, init }
235235
CODE
236236
237-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
237+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
238238
with:
239239
checkout: 'false'
240240
node-version: ${{ matrix.node-version }}
@@ -310,7 +310,7 @@ jobs:
310310
export default { text, view, renderToString, renderToStringWithWidth, printComponent, eprintComponent, getTerminalSize, TuiRenderer, init }
311311
CODE
312312
313-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
313+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
314314
with:
315315
checkout: 'false'
316316
node-version: ${{ matrix.node-version }}

.github/workflows/provenance.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
persist-credentials: false
5353

54-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
54+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
5555
with:
5656
checkout: 'false'
5757

@@ -91,7 +91,7 @@ jobs:
9191
with:
9292
persist-credentials: false
9393

94-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
94+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
9595
with:
9696
checkout: 'false'
9797
registry-url: 'https://registry.npmjs.org'
@@ -141,7 +141,7 @@ jobs:
141141
with:
142142
persist-credentials: false
143143

144-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
144+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
145145
with:
146146
checkout: 'false'
147147
registry-url: 'https://registry.npmjs.org'

.github/workflows/weekly-update.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
persist-credentials: false
3131

32-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
32+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
3333
with:
3434
checkout: 'false'
3535

@@ -61,7 +61,7 @@ jobs:
6161
fetch-depth: 0
6262
persist-credentials: false
6363

64-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
64+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
6565
with:
6666
checkout: 'false'
6767

@@ -76,7 +76,7 @@ jobs:
7676
git checkout -b "$BRANCH_NAME"
7777
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
7878
79-
- uses: SocketDev/socket-registry/.github/actions/setup-git-signing@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
79+
- uses: SocketDev/socket-registry/.github/actions/setup-git-signing@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
8080
with:
8181
gpg-private-key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
8282

@@ -303,7 +303,7 @@ jobs:
303303
test.log
304304
retention-days: 7
305305

306-
- uses: SocketDev/socket-registry/.github/actions/cleanup-git-signing@b86b2cb3fefa4ffa6c1a702476f9785f6c3bb887 # main
306+
- uses: SocketDev/socket-registry/.github/actions/cleanup-git-signing@bbe46386c0a2bc6baefd02916234956a38e622d5 # main
307307
if: always()
308308

309309
notify:

.husky/pre-commit

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,7 @@ else
1515
fi
1616

1717
if [ -z "${DISABLE_PRECOMMIT_TEST}" ]; then
18-
if ! command -v dotenvx >/dev/null 2>&1; then
19-
printf "Error: dotenvx not found in PATH\n" >&2
20-
printf "Install with: pnpm i\n" >&2
21-
exit 1
22-
fi
23-
# Note: .env.precommit is optional and not tracked in git (contains local test config).
24-
# If missing, dotenvx will continue without it. Create .env.precommit with test
25-
# environment variables to optimize pre-commit test performance.
26-
dotenvx -q run -f .env.precommit -- pnpm test --staged
18+
SOCKET_CLI_NO_API_TOKEN=1 pnpm test --staged
2719
else
2820
printf "Skipping testing due to DISABLE_PRECOMMIT_TEST env var\n"
2921
fi

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"pretest": "pnpm run build:cli"
5353
},
5454
"devDependencies": {
55-
"@typescript/native-preview": "7.0.0-dev.20260415.1",
5655
"@anthropic-ai/claude-code": "catalog:",
5756
"@babel/core": "catalog:",
5857
"@babel/parser": "catalog:",
@@ -63,7 +62,6 @@
6362
"@babel/preset-typescript": "catalog:",
6463
"@babel/runtime": "catalog:",
6564
"@babel/traverse": "catalog:",
66-
"@dotenvx/dotenvx": "catalog:",
6765
"@npmcli/arborist": "catalog:",
6866
"@npmcli/config": "catalog:",
6967
"@octokit/graphql": "catalog:",
@@ -96,6 +94,7 @@
9694
"@types/semver": "catalog:",
9795
"@types/which": "catalog:",
9896
"@types/yargs-parser": "catalog:",
97+
"@typescript/native-preview": "7.0.0-dev.20260415.1",
9998
"@vitest/coverage-v8": "catalog:",
10099
"@yao-pkg/pkg": "catalog:",
101100
"browserslist": "catalog:",

packages/cli/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@
4040
"clean:node-smol": "del-cli 'build/node-smol'",
4141
"clean:node_modules": "del-cli '**/node_modules'",
4242
"fix": "oxfmt --write . && oxlint --fix -c ../../.oxlintrc.json",
43-
"lint-staged": "dotenvx -q run -f .env.local -- lint-staged",
44-
"precommit": "dotenvx -q run -f .env.local -- lint-staged",
43+
"lint-staged": "lint-staged",
44+
"precommit": "lint-staged",
4545
"prepare": "husky",
46-
"bs": "dotenvx -q run -f .env.local -- pnpm run build && pnpm exec socket --",
47-
"s": "dotenvx -q run -f .env.local -- pnpm exec socket --",
46+
"bs": "pnpm run build && pnpm exec socket --",
47+
"s": "pnpm exec socket --",
4848
"dev": "node --experimental-strip-types src/cli-dispatch.mts",
4949
"dev:npm": "cross-env SOCKET_CLI_MODE=npm node --experimental-strip-types src/cli-dispatch.mts",
5050
"dev:npx": "cross-env SOCKET_CLI_MODE=npx node --experimental-strip-types src/cli-dispatch.mts",
51-
"e2e-tests": "dotenvx -q run -f .env.test -- vitest run --config vitest.e2e.config.mts",
51+
"e2e-tests": "vitest run --config vitest.e2e.config.mts",
5252
"e2e:js": "node scripts/e2e.mts --js",
5353
"e2e:sea": "node scripts/e2e.mts --sea",
5454
"e2e:all": "node scripts/e2e.mts --all",
5555
"test": "run-s check test:*",
56-
"test:prepare": "dotenvx -q run -f .env.test -- pnpm build && del-cli 'test/**/node_modules'",
56+
"test:prepare": "pnpm build && del-cli 'test/**/node_modules'",
5757
"test:unit": "node --import=./scripts/load.mts scripts/test-wrapper.mts",
5858
"test:unit:update": "node --import=./scripts/load.mts scripts/test-wrapper.mts --update",
5959
"test:unit:coverage": "node --import=./scripts/load.mts scripts/test-wrapper.mts --coverage",

0 commit comments

Comments
 (0)