Skip to content

Script cleanup & DevContainer

Latest

Choose a tag to compare

@khleomix khleomix released this 18 May 17:02
8b47ae7

Release Notes – Script Cleanup & DevContainer

Summary

This release removes custom PHP/Node wrapper scripts in favor of native tooling and adds a theme-only DevContainer so the theme can be developed without installing PHP or Node locally. It also tightens block templates for lint and ensures block view scripts run on the front end.


What's New

DevContainer (theme-only workflow)

  • .devcontainer added with PHP 8.2 and Node 24, aligned with WebDevStudios/wds-devcontainer.
  • Open the theme in Cursor or VS Code and use Reopen in Container to get a consistent environment; no need to install PHP or Node on the host.
  • Intended for theme-only work; when using a full WordPress project, use that project's devcontainer for the site.

Block view scripts

  • New blocks created with npm run create-block get a view script that actually runs on the front end when the block is present.
  • Default view.js is a small runnable module; replace its contents with your own logic (e.g. Interactivity API).

Block template updates

  • New blocks pass ESLint and Prettier out of the box.
  • Edit template uses a single-line return and no unused variables; index and view templates have correct formatting and no trailing blank lines.

Changed

PHP and fonts

  • Font and theme.json scripts (fonts, fonts:detect, fonts:generate) now call php directly instead of wrapper scripts.
  • PHPCS/PHPCBF (npm run lint:php, format) use vendor/bin/phpcs and vendor/bin/phpcbf directly; extension warning filtering for local runs is unchanged.
  • Webpack ThemeJsonGeneratorPlugin runs php (or php -n outside CI) instead of using a detected PHP path.

update-cursorrules (dev only)

  • update-cursorrules.sh runs only in local dev; it exits immediately when CI or BUDDY is set, so CI/Buddy do not need jq or Cursor rules.

Documentation

  • README and docs now describe the DevContainer (theme-only, PHP 8.2, Node 24) and no longer mention the old PHP wrapper scripts or Lighthouse.
  • Cross-platform and accessibility docs point to the DevContainer or native PHP/Node and note that update-cursorrules is dev-only.

Removed

BT wrapper scripts

  • scripts/get-php.js – Node PHP binary detection
  • scripts/get-php.sh – Bash PHP binary detection
  • scripts/get-php-flags.sh – CI vs local PHP flags

Use php on the path (e.g. via DevContainer or system install) instead.

Lighthouse

  • npm run lighthouse and scripts/run-lighthouse.cjs removed.
  • All references to the Lighthouse script removed from README and docs.

Requirements (unchanged)

  • WordPress 6.4+
  • PHP 8.2+ (extensions: tokenizer, xmlwriter, simplexml)
  • Node 24+, npm 11+
  • Composer 2+

Upgrade / migration

  1. Pull the release and run npm run setup (or reopen in the DevContainer and run it there).
  2. No local PHP/Node: Use the theme's DevContainer ("Reopen in Container") for theme-only work.
  3. CI/Buddy: No change; update-cursorrules is skipped when CI or BUDDY is set.
  4. Existing blocks: Re-run npm run build; no code changes required. New blocks get the updated templates and working view script automatically.

For developers

  • Theme-only dev: use .devcontainer or install PHP 8.2+ and Node 24+ locally.
  • New blocks: run npm run create-block, then npm run build; view script runs when the block is on the page.
  • Lint: npm run lint (PHP, JS, CSS); block template output is lint-clean.
  • Version: see .env and style.css for the release version number.