Skip to content

build: validate component-spec theming anatomy - #5718

Merged
cixzhang merged 1 commit into
mainfrom
feat/anatomy-theming-dispositions
Aug 31, 2026
Merged

cixzhang merged 1 commit into
mainfrom
feat/anatomy-theming-dispositions

Conversation

@cixzhang

@cixzhang cixzhang commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

Theme authors need every documented component part to have an explicit theming owner, without exposing maintainer ownership records through consumer docs, CLI JSON, MCP, or generated docsite data.

What

  • Add an optional ### Theming anatomy block under ## Design relationships in the existing component-spec template. The versioned JSON map keys exact English anatomy names and declares one of target, inherits, delegatesTo, or none with a reason.
  • Extend check:knowledge to parse opted-in blocks, compare them with the component's canonical .doc.mjs anatomy and current targets, and reject incomplete, conflicting, misplaced, or malformed dispositions.
  • Keep the block optional while existing component specs migrate; no component is required to backfill in this foundation.
  • Clarify that exact mappings live only in component specs, while nearby prose is reserved for non-obvious rationale, exceptions, and links.

Consumer impact

None. ComponentDoc, .doc.mjs, CLI and programmatic JSON, MCP responses, and generated docsite registry types and data are unchanged. The validator test verifies consumer doc bytes remain unchanged.

Metadata shape

### Theming anatomy

<!-- anatomy-theming:v1 -->
```json
{
  "Root": {"target": "button"},
  "Label": {"inherits": "button"},
  "Icon": {
    "delegatesTo": {"owner": "component:Icon", "target": "icon"}
  },
  "Content": {"none": {"reason": "Consumer-owned content."}}
}
```

Target names omit astryx- and use kebab-case. Delegated owners use component:<Name> or family:<id>.

Testing

  • vitest run scripts/check-knowledge.test.mjs — 30 tests
  • pnpm check:knowledge
  • pnpm check:repo
  • Generated component registry leak check
  • CLI component JSON leak check
  • Consumer schema/generator diff against the parent branch is empty
  • Public leak scan

@vercel

vercel Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 31, 2026 3:15am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 30, 2026
@cixzhang
cixzhang force-pushed the docs/component-theming-surface branch from 2ba0db5 to 3fbed51 Compare August 30, 2026 22:50
@cixzhang cixzhang changed the title feat(cli): type anatomy theming dispositions build: validate component-spec theming anatomy Aug 30, 2026
@cixzhang
cixzhang force-pushed the feat/anatomy-theming-dispositions branch 2 times, most recently from 5d3842e to 493cf44 Compare August 30, 2026 22:55
@cixzhang
cixzhang force-pushed the feat/anatomy-theming-dispositions branch from 493cf44 to e9ba105 Compare August 30, 2026 22:59
@cixzhang
cixzhang force-pushed the docs/component-theming-surface branch from 3fbed51 to f171a16 Compare August 30, 2026 23:00
@cixzhang
cixzhang force-pushed the feat/anatomy-theming-dispositions branch from e9ba105 to ab81a4b Compare August 30, 2026 23:04
@cixzhang
cixzhang force-pushed the docs/component-theming-surface branch from f171a16 to e2e8741 Compare August 30, 2026 23:10
@cixzhang
cixzhang force-pushed the feat/anatomy-theming-dispositions branch from ab81a4b to 446327c Compare August 30, 2026 23:11
@cixzhang
cixzhang force-pushed the docs/component-theming-surface branch from e2e8741 to cf708e2 Compare August 30, 2026 23:18
@cixzhang
cixzhang force-pushed the feat/anatomy-theming-dispositions branch from 446327c to d0b9d15 Compare August 30, 2026 23:19
@cixzhang
cixzhang force-pushed the feat/anatomy-theming-dispositions branch from d0b9d15 to ea37a28 Compare August 30, 2026 23:58
@cixzhang
cixzhang changed the base branch from docs/component-theming-surface to main August 30, 2026 23:58
@cixzhang
cixzhang marked this pull request as ready for review August 31, 2026 00:01
@cixzhang
cixzhang enabled auto-merge (squash) August 31, 2026 00:01
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Aug 31, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec ea37a28

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Aug 31, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 090d592

@cixzhang
cixzhang force-pushed the feat/anatomy-theming-dispositions branch from ea37a28 to 090d592 Compare August 31, 2026 03:07
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Aug 31, 2026
@cixzhang
cixzhang force-pushed the feat/anatomy-theming-dispositions branch from f026032 to 090d592 Compare August 31, 2026 03:12
@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Aug 31, 2026
github-actions Bot added a commit that referenced this pull request Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang merged commit 039852f into main Aug 31, 2026
40 of 44 checks passed
@github-actions
github-actions Bot deleted the feat/anatomy-theming-dispositions branch August 31, 2026 06:28

This branch was successfully deployed

1 active deployment
Preview — 090d592e Deployed Aug 31, 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