Skip to content

fix: keep WordPress plugin's bundled CSS in sync with core builds - #256

Merged
jackgranatowski merged 2 commits into
mainfrom
claude/file-tracking-versioning-tEiKa
Jun 7, 2026
Merged

fix: keep WordPress plugin's bundled CSS in sync with core builds#256
jackgranatowski merged 2 commits into
mainfrom
claude/file-tracking-versioning-tEiKa

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

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

Summary by CodeRabbit

  • Chores
    • Updated the build process to automatically synchronize and include pre-built CSS bundles in the WordPress plugin distribution, improving the release workflow.

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
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jackgranatowski, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 77d7954a-5de1-4c80-bc73-29c3d11a91eb

📥 Commits

Reviewing files that changed from the base of the PR and between 8cd83af and 1a3ede2.

📒 Files selected for processing (1)
  • scripts/zip-plugin.js
📝 Walkthrough

Walkthrough

Build pipeline extended to synchronize CSS bundles from the root dist/ directory into the WordPress plugin's dist/ directory and include those bundles in the final plugin zip package via a new sync script integrated into both npm run build and the artifacts pipeline.

Changes

Plugin CSS bundle synchronization and packaging

Layer / File(s) Summary
CSS bundle sync script and build pipeline integration
scripts/sync-plugin-dist.js, package.json, scripts/artifacts.json
New sync-plugin-dist.js script copies CSS bundles (essential, optimal, full) from root dist/ into plugins/SLASHED-for-WP/dist/. Integrated into both package.json build script and scripts/artifacts.json artifact pipeline, with expanded outputs declaring the new plugin dist CSS files.
Plugin zip packaging update
scripts/zip-plugin.js
Zip script now includes the plugin's dist/ directory in the packaged slashed.zip under slashed/dist/, with header comment updated to document the bundled CSS location.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#239: Implements local-first CSS delivery using the plugin's dist/ files that this PR syncs and packages.
  • codeslash-dev/SLASHED#211: Extends the shared scripts/artifacts.json build pipeline; this PR similarly updates artifact pipeline definitions and outputs.
  • codeslash-dev/SLASHED#175: Also modifies scripts/zip-plugin.js to adjust plugin packaging and file mapping for the relocated plugin directory layout.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically addresses the main change: adding a synchronization mechanism to keep the WordPress plugin's bundled CSS in sync with core builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/file-tracking-versioning-tEiKa

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1737997 and 8cd83af.

⛔ Files ignored due to path filters (3)
  • plugins/SLASHED-for-WP/dist/slashed.essential.css is excluded by !**/dist/**
  • plugins/SLASHED-for-WP/dist/slashed.full.css is excluded by !**/dist/**
  • plugins/SLASHED-for-WP/dist/slashed.optimal.css is excluded by !**/dist/**
📒 Files selected for processing (4)
  • package.json
  • scripts/artifacts.json
  • scripts/sync-plugin-dist.js
  • scripts/zip-plugin.js

Comment thread scripts/zip-plugin.js Outdated
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
@jackgranatowski
jackgranatowski merged commit cdb42d7 into main Jun 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants