From 5d967d2e9d0a6af21bb6765706c891b2d9c3d11f Mon Sep 17 00:00:00 2001 From: liuxiaocs7 Date: Wed, 26 Aug 2026 15:39:17 +0800 Subject: [PATCH] fix(build): derive Astryx surface inventory from @astryxdesign/core MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The file-level Astryx surface inventory could not see most of the design system. Its known-component set was a hand-maintained 47-name list while @astryxdesign/core ships ~190 components, so Timestamp, ChatMessage, Thumbnail and others were invisible — removing such a component from a file left its inventory row byte-identical and the coverage gate saw nothing. Severity also recognized only raw button/input/select, so a hand-rolled replacement for a shipped component scored aligned. Derive the component set by parsing the installed @astryxdesign/core declarations (hard error if the package is absent, so the artifact never silently regenerates with a partial set), add a reimplementation severity tier for a local component that shadows a shipped twin it does not import, and regenerate the committed inventory. The declaration parse walks the whole `export *` barrel graph recursively (cycle-safe, fail-closed on any unresolved relative target) rather than a single layer, so a future nested barrel cannot silently drop components; a multi-level fixture makes that boundary executable. Generated-by: Claude Opus 4.8 via Claude Code --- .github/workflows/ci.yml | 6 +- docs/astryx-alignment-inventory.md | 5 +- docs/astryx-surface-file-inventory.md | 180 +++---- package.json | 1 + scripts/ci-test-plan.test.mjs | 14 + scripts/generate-astryx-surface-inventory.mjs | 463 ++++++++++++++---- ...generate-astryx-surface-inventory.test.mjs | 228 +++++++++ 7 files changed, 700 insertions(+), 197 deletions(-) create mode 100644 scripts/generate-astryx-surface-inventory.test.mjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7d6b45dab..53b88315a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,7 +143,7 @@ jobs: fi - name: Install dependencies - if: steps.plan.outputs.code == 'true' || steps.plan.outputs.asf_source == 'true' || steps.plan.outputs.cli_package == 'true' || steps.plan.outputs.release_contract == 'true' + if: steps.plan.outputs.code == 'true' || steps.plan.outputs.astryx_surface == 'true' || steps.plan.outputs.asf_source == 'true' || steps.plan.outputs.cli_package == 'true' || steps.plan.outputs.release_contract == 'true' run: npm ci # The header audit above remains install-free. The complete source gate @@ -181,7 +181,9 @@ jobs: # directly instead of being hidden behind an earlier compilation failure. - name: Astryx surface inventory if: steps.plan.outputs.code == 'true' || steps.plan.outputs.astryx_surface == 'true' - run: npm run astryx:surface-inventory + run: | + npm run astryx:surface-inventory + npm run astryx:surface-inventory:test - name: Build if: steps.plan.outputs.code == 'true' || steps.plan.outputs.cli_package == 'true' || steps.plan.outputs.release_contract == 'true' diff --git a/docs/astryx-alignment-inventory.md b/docs/astryx-alignment-inventory.md index 6b291758ab..264191655b 100644 --- a/docs/astryx-alignment-inventory.md +++ b/docs/astryx-alignment-inventory.md @@ -23,7 +23,9 @@ Maps [Astryx wiki](https://github.com/facebook/astryx/wiki) conventions onto Maka product surfaces. Severity: **blocker** (raw control when an Astryx twin -exists / broken hierarchy) · **polish** (off-scale px, density). +exists / broken hierarchy) · **reimplementation** (a public `@maka/ui` export +shadows a shipped Astryx component — a review signal, not proof) · **polish** +(off-scale px, density). ## Wiki smell checklist (searchable) @@ -34,6 +36,7 @@ exists / broken hierarchy) · **polish** (off-scale px, density). | Design · radius | Nested radii not `outer − gap` | Role radii | | Design · elevation | Raw `box-shadow` / magic z-index | Elevation tokens | | API · Use the System | Raw `