Review 13.4 Merged

88937[TASK] Merge runTests.sh frontend build scripts into one reliable verb

Georg Ringer CR +2 V +2 Easy +3 −9 updated 04/03/25, 12:30

Commit message

Since `grunt scripts` and `grunt css` are incremental build verbs
(intended to be used after a full rebuild, e.g. by `grunt watch`)
and require cache files to be manually invalidated when switching
between different commits, the "easy" mode frontend building via
`runTests.sh` is now providing a single "build" command that will call
`npm run build` in order to rebuild all frontend assets.

`npm run build`:
  a) is fast enough since #106357 (~9sec instead of 40sec).
     It has equal runtime, since all build jobs are run
     in parallel on different CPU cores
  b) ensures that all caches are clean and that the result will pass CI

Also avoid using `npm ci`. `npm ci` is targeted for CI environments,
while `npm install` is targeted for usage on development machines (also
respects package-lock.json, see commit description for #96355), as it
will incremently update node_modules (fast) instead of always wiping it
off.
Please note that CI will still use `npm ci` since the build verification
is performed via `checkGruntClean`.

That means invocations of:

  Build/Scripts/runTests.sh -s buildJavascript
  Build/Scripts/runTests.sh -s buildCss

Are to be replaced by:

  Build/Scripts/runTests.sh -s build

For fine-grained build-target selection or advanced usage it is still
suggested to use nvm or nodejs directly and invoke scripts via `npm`
instead of the `runTests.sh` wrapper, as this avoids the need for
using a TYPO3-specific nodejs image:

  cd Build
  nvm use
  npm run build
  # for consecutive watching after an initial rebuild
  npm run watch:build
  # run JavaScript unit tests as a watcher
  npm run watch:test
  # building temporary sourcemaps
  npm run build -- --sourcemaps

Review

  • Code review CR +2 Done
    • Georg Ringer +2
  • Verified V +2 Done
    • Georg Ringer +2
    • core-ci +1 CI

Issues 1

Files 1

Review log 34

  1. Georg Ringer commented on patch set 1 04/03/25, 12:23

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 04/03/25, 12:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76947

  3. Georg Ringer voted on patch set 1 CR +2 V +2 04/03/25, 12:30

  4. Georg Ringer merged patch set 2 04/03/25, 12:30