Repository navigation
feat(cli): add opt-in strict checkJs typecheck command - #4275
Merged
Merged
Conversation
The CLI ships as hand-written .mjs (no build step) and is type-checked via checkJs against JSDoc. Only a handful of files are covered by the existing typecheck:json-api project; the rest of the tree has never been strict-checked. Add tsconfig.strict.json (whole non-test tree, full strict incl. noImplicitAny) and a 'typecheck:strict' script so contributors can run it locally. It is NOT wired into CI yet — the tree still has known strict errors. Those will be burned down in follow-up PRs, after which a later PR makes it a required gate.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Cover bin, scripts, docs, and the emitted templates (including their .tsx source) in addition to src — not just src/**. The template .tsx files import built workspace packages (@astryxdesign/core,charts,lab), so a full 'pnpm build' is required before running; documented that prerequisite. Whole-package strict currently reports ~1717 errors (1617 src + 97 docs + 3 bin/scripts; templates are already clean).
josephfarina
added a commit
that referenced
this pull request
Jul 24, 2026
…JSDoc Drive `pnpm -F @astryxdesign/cli typecheck:strict` (tsconfig.strict.json — full strict checkJs over the whole CLI package: src, bin, scripts, docs, and the emitted templates) to zero errors, down from 1717 across 119 files. Fixes are JSDoc-only: no runtime logic changed, .mjs stays .mjs, no @ts-ignore or rule disabling (the single exception is an eslint-disable for the untyped jscodeshift AST factory type, which genuinely cannot be expressed without any). Strict checking surfaced and corrected several real type-contract drifts: - upgrade.run response type declared a `depsUpdated` field the command never emits and omitted the real integrations/filesChanged/transformsApplied/errors - registered the emitted theme.list, theme.add, and layout.* response types in the --json envelope union (they were defined and emitted but never listed in CLIAnyResponse, so their payloads were never actually type-checked) - added category? to ReferenceSection in core docs-types (reference docs already emit it on sections) Also: typed jscodeshift transforms via a shared ambient module declaration plus codemod typedefs, and narrowed catch(e) to Error across command/api handlers. This does not wire the check into CI (that is a follow-up); typecheck:strict remains the opt-in command added in #4275, now passing at zero.
3 tasks
josephfarina
added a commit
that referenced
this pull request
Jul 24, 2026
Wire `pnpm -F @astryxdesign/cli typecheck:strict` (full-package strict checkJs over src, bin, scripts, docs, and the emitted templates) into CI as a required gate — the follow-up #4275 promised once the tree was clean, now unblocked by #4283 driving strict errors to zero. Mirrors the repo's existing typecheck-gate convention: added to the build-storybook job in ci.yml (PRs + merge queue) and the test job in deploy.yml (push to main / deploy). Both jobs already run `pnpm build` first, which strict typecheck requires so the template .tsx sources can resolve the built @astryxdesign/{core,charts,lab} types. Also updates packages/cli/CONTRIBUTING.md, which documented this as "not yet wired into CI." Co-authored-by: Cursor <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an opt-in strict
checkJstype-check command for the CLI. Not wired into CI yet — this just makes the check runnable locally.The CLI ships as hand-written
.mjs(no build step) and is type-checked via TypeScript'scheckJsagainst JSDoc annotations. Today only a handful of files are covered (typecheck:json-apichecksjson.mjs,manifest.mjs,parse.mjs,config.mjs); the rest of the package has never been strict-checked, so type errors and missing annotations land freely.Change
tsconfig.strict.json— fullstrictcheckJsover the whole package:src,bin,scripts,docs, and the emittedtemplates(including their.tsxsource). Tests excluded.strictincludesnoImplicitAny, so an un-annotated parameter is an error — this is what will eventually force complete JSDoc.typecheck:strictscript →tsc --project tsconfig.strict.json.pnpm buildprerequisite (the template.tsxfiles import built workspace packages).pnpm build # so core/charts/lab dist types resolve pnpm -F @astryxdesign/cli typecheck:strictScope / current error count
Whole-package strict currently reports ~1717 errors:
srcdocsbin+scriptstemplates(incl. 639.tsx)The 639 emitted template
.tsxfiles are already strict-clean once the workspace packages are built — confirmed they're genuinely in the checked program (injecting a bad type into one raises the count and is caught).Deliberately NOT in this PR
No CI wiring, no allowlist, no baseline/ratchet. The plan:
typecheck:stricta required CI gate once the package is clean.Test
pnpm -F @astryxdesign/cli typecheck:strictruns over the whole package and reports the current errors (exits non-zero, as expected until clean).typecheck:json-apiandtypecheck:template-docsstill pass.