fix: keep WordPress plugin's bundled CSS in sync with core builds - #256
Conversation
The plugin ships local copies of the essential/optimal/full CSS bundles under plugins/SLASHED-for-WP/dist/ for "local-first delivery" (no CDN dependency), but nothing regenerated them after the initial commit — they had drifted ~900 lines out of sync with core/, missing the Tier-1 sRGB color fallbacks and other recent changes shipped in PR #254. Add scripts/sync-plugin-dist.js to copy the three bundles from dist/ into the plugin directory, wire it into `npm run build` (so every merge to main and every release refreshes them) and into scripts/artifacts.json (so the pre-commit hook restages them and CI's artifacts-freshness job fails the build if they ever drift again). Also add the plugin's dist/ directory to zip-plugin.js's INCLUDE list — it was omitted entirely, so the packaged plugin zip shipped without the local CSS its own readme.txt advertises. https://claude.ai/code/session_013X2ircNx9MUbVfbRxvjzAV
|
Warning Review limit reached
More reviews will be available in 52 minutes and 12 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughBuild pipeline extended to synchronize CSS bundles from the root ChangesPlugin CSS bundle synchronization and packaging
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@scripts/zip-plugin.js`:
- Line 42: The packaging currently lists a required include { src:
`${PLUGIN_ROOT}/dist`, dest: 'dist' } but later (around the warning block that
currently logs and continues) silently allows missing content; change that
behavior to fail fast: replace the warn-and-continue logic (the block around
lines 81–84) with a hard failure that throws an Error or calls process.exit(1)
when `${PLUGIN_ROOT}/dist` (and any other required include paths) do not exist,
using fs.existsSync or fs.statSync to detect absence so the zip build stops
instead of producing an incomplete slashed.zip.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d18664d8-e33a-4127-82fc-a7b21b404d3c
⛔ Files ignored due to path filters (3)
plugins/SLASHED-for-WP/dist/slashed.essential.cssis excluded by!**/dist/**plugins/SLASHED-for-WP/dist/slashed.full.cssis excluded by!**/dist/**plugins/SLASHED-for-WP/dist/slashed.optimal.cssis excluded by!**/dist/**
📒 Files selected for processing (4)
package.jsonscripts/artifacts.jsonscripts/sync-plugin-dist.jsscripts/zip-plugin.js
Per CodeRabbit review on PR #256: the dist/ entry was listed as a required include but the loop still warned-and-continued on a missing path, which could silently produce a slashed.zip without the local CSS bundles. Mark it required and throw instead, so an incomplete build can't ship quietly. https://claude.ai/code/session_013X2ircNx9MUbVfbRxvjzAV
The plugin ships local copies of the essential/optimal/full CSS bundles
under plugins/SLASHED-for-WP/dist/ for "local-first delivery" (no CDN
dependency), but nothing regenerated them after the initial commit — they
had drifted ~900 lines out of sync with core/, missing the Tier-1 sRGB
color fallbacks and other recent changes shipped in PR #254.
Add scripts/sync-plugin-dist.js to copy the three bundles from dist/ into
the plugin directory, wire it into
npm run build(so every merge to mainand every release refreshes them) and into scripts/artifacts.json (so the
pre-commit hook restages them and CI's artifacts-freshness job fails the
build if they ever drift again). Also add the plugin's dist/ directory to
zip-plugin.js's INCLUDE list — it was omitted entirely, so the packaged
plugin zip shipped without the local CSS its own readme.txt advertises.
https://claude.ai/code/session_013X2ircNx9MUbVfbRxvjzAV
Summary by CodeRabbit