Repository navigation
ci: typecheck lab, charts, rich text and Vega with their tests, like core - #8318
Conversation
`pnpm -F @astryxdesign/lab typecheck` failed on main: the create harness typed its spy as `ReturnType<typeof vi.fn>`, which vitest 4.1 types as `Mock<Procedure | Constructable>`, a mock TypeScript won't call (`spy(items, change)`: TS2348). The harness now takes the same callable type as the file's other harness; `vi.fn()` still fits it.
…core CI and the push gate ran only these packages' typecheck:docs, which covers their .doc.mjs files, so a type error in their sources or tests merged unseen (lab's MobileTokenizer.test.tsx). Both typecheck lanes now run each package's full typecheck after the build, with core's specialized-lane guard in ci.yml, and a routing test requires every component package's full typecheck in both workflows.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
This change looks ready to merge: the four new full typechecks join the existing typecheck job and push-gate lane without adding a lane or required check, they pass on this head, and the new routing case fails if any of them is removed or loses core's guard. One optional follow-up: take the routing case's package list from COMPONENT_PACKAGE_NAMES, which the file already imports, so a future component package is covered automatically. The branch carries #8313's commit, so either pull request can merge first.
[Automated review]
| // Each component package's own sources and tests, in both typecheck lanes: | ||
| // typecheck:docs covers only its .doc.mjs files, so a type error in a test | ||
| // otherwise lands on main unseen (lab's MobileTokenizer.test.tsx did). | ||
| const packages = ['core', 'lab', 'charts', 'richtext', 'vega']; |
There was a problem hiding this comment.
Optional hardening: this list duplicates COMPONENT_PACKAGE_NAMES, which this file already imports (line 30) and uses to require an RTL shard for every package. Taking it from the registry keeps this case's "every component package" promise true when a package is added:
const packages = COMPONENT_PACKAGE_NAMES;
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsMobileTokenizer (@astryxdesign/lab) · View in Storybook
Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: No accessibility violations detected. Visual Regression46 of 502 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 26 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Depends on #8313: until it merges, this branch carries its commit, and lab's typecheck needs it. Review the last commit.
Maintainer impact
A type error in the sources or tests of
@astryxdesign/lab,charts,richtextorvegamerges without a red check. CI'stypecheckjob and the push gate'stypechecklane run only these packages'typecheck:docs, which covers their.doc.mjsfiles; core alone also runs its fulltypecheck. Lab'sMobileTokenizer.test.tsxmerged with an error this way (TS2348, fixed in #8313), and anyone runningpnpm -F @astryxdesign/lab typecheckhit it on main.Intended invariant
Every component package's own sources and tests typecheck in both typecheck lanes, as core's do since #3197: a type error fails the required
buildjoin (and the release check) instead of landing on main.Change
ci.ymltypecheckjob:Typecheck lab / charts / rich text / Vega (including tests)afterTypecheck core (including tests), with the same specialized-lane guard. No new job, scope or join:typecheckalready runs for every non-specialized change and feedsbuild.deploy.ymltypechecklane: the same four gates after core's.ci-test-routing.test.mjs: both workflows must runpnpm -F @astryxdesign/<package> typecheck(the exact command, sotypecheck:docsdoes not count) for core, lab, charts, richtext and vega, guarded like core's.Cost: 1–8 s per package on a large machine. The
typecheckjob (about 4.5 min, mostly the build) runs besidebuild-storybookand stays off the critical path.Evidence
pnpm -F @astryxdesign/lab typecheckexits 2.pnpm build(lab 8 s, charts 2 s, rich text 5 s, Vega 1 s); the routing cases pass.Scope
Testing
pnpm exec vitest run .github/scripts: 1,229 passed; with the workflow edits reverted, the two new cases fail.pnpm build, thenpnpm -F @astryxdesign/{lab,charts,richtext,vega} typecheck: all exit 0.