Skip to content

WDSEN-51: Script cleanup + platform agnostic package changes#84

Open
khleomix wants to merge 6 commits intomainfrom
feature/WDSEN-5-Script-Cleanup
Open

WDSEN-51: Script cleanup + platform agnostic package changes#84
khleomix wants to merge 6 commits intomainfrom
feature/WDSEN-5-Script-Cleanup

Conversation

@khleomix
Copy link
Contributor

@khleomix khleomix commented Mar 16, 2026

Closes

WDSEN-51

Link to test

Test Locally

Description

  • Remove PHP/Node wrapper scripts and use native php with a DevContainer (PHP 8.2, Node 24).
  • Add theme-only DevContainer so the theme works for non-WDS contributors.
  • Run update-cursorrules only in dev (skip in CI/Buddy).
  • Remove Lighthouse script and references.
  • Fix block template so new blocks pass ESLint/Prettier and block view scripts run on the front end.
  • replaced imagemin for sharp for platform agnostic image optimization

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

AI Assistance

  • 🤖 This project was developed with the help of a LLM/AI such as Cursor, Gemini, etc.

Added to documentation?

  • 📜 README.md
  • 📓 ClickUp
  • 🙅 No documentation needed

Added tests?

  • 👍 Yes
  • 🙅 No, because they aren't needed
  • 🙋 No, because I need help

Testing Instructions

Testing instructions for feature/WDSEN-5-Script-Cleanup:

Testing instructions (WDSEN-5)

  1. Theme setup
cd wp-content/themes/wds-bt
npm run setup
  • Expect: Dependencies install, build completes, no errors.
  • Optional (DevContainer): Open repo in Cursor/VS Code → “Reopen in Container” → then run npm run setup inside the container.
  1. Lint
    npm run lint
  • Expect: All pass (lint:php, lint:js, lint:css, lint:pkg-json). No failures.
  1. Build
    npm run build
  • Expect: Build finishes; build/ and blocks/ are written. No build errors.
  1. Font / theme.json scripts (native php)
npm run fonts:generate
npm run fonts:detect
  • Expect: Commands run with no errors (they use php directly, no wrapper scripts).
  1. PHP lint (native vendor scripts)
    npm run lint:php
  • Expect: PHPCS runs via vendor/bin/phpcs; same results as before, no wrapper usage.
  1. New block + view script
npm run create-block
# Use block name e.g. "test-view"
cd assets/blocks/test-view
# Then from theme root:
cd ../..
npm run build
  • Expect: No ESLint/Prettier errors in the new block. blocks//view.js is non‑empty.
  • Front end: Add the block to a page, view the page. In the browser console run window.__wdsbtBlockViewLoaded. Expect: true when the block is on the page (confirms view script runs).
  1. update-cursorrules (dev only)
  • Local (no CI/Buddy): Run npm install or ./scripts/update-cursorrules.sh.
    • Expect: Cursor rules under .cursor/rules/ update (if jq is installed).
  • CI/Buddy: With CI=1 or BUDDY=1 set, run ./scripts/update-cursorrules.sh.
    • Expect: Script exits immediately with no errors and does not require jq or write rules.
  1. Removed behavior (should be gone)
  • No wrapper scripts: scripts/get-php.js, scripts/get-php.sh, scripts/get-php-flags.sh do not exist.
  • No Lighthouse: npm run lighthouse is not in package.json and should not exist.
  1. DevContainer (optional)
  • Open the theme in Cursor/VS Code with Dev Containers support.
  • Use “Reopen in Container” and wait for the container to build.
  • Expect: Container has PHP 8.2 and Node 24; npm run setup and npm run build work inside the container.

Reviewer's Testing Checklist

As a reviewer, please verify that the relevant testing criteria are fulfilled and confirmed before approving this Pull Request.

  • Visual Regression Testing: Ensure that existing functionality is not negatively impacted by the changes.
  • Cross-Browser Compatibility: Test on major browsers (Chrome, Firefox, Safari) to ensure compatibility.
  • Mobile Responsiveness: Confirm that the changes are responsive and functional on various mobile devices.
  • Theme Compatibility: Ensure that the changes do not adversely affect the site's theme and styling.
  • Linting: Check that the code passes all linting checks (PHPCS, ESLint, SassLint). Check if PR passes code quality check.
  • Accessibility Testing: Validate that the changes comply with accessibility standards. Run npm run a11y.
  • Security Best Practices: Ensure that the code follows WordPress security best practices. Check if PR passes security check.
  • Documentation: Ensure that any new features or changes are appropriately documented in the README.md or Confluence.
  • Post-Deployment Tasks: Check if there are any tasks that need to be performed after deployment.

[optional] Additional Reviewer Notes or Considerations?

@khleomix khleomix self-assigned this Mar 16, 2026
@thatmitchcanter
Copy link
Member

JC before she left provided me with a PR that had the build scripts all decoupled to the best she could (since she was VERY busy before she left with project work). There were a few small things that were outstanding, one of them being that imagemin for our optimizations was intel-based. in the PR, I've now swapped that out for sharp which is platform agnostic. This cut our dependencies down considerably, and still does the work of optimizing the images at the point of build.

The DevContainer on WDS-BT is officially working and building the theme. Once JC's back I'll have her/Amor approve the PR work and we can go over it during our meeting next week, but we can start rolling this out ASAP once approved.

@thatmitchcanter thatmitchcanter changed the title WDSEN-51: Script cleanup WDSEN-51: Script cleanup + platform agnostic package changes Mar 18, 2026
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