An open source design system that's fully customizable and agent ready
TypeScript
ci(cli): gate PRs and deploy on CLI strict typecheck (#4297)
Joeydf3106c15773
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 5b362cf9b0..bf61825807 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -190,6 +190,13 @@ jobs:if: needs.check-scope.outputs.docsite_only != 'true'run: pnpm -F @astryxdesign/cli typecheck:template-docs+ # Full-package strict checkJs over the CLI (src, bin, scripts, docs, and+ # the emitted templates). Requires the `pnpm build` above so the template+ # .tsx sources can resolve the built @astryxdesign/{core,charts,lab} types.+ - name: Typecheck CLI (strict)+ if: needs.check-scope.outputs.docsite_only != 'true'+ run: pnpm -F @astryxdesign/cli typecheck:strict+- name: Typecheck storybookif: needs.check-scope.outputs.docsite_only != 'true'run: pnpm -F @astryxdesign/storybook typecheckdiff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.ymlindex 98d8ac5c62..de10d1d108 100644--- a/.github/workflows/deploy.yml+++ b/.github/workflows/deploy.yml@@ -81,6 +81,12 @@ jobs:- name: Typecheck template docsrun: pnpm -F @astryxdesign/cli typecheck:template-docs+ # Full-package strict checkJs over the CLI (src, bin, scripts, docs, and+ # the emitted templates). Requires the `pnpm build` above so the template+ # .tsx sources can resolve the built @astryxdesign/{core,charts,lab} types.+ - name: Typecheck CLI (strict)+ run: pnpm -F @astryxdesign/cli typecheck:strict+- name: Typecheck storybookrun: pnpm -F @astryxdesign/storybook typecheckdiff --git a/packages/cli/CONTRIBUTING.md b/packages/cli/CONTRIBUTING.mdindex e95ba8c4b3..6ba59aa84b 100644--- a/packages/cli/CONTRIBUTING.md+++ b/packages/cli/CONTRIBUTING.md@@ -293,7 +293,7 @@ if (!json) p.log.step('Running...');- `.github/scripts/api-cli-parity-test.mjs` verifies the programmatic API returns identical data to `xds --json` for every command- All three run in the `cli-smoke-test.yml` workflow on every PR-## Strict type-check (checkJs + JSDoc) — opt-in for now+## Strict type-check (checkJs + JSDoc) — required CI gateThe CLI ships as hand-written `.mjs` (no build step) but is type-checked withTypeScript's `checkJs` against the JSDoc annotations in the source. `tsconfig.strict.json`@@ -306,8 +306,9 @@ pnpm build # once, so @astryxdesign/{core,charts,lab} dist types resolvepnpm -F @astryxdesign/cli typecheck:strict```-This is **not yet wired into CI** — the tree still has known strict errors. It's available-as a command so contributors can run it locally and so the remaining errors can be burned-down in follow-up PRs. Once the tree is clean, a later PR will make it a required CI gate.-(The emitted `templates/**/*.tsx` import built workspace packages, so run `pnpm build` first-or you'll see spurious "cannot find module" errors from unbuilt `dist` output.)+This is a **required CI gate**: it runs on every PR and in the merge queue (the `build`+check in `ci.yml`) and again before every deploy (the `test` job in `deploy.yml`), so the+CLI must stay strict-clean — a new un-annotated parameter or type error fails CI. Run it+locally before pushing. (The emitted `templates/**/*.tsx` import built workspace packages,+so run `pnpm build` first or you'll see spurious "cannot find module" errors from unbuilt+`dist` output.)