Skip to content

test(theme): discover component sources at any depth under src - #5784

Merged
imdreamrunner merged 1 commit into
mainfrom
guard/affordance-color-reach
Sep 1, 2026
Merged

test(theme): discover component sources at any depth under src#5784
imdreamrunner merged 1 commit into
mainfrom
guard/affordance-color-reach

Conversation

@freddymeta

Copy link
Copy Markdown
Contributor

Why

Split out of #5420 at review request — this is guard infrastructure, not part of exposing Table's affordance theme targets, and it should stand or fall on its own.

What

themingTargets.test.ts scanned only the top level of src, so a component whose sources sit a level down was silently exempt from the guard. Table's plugins render from Table/plugins/<name>/, so both of them were. That is the drift #3741 was filed to prevent.

Nothing was failing when this was written, so it closes a hole rather than fixing a live break: 294 assertions to 302.

Testing

Measured rather than assumed — instrumented the discovery to print what it finds:

core=98  lab=5  nested=2
nested = Table/plugins/filtering, Table/plugins/sortable

What is deliberately NOT here

The same recursion on the sibling derivedVarRegistry.test.ts. I wrote it, measured it, and it discovered nothingnested=0 — because that guard also requires a doc file named after the directory, and Table/plugins/sortable/ has no sortable.doc.mjs. Closing that one needs the doc-fallback lookup this file already has, which is a larger change than a walk.

Shipping the walk alone would have been a rule that never fires, so it is not in this PR. Worth its own change if the gap matters.

Risk

Test-only. No runtime, public API, DOM, style, or behavioural change.

Split out of #5420 at review request: this is guard infrastructure, not part
of exposing Table's affordance theme targets, and it should stand or fall on
its own.

`themingTargets.test.ts` scanned only the top level of `src`, so a component
whose sources sit a level down — Table's plugins render from
`Table/plugins/<name>/` — was silently exempt from the guard. That is the
drift #3741 was filed to prevent. Nothing was failing when this was written,
so it closes a hole rather than fixing a live break: 294 assertions to 302.

Measured rather than assumed — instrumented discovery reports core=98, lab=5,
nested=2, the two being `Table/plugins/filtering` and `Table/plugins/sortable`.

NOT included, deliberately: the same recursion on the sibling
`derivedVarRegistry.test.ts`. I wrote it, measured it, and it discovered
nothing (nested=0), because that guard also requires a doc file named after
the directory and `Table/plugins/sortable/` has no `sortable.doc.mjs`. Closing
that one needs the doc-fallback lookup this file already has, which is a
larger change than a walk; shipping the walk alone would have been a rule that
never fires.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 31, 2026
@vercel

vercel Bot commented Aug 31, 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:19pm

Request Review

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels 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

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.8KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.


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

@imdreamrunner
imdreamrunner enabled auto-merge (squash) September 1, 2026 21:13
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Sep 1, 2026
@imdreamrunner
imdreamrunner merged commit ed45a8f into main Sep 1, 2026
28 checks passed
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. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants