Skip to content

Commit ce4aa1c

Browse files
committed
ci: build the miner CLI before Typecheck, not after
benchmark.ts and cross-repo-evaluation.ts (packages/loopover-miner/scripts/) import from this package's OWN ../dist/lib/*.js -- real .ts since this PR's port, so Typecheck now actually opens and type-checks them, unlike when they were .mjs and invisible to tsc. "Build miner CLI" ran well after Typecheck (down by "Miner package check"), so a clean CI checkout hit Cannot find module on both scripts' dist imports every run. Same class of gap the contract/engine build-order fixes already cover, just for the miner package's own dist rather than a workspace dependency's -- moved the step ahead of Typecheck and widened its trigger to match Typecheck's exactly, for the same reason those two already match: any trigger that typechecks must also have built what typechecking reads. Refs #9527
1 parent c51a97c commit ce4aa1c

1 file changed

Lines changed: 10 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,16 @@ jobs:
499499
- name: Engine package check
500500
if: ${{ github.event_name == 'push' || needs.changes.outputs.backend == 'true' || needs.changes.outputs.engine == 'true' || needs.changes.outputs.ui == 'true' }}
501501
run: npm run test:engine-pack
502+
# Moved ahead of Typecheck (was originally positioned much later, alongside "Miner package check"):
503+
# benchmark.ts and cross-repo-evaluation.ts (packages/loopover-miner/scripts/, real .ts since #9527's
504+
# port) import from this package's OWN ../dist/lib/*.js, so Typecheck cannot resolve them until this
505+
# has run -- the identical class of gap the contract/engine build-order comments above already
506+
# describe, just for the miner package's own dist rather than a workspace dependency's. Trigger
507+
# condition matches Typecheck's exactly (not just miner/engine) for the same reason those two match:
508+
# any trigger that typechecks must also have built what typechecking reads.
509+
- name: Build miner CLI
510+
if: ${{ github.event_name == 'push' || needs.changes.outputs.backend == 'true' || needs.changes.outputs.engine == 'true' || needs.changes.outputs.mcp == 'true' || needs.changes.outputs.miner == 'true' }}
511+
run: npx turbo run build:tsc build:verify --filter=@loopover/miner
502512
# .tsbuildinfo mutates every run (tsc's own incremental state), unlike node_modules above which is
503513
# immutable per lockfile -- so this needs the run_id-suffixed-key + restore-keys-prefix pattern (always
504514
# creates a new cache entry to save into, restore falls back to the most recent matching prefix) rather
@@ -567,25 +577,6 @@ jobs:
567577
- name: MCP package check
568578
if: ${{ github.event_name == 'push' || needs.changes.outputs.mcp == 'true' || needs.changes.outputs.engine == 'true' }}
569579
run: npm run test:mcp-pack
570-
# Same "ships .ts only, this build is for the published npm tarball + the pack-check below, not for
571-
# tests" story as MCP's own "Build MCP" step above. Invokes turbo.json's @loopover/miner#build:tsc
572-
# (real caching win since the 2026-07-24 dist/ migration -- previously cache: false, historically to
573-
# avoid a cache restore stomping this package's hand-written .js files while the #7290 migration was
574-
# still in-flight; #7317 closed that out, and the dist/ split removed the original in-place-emit
575-
# hazard entirely, so caching was finally enabled) and @loopover/miner#build:verify (real caching
576-
# win: skips re-`node --check`-ing all bin/lib files when neither changed) DIRECTLY as their own task names,
577-
# deliberately NOT via the aggregate `@loopover/miner#build` task (which exists for standalone/local
578-
# `npm run build` callers) -- that aggregate's own script is `npm run build:tsc && npm run
579-
# build:verify`, i.e. it re-invokes both of these exact scripts a second time even when turbo already
580-
# ran them as cached prerequisite tasks (declaring a task as a dependsOn prerequisite doesn't replace
581-
# a parent task's own script body). Calling the aggregate here would silently double both the tsc
582-
# compile and the syntax check on every run, negating the caching win this comment describes --
583-
# confirmed by reproducing the double execution locally before switching to this direct form. This
584-
# also finally activates the build:tsc/build:verify split from Phase 0, which no ci.yml step
585-
# exercised until now.
586-
- name: Build miner CLI
587-
if: ${{ github.event_name == 'push' || needs.changes.outputs.miner == 'true' || needs.changes.outputs.engine == 'true' }}
588-
run: npx turbo run build:tsc build:verify --filter=@loopover/miner
589580
# loopover-miner depends on @loopover/engine for real too (same relationship as loopover-mcp above
590581
# -- packages/loopover-miner/package.json lists it as a dependency), so this and "Build miner CLI"
591582
# above now also trigger on an engine-only PR, matching "Build MCP"/"MCP package check"'s existing

0 commit comments

Comments
 (0)