Update Theme Watch Process to cover all of CSS, JS, images and fonts#1003
Update Theme Watch Process to cover all of CSS, JS, images and fonts#1003dipakmdhrm merged 5 commits intomainfrom
Conversation
Replace PHP-based Robo task compilation with npm scripts that handle CSS, JS, fonts, and images. Use concurrently to watch all asset types in parallel during development. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b9645cc to
75f7676
Compare
|
@dipakmdhrm This is nice! I have #995, but I am happy to throw it away, the only thing I'd like to double-check that the process should exit with non-zero code if CSS or JS or any other asset has a failure, so the process has a glitch, like malformed SVG, broken JS, syntax error in the style, etc. |
CSS and SVGs had proper exit logic (compile fail on error), but it wasn't so for JS. I've replaced |
|
@dipakmdhrm Thanks! Now |
There was a problem hiding this comment.
Pull request overview
This PR replaces the Robo/PHP-based theme asset compilation and watching workflow with npm scripts, so ddev theme:compile/ddev theme:watch can build and watch CSS, JS, fonts, and images via the theme’s package.json.
Changes:
- Add npm
build/watchscripts (and dev dependencies) to compile/watch CSS, JS, fonts, and images. - Simplify
ThemeTraitcompilation to delegate asset work tonpm run build. - Update DDEV commands and docs to use the new
ddev theme:compile/ddev theme:watchflow.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| web/themes/custom/server_theme/package.json | Adds npm build/watch scripts and dev dependencies for asset compilation. |
| robo-components/ThemeTrait.php | Replaces custom Robo/PHP asset handling with npm install + npm run build. |
| .ddev/commands/web/theme-compile | Switches compile command to run npm build directly in the theme directory. |
| .ddev/commands/web/theme-watch | Switches watch command to run the npm watch script. |
| .ddev/config.local.yaml.example | Updates DDEV hooks to call the new compile command. |
| README.md | Updates theme development commands referenced in documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix ThemeTrait.php to throw on non-zero npm build exit code instead of silently returning with inverted check order - Update README theme development section: remove outdated Robo references, replace tailwind.config.js/whitelist with Tailwind 4 @source approach - Fix misleading debug/purge comment in config.local.yaml.example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@amitaibu Copilot feedback has been addressed. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Latest commit: Replace shell npm scripts with Node.js build and watch scriptsThe inline shell commands in
|
Closes #324
Summary
Replaces the PHP/Robo-based theme compilation pipeline with npm scripts, simplifying the build
toolchain and enabling parallel asset watching.
Changes:
package.json: Addbuildandwatchnpm scripts for CSS, JS, fonts, and images. Addconcurrently,chokidar-cli, andimagemin-clias dev dependenciesThemeTrait.php: Remove complex PHP-based asset handling (JS minification, image optimization, SVGcompression, file watching). Delegate all of this to
npm run buildddev theme:compile: Now runsnpm install && npm run builddirectly instead ofddev robo theme:compileddev theme:watch: Now runsnpm run watchwhich usesconcurrentlyto watch CSS, JS, fonts, andimages in parallel
config.local.yaml.example/README.md: Update references fromddev robo theme:compile[-debug]to
ddev theme:compileTest plan
ddev theme:compilebuilds all assets todist/(CSS, JS, fonts, images)ddev theme:watchstarts watchers for all asset types in parallelddev restarttriggers theme compilation via the updated hookddev phpcsandddev phpstanpass (verified by pre-push hook)theme-2026-03-12_14.33.38.mp4