Repository navigation
fix(cli): use a stored doc parse only with the zod release that made it - #12425
josephfarina wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approved pending CI. CI has not run on this head yet: its run stopped because CI was full, so it needs a re-run, and its required checks still need to pass.
The stored doc parses are now keyed by the zod release that made them, and the CLI reads one only when it loads that same release. The new two-release test fails when the key leaves the release out and passes with it, and the existing stored-parse and kept-parse tests still pass.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Changeset: a stored parse is used only with the zod release that made it, and another release parses the doc, so the answer matches a fresh parse: verified (
storedParse,storedDocsText, new test). - The CLI ships its own docs already parsed and depends on zod by a range: verified (
generate-stored-docs.mjs, thezoddependency inpackages/cli/package.json). - Before this change, an install on another zod release was served the stored parse: verified (the new test fails with the old key, 0 parses instead of 1).
- The per-user kept parses already key on the zod release: verified (
keptParse). - The store key now names the zod release: verified (
storedParseKey). - The reader reads the release once per run and skips the store when it cannot read it: verified (
storedParse,docParserZodVersion). - The generator stores parses under the release it loads, and none when it cannot read it: verified (
storedDocsText). - No new public API: verified (the module is not reachable through the package
exports). - No output change for an install on the publish-time release: verified (that case parses nothing and prints the same).
- Another release parses once with output equal to a fresh parse, and the matching release parses nothing: verified (new test).
- The existing stored-parse and kept-parse tests pass with only the key's new argument: verified.
- The timing table shows no material difference: consistent; the common path adds one cached manifest read of about a millisecond (not re-timed end to end).
- Typecheck adds no new errors, and formatting, the changeset check and the pre-review report pass: verified.
- One defect, no tagalong, and no internal context in public text: verified.
.changeset/stored-parses-zod-release.md: clear.packages/cli/foundation/doc-compiler/stored-docs.mjs: clear.packages/cli/foundation/doc-compiler/stored-docs.test.mjs: clear.packages/cli/scripts/generate-stored-docs.mjs: clear.
- #12252 docs(cli): agent docs name the prop names that differ from other libraries Author: Joey Farina <[email protected]> - #12154 fix(core): a numeric typography weight builds through an extended base's adaptation rules Author: Joey <[email protected]> - #12092 fix(cli): theme build reads the Core it builds with for variant declarations, and names the build command alone Author: Joey Farina <[email protected]> - #12316 fix(core): a shorthand never follows its own longhand in one style merge Author: josephfarina <[email protected]> - #12357 fix(core): a Table stays the scroll region when a host scrolls every table's parent Author: Joey Farina <[email protected]> - #12349 fix(core): end a mouse drag a sandboxed frame never saw released Author: josephfarina <[email protected]> - #12425 fix(cli): use a stored doc parse only with the zod release that made it Author: Joey <[email protected]> - #12396 fix(AppShell): with the standard width points, a server-rendered shell hides its inline side nav on a phone before its script runs Author: Joey <[email protected]> - #12438 fix(charts): end dots draw whole and a thinned axis keeps its last label Author: Joey Farina <[email protected]> - #12448 fix(cli): upgrade outside a project names the project, not --from Author: Joey Farina <[email protected]> - #12459 fix(templates): the dashboard scorecard fits a phone screen Author: Joey Farina <[email protected]> - #12428 fix(core): Field labels draw in a bolder face than their description Author: Joey Farina <[email protected]> - #12435 fix(theme-matcha): dark menus, popovers and muted fills take the theme's deep gray neutral Author: Joey <[email protected]> - #12432 fix(templates): dashboard chart labels show whole instead of clipped by the chart edge Author: Joey Farina <[email protected]> - #12441 fix(cli): mark icon-set generated calls pure so apps drop unused icons Author: Joey Farina <[email protected]> - #12472 fix(MetadataListItem): a value breaks only a word longer than its line Author: Joey <[email protected]>
|
Landed in #12718. |
User impact
The published CLI ships each of its own docs already parsed, so a run reads the parse instead of running the doc parsers. The parsers are zod schemas, and the CLI depends on zod by a range (
^4.6.7), not an exact version. An install can resolve another zod release than the one the parses were made with (a range bump, dedupe with a project's zod, an override). The CLI then served the stored parse anyway, so a valid doc's answer could differ from what parsing it gives under the installed zod (key order, defaults, transforms). The per-user kept parses already key on the installed zod release; the stored parses did not.Problem and solution fit
Expected behavior and authority
A stored parse is "what parsing the doc gives" (
stored-docs.mjs,generate-stored-docs.mjs); the kept parses already hold that rule across zod releases. No record states the stored parses' conditions, so no record changes.Smallest restoration
storedParseKey(key, name, zod): the store key names the zod version.storedParsereads the zod version once per run (the same cached read the kept parses use) and returns nothing when it cannot be read.No new public API (the touched module is internal), no output change for an install that resolves the publish-time zod release.
Evidence
expected +0 to be 1doc parses).parseDoc; the matching release → zero parses, the same output.prepackfile, unpacked to sibling folders of equal path length,CI=1, median of 15 alternating runs, two rounds), base vs this change, ms:docs principles --densedocsdocs tokens --denseDifferences are within run-to-run noise and change sign between rounds; outputs are identical.
Scope
Components: CLI doc compiler (stored docs)
Testing
CI=1 pnpm vitest run --project node packages/cli/foundation/doc-compiler packages/cli/foundation/fs packages/cli/test/packed-stored-docs.test.mjs packages/cli/test/packed-gather-cache.doc-parses.test.mjs packages/cli/test/lazy-dependencies.test.mjspnpm -F @astryxdesign/cli typecheck(no new errors), prettier,pnpm check:changesets,pnpm review:pre(0 findings)