From 4a1950316d5f5ee6092de590067bd4f1df7cce4e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 7 Jul 2026 20:44:21 +0000 Subject: [PATCH 1/2] fix: resolve macro catalog drift and wire check:macros into CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - docs/macros.md: spell out all five .sf-drop-shadow-* class names so the macro catalog checker can match them (the -s/-m/-l/-xl shorthand was invisible to its regex) - check-macro-catalog.js: allowlist .sf-is-active as a cross-reference — it is defined in core/states.css, outside the macro CSS sources - ci.yml: run check-macro-catalog.js in the artifacts-freshness job so this drift can no longer land silently - package.json: deduplicate the unit-test file list between pretest and test:unit with a tests/*.test.js glob (same 9 files, one source of truth) Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01BNdrFatwnUKuBcdLcJs6DX --- .github/workflows/ci.yml | 1 + CLAUDE.md | 2 +- docs/macros.md | 2 +- package.json | 4 ++-- scripts/check-macro-catalog.js | 3 +++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5d7e508..ae515957 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,6 +93,7 @@ jobs: - run: node scripts/check-version-sync.js - run: node scripts/check-token-registry.js - run: node scripts/check-llm-guide.js + - run: node scripts/check-macro-catalog.js dependency-audit: name: Dependency vulnerability audit diff --git a/CLAUDE.md b/CLAUDE.md index e2903ec1..a77907c1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -51,7 +51,7 @@ requires a rebuild+redeploy, not just a file edit. | `npm run version-sync` | Sync all version references to root `package.json` | | `npm run check:version` | Verify all version references match (CI gate — run before every commit that touches versions) | | `npm run check:llm-guide` | Verify `docs/llm-guide.md` only references live tokens (CI gate) | -| `npm run check:macros` | Verify `.sf-*` macro classes match `docs/macros.md` (not currently wired into CI — run manually before committing macro changes) | +| `npm run check:macros` | Verify `.sf-*` macro classes match `docs/macros.md` (CI gate) | | `npm run check:registry` | Verify `token-registry.json` is in sync with source (CI gate) | | `npm run audit:check` | Verify `docs/registry.json` matches source without writing (CI gate) | | `npm run lint:css` | Lint all CSS source with stylelint (CI gate) | diff --git a/docs/macros.md b/docs/macros.md index 874678b7..cb2e6878 100644 --- a/docs/macros.md +++ b/docs/macros.md @@ -292,7 +292,7 @@ Universal browser support. --- -## `.sf-drop-shadow-xs` / `-s` / `-m` / `-l` / `-xl` +## `.sf-drop-shadow-xs` / `.sf-drop-shadow-s` / `.sf-drop-shadow-m` / `.sf-drop-shadow-l` / `.sf-drop-shadow-xl` Applies `filter: drop-shadow(...)` — unlike `box-shadow`, this follows the actual alpha shape of the element (PNG cutouts, SVG icons, transparent diff --git a/package.json b/package.json index c64b11b6..eccfc59a 100644 --- a/package.json +++ b/package.json @@ -52,9 +52,9 @@ "check:version": "node scripts/check-version-sync.js", "lint:css": "stylelint \"**/*.css\"", "lint:css:fix": "stylelint \"**/*.css\" --fix", - "pretest": "npm run build && node --test tests/tier1-p2-coverage.test.js tests/tier1-p7-oldengine.test.js tests/tier1-p10-contrast.test.js tests/api-index-sync.test.js tests/color-docs.test.js tests/docs-artifacts-sync.test.js tests/check-version-sync.test.js tests/coverage.test.js tests/parse-lib.test.js", + "pretest": "npm run build && npm run test:unit", "test": "playwright test", - "test:unit": "node --test tests/tier1-p2-coverage.test.js tests/tier1-p7-oldengine.test.js tests/tier1-p10-contrast.test.js tests/api-index-sync.test.js tests/color-docs.test.js tests/docs-artifacts-sync.test.js tests/check-version-sync.test.js tests/coverage.test.js tests/parse-lib.test.js", + "test:unit": "node --test tests/*.test.js", "test:install": "playwright install --with-deps chromium firefox webkit", "release": "release-it", "release:minor": "release-it --increment minor", diff --git a/scripts/check-macro-catalog.js b/scripts/check-macro-catalog.js index 3820982e..283ca8ca 100644 --- a/scripts/check-macro-catalog.js +++ b/scripts/check-macro-catalog.js @@ -39,6 +39,9 @@ const SKIP_IN_CSS = new Set([ // defined in the macro CSS sources (they live in layout CSS, documented elsewhere). const SKIP_IN_DOCS = new Set([ '.sf-frame', '.sf-reel', '.sf-bg-layer', + // Defined in core/states.css (outside the macro sources above); macros.md + // only cross-references it from .sf-no-tap-highlight. + '.sf-is-active', ]); // ── 1. Collect classes from CSS ─────────────────────────────────────────────── From e25967f686c26c6ee16ed87b8e4189c005de0707 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 7 Jul 2026 21:18:52 +0000 Subject: [PATCH 2/2] docs: update test conventions for glob-based unit test discovery MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test:unit now runs the tests/*.test.js glob (pretest delegates to it), so new *.test.js files are picked up automatically — tests/README.md no longer tells contributors to manually wire them into package.json. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01BNdrFatwnUKuBcdLcJs6DX --- tests/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/README.md b/tests/README.md index 6ffd799d..455bd178 100644 --- a/tests/README.md +++ b/tests/README.md @@ -8,8 +8,9 @@ Two runners, split by whether a test needs a real browser: - **`*.test.js`** — Node's built-in test runner (`npm run test:unit`), single process, no browser. Use for pure fs/regex/data-shape checks that never touch a DOM — imports `test`/`describe` from `node:test` and `assert` from - `node:assert/strict`. Wire new files into `pretest`/`test:unit` in - `package.json`. + `node:assert/strict`. New files are picked up automatically: `test:unit` runs + the `tests/*.test.js` glob and `pretest` delegates to it, so no `package.json` + wiring is needed — just drop the file in `tests/`. If a test doesn't call `page.*` or read a computed style, it almost certainly belongs in `*.test.js`, not `*.spec.js` — see SL-027 (`coverage.test.js` used