Repository navigation
fix(cli): make .mjs sources fully strict-typecheckable (checkJs + JSDoc, 1717 → 0) - #4283
Merged
Merged
Conversation
josephfarina
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 24, 2026 03:42
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
July 24, 2026 03:42
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: 70 accessibility violation(s) found — 6 critical, 57 serious, 6 moderate, 1 minor. AppShell - 1 issue(s)
Avatar - 1 issue(s)
AvatarGroup - 1 issue(s)
Badge - 1 issue(s)
Banner - 1 issue(s)
Card - 1 issue(s)
Carousel - 1 issue(s)
Chat - 1 issue(s)
ChatComposer - 1 issue(s)
ChatComposerInput - 2 issue(s)
ChatLayout - 1 issue(s)
ChatReasoning - 1 issue(s)
ChatToolCalls - 1 issue(s)
CheckboxList - 1 issue(s)
ClickableCard - 1 issue(s)
CodeEditor - 2 issue(s)
CodeEditorPerf - 2 issue(s)
CodeEditorTheme - 1 issue(s)
CodeTheme - 1 issue(s)
Collapsible - 1 issue(s)
DateRangeInput - 1 issue(s)
FileInput - 3 issue(s)
Grid - 1 issue(s)
GridMasonry - 1 issue(s)
Heading - 1 issue(s)
Icon - 1 issue(s)
InputGroup - 1 issue(s)
Item - 2 issue(s)
Kbd - 1 issue(s)
Layout - 2 issue(s)
List - 2 issue(s)
LogStream - 1 issue(s)
Outline - 1 issue(s)
OverflowList - 1 issue(s)
Overlay - 1 issue(s)
Pagination - 1 issue(s)
PowerSearch - 1 issue(s)
ProgressBar - 1 issue(s)
RadioList - 1 issue(s)
RichTextEditor - 1 issue(s)
Schedule - 1 issue(s)
Section - 1 issue(s)
SegmentedControl - 1 issue(s)
SelectableCard - 1 issue(s)
Stack - 1 issue(s)
Stepper - 1 issue(s)
TabList - 1 issue(s)
Table - 1 issue(s)
TableGroupedRows - 2 issue(s)
TablePagination - 1 issue(s)
TableRowStatus - 1 issue(s)
TableTree - 1 issue(s)
Text - 1 issue(s)
Theme - 1 issue(s)
PopArt - 1 issue(s)
Thumbnail - 1 issue(s)
Timestamp - 1 issue(s)
Token - 1 issue(s)
Tokenizer - 1 issue(s)
Toolbar - 1 issue(s)
ToolbarEdgeCompensation - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
josephfarina
force-pushed
the
fix/strict-typecheck-zero
branch
from
July 24, 2026 06:15
37d9ff1 to
595ac9a
Compare
josephfarina
force-pushed
the
fix/strict-typecheck-zero
branch
from
July 24, 2026 06:53
595ac9a to
2d19c80
Compare
josephfarina
force-pushed
the
fix/strict-typecheck-zero
branch
from
July 24, 2026 07:12
2d19c80 to
9aa3b64
Compare
josephfarina
commented
Jul 24, 2026
| @@ -1,10 +0,0 @@ | |||
| { | |||
Contributor
Author
There was a problem hiding this comment.
why delete this file?
josephfarina
commented
Jul 24, 2026
| @@ -0,0 +1,42 @@ | |||
| # Code review brief — PR #4283 (strict-typecheck-zero) behavior-safety audit | |||
…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. JSDoc-only: no runtime logic change, .mjs stays .mjs, no @ts-ignore or rule disabling (one scoped eslint-disable for the untyped jscodeshift AST factory). Every runtime file was audited to confirm behavior preservation; annotations use runtime-erased casts, and the few spots where the type pass had incidentally altered error-message text / edge-path behavior were restored to match main. Type-contract corrections surfaced by strict checking: - upgrade.run response type declared a phantom depsUpdated field (never emitted) and omitted the real integrations/filesChanged/transformsApplied/errors - registered the emitted theme.list, theme.add, and layout.* response types in the --json envelope union; layout.grammar data includes its aliases table - added category? to ReferenceSection in core docs-types
josephfarina
force-pushed
the
fix/strict-typecheck-zero
branch
from
July 24, 2026 19:21
9aa3b64 to
7b78b64
Compare
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 was referenced Jul 27, 2026
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
Drives
pnpm -F @astryxdesign/cli typecheck:strict(the opt-intsconfig.strict.jsonadded in #4275 — fullstrictcheckJsover the whole CLI package:src,bin,scripts,docs, and the emittedtemplates) to zero errors, down from 1717 across 119 files.Fixes are JSDoc-only: no runtime logic changed, every
.mjsstays.mjs, no@ts-ignore/@ts-nocheck/rule-disabling — with one flagged exception (below).Why
The CLI ships as hand-written
.mjsand is type-checked viacheckJsagainst JSDoc. #4275 added the strict command but the tree had 1717 errors, so it couldn't gate anything. This annotates the whole package so the check is green — the prerequisite for wiring it into CI (a follow-up PR, intentionally not in this one).Real type-contract drifts fixed
Strict checking surfaced several genuine mismatches between declared types and what the code actually does — corrected honestly, not papered over:
upgrade.runresponse type was stale: declared adepsUpdatedfield the command never emits and omitted the realintegrations/filesChanged/transformsApplied/errors(the latter confirmed byupgrade.config-ordering.test). Aligned the type to the emitted envelope.theme.list,theme.add, andlayout.*were emitted but never registered in the--jsonenvelope union (CLIAnyResponse), so their payloads were never actually type-checked. Added the response types and registered them.ReferenceSectionwas missingcategory?in core'sdocs-types.ts, though reference docs already emit it on sections (this alone was 97 of the errors).@astryxdesignin aDoctorContexttypedef was read as a tag, silently truncating the type.The one flagged exception
jscodeshiftships no type declarations and its AST/builder surface is fully dynamic (j(src),j.JSXElement,path.node). Expressing the factory requiresany(a callable + index-signature type), whichunknowncan't do. That's isolated to one ambient module declaration (src/types/jscodeshift.d.ts+ the mirroredJscodeshiftFactoryincodemod.d.ts) behind a scopedeslint-disable @typescript-eslint/no-explicit-anywith an explanatory comment. Everywhere else, AST callback params use explicit JSDoc/** @type {any} */(allowed — only implicit any is banned).Not fixed (flagged for follow-up)
jsonError(msg, {agentDocs}/{receipt})inupgrade.mjspasses sidecar objects as thesuggestionsparam, whichtoErrorEnvelopesilently drops (it only forwards values with.length). This is a latent runtime bug; preserving current behavior here (JSDoc-only PR). Worth a dedicated fix.Project.loadedIntegrations→Array<object>,buildRegistry→ looseMap) force a few boundary casts. Tightening them is a good follow-up cleanup.Test
pnpm -F @astryxdesign/cli typecheck:strict→ 0 errors (was 1717).typecheck:json-apiandtypecheck:template-docs→ pass..tsxresolve (as CI'sbuildjob does).