Repository navigation
fix(cli): theme build --check ignores the command on each member line of a theme family - #11542
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report🔎 Preview ·
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Outcome: this needs an engineering owner's decision on the new --check behaviour before it can be approved, and two fixes are needed either way.
No current spec record says whether theme build --check may ignore the command on a built theme's built by line (spec:AST-050 FR8 covers only the stale exit and CRLF/LF line endings). An engineering owner records that decision by commenting /approve-spec followed by the full head commit SHA, ideally after stating the rule in FR8; the author may do this if they are an engineering owner.
Blocking:
.changeset/theme-check-ignores-runner.mdhas no contributor line, sopnpm check:changesets(part ofpnpm check:repoin Lint) fails with "body must credit at least one contributor"; add@cixzhangon its own line after the headline.packages/cli/api/integration/pack-check.mjs:131-136keeps its own copy of thebuilt bynormalization, which now runs on a linenormalizeThemeBuildForComparealready hid at line 116, while the doc comment at lines 104-112 still says malformed headers stay significant and--checkstays strict; delete the copy and its import, and update that doc comment, theverify-onlydescribe name and the malformed-header case inpack-check.test.mjs, which passes either way.
The new test fails on main and passes on this branch, and a real change to the module is still reported as stale.
Claims and files checked
- Claim: the check no longer reads a theme as stale when only the runner that built it differs. Verified: the new test fails on main and passes here; a by-hand build under pnpm and check under npm exits 1 on main and 0 here.
- Claim: a built module names the command that built it. Verified:
build.mjs:3323. - Claim: the check now treats that line like the header's
Command:line, asintegration verifyalready does. Verified:build.mjs:718-728,pack-check.mjs:116. - Claim: any other change to the module is still out of date, and a second
built byline counts as content. Verified: the new test's drift case,build.mjs:722-725. - Claim: four theme-editor cases fail on main without pnpm's user agent and pass with it. Verified: on main 4 of 6 fail without it and all 6 pass with it; all 6 pass here without it.
- Claim:
integration verifyand--checkshare one definition of the pattern. Verified for the pattern; the replacement logic is still duplicated (blocking finding above). - Claim: no record says the build command is part of a theme's outputs, and the CLI and Core provenance lines still compare verbatim. Verified: no record mentions the line;
build.mjs:718-728leaves them as they are. - Claim: the macOS results (576 tests, three temp-folder failures). Not checked: macOS only.
- File
.changeset/theme-check-ignores-runner.md: blocking finding (no contributor line). - File
packages/cli/api/integration/pack-check.mjs: blocking finding (duplicate normalization, outdated doc comment). - File
packages/cli/api/integration/pack-check.test.mjs: flipped case correct; malformed-header case covered by the finding above. - File
packages/cli/api/theme/build/build.mjs: clear, pending the owner decision. - File
packages/cli/clients/cli/commands/build-theme.check-runner.test.mjs: clear.
There was a problem hiding this comment.
Outcome: this needs an engineering owner's decision on the new --check behaviour before it can be approved, and one fix is needed either way.
No current spec record says whether theme build --check may ignore the command on a built theme's built by line (spec:AST-050 FR8 covers only the stale exit and CRLF/LF line endings). An engineering owner records that decision by commenting /approve-spec followed by the full head commit SHA, ideally after stating the rule in FR8; the author may do this if they are an engineering owner.
Blocking:
packages/cli/api/integration/pack-check.mjs:131-136still keeps its own copy of thebuilt bynormalization, which now only rewrites the linenormalizeThemeBuildForComparealready hid at line 116, while the doc comment at lines 104-112 says malformed headers stay significant andtheme build --checkstays strict; delete the copy and its import, and update that doc comment, theverify-onlydescribe name and the malformed-header case inpack-check.test.mjs(lines 118-127), which passes either way.
The changeset now credits its author and passes pnpm check:changesets. Required CI has not run on this draft head yet.
Claims and files checked
- Claim: the check no longer reads a theme as stale when only the runner that built it differs. Verified: the new test fails on main and passes here; a build under pnpm checked under npm exits 1 on main and 0 here.
- Claim: a built module names the command that built it, and that command follows the package manager and host. Verified:
build.mjs:3323,package-manager.mjs:524-559. - Claim: the check used to fail with "1 theme output(s) are out of date". Verified: the same build and check on main.
- Claim: the check now treats that line like the header's
Command:line, asintegration verifyalready does. Verified:build.mjs:713-730; on main, verify already hid it behind its header gate. - Claim: any other change to the module is still out of date, and a second
built byline counts as content. Verified: the new test's drift case,build.mjs:722-728. - Claim: four theme-editor cases fail on main without pnpm's user agent and pass with it. Verified: on main 4 of 6 fail without it and all 6 pass with it; all 6 pass here without it.
- Claim:
integration verifyand--checkshare one definition of the pattern. Verified for the pattern; the replacement logic is still duplicated (blocking finding above). - Claim: the
pack-check.test.mjscase now expects a yarn build and a pnpm build to read the same. Verified: it fails on main and passes here. - Claim: no record says the build command is part of a theme's outputs, and the CLI and Core provenance lines still compare verbatim. Verified: no record mentions the line; those header lines are not touched.
- Claim: the changeset is a patch
[fix]for@astryxdesign/cli. Verified:pnpm check:changesetspasses. - Claim: the new test fails in CI before the change. Not checked: CI has not run on this draft.
- Claim: the macOS results (576 tests, three temp-folder failures). Not checked: macOS only.
- Claim: CI impact is one new file of two quick cases. Verified: two tests, under a second here.
- File
.changeset/theme-check-ignores-runner.md: clear. - File
packages/cli/api/integration/pack-check.mjs: blocking finding (duplicate normalization, outdated doc comment). - File
packages/cli/api/integration/pack-check.test.mjs: flipped case correct; describe name and malformed-header case covered by the finding above. - File
packages/cli/api/theme/build/build.mjs: clear, pending the owner decision. - File
packages/cli/clients/cli/commands/build-theme.check-runner.test.mjs: clear.
There was a problem hiding this comment.
Outcome: this needs an engineering owner's decision on the new FR8 rule, and two fixes are needed either way.
The pull request adds a requirement to spec:AST-050 FR8 (--check and integration verify ignore the package-manager command on a built module's built by line) that no current spec record states yet. An engineering owner records that decision by commenting /approve-spec followed by the full head commit SHA on this pull request; the author may do this if they are an engineering owner.
Blocking:
- The new FR8 sentence says source, CLI and Core provenance "still compare verbatim" for both commands, but
integration verifynormalizes theSource:path and theCLI:/Core:versions (packages/cli/api/integration/pack-check.mjs:131-142, asserted inpack-check.test.mjs:136-150), so scope that clause to--check. - Miss: a theme family built with one package manager still fails
theme build --family … --checkunder another, because a family module has onebuilt byline per member andnormalizeThemeBuildForComparehides the command only when there is exactly one (packages/cli/api/theme/build/build.mjs:722-726), so either cover family modules with a family test or narrow the changeset, title and FR8 to single-theme builds.
Claims and files checked
- Claim:
theme build --checkno longer reads a theme as stale when only the package manager differs: true for single-theme modules (new test), false for family builds (family probe). - Claim: a built module names the command that built it: verified (
build.mjs:3323). - Claim: a theme built with pnpm and checked with npm failed with identical outputs: verified, the new test fails on the base with
ERR_THEME_STALE. - Claim: the check now treats that line like the
Command:line, asintegration verifyalready did: verified (build.mjs:722-726; the base's verify normalization). - Claim: any other change to the module is still out of date: verified (
build-theme.check-runner.test.mjs:81-94). - Claim: four theme-editor cases fail without pnpm's user agent and pass with it on the base: verified; they pass on the head with no user agent.
- Claim: a second
built byline still counts as content: verified in code; the test case cannot fail (non-blocking). - Claim:
BUILT_BY_LINEmoves tobuild.mjsand is exported; verify relies on the shared normalization and its doc comment says so: verified. - Claim: the pack-check case is flipped, the describe renamed and a header-less case added: verified.
- Claim: the FR8 clause is records-consistent: false, its provenance clause misstates
integration verify. - Claim: the record changes only in FR8: verified.
- Claim: red-first before fails and after passes, real drift still detected: verified.
- Claim: one new test file of two cases: verified.
- File
.changeset/theme-check-ignores-runner.md: claim broader than the change (family builds). - File
docs/specs/AST-050-app-themes/spec.md: provenance clause misstatesintegration verify; owner approval pending. - File
packages/cli/api/integration/pack-check.mjs: clear. - File
packages/cli/api/integration/pack-check.test.mjs: clear; the second-line case cannot fail (non-blocking). - File
packages/cli/api/theme/build/build.mjs: family modules not covered; check-mode comment outdated (non-blocking). - File
packages/cli/clients/cli/commands/build-theme.check-runner.test.mjs: clear; no family case.
…es-runner # Conflicts: # packages/cli/api/integration/pack-check.test.mjs
… member's built-by line; FR8 scopes verbatim provenance to --check
There was a problem hiding this comment.
Outcome: approval waits on an engineering owner's decision on the new FR8 rule; nothing else blocks.
This pull request writes a new requirement into spec:AST-050 FR8: theme build --check and integration verify ignore the package-manager command on a built module's built by lines, one per theme, and no current spec record states that yet. An engineering owner records that decision by commenting /approve-spec followed by the full head commit SHA on this pull request; the author may do this as an engineering owner. Both earlier findings are fixed: the FR8 provenance sentence is scoped to --check, and family modules are covered and tested.
Optional, non-blocking:
- Two comments still describe the old rule:
integration verify's doc comment says the shared function hides "onebuilt byline" (packages/cli/api/integration/pack-check.mjs:108-109), and the check-mode comment atpackages/cli/api/theme/build/build.mjs:6188-6191names only theCommand:line. - The changeset says
--checknow does whatintegration verify"already does", but verify also changes here for family modules and malformed headers; the description still namestheme-hunt59.test.mjs, whichmainrenamed totheme-app-copy-exactly-source.test.mjs.
Claims and files checked
Review mode: full; reason: spec-record
- Claim:
theme build --checkno longer reads a theme or a family as stale when only the package manager differs: verified (new single-theme and family cases fail on the base and pass on the head). - Claim: a built module names the command that built it: verified (
build.mjs:4385). - Claim: a theme built with pnpm and checked with npm failed the check with identical outputs: verified (red-first run,
ERR_THEME_STALE). - Claim: the check treats those lines like the header's
Command:line, asintegration verifyalready does: verified for single-theme modules; verify also changes for family members and malformed headers (non-blocking). - Claim: any other change to the module is still out of date: verified (
build-theme.check-runner.test.mjs:90-103). - Claim: theme-editor cases fail on
mainwithout a package manager's user agent and pass with pnpm's: verified, now one case intheme-compile-private.test.mjsand four intheme-app-copy-exactly-source.test.mjs(the renamed file); all pass on the head. - Claim: the normalization hides one command per theme, and a second line for the same theme is content and hides nothing: verified (
build.mjs:869-879,pack-check.test.mjs:139-143). - Claim:
BUILT_BY_LINEmoves intobuild.mjsand is exported: verified (build.mjs:841-842). - Claim:
integration verifybuilds on the shared normalization with no copy of its own, and its doc comment says so: verified; the comment still says "one" line (non-blocking). - Claim: the flipped case, renamed describe, header-less case and family case behave as described, the family case failing under the old one-line rule: verified (all fail on the base).
- Claim: FR8 gains the stated sentences and the record changes only in FR8: verified (
spec.md:243-248). - Claim:
--checkstill compares theSource:,CLI:andCore:lines verbatim whileintegration verifyreads them as placeholders: verified (pack-check.test.mjs:156-171,pack-check.mjs:132-145). - Claim: the new test file has three cases, and the pull request adds one net unit case: verified.
- Claim:
mainis merged with one formatting-only conflict inpack-check.test.mjs: verified, that file's final diff holds only this change's cases. - Claim: after the merge the two test files pass (122 tests) and eslint and prettier are clean: verified on Linux; the macOS runs, and the three macOS-only temp-folder failures the description names, were not reproduced.
- Claim: writing rubric results are reported: present.
- File
.changeset/theme-check-ignores-runner.md: verify wording (non-blocking). - File
docs/specs/AST-050-app-themes/spec.md: the new FR8 rule waits on engineering-owner approval; its text matches the code. - File
packages/cli/api/integration/pack-check.mjs: doc comment says one line (non-blocking). - File
packages/cli/api/integration/pack-check.test.mjs: clear. - File
packages/cli/api/theme/build/build.mjs: clear; check-mode comment outdated (non-blocking). - File
packages/cli/clients/cli/commands/build-theme.check-runner.test.mjs: clear.
Main now hides the command on a built module's built-by line (#12282, by Joey Farina), which was this branch's core, and a build now always names `astryx theme build` there. Main hides the command only when the module has exactly one such line. A theme family has one line per member, so a family an earlier release built with another command still read as out of date. This merge keeps main's normalization and changes withBuiltByCommandPlaceholder to hide the command on every member's line, unless two lines name the same theme. integration verify shares the helper. The branch's own pack-check and AST-050 changes are dropped: AST-050 already says that another command never makes an output stale.
|
/approve-spec a513134 |
There was a problem hiding this comment.
Outcome: changes requested. The code change is ready, but the title and description still describe the earlier, larger version of this pull request.
The family fix follows the existing app-themes rule that the command a built module names never makes an output stale on its own, and the new family case fails on main and passes here.
- The title says
theme build --checknow ignores which package manager built a theme, but a single theme already checks clean onmain, so retitle it to the family case, for examplefix(cli): theme build --check ignores the command on each family member's built-by line. - The description says this pull request moves
BUILT_BY_LINE, changespack-check.mjs,pack-check.test.mjsand the FR8 text, builds its test themes under pnpm's user agent, and fixes single-theme and theme-editor cases that fail onmain, while this head only changeswithBuiltByCommandPlaceholderand adds a four-case test whose single-theme case already passes onmain, so rewrite it to describe this change.
Optional, non-blocking:
- The doc comments of
normalizeThemeBuildForCompare(packages/cli/api/theme/build/build.mjs:947-951) andnormalizeThemeVerifyForCompare(packages/cli/api/integration/pack-check.mjs:111-113) still say they hide "one"built byline. - The repeated-theme guard changes no result, since a doubled line always differs from a fresh build, so the case written for it passes with or without it; the two drift cases also do not check that their build succeeded.
Claims and files checked
Review mode: full; reason: spec-record
- Claim (changeset):
--checkno longer reads a theme family as out of date when only the command on its built-by lines differs: verified (family case fails onmainwithocean-family.jsoutdated and passes here). - Claim (changeset): a family module names the build command once per member: verified (one line per member in the built
ocean-family.js). - Claim (changeset): such outputs failed the check with otherwise identical content: verified for families.
- Claim (changeset): the check already ignored that line in a single theme's module: verified (single-theme check is up to date on
main). - Claim (changeset): it now ignores every member's line, and
integration verifydoes the same: verified (both use the shared normalization). - Claim (changeset): a second line for one theme, or any other change, is still out of date: verified (both drift cases exit 1).
- Claim (description): the built module's comment names the command, which follows the package manager: verified.
- Claim (description):
--checkcompared the line literally and failed for a single theme: false onmain. - Claim (description):
integration verifyalready ignores that line: verified for single-line modules. - Claim (description): the theme-editor cases fail on
mainwithout a package manager's user agent: false (all pass onmainwith it unset). - Claim (description): the normalization hides one command per theme and none when a theme repeats: verified.
- Claim (description):
BUILT_BY_LINEmoves intobuild.mjsand is exported: false for this pull request (already there onmain). - Claim (description):
pack-check.mjs, its doc comment andpack-check.test.mjschange: false (not in this diff). - Claim (description): the AST-050 FR8 text gains the quoted sentences and the record changes only there: false (no record changes;
mainhas different FR8 wording). - Claim (description): the changeset is a fix for the CLI: verified.
- Claim (description): the new test builds under pnpm's user agent and the single-theme case fails before the change: false (it rewrites the line after the build; that case passes on
main). - Claim (description): a drift case and a family case exist and behave as stated: verified.
- Claim (description): a family case in
pack-check.test.mjsfails under the one-line rule: false (not in this diff). - Claim (description): the macOS runs, test counts and temp-folder failures: not reproducible here.
- Claim (description):
mainis merged with one formatting-only conflict: describes an earlier merge; the latest merge reshaped the patch. - Claim (description): one new file of 3 cases and one unit case: false (4 cases, no unit case).
- Claim (description): writing rubric results: present, but they describe FR8 sentences no longer in this pull request.
- Claim (description): the owning automation and land path: not a code claim.
- File
.changeset/theme-check-ignores-runner.md: clear. - File
packages/cli/api/theme/build/build.mjs: clear; redundant guard and stale doc comment (non-blocking). - File
packages/cli/clients/cli/commands/build-theme.check-runner.test.mjs: clear; drift cases do not assert their build (non-blocking).
…doc comments A second built-by line for one theme already differs from a fresh build, so the guard for it changed no result; the helper now hides the command on every line. The doc comments of normalizeThemeBuildForCompare and normalizeThemeVerifyForCompare name one line per theme. The drift cases check that their build succeeded. Prettier formats two lines main left unformatted in build.mjs.
|
/approve-spec bef09d8 |
There was a problem hiding this comment.
Outcome: approved. CI, Lint and the CLI smoke test have passed on this head, including the Node tests that run the new file.
The family fix follows the app-themes rule that the command a built module names never makes an output stale on its own: the new family case fails on main and passes here, and real drift still fails. Nothing else needs to change.
Claims and files checked
Review mode: same-head; reason: none
- Changed rules (0): none.
- Title:
--checkignores the command on each family member's line: verified (the family case fails onmainand passes here, and CI's Node tests pass it). - Changeset: the check no longer reads a family as stale when only the built-by command differs: verified (
build-theme.check-runner.test.mjs:98-105, red onmain). - Changeset: a built family module names the command once per member: verified (
build.mjs:7065builds each member's module from the template at:4324-4330; the test's family module has two lines,:101). - Changeset: such outputs failed the check with otherwise identical content: verified (
mainreportsocean-family.jsoutdated). - Changeset: the check already ignored the line in a single theme's module: verified (
mainhides it only when a module has exactly one built-by line; the single-theme case passes there). - Changeset: it now ignores every member's line, and
integration verifydoes the same: verified (build.mjs:906-908, used bypack-check.mjs:134). - Changeset: a second line for one theme, or any other change, is still out of date: verified (
:107-117,:119-134,pack-check.test.mjs:111-134). - Changeset: a patch fix for the CLI that credits its author: verified (the credit line, and the changeset check passes).
- Description: who it helps, and that a family module names the command once per member: verified.
- Description:
mainalready ignores the command when a module has exactly one built-by line, from an earlier merged change, so a single theme checks clean: verified. - Description: a family has two or more lines, so it still failed: verified (red family case).
- Description: the helper hides the command on every built-by line, and a second line for one theme still differs from a fresh build: verified (
build.mjs:906-908; a family never repeats a theme,family.mjs:25-29). - Description:
--checkandintegration verifyshare the helper, and both doc comments say one line per theme: verified (build.mjs:941-953,pack-check.mjs:107-116). - Description: no record change, and the app-themes rule it quotes already decides it: verified (the quote matches that rule on
main). - Description: the earlier record sentence and
pack-check.mjscode changes are dropped: verified (only a doc-comment edit topack-check.mjsremains). - Description: the red-first cases (family up to date here and stale on
main; single theme up to date as onmain; changed member content and a second built-by line still stale): verified. - Description: the new file and the pack-check and theme-build suites pass 752 with 2 skipped, and eslint and prettier are clean: verified.
- Description: prettier also formats two lines
mainleft unformatted: verified (build.mjs:5710,:5723). - Description: CI impact is one new four-case file in the Node project: verified (CI's Node tests ran it at this head).
- Description: overlap with the earlier merged change was checked and credited: verified.
- File
.changeset/theme-check-ignores-runner.md: clear. - File
packages/cli/api/integration/pack-check.mjs: clear (doc comment only). - File
packages/cli/api/theme/build/build.mjs: clear. - File
packages/cli/clients/cli/commands/build-theme.check-runner.test.mjs: clear.
Who this helps
Anyone who checks a theme family with
theme build --check(orintegration verify) when its built module came from an earlier release that named another command, such aspnpm dlx … theme build. A family module names that command once per member theme. Main already ignores the command when a module has exactly one built-by line (#12282, by Joey Farina), so a single theme checks clean. A family has two or more lines, so it still read as out of date with otherwise identical content.What changes
packages/cli/api/theme/build/build.mjs:withBuiltByCommandPlaceholderhides the command on every built-by line, one per theme. A second line for one theme still differs from a fresh build, so it stays significant.--checkandintegration verifyboth use this helper, so they agree, and both doc comments now say one line per theme..changeset/theme-check-ignores-runner.md:[fix]for@astryxdesign/cli.pack-check.mjschanges are dropped, since main's fix(cli): theme build --check and doctor ignore which CLI release, and which command name, built a theme #12282 carries the core.Red-first
packages/cli/clients/cli/commands/build-theme.check-runner.test.mjsbuilds a theme and a family, rewrites their built-by lines to namepnpm dlx @astryxdesign/cli theme build, and runs--check:Tests
On a Linux build machine at bef09d8: the new file and the
pack-check.test.mjsandtheme/buildsuites pass 752, with 2 skipped (the family case fails with main's helper); eslint and prettier are clean. Prettier also formats two lines main left unformatted inbuild.mjs.CI impact
None: one new test file of 4 cases in the Node project.
Overlap checked: #12282 (merged; this builds on its normalization and credits it for the core)