Repository navigation
build: run turbo boundaries in CI and move the shared Vitest config into a package - #2423
Conversation
…nto a package `turbo boundaries` checks that each package imports only its own files and the packages its package.json declares. It reported 40 issues; it now reports none and runs in ci.yml and ci-turbo.yml. - vitest.shared.mjs and vitest.shared.d.mts move into the private package `@zitadel/vitest-config` (packages/vitest-config). The 26 configs that spread it and the root vitest.config.ts import it by name and declare it. Both runners keep its files a global dependency: no task edge reaches the package. - The 14 imports that cannot go through a package carry `// @boundaries-ignore <reason>`: root scripts/ modules, the components' unpublished Vite plugin and k6's runtime module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🔵 Needs a closer look
This change introduces a new repo-wide required turbo boundaries CI gate propped up by 14 manual // @boundaries-ignore comments, whose passing run must be verified before merge.
No open issues 🎉
1 file not reviewed
pnpm-lock.yaml: Generated file
What changed in this PR
This PR makes turbo boundaries pass and runs it in CI, so each package only imports its own files and the workspace packages it declares. The main mechanism is extracting the root shared Vitest config (vitest.shared.mjs / vitest.shared.d.mts) into a private workspace package @zitadel/vitest-config, so the 26+ configs that spread it import it by name and declare it as a devDependency. The 14 imports that genuinely cannot route through a package (root scripts/ modules, the unpublished components Vite plugin, k6's runtime module) are annotated with // @boundaries-ignore <reason>.
Changes:
- Move the shared Vitest config into
packages/vitest-config(@zitadel/vitest-config) and update all configs + devDependencies + lockfile. - Add
// @boundaries-ignorecomments to the 14 unavoidable cross-boundary imports; addturbo boundariestoci.ymlandci-turbo.yml. - Update references (moon inputs, turbo globalDependencies, PR-title non-shipping lists, contract-spec guard, docs) to the new package path.
| File | Description |
|---|---|
| packages/vitest-config/{package.json,vitest.shared.mjs,vitest.shared.d.mts} | New private package holding the shared config and its hand-written types |
| 27 vitest/vite config files | Import @zitadel/vitest-config by name instead of the root relative path |
| ~25 package.json files + pnpm-lock.yaml | Add @zitadel/vitest-config devDependency and lockfile links |
| turbo.json | List the package's files in globalDependencies; refresh the comment |
| moon.yml, .moon/tasks/typescript.yml | Point test inputs/implicitInputs at the new package path |
| scripts/check-pr-title.mjs | Add packages/vitest-config/ to non-shipping workspaces; drop old root files |
| packages/sdk-core/src/contract.spec.ts | Update the edge-config import guard regex/fixture to the package name |
| e2e/* , tools/bench/scripts/bench.js, apps/storybook/.storybook/main.ts, apps/cli/tests/.../check-pr-title.test.ts | Add // @boundaries-ignore to unavoidable cross-boundary imports |
| .github/workflows/{ci.yml,ci-turbo.yml} | Add the turbo boundaries step after install |
| CONTRIBUTING.md, docs/design/build/turborepo*.md, packages/AGENTS.md, packages/components/AGENTS.md | Document the boundaries rule and the package rename |
Note: this change introduces turbo boundaries as a new repo-wide required CI gate backed by hand-written ignore comments; it would be worth confirming this PR's own full-pr run of that step is green before merge.
Review effort: Balanced
Moves vite.shared.mjs into a private @zitadel/vite package so the SDK builds pass turbo boundaries, as #2423 did for the Vitest config.
Summary
turbo boundariesfails when a package imports a file outside its own directory, or a package itspackage.jsondoes not declare. It reported 40 issues on main. This PR gets it to none and runs it in CI, so turbo's own check keeps imports inside the package graph.vitest.shared.mjsand itsvitest.shared.d.mtsmove into a private workspace package,@zitadel/vitest-config(packages/vitest-config, file names unchanged).vitest.config.ts, now import it by name and list it in their devDependencies. That fixes 26 of the 40 issues.globalDependenciesinturbo.json,implicitInputsin.moon/tasks/typescript.yml. No task edge reaches the package, and turbo hashes another package's files into a task only through task edges, so dropping that would leave every test cache-hit after an edit to the config.// @boundaries-ignore <reason>:scripts/modules: the release manifest and artifacts,dev-process,task-runner,render-builtin-schemas,check-pr-title. No package can depend on the workspace root.k6/x/nextgen, which the xk6 binary provides at run time.turbo boundariesruns right after install inci.yml(the requiredfull-prcheck) and inci-turbo.yml.docs/design/build/turborepo.md, and the CI step is listed inCONTRIBUTING.md.Validation
turbo boundaries: no issues in 1505 files and 38 packages (40 issues before). It exits 1 on a probe import that leaves its package.turbo run typecheck testfor every JS package and the root, uncached: 82 tasks passed (27 typechecks, 25 test suites, and their builds) in 62 s.node scripts/check-moon-graph.mjs,node scripts/check-typecheck-programs.mjs,biome check,pnpm install --frozen-lockfile: clean.packages/vitest-config/vitest.shared.mjschanges the hash of every task, as an edit to the root file did.node scripts/check-pr-title.mjs --base origin/main: ok.Release notes / changeset
No changeset required — no shipped behavior changed. The published packages gain a devDependency only.
Notes
cli-deployment,schemas-deployment). The journey lanes,e2e#testandcli#testread root scripts their turbo inputs do not list; build: stop docs and test edits from re-running the task graph, and let turbo select what ci-turbo runs #2420 adds those inputs.--ignore=alloption, which writes these comments itself, deletedimport nextgen fromfrom the k6 script in a trial run, so the comments here are written by hand.🤖 Generated with Claude Code