Skip to content

Commit 31c70e0

Browse files
committed
Remove dead JS-bundling code from Bundle.php, drop updateGruntfile.php, make npm a hard install requirement
Bundle::all() has returned [] unconditionally since before this change (Grunt/terser JS bundling was dropped when we moved to rollup), making its ~70-line body, Bundle::urls(), and the bundle-cache lookup in js_includes() all unreachable. Bundle::getImportMap() only did real work by looping over self::all(true), so it too was provably always returning []; its Gruntfile.js regex-parsing (including a now-nonexistent 'terser' config key) is removed along with it. js_includes() keeps its per-file resolution (cache-buster, *.min.js companion lookup), which is the only part that was ever doing anything. updateGruntfile.php regenerated that dead 'terser' config and isn't wired into any npm/composer/CI script; removed rather than fixed. Gruntfile.js and build-css.mjs's doc-comments updated - Gruntfile.js is NOT dead, build-css.mjs (npm run css) still reads its cssmin config directly, just no longer via the grunt CLI. install-cli.php previously let npm be missing and skipped `npm install`/`npm run css`/`npm run build` with just a warning. Since CSS/JS bundling now requires npm unconditionally (there's no longer a PHP-side fallback bundler), treat it like php/git/composer: exit(1) if missing.
1 parent c0aa5be commit 31c70e0

4 files changed

Lines changed: 58 additions & 394 deletions

File tree

Gruntfile.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
* grunt-contrib-cssmin vendor outdated, vulnerable glob/minimatch/js-yaml versions
1313
* with no upstream fix - see GHSA-mh99-v99m-4gvg and related advisories).
1414
*
15-
* This file is kept for two reasons:
16-
* - build-css.mjs (run via "npm run css") reads the cssmin config below through a
17-
* minimal grunt.initConfig() shim, so the file lists stay a single source of truth
18-
* - Api\Framework\Bundle::getImportMap() (api/src/Framework/Bundle.php) parses this
19-
* file's grunt.initConfig({...}) call directly by regex for (unrelated, legacy)
20-
* JS bundle info
15+
* This file is kept because build-css.mjs (run via "npm run css") reads the cssmin
16+
* config below through a minimal grunt.initConfig() shim, so the file lists stay a
17+
* single source of truth.
2118
*
22-
* Please use only double quotes, as we parse this file as json to update it!
19+
* Api\Framework\Bundle::getImportMap() (api/src/Framework/Bundle.php) used to parse
20+
* this file's grunt.initConfig({...}) call by regex for legacy JS bundle info, but
21+
* that was JS bundling/minifying leftover from before rollup and has been removed -
22+
* Bundle.php no longer reads this file at all.
23+
*
24+
* Please use only double quotes, as build-css.mjs parses this file as json.
2325
*
2426
* @param {object} grunt
2527
*/

0 commit comments

Comments
 (0)