From 56be576b537d6643fc8c9733a9a7877847898b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kiss=20R=C3=B3bert?= Date: Sat, 25 Jul 2026 13:10:12 +0200 Subject: [PATCH] chore: use --ignore-scripts when installing dependencies --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy-gh-pages.yml | 2 +- README.md | 12 ++++++++---- package.json | 3 ++- packages/uhk-agent/package.json | 2 +- packages/usb/README.md | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa47fae25b3..f35c7e51ec6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: cache: npm - name: Install dependencies - run: npm install + run: npm run install - name: Run Build run: npm run build diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index 1f150bcefdf..061459f923f 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -23,7 +23,7 @@ jobs: cache: npm - name: Install dependencies - run: npm install + run: npm run install - name: Run Build run: npm run build diff --git a/README.md b/README.md index c975e7c766d..b97ece9e311 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ Please do not build Agent from source unless you want to develop it. Using an ex ### Step 1: Build Dependencies -You'll need Node.js 20.x. Use your OS package manager to install it. [Check the NodeJS site for more info.](https://nodejs.org/en/download/package-manager/ "Installing Node.js via package manager") Mac OS users can simply `brew install node` to get both. Should you need multiple Node.js versions on the same computer, use Node Version Manager for [Mac/Linux](https://github.com/creationix/nvm) or for [Windows](https://github.com/coreybutler/nvm-windows) +You'll need Node.js 20.x. Use your OS package manager to install it. [Check the Node.js site for more info.](https://nodejs.org/en/download/package-manager/ "Installing Node.js via package manager") Mac OS users can simply `brew install node` to get both. Should you need multiple Node.js versions on the same computer, use Node Version Manager for [Mac/Linux](https://github.com/creationix/nvm) or for [Windows](https://github.com/coreybutler/nvm-windows) You'll also need `libusb`. On debian-based linux distros, `apt-get install libusb-dev libudev-dev g++` is sufficient. -On Mac OS, use `brew install libusb libusb-compat`. +On macOS, use `brew install libusb libusb-compat`. For everyone else, use the appropriate package manager for your OS. ### Step 2: Build Environment @@ -24,17 +24,21 @@ For everyone else, use the appropriate package manager for your OS. ``` git clone git@github.com:UltimateHackingKeyboard/agent.git cd agent -npm ci +npm run install npm run build npm run electron ``` +The `npm run install` script wraps `npm ci --ignore-scripts && npm run postinstall`, +allowing us to skip dependency install scripts. Agent currently has no dependencies +that require post-install steps, so this serves as a workaround until npm 12 ships with Node.js. + At this point, Agent should be running on your machine. ## Install dependencies npm workspace installs dependencies in hoisted mode, it is not really suitable for us. -If you add or update a dependency of a package then navigate to the directory edit the package.json and run `npm install` +If you add or update a dependency of a package then navigate to the directory edit the package.json and run `npm install --ignore-scripts` ## Developing the web application diff --git a/package.json b/package.json index dc752437f67..7ab4cf71fbb 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,8 @@ "webpack-cli": "7.2.1" }, "scripts": { - "postinstall": "lerna exec npm ci", + "install": "npm ci --ignore-scripts && npm run postinstall", + "postinstall": "lerna exec npm ci -- --ignore-scripts", "test": "lerna run test", "lint": "lerna run lint", "e2e": "lerna run e2e --scope uhk-web", diff --git a/packages/uhk-agent/package.json b/packages/uhk-agent/package.json index a6435f4bc25..c23dae591e5 100644 --- a/packages/uhk-agent/package.json +++ b/packages/uhk-agent/package.json @@ -36,7 +36,7 @@ "build": "webpack && npm run install:build-deps && npm run download-firmware && npm run copy-to-tmp-folder", "clean": "rimraf ./node_modules ./dist", "lint": "eslint", - "install:build-deps": "cd ./dist && npm i", + "install:build-deps": "cd ./dist && npm i --ignore-scripts", "download-firmware": "node ../../scripts/download-firmware.js", "copy-to-tmp-folder": "node ../../scripts/copy-to-tmp-folder.js", "webpack": "webpack" diff --git a/packages/usb/README.md b/packages/usb/README.md index 562b0aa8f6b..78e106133d6 100644 --- a/packages/usb/README.md +++ b/packages/usb/README.md @@ -1,7 +1,7 @@ ## Usage 1. Install node.js and npm -2. Run `npm ci` in the root directory of the git repository +2. Run `npm run install` in the root directory of the git repository 3. Run `npm build` 4. Switch to usb directory `cd packages/usb` 4. Run script eg. `./blink-led-pwm-brightness.ts`