Skip to content

fix(cli): --check reads a theme family's committed compiled registries - #13388

Closed
josephfarina wants to merge 1 commit into
josephfarina/family-compiled-checkfrom
josephfarina/family-check-committed
Closed

josephfarina wants to merge 1 commit into
josephfarina/family-compiled-checkfrom
josephfarina/family-check-committed

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

fix(cli): --check reads a theme family's committed compiled registries

What changes

With #13358 a family whose member has a local TypeScript or JSX registry builds, but theme build --family … --check still checked that registry from its source with Node, so it failed (Cannot import family registry … Unknown file extension ".tsx") right after a successful build — while a single theme build --check of the same member reports it up to date.

Now, under --check, when every module the build compiles matches its committed copy in <family-key>.modules/ (the same comparison --check already makes), each compiled registry is checked by importing that committed copy with Node — exactly what the family module imports — and nothing is written (spec:AST-034 FR8). When any compiled copy is stale or missing, those registries are not imported; the comparison of the outputs reports the stale or missing file, as for every other output. Registries that are not compiled are checked from source, as before.

Testing

New tests in build.self-contained.test.mjs run the CLI in its own process (plain Node):

  • a .tsx family is reported up to date by --check right after its build (fails on the parent);
  • after the registry changes, --check reports ocean-family.modules/icons.tsx.js stale instead of failing to import it (fails on the parent);
  • a local .ts registry whose installed dependency drops the export it imports still fails --check with Cannot import family registry (the committed copy is imported).

vitest run packages/cli/api/theme/build packages/cli/foundation/doc-compiler/doc-loads.test.mjs packages/cli/test/experimental-isolation.test.mjs: 816 pass, 2 skipped.

Stack: #13358 → #13388

preflight: pass 23a79ca

@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 21, 2026 11:44pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 11:35 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 21, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet, and it runs once the pull request targets main and is out of draft.

