Wire macro catalog check into CI and fix documentation - #563
Conversation
- 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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BNdrFatwnUKuBcdLcJs6DX
|
Warning Review limit reached
Next review available in: 38 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a CI step running scripts/check-macro-catalog.js, adds .sf-is-active to that script's docs/CSS drift-skip list, updates CLAUDE.md and docs/macros.md text, and changes package.json pretest/test:unit scripts to run all tests/*.test.js via glob instead of a hardcoded file list. ChangesMacro Catalog CI Gate
Test Script Consolidation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoAdd macro-catalog verification to CI; fix macros docs and unit-test script
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
package.json (1)
57-57: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winQuote the glob pattern for cross-shell portability.
Glob patterns follow the behavior of glob(7). The glob patterns should be enclosed in double quotes on the command line to prevent shell expansion, which can reduce portability across systems. Leaving
tests/*.test.jsunquoted works today on POSIX shells (CI), but it's fragile for local/Windows dev shells where either no expansion happens or expansion behaves inconsistently across shells.♻️ Proposed fix
- "test:unit": "node --test tests/*.test.js", + "test:unit": "node --test \"tests/*.test.js\"",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` at line 57, The test:unit script currently passes the tests/*.test.js glob unquoted, which can break or behave inconsistently across shells. Update the package.json script to quote the glob pattern in the node --test command so it is preserved for Node to expand consistently, and verify the test:unit entry remains the same otherwise.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@package.json`:
- Line 57: The test:unit script currently passes the tests/*.test.js glob
unquoted, which can break or behave inconsistently across shells. Update the
package.json script to quote the glob pattern in the node --test command so it
is preserved for Node to expand consistently, and verify the test:unit entry
remains the same otherwise.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1e371ef6-3b80-4e3d-81f6-e285371aa8c7
📒 Files selected for processing (5)
.github/workflows/ci.ymlCLAUDE.mddocs/macros.mdpackage.jsonscripts/check-macro-catalog.js
Code Review by Qodo
Context used✅ Compliance rules (platform):
12 rules 1.
|
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BNdrFatwnUKuBcdLcJs6DX
Summary
This PR integrates the macro catalog verification into the CI pipeline and fixes related documentation issues. The
check:macrosscript is now a CI gate to catch macro/documentation drift automatically, and several documentation inconsistencies are corrected.Key changes
npm run check:macrosto the CI workflow (.github/workflows/ci.yml) so macro catalog mismatches are caught automatically rather than requiring manual verificationnpm run test:unitto use a glob pattern (tests/*.test.js) instead of listing test files individually, making it easier to add new tests without updating package.json.sf-is-activeto theSKIP_IN_DOCSset inscripts/check-macro-catalog.jswith a comment explaining it's defined incore/states.cssand only cross-referenced in the docsCLAUDE.mdto reflect thatcheck:macrosis now a CI gate (was previously "not currently wired into CI")docs/macros.mdto use full class names (.sf-drop-shadow-s,.sf-drop-shadow-m, etc.) instead of shorthand abbreviations in the section headingImplementation details
The test script change from explicit file listing to glob pattern makes the test suite more maintainable — new test files in
tests/will automatically be included without requiring package.json edits. The pretest hook now delegates tonpm run test:unit, keeping the logic in one place.https://claude.ai/code/session_01BNdrFatwnUKuBcdLcJs6DX
Summary by CodeRabbit