fix(ci): make @civic-source/* resolvable for sync-law.yml inline scripts#198
Merged
Merged
Conversation
The "Sync US Code" workflow failed with `ERR_MODULE_NOT_FOUND: Cannot find package '@civic-source/fetcher'` (run 27901575756). Its inline `node --input-type=module` steps run from the repo root and import @civic-source/fetcher, /transformer, /annotator, but pnpm only symlinks workspace packages into the node_modules of packages that declare them — and the root package.json declared none. Declare the three imported packages as root devDependencies (`workspace:*`) so pnpm symlinks them into the root node_modules, making them resolvable when the scripts execute from the repo root. No workflow path changes needed. Verified locally: reproduced the ERR_MODULE_NOT_FOUND, applied the fix, then confirmed all three imports resolve from repo root after `pnpm install && pnpm build`. Closes #194
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #194.
Problem
The Sync US Code workflow failed on its first real run (27901575756) with:
The inline
node --input-type=module <<'SCRIPT'steps run from the repo root and import@civic-source/fetcher//transformer//annotator. pnpm only symlinks a workspace package into thenode_modulesof packages that declare it as a dependency — and the rootpackage.jsondeclared none — so the imports could not resolve and the step died before any network call.Fix
Declare the three imported packages as root
devDependencies(workspace:*). pnpm then symlinks them into the rootnode_modules, so they resolve when the scripts execute from the repo root. No changes to the workflow's relative paths required."devDependencies": { + "@civic-source/annotator": "workspace:*", + "@civic-source/fetcher": "workspace:*", + "@civic-source/transformer": "workspace:*",Verification (local)
node -e "import('@civic-source/fetcher')"from repo root →ERR_MODULE_NOT_FOUND.pnpm install && pnpm build.Follow-up (not in this PR)
@civic-source/pipelineorchestrate()(de-duping the inline heredoc logic) remains open in fix(ci): sync-law.yml inline node scripts can't resolve @civic-source/* workspace packages #194.🤖 Generated with Claude Code