Skip to content

feat(plugin): WordPress.org submission prep, docs cleanup, ESM scripts - #240

Merged
jackgranatowski merged 5 commits into
mainfrom
claude/rebemer-plugin-architecture-Mt4o6
Jun 6, 2026
Merged

feat(plugin): WordPress.org submission prep, docs cleanup, ESM scripts#240
jackgranatowski merged 5 commits into
mainfrom
claude/rebemer-plugin-architecture-Mt4o6

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

$(cat <<'EOF'

Summary

  • WordPress.org submission prep — local-first CSS delivery (dist/ bundled in plugin), in-admin updater to download latest bundles from jsDelivr, optional CDN source with pinned version, readme.txt with correct contributor/tested-up-to, load_plugin_textdomain() on all three plugin entry points, standalone dist path fixed (../../../../dist/../../dist/), atomic bundle downloads via WP_Filesystem (stage to .tmp, rename only when all 3 succeed)
  • Docs cleanup — translated docs/bricks-template-workflow.md from Polish to English, fixed stale facts; stripped meta commentary from docs/roadmap.md, docs/rebemer.md, and plugin README; renumbered reBEMer sections sequentially with updated cross-references
  • ESM conversion — all 11 scripts/*.js converted from CommonJS (require/module.exports/__dirname) to ES modules (import/export/import.meta.dirname); "type": "module" added to package.json — eliminates [MODULE_TYPELESS_PACKAGE_JSON] Node warning. All 64 unit tests pass.

Test plan

  • node scripts/bundle.js — all bundles build without error
  • node scripts/audit.js --check — 806 tokens, 160 .sf-classes, 40 .is-classes
  • All doc-gen scripts run clean (gen-token-reference, gen-class-reference, gen-bricks-inventory, gen-class-hints, check-cheatsheet)
  • node --test tests/element-types.test.js tests/class-hints.test.js tests/color-model.test.js — 64/64 pass
  • node scripts/zip-plugin.js — produces dist/slashed.zip
  • Plugin activates standalone (outside monorepo) with local dist/ folder
  • Admin → SLASHED shows CSS delivery section with local/CDN toggle and update button

https://claude.ai/code/session_01NQDBMUYWyjsrBrxvi5DxCK
EOF
)


Generated by Claude Code

Summary by CodeRabbit

  • Chores

    • Migrated project configuration and scripts to modern module format and updated package metadata for improved compatibility, path handling, and consistency across tooling.
    • No public APIs or exported behaviors were changed.
  • Tests

    • Test suites updated to the same module format to keep CI and local checks working with the modernized tooling.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Too much diff to scan? Review this PR in Change Stack to start with the highest-impact changes.

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 53 minutes and 3 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: b5afe005-9098-40ec-8b32-08e5914664c2

📥 Commits

Reviewing files that changed from the base of the PR and between cb67b53 and 34749a1.

⛔ 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 (32)
  • package.json
  • playwright.config.js
  • scripts/audit.js
  • scripts/bundle.js
  • scripts/check-artifacts.js
  • scripts/check-cheatsheet.js
  • scripts/gen-bricks-inventory.js
  • scripts/gen-class-hints.js
  • scripts/gen-class-reference.js
  • scripts/gen-token-reference.js
  • scripts/registry-sources.js
  • scripts/version-sync.js
  • scripts/zip-plugin.js
  • tests/a11y-patterns.spec.js
  • tests/a11y.spec.js
  • tests/auto-color.spec.js
  • tests/behavior.spec.js
  • tests/bundle-size.spec.js
  • tests/color-semantic.spec.js
  • tests/container-queries.spec.js
  • tests/coverage.spec.js
  • tests/demo-a11y-panel.spec.js
  • tests/demo-visual.spec.js
  • tests/layers.spec.js
  • tests/layout.spec.js
  • tests/link-contrast.spec.js
  • tests/macros.spec.js
  • tests/print.spec.js
  • tests/states-full.spec.js
  • tests/token-api.spec.js
  • tests/tokens.spec.js
  • tests/typography.spec.js
📝 Walkthrough

Walkthrough

This PR converts the package and all build/test tooling from CommonJS to ES modules: package.json sets "type":"module"; scripts and Playwright tests switch require/module.exports/__dirname to import/import.meta.dirname/ES exports; optional dev deps retain createRequire fallbacks where needed.

Changes

ESM module system conversion

Layer / File(s) Summary
Package declaration and shared registry exports
package.json, scripts/registry-sources.js
package.json adds type: "module". scripts/registry-sources.js removes 'use strict' and exports TOKEN_FILES and CLASS_FILES via ES named exports instead of module.exports.
Build infrastructure and bundling scripts
scripts/bundle.js, scripts/check-artifacts.js, scripts/zip-plugin.js
Bundling, artifact-checking, and zip-plugin scripts converted to ESM imports; path resolution changed from __dirname to import.meta.dirname. bundle.js keeps optional lightningcss loading via createRequire(import.meta.url).
Code generation scripts with registry dependencies
scripts/audit.js, scripts/gen-bricks-inventory.js, scripts/gen-class-reference.js, scripts/gen-token-reference.js
Audit, inventory, class-reference, and token-reference scripts converted to ESM and now import TOKEN_FILES/CLASS_FILES from the registry module; ROOT/OUT calculations use import.meta.dirname.
Validation and maintenance utility scripts
scripts/check-cheatsheet.js, scripts/gen-class-hints.js, scripts/version-sync.js
Cheatsheet check, class-hints, and version-sync scripts converted to ESM and updated to use import.meta.dirname; top-level 'use strict' removed where present.
Playwright config and tests
playwright.config.js, tests/*
Playwright config converted to export default defineConfig(...). All Playwright test specs migrated to ESM imports and use import.meta.dirname/pathToFileURL for fixture/demo URLs; test assertions and logic remain unchanged.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#79: Both PRs modify scripts/gen-token-reference.js — this PR migrates it to ESM while that PR added token-source inputs.
  • codeslash-dev/SLASHED#93: Related changes to tests/token-api.spec.js and scripts/registry-sources.js involving token snapshot tests and registry wiring.
  • codeslash-dev/SLASHED#60: Overlaps on scripts/bundle.js bundling behavior and related configuration changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the three main changes: WordPress.org submission prep, docs cleanup, and ESM scripts conversion, which aligns with the comprehensive changeset across 40+ files.
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/rebemer-plugin-architecture-Mt4o6

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 `@package.json`:
- Line 3: The project's package.json sets "type": "module", but test files like
tests/token-api.spec.js and tests/tokens.spec.js are written as CommonJS (use
require and __dirname) and will fail as ESM; fix by either renaming those test
files to .cjs so Node treats them as CommonJS, or convert each spec to ESM by
replacing require(...) with import statements and any __dirname usage with path
resolution using import.meta.url (or, if you must keep CommonJS syntax,
explicitly use createRequire to load modules), ensuring all test files follow
the same module style.
🪄 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: 01fb8b1b-ecc8-4930-82fc-e0f707dfc4ee

📥 Commits

Reviewing files that changed from the base of the PR and between 7ab0fb5 and 502cd6b.

⛔ 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 (12)
  • package.json
  • scripts/audit.js
  • scripts/bundle.js
  • scripts/check-artifacts.js
  • scripts/check-cheatsheet.js
  • scripts/gen-bricks-inventory.js
  • scripts/gen-class-hints.js
  • scripts/gen-class-reference.js
  • scripts/gen-token-reference.js
  • scripts/registry-sources.js
  • scripts/version-sync.js
  • scripts/zip-plugin.js

Comment thread package.json
claude added 5 commits June 6, 2026 10:30
Eliminates the [MODULE_TYPELESS_PACKAGE_JSON] Node warning. All 11
scripts converted from CommonJS (require/module.exports/__dirname) to
ES modules (import/export/import.meta.dirname). Optional lightningcss
dependency in bundle.js uses createRequire as a bridge so the dynamic
try/catch import path still works.

https://claude.ai/code/session_01NQDBMUYWyjsrBrxvi5DxCK
Missed in the CJS→ESM conversion; "type": "module" in package.json
caused Playwright to fail with "require is not defined in ES module scope".

https://claude.ai/code/session_01NQDBMUYWyjsrBrxvi5DxCK
All 18 tests/*.spec.js files missed in the initial CJS→ESM pass.
"type": "module" in package.json caused Playwright to fail with
"require is not defined in ES module scope" for every spec file.

https://claude.ai/code/session_01NQDBMUYWyjsrBrxvi5DxCK
File arrived from main after rebase; still had require() calls.

https://claude.ai/code/session_01NQDBMUYWyjsrBrxvi5DxCK
@jackgranatowski
jackgranatowski force-pushed the claude/rebemer-plugin-architecture-Mt4o6 branch from cb67b53 to 34749a1 Compare June 6, 2026 10:30
@jackgranatowski
jackgranatowski merged commit 365b74d into main Jun 6, 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