Skip to content

Commit 2116b0c

Browse files
committed
fix(ci): build dist via prepare so socket-registry install can resolve self-import
The reusable CI workflow's setup-and-install action (bumped to 13684cd8 in c962821) now provisions ecc-agentshield by invoking `node -e "import { downloadPackage } from '@socketsecurity/lib/dlx/package'"` right after `pnpm install`. For socket-lib itself this path resolves to ./dist/dlx/package.js via the package's own exports map — but dist/ doesn't exist before the build step runs, so the import throws ERR_MODULE_NOT_FOUND and the Check + Test (Isolated) jobs fail. (Matrix test cells skip the agentshield install via `if: strategy.job-total < 2`, so they continued to pass. The breakage was scoped to single-job invocations of setup-and-install.) Build dist as part of the root prepare script. pnpm runs prepare for the workspace root after pnpm install (the root project's ignore-scripts=true only affects deps), so dist/ is in place before any subsequent action step tries to import @socketsecurity/lib/*. The build itself still imports from @socketsecurity/lib-stable (npm:@socketsecurity/lib@5.24.0, already in devDependencies), so there is no chicken-and-egg in prepare. Cost: ~3s added to every pnpm install (acceptable for a build that was already required before publish via prepublishOnly).
1 parent 1fb0e34 commit 2116b0c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@
700700
"fix": "node scripts/fix.mts",
701701
"lint": "node scripts/lint.mts",
702702
"security": "agentshield scan && { command -v zizmor >/dev/null && zizmor .github/ || echo 'zizmor not installed — run pnpm run setup to install'; }",
703-
"prepare": "husky",
703+
"prepare": "husky && node scripts/build/main.mts --quiet",
704704
"prepublishOnly": "pnpm run build",
705705
"test": "node scripts/test/main.mts",
706706
"update": "node scripts/update.mts"

0 commit comments

Comments
 (0)