theme build --family … --check now passes on an up-to-date family with a .tsx or .jsx registry and names a stale or missing compiled copy, and the two new tests fail without the change. There are no blocking findings.

  • Optional: the new up-to-date test at packages/cli/api/theme/build/build.mjs:2721 repeats staleBuildOutputs's per-file comparison; deriving it from staleBuildOutputs would keep the registry skip and the stale report from drifting apart.
Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: With the parent change, a family whose member has a local TypeScript or JSX registry builds, but its family check failed right after the build with an unknown-extension import error: verified (the new up-to-date test fails on the base with that error).
  • Claim: A single build check of the same member reports it up to date: verified (probe exits 0 on the base and the head).
  • Claim: Under the check, when every compiled module matches its committed copy, each compiled registry is checked by importing that copy, and nothing is written: verified (build.mjs:2718-2722; the read-only folder test and probe).
  • Claim: When a compiled copy is stale or missing, those registries are not imported and the output comparison reports the file: verified (build.mjs:2722; the stale test; the missing-copy probe).
  • Claim: Registries that are not compiled are still checked from their source: verified (build.mjs:2716-2717, :2722).
  • Claim: New test, a .tsx family is up to date right after its build, fails on the parent: verified (fails on the base, passes on the head).
  • Claim: New test, an edited registry is reported stale as ocean-family.modules/icons.tsx.js, fails on the parent: verified (fails on the base, passes on the head).
  • Claim: New test, a .ts registry whose installed dependency drops an export still fails the check with the import error: verified (passes on the head).
  • Claim: The new tests run the CLI in its own process: verified (build.self-contained.test.mjs:102-107 spawns Node with the CLI bin).
  • Claim: The named test run gives 816 passed and 2 skipped: consistent (815 passed and 2 skipped here; the one other test lists files with git and finds none in a tree copy without a repository).
  • Claim: Release note: the family check reports a family with a local TypeScript or JSX registry up to date right after its build, imports the committed copies, writes nothing, and leaves a stale or missing copy to the output comparison: verified (.tsx test, .jsx probe, .ts read-only test, stale test, missing probe).
  • Claim: Release note edit: the parent's note no longer says the check reads registries as before, which this change makes untrue: verified (build.mjs:2718-2722); the rest of that note passes the head's build tests.
  • File: packages/cli/api/theme/build/build.mjs: non-blocking note (the up-to-date test repeats the stale comparison's per-file test).
  • File: packages/cli/api/theme/build/build.self-contained.test.mjs: clear.
  • File: .changeset/family-check-committed-modules.md: clear.
  • File: .changeset/family-build-compiled-registry-check.md: clear.

Automated review (maintainer link)

if (check) {
// The committed copies are imported only when every module this build
// compiles matches its committed copy: a copy imports the others.
const current = writes.every(write => path.relative(modulesDir, write.dest).startsWith('..') || (fs.existsSync(write.dest) && normalizeThemeBuildForCompare(fs.readFileSync(write.dest, 'utf8')) === normalizeThemeBuildForCompare(write.content)));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this repeats the per-file test in staleBuildOutputs (lines 975-987). Skipping compiled registries is safe only while the two agree. They already differ for a missing write marked warnWhenMissing, which no module write has today. Deriving current from staleBuildOutputs over the module writes keeps one predicate for both.

A family whose member has a local TypeScript or JSX registry builds, but
--check checked that registry from its source, so it failed right after a
successful build. When every module the build compiles matches its committed
copy in <family-key>.modules/, --check now imports each compiled registry from
that committed copy, as the family module does, and writes nothing; when a
copy is stale or missing, the comparison of the outputs reports it.

Tests run the CLI in its own process: a .tsx family is up to date right after
its build; a changed registry is reported stale, not as a registry it cannot
import (both fail on the parent); a dependency that drops an export the
registry imports still fails --check.
@josephfarina
josephfarina force-pushed the josephfarina/family-compiled-check branch from 93a4f13 to d901f60 Compare November 21, 2026 23:26
@josephfarina
josephfarina force-pushed the josephfarina/family-check-committed branch from c99a2d5 to 23a79ca Compare November 21, 2026 23:26

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet; the CI workflow runs for pull requests to main, so it runs once this pull request targets main.

theme build --family … --check now passes on an up-to-date family with a .tsx or .jsx registry and names a stale or missing compiled copy, and the two new tests fail without the change. There are no blocking findings.

  • Optional: the new up-to-date test at packages/cli/api/theme/build/build.mjs:2721 repeats staleBuildOutputs's per-file comparison; deriving it from staleBuildOutputs would keep the registry skip and the stale report from drifting apart.
Claims and files checked

Review mode: carry-forward; reason: none

  • Claim: With the parent change, a family whose member has a local TypeScript or JSX registry builds, but its family check failed right after the build with an unknown-extension import error: verified (the new up-to-date test fails on the parent with that error).
  • Claim: A single build check of the same member reports it up to date: verified (probe exits 0 on the base and the head).
  • Claim: Under the check, when every compiled module matches its committed copy, each compiled registry is checked by importing that copy, and nothing is written: verified (build.mjs:2718-2722; the read-only folder test and probe).
  • Claim: When a compiled copy is stale or missing, those registries are not imported and the output comparison reports the file: verified (build.mjs:2722; the stale test; the missing-copy probe).
  • Claim: Registries that are not compiled are still checked from their source: verified (build.mjs:2716-2717, :2722).
  • Claim: New test, a .tsx family is up to date right after its build, fails on the parent: verified (fails on the parent, passes with the change).
  • Claim: New test, an edited registry is reported stale as ocean-family.modules/icons.tsx.js, fails on the parent: verified (fails on the parent, passes with the change).
  • Claim: New test, a .ts registry whose installed dependency drops an export still fails the check with the import error: verified (passes on the head).
  • Claim: The new tests run the CLI in its own process: verified (build.self-contained.test.mjs:102-107 spawns Node with the CLI bin).
  • Claim: The named test run gives 816 passed and 2 skipped: consistent (a run of the same patch gave 815 passed and 2 skipped; the one other test lists files with git and finds none in a tree copy without a repository).
  • Claim: Release note: the family check reports a family with a local TypeScript or JSX registry up to date right after its build, imports the committed copies, writes nothing, and leaves a stale or missing copy to the output comparison: verified (.tsx test, .jsx probe, .ts read-only test, stale test, missing probe).
  • Claim: Release note edit: the parent's note no longer says the check reads registries as before, which this change makes untrue: verified (build.mjs:2718-2722); the rest of that note passes the head's build tests.
  • File: packages/cli/api/theme/build/build.mjs: non-blocking note (the up-to-date test repeats the stale comparison's per-file test).
  • File: packages/cli/api/theme/build/build.self-contained.test.mjs: clear.
  • File: .changeset/family-check-committed-modules.md: clear.
  • File: .changeset/family-build-compiled-registry-check.md: clear.

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 22, 2026
- #13358 fix(cli): a theme family checks its compiled registries as plain Node loads them
  Author: @josephfarina
- #13388 fix(cli): --check reads a theme family's committed compiled registries
  Author: @josephfarina
- #13464 experimental theme: a resting background color, outline or shadow keeps a part's hover and keyboard focus visible
  Author: @josephfarina
- #13433 cli(icons): icon response types say "icon meaning" and "variant"
  Author: @josephfarina
- #13456 feat(templates): dashboard-scorecard shows two headline numbers per row on a phone when they fit
  Author: @josephfarina
- #13473 docs(icons): icon-set guide's relatives line; template icons say icon component
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #13542.

@github-actions
github-actions Bot deleted the josephfarina/family-check-committed branch November 23, 2026 06:06

This branch was successfully deployed

1 active deployment
Preview — 23a79ca7 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant