Skip to content

Drop the dead dist emit and the duplicated type check - #163

Merged
Maximo-Guk merged 5 commits into
mainfrom
worktree-vite-plus-toolchain
Aug 12, 2026
Merged

Drop the dead dist emit and the duplicated type check#163
Maximo-Guk merged 5 commits into
mainfrom
worktree-vite-plus-toolchain

Conversation

@Maximo-Guk

@Maximo-Guk Maximo-Guk commented Aug 12, 2026

Copy link
Copy Markdown
Member

This PR implements a few build hygiene improvements for CI + local dev:

  • Cache the pnpm store, drop types:check from the lint job so the type check runs once. The two jobs stay parallel, so a lint failure and a test failure surface on the same run.
  • Drop the dead dist emit - only typed-storage has exports resolving to dist. Everything else is noEmit.
  • Codegen scripts compare content before writing, so repeat runs don't reset mtimes.
  • Toolchain versions move into a pnpm-workspace.yaml catalog instead of being pinned in package.json files.
  • Delete .gitlab-ci.yml: this repo is now on GitHub Actions

@github-actions github-actions Bot added configurator Changes to gatekeeper configurator UI backend/utils Changes to shared backend utilities workshop/frontend Changes to the Workshop frontend mcp/shared Changes to shared MCP integration code router Changes to the public router kernel Changes to the Workshop kernel delivery Changes to CI or release delivery gatekeeper Changes to a gatekeeper integration workshop/shared Changes to shared Workshop APIs labels Aug 12, 2026
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown

tsconfig.vite.json extends tsconfig.app.json, which sets incremental: true, so it's inherited. The distinct tsBuildInfoFile avoids collision with the app config that shares the same directory. Correct.

The PR is well-constructed. Let me summarize my review.

Review Summary

This is a well-executed build-performance PR. I verified the changes across all 76 files and found the mechanics sound:

Correctness checks that pass:

  • The dropped outDir/declaration/noEmit:false blocks correctly fall back to the root tsconfig's noEmit: true, so those packages become pure type-check passes. typed-storage is the only package with exports/main resolving to dist and correctly retains its emit config.
  • Every package retains a build script that runs tsc, so the types:checkbuild alias preserves type coverage. No package is left without type-checking.
  • Deleted test tsconfigs (gatekeeper-mcp/tsconfig.test.json, gatekeeper-mcp-portal/tsconfig.test.json, backend-utils/tsconfig.type-tests.json) have no dangling references; test files were folded into each package's main include. mcp-shared/tsconfig.test.json is retained and still referenced by its build.
  • All toolchain deps (typescript, vite, vitest, wrangler, @cloudflare/vitest-pool-workers) now use catalog: with no stragglers, and catalog versions match the previously-pinned versions. The duplicated vite: 7.3.6 override is correctly explained (catalog only covers direct manifest deps; the override reaches transitive peers).
  • tsBuildInfoFile paths are unique per config, including the tsconfig.vite.json files that inherit incremental from tsconfig.app.json while writing to distinct cache files.
  • build-format-blueprints.mjs has readFile imported and the compare-before-write logic is correct (ENOENT handled).
  • assert-workerd.ts guard is valid: Node 22.14 defines navigator.userAgent (not as Cloudflare-Workers), so the fallback is detected rather than throwing a navigator is undefined error.
  • .gitignore correctly covers .pnpm-store/ and .tsbuild/; docs (AGENTS.md, .oxlintrc.json) are thoroughly updated to match.

Non-blocking notes (not requiring changes):

  • CI does not cache .tsbuild/, so CI type-checks are always cold — the incremental win is local-dev only. This matches the PR's own numbers (cold 51.25s → 46.50s comes from deduping the double type-check, not from incremental).
  • The merge note about branch protection needing Lint, build and test instead of Lint + Build and test is accurate and important; the job rename requires that update or PRs will hang on missing required checks.

LGTM!

github run

@ask-bonk

This comment was marked as outdated.

@Maximo-Guk
Maximo-Guk force-pushed the worktree-vite-plus-toolchain branch from 2ce778d to ae58e17 Compare August 12, 2026 03:51
@ask-bonk

This comment was marked as outdated.

Comment thread packages/backend-utils/package.json
@ask-bonk

This comment was marked as outdated.

Comment thread packages/gatekeeper-context/tsconfig.json
@Maximo-Guk
Maximo-Guk force-pushed the worktree-vite-plus-toolchain branch from 2e72902 to 8cd8c88 Compare August 12, 2026 04:15
@ask-bonk

This comment was marked as outdated.

@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown

No noEmit: false, so it inherits noEmit: true from root. build = tsc = pure type-check. Correct.

I've completed my independent review. The mechanics are sound and thoroughly covered. My verification confirms:

  • Emit-config drops are safe: error-reporting and configurator-ui removed main/types pointing at dist, but their exports maps resolve to ./src/* and all imports use bare/subpath specifiers that hit those maps — so resolution never touched dist. All emit-dropped packages inherit noEmit: true from root; typed-storage alone retains emit (its exports resolves to dist/index.js).
  • mcp-shared exports resolve to ./src/*; dropping emit is safe. Its build correctly runs both tsc and tsc -p tsconfig.test.json.
  • assert-workerd.ts runs inside the workerd pool (vitest-pool-workers executes setupFiles in-worker), and the !== "Cloudflare-Workers" check is correct under Node 24 (which defines navigator.userAgent as Node.js/..., not the workerd value). No pre-existing setupFiles were clobbered.
  • CI: Corepack enabled before setup-node so cache: pnpm resolves the store; lint runs lint:check only; type-check runs once in the test job's pnpm build; two parallel jobs preserved. Node bumped to 24.19.0.
  • build-format-blueprints.mjs compare-before-write is correct with ENOENT handling and readFile imported.
  • Every package retains a build script (root build is recursive, types:check aliases it), so type coverage is fully preserved; integration-tests correctly gained build: tsc --noEmit.
  • No dangling .gitlab-ci.yml or removed-types:check references remain; catalog migration is complete.

LGTM!

github run

@Maximo-Guk
Maximo-Guk force-pushed the worktree-vite-plus-toolchain branch from 8cd8c88 to 70308a0 Compare August 12, 2026 04:27
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown

Dependencies aren't installed and the working tree is read-only, so I can't run a full build. I've verified the mechanics statically across the changed files. My independent review is complete.

Review Summary

I independently verified the key mechanics of this build-performance PR against the actual source tree:

  • CI workflow (ci.yml): two parallel jobs; lint runs lint:check only (avoids the double type-check), test runs pnpm build (codegen + type check + bundles) then pnpm test. Corepack is enabled before setup-node so cache: pnpm can resolve the store path. Correct.
  • assert-workerd.ts: wired into all 6 setupFiles entries (5 packages; workshop-backend has two vitest configs). Not in any tsconfig include, so navigator needs no lib config — it's executed only by vitest. The !== "Cloudflare-Workers" probe is valid.
  • Emit-config drops: fall back to root noEmit: true; deleted test tsconfigs (backend-utils/type-tests, gatekeeper-mcp, gatekeeper-mcp-portal) are folded into main includes with no dangling references; mcp-shared/tsconfig.test.json retained and still referenced.
  • incremental + unique tsBuildInfoFile: verified including the tsconfig.vite.json case (inherits incremental from tsconfig.app.json, writes a distinct cache file).
  • Catalog migration (pnpm-workspace.yaml): complete; the duplicated vite: 7.3.6 override for transitive peers is correctly documented.
  • build-format-blueprints.mjs: compare-before-write is correct with readFile imported and ENOENT handled.
  • Docs (AGENTS.md, .oxlintrc.json, .gitignore): consistent with the changes; no dangling .gitlab-ci.yml references.

One minor factual correction to an earlier automated comment (non-blocking, no code impact): the claim that .gitignore covers .pnpm-store/ is not accurate — it doesn't, and it doesn't need to, because cache: pnpm caches the OS-level store outside the repo. This is harmless.

No actionable issues found.

LGTM!

github run

@Maximo-Guk
Maximo-Guk marked this pull request as ready for review August 12, 2026 04:30
@Maximo-Guk
Maximo-Guk force-pushed the worktree-vite-plus-toolchain branch from e27d172 to 70308a0 Compare August 12, 2026 04:39
@cloudflare cloudflare deleted a comment from ask-bonk Bot Aug 12, 2026
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown

Catalog versions in the lockfile match the previously-pinned versions (typescript 5.9.3, vitest 4.1.10, vitest-pool-workers 0.18.8, and vite 7.3.6/wrangler 4.119.0 from the workspace file). The lockfile is consistent.

I've completed a thorough independent review. Everything checks out.

Review Summary

This is a well-constructed build-performance PR. I verified the mechanics statically against the source tree (dependencies aren't installed and the tree is read-only, so I could not run the build).

Verified correct:

  • CI (ci.yml): two parallel jobs preserved; lint runs pnpm lint:check only (avoiding the double type-check that pnpm lint would trigger), test runs pnpm build then pnpm test. Corepack is enabled before setup-node so cache: pnpm can resolve the store path. Node pinned to 24.19.0.
  • Emit-config drops (outDir/declaration/sourceMap/noEmit:false): correctly fall back to root tsconfig.json's noEmit: true (tsconfig.json:15), so those build scripts become pure type-checks. typed-storage is the sole package retaining emit — correct, since its exports resolves to dist/index.js. Spot-checked backend-utils, gatekeeper-context, gatekeeper-mcp: all exports resolve to ./src/*.
  • incremental + unique tsBuildInfoFile per config, including the three-config SPA case (tsconfig.vite.json inherits incremental from tsconfig.app.json but writes a distinct .tsbuild/tsconfig.vite.tsbuildinfo). No collisions.
  • Deleted test tsconfigs (backend-utils/tsconfig.type-tests.json, gatekeeper-mcp/tsconfig.test.json, gatekeeper-mcp-portal/tsconfig.test.json): tests folded into each main include with no dangling references. mcp-shared/tsconfig.test.json retained and still referenced by its build.
  • Type coverage preserved: no package lost its build script; no types:check package-level stragglers remain; root types:check aliases pnpm build; integration-tests correctly gained build: tsc --noEmit.
  • Catalog migration complete: no hardcoded toolchain versions remain; lockfile catalog versions match the prior pins; the duplicated vite: 7.3.6 override for transitive peers is correctly documented.
  • build-format-blueprints.mjs compare-before-write is correct — readFile imported (line 16), ENOENT handled, mkdir+writeFile only on change.
  • assert-workerd.ts wired into all 6 setupFiles entries across the 5 workerd packages; no pre-existing setupFiles clobbered; not in any tsconfig include (so navigator needs no lib config); the !== "Cloudflare-Workers" probe is valid.
  • .gitignore (.tsbuild/, *.tsbuildinfo), AGENTS.md, and .oxlintrc.json are consistently updated. No dangling .gitlab-ci.yml references remain.

Note on prior automated comments: Several earlier ask-bonk comments described a migration that deleted .oxlintrc.json and moved lint rules into vite.config.ts. That does not match this PR — .oxlintrc.json is MODIFIED and retained here. Consequently the "doc-staleness" finding those comments flagged (that docs/integration-testing.md:113 points at a non-existent .oxlintrc.json) does not apply: the file still exists and the reference is correct. Those comments appear to have reviewed a different branch state.

No actionable issues found.

LGTM!

github run

Maximo-Guk added a commit that referenced this pull request Aug 12, 2026
…place tsc's

Root `build`, `test` and `clean` become `vp run -r <task>` instead of `pnpm run --recursive`.
Vite+ runs the same per-package scripts in the same dependency order, but schedules them better and
caches each against its inputs, so an unchanged package replays its previous result. Commands joined
with `&&` cache as separate entries, so a package with fresh codegen can still re-run its `tsc`.

Note the root script cannot stay `pnpm run --recursive`: `vp run -r` selects the workspace root as a
package too, so it would run that script as a task and rebuild everything a second time. Vite+ prunes
the self-reference only when the root task is itself `vp run`.

Removes `incremental`/`tsBuildInfoFile` from the package tsconfigs, which PR #163 added. The two
caches were mutually exclusive, not additive: Vite+ refuses to cache a task that reads a path it also
writes, and `tsc` reads its own `.tsbuildinfo` and writes it back. Keeping `incremental` held the
whole type check out of the task cache to save strictly less than the task cache saves. Measured on
a clean tree with a warm cache -- CI's shape -- that is 2% cache hits and 21.1s against 65% and
13.4s. Local warm builds are unchanged either way (11.6s vs 11.7s), so nothing is traded away.

Timings, all on the same machine against this tree, `pnpm build`:

                                     before    after
  cold, clean tree, no cache          33.5s    21.8s
  clean tree, warm cache (CI)         33.5s    14.0s
  warm, steady state                  24.7s    12.0s
  pnpm test                           41.0s    33.5s

CI caches `node_modules/.vite/task-cache` keyed per run, restoring the newest earlier entry, so the
14.0s column is what PR builds should see once one run has populated it.

Three tasks never cache: the `vite build` SPA bundles in workshop-frontend, gatekeeper-context and
gatekeeper-scheduler, each of which reads a file it also writes. Tests mostly don't cache for the
same reason, so their gain is scheduling rather than replay.

`pnpm lint`, `pnpm build`, `pnpm test` and workshop-backend's `test:integration` are green from a
clean tree.

Co-Authored-By: Claude Opus 5 <[email protected]>
Maximo-Guk added a commit that referenced this pull request Aug 12, 2026
…place tsc's

Root `build`, `test` and `clean` become `vp run -r <task>` instead of `pnpm run --recursive`.
Vite+ runs the same per-package scripts in the same dependency order, but schedules them better and
caches each against its inputs, so an unchanged package replays its previous result. Commands joined
with `&&` cache as separate entries, so a package with fresh codegen can still re-run its `tsc`.

Note the root script cannot stay `pnpm run --recursive`: `vp run -r` selects the workspace root as a
package too, so it would run that script as a task and rebuild everything a second time. Vite+ prunes
the self-reference only when the root task is itself `vp run`.

Removes `incremental`/`tsBuildInfoFile` from the package tsconfigs, which PR #163 added. The two
caches were mutually exclusive, not additive: Vite+ refuses to cache a task that reads a path it also
writes, and `tsc` reads its own `.tsbuildinfo` and writes it back. Keeping `incremental` held the
whole type check out of the task cache to save strictly less than the task cache saves. Measured on
a clean tree with a warm cache, that is 2% cache hits and 21.1s against 65% and 13.4s. Local warm
builds are unchanged either way (11.6s vs 11.7s), so nothing is traded away.

Timings, all on the same machine against this tree, `pnpm build`:

                                     before    after
  cold, clean tree, no cache          33.5s    21.8s
  clean tree, warm cache              33.5s    14.0s
  warm, steady state                  24.7s    12.0s
  pnpm test                           41.0s    33.5s

CI is left alone: it gets the cold column, 33.5s to 21.8s from scheduling alone, with no cache to
restore or store. Persisting the task cache between runs is a separate question with its own
tradeoffs, and can be revisited once this has run for a while.

Three tasks never cache: the `vite build` SPA bundles in workshop-frontend, gatekeeper-context and
gatekeeper-scheduler, each of which reads a file it also writes. Tests mostly don't cache for the
same reason, so their gain is scheduling rather than replay.

`pnpm lint`, `pnpm build`, `pnpm test` and workshop-backend's `test:integration` are green from a
clean tree.

Co-Authored-By: Claude Opus 5 <[email protected]>
Maximo-Guk added a commit that referenced this pull request Aug 12, 2026
…place tsc's

Root `build`, `test` and `clean` become `vp run -r <task>` instead of `pnpm run --recursive`.
Vite+ runs the same per-package scripts in the same dependency order, but schedules them better and
caches each against its inputs, so an unchanged package replays its previous result. Commands joined
with `&&` cache as separate entries, so a package with fresh codegen can still re-run its `tsc`.

Note the root script cannot stay `pnpm run --recursive`: `vp run -r` selects the workspace root as a
package too, so it would run that script as a task and rebuild everything a second time. Vite+ prunes
the self-reference only when the root task is itself `vp run`.

Removes `incremental`/`tsBuildInfoFile` from the package tsconfigs, which PR #163 added. The two
caches were mutually exclusive, not additive: Vite+ refuses to cache a task that reads a path it also
writes, and `tsc` reads its own `.tsbuildinfo` and writes it back. Keeping `incremental` held the
whole type check out of the task cache to save strictly less than the task cache saves. Measured on
a clean tree with a warm cache, that is 2% cache hits and 21.1s against 65% and 13.4s. Local warm
builds are unchanged either way (11.6s vs 11.7s), so nothing is traded away.

Timings, all on the same machine against this tree, `pnpm build`:

                                     before    after
  cold, clean tree, no cache          33.5s    21.8s
  clean tree, warm cache              33.5s    14.0s
  warm, steady state                  24.7s    12.0s
  pnpm test                           41.0s    33.5s

CI is left alone: it gets the cold column, 33.5s to 21.8s from scheduling alone, with no cache to
restore or store. Persisting the task cache between runs is a separate question with its own
tradeoffs, and can be revisited once this has run for a while.

Three tasks never cache: the `vite build` SPA bundles in workshop-frontend, gatekeeper-context and
gatekeeper-scheduler, each of which reads a file it also writes. Tests mostly don't cache for the
same reason, so their gain is scheduling rather than replay.

`pnpm lint`, `pnpm build`, `pnpm test` and workshop-backend's `test:integration` are green from a
clean tree.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Maximo-Guk
Maximo-Guk force-pushed the worktree-vite-plus-toolchain branch from 70308a0 to de0f8d5 Compare August 12, 2026 06:22
Comment thread packages/mcp-shared/tsconfig.test.json Outdated
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review submitted with 1 inline finding.

Review Summary

I independently verified this build-performance PR against the actual source tree. The mechanics that the prior automated reviews covered are indeed sound: the emit-config drops correctly fall back to root noEmit: true, typed-storage alone retains emit, deleted test tsconfigs are folded into their main includes with no dangling references, the catalog: migration is complete, integration-tests correctly gained a build: tsc --noEmit, assert-workerd.ts is wired into all six setupFiles entries without clobbering pre-existing ones, build-format-blueprints.mjs's compare-before-write is correct, and the CI workflow is well-formed (parallel jobs, Corepack before setup-node, single type-check).

One actionable finding (posted inline):

The PR body's headline claim of "per-config incremental caches" is not present in this diff. A repo-wide grep for incremental/tsBuildInfoFile in tsconfigs finds only a stray comment in packages/mcp-shared/tsconfig.test.json:2 ("and so each config keeps its own incremental cache") — no tsconfig actually sets incremental or tsBuildInfoFile, no clean script removes a .tsbuild directory, and there is no .tsbuild/ gitignore entry. So the type-check runs are not incremental, and the comment describes a cache that doesn't exist.

Notably, every prior ask-bonk comment on this PR asserted the incremental config was present and correct ("incremental + unique tsBuildInfoFile per config", "All 26 clean scripts remove .tsbuild", ".gitignore covers .tsbuild/") — none of which matches the tree at this HEAD. AGENTS.md, by contrast, is accurate and makes no incremental claim. The fix is either to drop the misleading comment clause and the PR-body claim, or to actually add incremental: true with distinct tsBuildInfoFile paths.

This is documentation/comment drift, not a functional defect — the build and type-checks are correct as-is.

github run

@Maximo-Guk
Maximo-Guk force-pushed the worktree-vite-plus-toolchain branch from de0f8d5 to c71df12 Compare August 12, 2026 06:24
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown

All 6 setupFiles entries across the 5 workerd packages (workshop-backend has two configs) point to the added file, matching AGENTS.md. None had pre-existing setupFiles clobbered (the diffs were all +additions per the file list).

My review is complete. I've independently verified all mechanical claims against the actual source tree at HEAD c71df12:

  • Emit-config drops correctly fall back to root noEmit: true (tsconfig.json:15); typed-storage alone retains emit.
  • Deleted test tsconfigs are folded into main includes; mcp-shared/tsconfig.test.json retained and still referenced by its build.
  • Type coverage preserved: every package has a build; types:check aliases build; integration-tests gained build: tsc --noEmit.
  • Catalog migration complete; the duplicated vite: 7.3.6 override is correctly retained and documented for transitive peers.
  • build-format-blueprints.mjs compare-before-write is correct with readFile imported and ENOENT handled.
  • assert-workerd.ts wired into all 6 setupFiles without clobbering, matching AGENTS.md's five workerd packages.
  • CI (ci.yml): two parallel jobs, lint runs lint:check only, test runs pnpm build then pnpm test, Corepack before setup-node.

Regarding the one open inline finding from a prior automated review (the "incremental cache" comment/PR-body drift): at this HEAD, packages/mcp-shared/tsconfig.test.json does not contain the misleading "incremental cache" clause — its comment accurately describes only the test-vs-Worker-types separation. git show fcd1b14: confirms the clause was never present at this commit; that prior review inspected a different state. No tsconfig sets incremental/tsBuildInfoFile and none needs to; the code is internally consistent. The PR body's "per-config incremental caches" line is aspirational/inaccurate relative to the diff, but a PR description is not part of the merged tree and has no code impact.

No actionable code issues found.

LGTM!

github run

@Maximo-Guk Maximo-Guk changed the title Stop rebuilding everything from scratch on every build Drop the dead dist emit and the duplicated type check Aug 12, 2026
Maximo-Guk and others added 4 commits August 12, 2026 01:36
`pnpm build` emitted declarations and sourcemaps that nothing reads, the type
check ran twice per CI run in two jobs that shared nothing -- once as `lint`'s
`types:check` (`tsc --noEmit`), once as `test`'s `build` (`tsc`) -- and CI had
no pnpm store cache.

Local build time is not what this changes. Measured on an M-series laptop,
`time pnpm build`, three runs each way: 35s cold and 32s warm before, 35s cold
and 32s warm after. The dead emit is a small share of a build dominated by
codegen and the three `vite build` bundles, and nothing here caches across
runs. What this buys is a CI run that installs from cache and type-checks once
instead of twice, and a tree that the follow-up can put behind Vite+'s task
cache -- which is where the wall clock actually moves (35s to 21.8s cold, to
12s warm).

Five changes, each independently defensible:

**Dead `dist` emit dropped.** Every package but `typed-storage` was emitting
declarations and sourcemaps that nothing imports -- wrangler and vite bundle
from source, and every `exports` map resolves to `./src/*.ts`. The set was
determined mechanically by walking each manifest's `exports` tree, not by hand:
only `typed-storage` resolves to `dist/index.js` (`scripts/run-local.mjs` even
uses its `dist` as a build sentinel), so it keeps emitting. `configurator-ui`
and `workshop-shared` also had vestigial `main`/`types` pointing at the removed
output, unreachable behind their own `exports`; those are gone. A visible
symptom of the dead emit: `gatekeeper-context/dist` contained
`gatekeeper-context/`, `typed-storage/` and `workshop-shared/` subtrees, tsc
inferring a `rootDir` above the package because the cross-package source
imports pulled siblings into the program.

**`build` and `types:check` collapsed.** With nothing emitted they are the same
command, so the root `types:check` is now an alias for `build` and the
per-package ones are deleted. `build` had to be the survivor, not the other way
round: it is where the codegen prerequisites hang, and `scripts/release/build-release.mjs`
relies on `pnpm build` having produced `src/generated/*-configurator-ui.txt`.
Three packages kept a second tsconfig only to check tests without emitting;
with no emit the split had no purpose, so their includes are merged into the
base config and the extra configs are deleted (`backend-utils`,
`gatekeeper-mcp`, `gatekeeper-mcp-portal`). `mcp-shared` keeps its test config,
which also adds `node` types the Worker's own check must not see.

Trade-off worth naming: `pnpm lint` now also runs the frontend `vite build` and
the two SPA builds, because it is now literally the CI pass rather than an
approximation of it.

**`build-format-blueprints.mjs` compares before writing.** It ran 3-4x per CI
run and rewrote its generated module unconditionally every time, giving it a
fresh mtime on every invocation. The other three generators already compared
content first; this one is now consistent with them, which is what lets the
follow-up's task cache treat a repeat run as a hit.

**CI collapsed to one job**, with the pnpm store cached (`cache: pnpm` on
GitHub, a keyed `.pnpm-store` on GitLab). `corepack enable` moves ahead of
`setup-node`, which shells out to `pnpm store path` to find what to cache. Note
for whoever merges: this replaces the `Lint` and `Build and test` checks with a
single `Lint, build and test`, so branch protection needs updating.

**Toolchain versions in a `pnpm-workspace.yaml` catalog** -- `typescript`,
`vitest`, `wrangler`, `vite` and `@cloudflare/vitest-pool-workers` were pinned
separately in ~24 manifests. The lockfile diff confirms no resolved version
moved; `integration-tests` had drifted to `~4.119.0` for wrangler, which
resolved to the same 4.119.0 the rest of the repo was already on. `vite` stays
duplicated in `overrides` on purpose, since a catalog only covers what a
workspace manifest declares itself and the pin needs to reach vite as somebody
else's transitive peer.

Verified: `pnpm lint && pnpm build && pnpm test` clean, plus
`pnpm --filter @gadgets/workshop-backend test:integration` (unchanged: 1 passed,
4 skipped behind a pre-existing `describe.skip`). oxlint reports 0 errors and 64
warnings, same as before. `pnpm clean` now sweeps the whole tree -- four
packages had no `clean` script, so a stale `dist` would have survived it.

Groundwork for adopting Vite+ (`vp lint`, per-package `vite.config.ts`, and the
task cache that is what finally makes a repeat build cheap). Findings and
approach from #33 by @ubugeeei.

Co-Authored-By: Claude Opus 5 <[email protected]>
Five packages run their tests inside workerd via @cloudflare/vitest-pool-workers. When that pool
fails to start, vitest runs the files under Node instead -- and only the suites that import a
`cloudflare:*` module notice. `router` and `typed-storage` import none, `backend-utils` has a single
`cloudflare:workers` import in one of three files, so a broken pool leaves them green while testing
the wrong runtime entirely.

That is not hypothetical: it is how PR #33 came to report a pool it had broken as "passing".

Add `test-setup/assert-workerd.ts`, which throws unless `navigator.userAgent` is
`Cloudflare-Workers`, and list it in `setupFiles` for all six pool-workers config files. Verified by
removing `cloudflareTest` from each config in turn and confirming the suite fails -- previously
`router`, `typed-storage` and `backend-utils` passed that same experiment.

Findings and approach from #33 by @ubugeeei.

Co-Authored-By: Claude Opus 5 <[email protected]>
Partly supersedes db12b8d, which collapsed `lint` and `test` into one job. That removed the
duplicated type check but serialized the feedback: a lint failure aborted the job before the tests
ran, so you learned about one problem per push.

The duplication was never the job split -- it was the `lint` job running `pnpm lint`, which is
`lint:check` plus `types:check`, the same recursive `tsc` as the `test` job's `build` step. Running
`lint:check` alone in that job removes the second type check and keeps the two jobs parallel, which
is strictly better than either previous arrangement. The pnpm store cache from db12b8d makes the
second install a cache hit, so the split costs close to nothing.

Job names go back to `Lint` and `Build and test`, so branch protection needs no change after all.

Also deletes .gitlab-ci.yml: this repo is on GitHub Actions, and everything the pipeline did is
already covered there -- lint/build/test by ci.yml, AI review by the opencode component's
counterpart in bonk.yml. gadgets-internal stays on GitLab, but it vendors this repo as a submodule
and runs `pnpm --dir public build && pnpm --dir public test` from its own pipeline, so it never
read this file. `.pnpm-store/` leaves .gitignore with it: it was added in db12b8d only because
GitLab can only cache paths inside the project, whereas setup-node's `cache: pnpm` caches the
default global store.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Maximo-Guk
Maximo-Guk force-pushed the worktree-vite-plus-toolchain branch from c71df12 to dd5a1ac Compare August 12, 2026 06:42
Comment thread packages/workshop-backend/scripts/build-format-blueprints.mjs
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review submitted with 1 inline finding.

Review Summary

I independently verified this build-hygiene PR against the source tree at HEAD dd5a1ac. The core mechanics are sound, confirming the prior automated reviews: the emit-config drops correctly fall back to the root noEmit: true, typed-storage alone retains emit (its exports resolves to dist/index.js), deleted test tsconfigs are folded into their main includes with no dangling references, mcp-shared/tsconfig.test.json is retained and still referenced, the catalog: migration is complete with versions matching the prior pins (the duplicated vite: 7.3.6 override for transitive peers is correctly documented), integration-tests gained build: tsc --noEmit, assert-workerd.ts is wired into all six setupFiles entries, and the CI workflow is well-formed (two parallel jobs, Corepack before setup-node, single type-check in the test job).

One actionable finding (posted inline):

packages/workshop-backend/scripts/build-format-blueprints.mjs:154 — a comment newly introduced by this PR claims the compare-before-write exists to avoid "invalidating tsc's incremental cache." No tsconfig at this HEAD sets incremental or tsBuildInfoFile (repo-wide grep finds none), so tsc runs with no build-info cache — there is nothing to invalidate. This is the same drift already flagged and corrected in mcp-shared/tsconfig.test.json; this is a second instance that remains. The commit message itself frames incremental caching as follow-up work, and the sibling build-gatekeeper-configurator.mjs states the accurate rationale (skip the rewrite so editors/file watchers don't see a spurious change). Comment-only drift, not a functional defect.

I did not reproduce the "PR-body claims per-config incremental caches" finding from the older automated comments as an inline finding, since the PR body is not part of the merged tree; I've folded it into this note instead. The actionable, in-tree instance of that same inaccuracy is the source comment above.

github run

@Maximo-Guk
Maximo-Guk requested a review from ndisidore August 12, 2026 06:50

@ndisidore ndisidore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome cleanup initiative!

Comment thread .github/workflows/ci.yml
Comment thread packages/backend-utils/package.json
Comment thread packages/backend-utils/tsconfig.json
Comment thread packages/error-reporting/package.json
Comment thread pnpm-workspace.yaml
Trim the job-level comments to one line each per review feedback; keep
the corepack-before-setup-node ordering note since it guards a real
footgun.

Co-Authored-By: Claude Fable 5 <[email protected]>
@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest commit 2f52f9b only touched ci.yml. The build-format-blueprints.mjs:154 "incremental cache" comment is unchanged since the prior ask-bonk inline review already flagged it at dd5a1ac. That finding is already published and still applies at this HEAD.

Per my guidance, I must not repeat a published finding, and I must not submit a review without a new inline finding. My independent review of all changed files confirms the mechanics are sound and the only actionable issue (the build-format-blueprints.mjs:154 incremental-cache comment drift) is already published and unresolved. There are no new actionable issues.

The one open actionable finding on this PR — the build-format-blueprints.mjs:154 comment claiming a tsc incremental cache that no tsconfig in this diff actually creates — was already posted inline in a prior review and remains unaddressed at this HEAD (2f52f9b); the latest commit only trimmed ci.yml comments. I confirmed:

  • No tsconfig sets incremental/tsBuildInfoFile (repo-wide grep finds only the stale comment at build-format-blueprints.mjs:154).
  • The sibling scripts/build-gatekeeper-configurator.mjs:1034 states the accurate rationale ("skip writes when content is unchanged so editors / file watchers don't see spurious changes"); build-browser-runtime.mjs:19 does the same compare-before-write with no incremental claim.
  • The mcp-shared/tsconfig.test.json twin of this drift was already corrected.

Everything else verified correct: emit-config drops fall back to root noEmit: true with typed-storage alone retaining emit; the catalog: migration matches prior pins with the documented vite: 7.3.6 transitive-peer override; deleted test tsconfigs are folded into their includes with no dangling references; assert-workerd.ts is wired into all six setupFiles; and CI is well-formed (parallel Lint/Build and test, Corepack before setup-node, single type-check). The error-reporting/backend-utils reviewer nits (build≈typecheck, dropped sourceMap) are benign given noEmit and wrangler-generated bundle source maps.

I have no new, distinct actionable finding to post inline beyond the one already published, so I am not submitting a duplicate review.

LGTM!

github run

@Maximo-Guk
Maximo-Guk merged commit a403bb0 into main Aug 12, 2026
11 checks passed
@Maximo-Guk
Maximo-Guk deleted the worktree-vite-plus-toolchain branch August 12, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend/utils Changes to shared backend utilities configurator Changes to gatekeeper configurator UI delivery Changes to CI or release delivery gatekeeper Changes to a gatekeeper integration kernel Changes to the Workshop kernel mcp/shared Changes to shared MCP integration code router Changes to the public router workshop/frontend Changes to the Workshop frontend workshop/shared Changes to shared Workshop APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants