From 78d45e770e65d242f6f7a63666e6133a3a0d8b4c Mon Sep 17 00:00:00 2001 From: Lars Strojny Date: Sun, 18 Dec 2022 21:01:04 +0100 Subject: [PATCH] NPM v9 compatibility (#68) `npm bin` no longer exists in npm version 9, so we use `npx` to run local commands instead. `npm exec` would work as well, but that was only introduced with npx version 7 and node 14 uses version 6. Duh! --- .github/workflows/build.yml | 4 ---- package.json | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1926256..c1e5097 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,10 +10,6 @@ jobs: fail-fast: false matrix: include: - - { node-version: 10.x, lint: false, tests: false } - - { node-version: 11.x, lint: false, tests: false } - - { node-version: 12.x, lint: false, tests: false } - - { node-version: 13.x, lint: false, tests: false } - { node-version: 14.x, lint: true, tests: true } - { node-version: 15.x, lint: false, tests: true } - { node-version: 16.x, lint: true, tests: true } diff --git a/package.json b/package.json index 30c3629..4a18b62 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ }, "main": "dist/src/index.js", "scripts": { - "lint": "ifNotCi() { test \"$CI\" && echo \"$2\" || echo \"$1\"; }; `npm bin`/tsc --noEmit && `npm bin`/prettier --ignore-path=.gitignore `ifNotCi --write \"--check --cache --cache-strategy content\"` '**/**.{ts,js,json}' && `npm bin`/eslint `ifNotCi --fix \"--cache --cache-strategy content\"` --ignore-path=.gitignore '**/**.{ts,js,json}'", + "lint": "ifNotCi() { test \"$CI\" && echo \"$2\" || echo \"$1\"; }; npx tsc --noEmit && npx prettier --ignore-path=.gitignore `ifNotCi --write \"--check --cache --cache-strategy content\"` '**/**.{ts,js,json}' && npx eslint `ifNotCi --fix \"--cache --cache-strategy content\"` --ignore-path=.gitignore '**/**.{ts,js,json}'", "start": "npm run build && npm run link && nodemon", - "test": "ifNotCi() { test \"$CI\" && echo \"$2\" || echo \"$1\"; }; npm run code-generation && `npm bin`/jest `ifNotCi --watchAll --collect-coverage`", + "test": "ifNotCi() { test \"$CI\" && echo \"$2\" || echo \"$1\"; }; npm run code-generation && npx jest `ifNotCi --watchAll --collect-coverage`", "link": "npm install --no-save file:///$PWD/", "build": "rimraf ./dist .tsbuildinfo && npm run code-generation && tsc", "code-generation": "./code-generation/hap-gen.js && ./code-generation/config-scheme-gen.js",