Review main Merged

83690[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
    • Thomas Hohn +1
    • Garvin Hicking +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 67

  1. Stefan Bürk uploaded patch set 1 04/07/24, 12:03

  2. core-ci voted on patch set 1 V +1 04/07/24, 12:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55506

  3. Garvin Hicking commented on patch set 1 CR +1 V +1 04/07/24, 17:06

    Works well for me, tested on: Darwin MBP-M1Pro2021-16G 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:43 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6000 arm64 (Sonoma 14.4) I ran the ci, build and watch tasks. Since the watch tasks AFAIR are not based on inotify but can do other processing too, it works also across the docker boundary for macOS.
  4. Thomas Hohn voted on patch set 1 CR +1 04/08/24, 08:07

  5. Christian Kuhn voted on patch set 1 CR +1 V +1 04/08/24, 09:00

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

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