Review 11.5 Merged

83664[TASK] Add `npm` command dispatcher to `Build/Scripts/runTests.sh`

Stefan Bürk CR +2 V +2 Easy +13 −0 updated 04/08/24, 10:53

Commit message

`Build/Scripts/runTests.sh` is the monorepo main dispatcher of
script and tools to ensure same working state across developer
host system and installation by using well defined containers.
This mitigates issues with missing dependencies or wrong version
of tools on develper machines.

Until now local installation of `node` and `npm` in the matching
version was mandatory to work with the node ecosystem like manage
dependencies, executing node based tools or the build chain for
CSS and TypeScript/JavaScript.

This change adds now a `npm` dispatcher to `runTests.sh` similar
to the `composer` command dispatcher introduced with #103045 to
allow executing npm commands and defined scripts in `package.json`
in a well-defined environment and removes the hard-requirement of
installing it locally for new contributors.

Added `runTests.sh` suite:

* ./Build/Scripts/runTests.sh -s npm --  <npm-command-arguments>

which allows now to using npm commands always with the correct
npm and node version defined for the mono-repository state.

Some examples:

  ./Build/Scripts/runTests.sh -s npm -- audit
  ./Build/Scripts/runTests.sh -s npm -- ci
  ./Build/Scripts/runTests.sh -s npm -- run build
  ./Build/Scripts/runTests.sh -s npm -- run watch:build
  ./Build/Scripts/runTests.sh -s npm -- install \
    --save bootstrap@^5.3.2

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 2

Files 1

Review log 34

  1. Stefan Bürk commented on patch set 1 04/08/24, 10:37

    Cherry Picked from branch 12.4.
  2. core-ci voted on patch set 1 V +1 04/08/24, 10:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55552

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 04/08/24, 10:53

  4. Stefan Bürk merged patch set 2 04/08/24, 10:53