Skip to content

fix(ci): make @civic-source/* resolvable for sync-law.yml inline scripts#198

Merged
williamzujkowski merged 1 commit into
mainfrom
fix/sync-law-workspace-resolution
Jun 23, 2026
Merged

fix(ci): make @civic-source/* resolvable for sync-law.yml inline scripts#198
williamzujkowski merged 1 commit into
mainfrom
fix/sync-law-workspace-resolution

Conversation

@williamzujkowski

Copy link
Copy Markdown
Collaborator

Closes #194.

Problem

The Sync US Code workflow failed on its first real run (27901575756) with:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@civic-source/fetcher'

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 the node_modules of packages that declare it as a dependency — and the root package.json declared 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 root node_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)

  1. Reproduced: node -e "import('@civic-source/fetcher')" from repo root → ERR_MODULE_NOT_FOUND.
  2. Applied fix → pnpm install && pnpm build.
  3. Re-ran the workflow's exact three-import block from repo root → all imports resolved.

Follow-up (not in this PR)

🤖 Generated with Claude Code

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
@williamzujkowski williamzujkowski requested a review from a team as a code owner June 23, 2026 03:11
@williamzujkowski williamzujkowski merged commit c3e1938 into main Jun 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): sync-law.yml inline node scripts can't resolve @civic-source/* workspace packages

1 participant