Skip to content

Commit 993c7b1

Browse files
committed
chore(wheelhouse): cascade template@8a15af1b
Auto-applied by socket-wheelhouse sync-scaffolding into cascade-socket-btm-9299. 12 file(s) touched: - .claude/hooks/fleet/prefer-async-spawn-guard/index.mts - .claude/hooks/fleet/prefer-async-spawn-guard/test/index.test.mts - .github/workflows/ci.yml - pnpm-lock.yaml - scripts/fleet/setup/external-tools.json - scripts/fleet/setup/index.mts - scripts/fleet/setup/lib/check-firewall.mjs - scripts/fleet/setup/lib/install-tool.mjs - scripts/fleet/setup/lib/jq.mjs - scripts/fleet/setup/lib/platform.mjs - scripts/fleet/setup/lib/read-pinned-version.mjs - scripts/fleet/setup/setup-tools.mjs
1 parent 44d38a2 commit 993c7b1

12 files changed

Lines changed: 1133 additions & 74 deletions

File tree

.claude/hooks/fleet/prefer-async-spawn-guard/index.mts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@ const CHILD_PROCESS_REQUIRE_RE =
5252

5353
/**
5454
* Files where importing `node:child_process` is legitimate: this hook's own
55-
* files, the oxlint rules that match the banned shapes, and the markdownlint
55+
* files, the oxlint rules that match the banned shapes, the markdownlint
5656
* self-skip shim (a `.mjs` rule loaded by markdownlint-cli2, which can't await
57-
* the async lib wrapper, so its documented fallback is the sync builtin).
57+
* the async lib wrapper, so its documented fallback is the sync builtin), and
58+
* the pre-pnpm bootstrap `.mjs` provisioners under `scripts/fleet/setup/`.
59+
* Those install pnpm itself on a bare machine BEFORE node_modules exists, so
60+
* `@socketsecurity/lib`'s async `spawn` wrapper isn't on disk to import — the
61+
* sync builtin is the only option (same constraint as the markdownlint shim);
62+
* each carries an `oxlint-disable socket/prefer-async-spawn` documenting it.
5863
*/
5964
export function isExemptPath(filePath: string): boolean {
6065
return (
@@ -72,7 +77,11 @@ export function isExemptPath(filePath: string): boolean {
7277
) ||
7378
filePath.includes(
7479
'/.config/fleet/markdownlint-rules/_shared/wheelhouse-self-skip.',
75-
)
80+
) ||
81+
// Pre-pnpm bootstrap .mjs provisioners (scripts/fleet/setup/{lib/,*}.mjs):
82+
// run before node_modules exists, so the lib spawn wrapper isn't importable
83+
// yet. Scoped to `.mjs` so the dir's `.mts` steps stay guarded.
84+
(filePath.includes('/scripts/fleet/setup/') && filePath.endsWith('.mjs'))
7685
)
7786
}
7887

.claude/hooks/fleet/prefer-async-spawn-guard/test/index.test.mts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ describe('prefer-async-spawn-guard / isExemptPath', () => {
7474
'/repo/.config/fleet/markdownlint-rules/_shared/wheelhouse-self-skip.mjs',
7575
'/repo/dist/foo.js',
7676
'/repo/node_modules/x/y.js',
77+
// Pre-pnpm bootstrap .mjs provisioners (install pnpm before node_modules
78+
// exists, so the lib spawn wrapper isn't importable yet).
79+
'/repo/scripts/fleet/setup/lib/install-tool.mjs',
80+
'/repo/scripts/fleet/setup/setup-tools.mjs',
7781
]) {
7882
assert.equal(isExemptPath(p), true, p)
7983
}
@@ -82,5 +86,9 @@ describe('prefer-async-spawn-guard / isExemptPath', () => {
8286
test('does not exempt ordinary source', () => {
8387
assert.equal(isExemptPath('/repo/scripts/foo.mts'), false)
8488
assert.equal(isExemptPath('/repo/src/bar.ts'), false)
89+
// The setup dir's `.mts` steps run AFTER setup, so they stay guarded —
90+
// only the pre-node `.mjs` bootstrap files are exempt.
91+
assert.equal(isExemptPath('/repo/scripts/fleet/setup/index.mts'), false)
92+
assert.equal(isExemptPath('/repo/scripts/fleet/setup/token.mts'), false)
8593
})
8694
})

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ concurrency:
2929
jobs:
3030
ci:
3131
name: Run CI Pipeline
32-
uses: SocketDev/socket-registry/.github/workflows/ci.yml@4069dfc8c54c0b6ffa43924857e6b89296370efe # main (2026-06-09)
32+
uses: SocketDev/socket-registry/.github/workflows/ci.yml@1c633fb12cf27b12f06f9d685e89d34e302822c3 # main (2026-06-13)

0 commit comments

Comments
 (0)