1
0
mirror of https://github.com/badges/shields.git synced 2025-04-17 08:37:04 +03:00

simplify NPM strict checks (#7973)

* simplify engine-strict/strict-peer-deps checks

* disable engine-strict for node 12/14 package tests

* update docs

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
chris48s 2022-05-17 21:23:06 +01:00 committed by GitHub
parent 22afe7b648
commit 07bc0325ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 24 deletions

View File

@ -7,7 +7,6 @@ main_steps: &main_steps
- run:
name: Install dependencies
command: |
npm install --dry-run
npm ci
environment:
# https://docs.cypress.io/guides/getting-started/installing-cypress.html#Skipping-installation
@ -50,7 +49,6 @@ integration_steps: &integration_steps
- run:
name: Install dependencies
command: |
npm install --dry-run
npm ci
environment:
CYPRESS_INSTALL_BINARY: 0
@ -73,7 +71,6 @@ services_steps: &services_steps
- run:
name: Install dependencies
command: |
npm install --dry-run
npm ci
environment:
CYPRESS_INSTALL_BINARY: 0
@ -116,6 +113,7 @@ package_steps: &package_steps
MOCHA_FILE: junit/badge-maker/v12/results.xml
NODE_VERSION: v12
CYPRESS_INSTALL_BINARY: 0
NPM_CONFIG_ENGINE_STRICT: 'false'
name: Run package tests on Node 12
command: scripts/run_package_tests.sh
@ -125,6 +123,7 @@ package_steps: &package_steps
MOCHA_FILE: junit/badge-maker/v14/results.xml
NODE_VERSION: v14
CYPRESS_INSTALL_BINARY: 0
NPM_CONFIG_ENGINE_STRICT: 'false'
name: Run package tests on Node 14
command: scripts/run_package_tests.sh
@ -144,9 +143,6 @@ jobs:
main:
docker:
- image: cimg/node:16.15
environment:
NPM_CONFIG_ENGINE_STRICT: 'true'
NPM_CONFIG_STRICT_PEER_DEPS: 'true'
<<: *main_steps
@ -159,9 +155,6 @@ jobs:
integration:
docker:
- image: cimg/node:16.15
environment:
NPM_CONFIG_ENGINE_STRICT: 'true'
NPM_CONFIG_STRICT_PEER_DEPS: 'true'
- image: redis
<<: *integration_steps
@ -196,16 +189,13 @@ jobs:
frontend:
docker:
- image: cimg/node:16.15
environment:
NPM_CONFIG_ENGINE_STRICT: 'true'
NPM_CONFIG_STRICT_PEER_DEPS: 'true'
steps:
- checkout
- run:
name: Install dependencies
command: |
npm install --dry-run
npm ci
environment:
CYPRESS_INSTALL_BINARY: 0
@ -243,9 +233,6 @@ jobs:
services:
docker:
- image: cimg/node:16.15
environment:
NPM_CONFIG_ENGINE_STRICT: 'true'
NPM_CONFIG_STRICT_PEER_DEPS: 'true'
<<: *services_steps
@ -258,9 +245,7 @@ jobs:
e2e:
docker:
- image: cypress/base:16.14.0
environment:
NPM_CONFIG_ENGINE_STRICT: 'true'
NPM_CONFIG_STRICT_PEER_DEPS: 'true'
steps:
- checkout
@ -272,7 +257,6 @@ jobs:
- run:
name: Install dependencies
command: |
npm install --dry-run
npm ci
- run:

2
.npmrc Normal file
View File

@ -0,0 +1,2 @@
engine-strict=true
strict-peer-deps=true

View File

@ -9,7 +9,7 @@ COPY package.json package-lock.json /usr/src/app/
COPY badge-maker /usr/src/app/badge-maker/
RUN apk add python3 make g++
RUN npm install -g "npm@>=7"
RUN npm install -g "npm@>=8"
# We need dev deps to build the front end. We don't need Cypress, though.
RUN NODE_ENV=development CYPRESS_INSTALL_BINARY=0 npm ci

View File

@ -25,7 +25,7 @@ and learn about the [GitHub workflow](http://try.github.io/).
#### Node, NPM
Node >=16 and NPM >=7 is required. If you don't already have them,
Node >=16 and NPM >=8 is required. If you don't already have them,
install node and npm: https://nodejs.org/en/download/
### Setup a dev install

View File

@ -241,8 +241,8 @@
"url": "^0.11.0"
},
"engines": {
"node": "^16.13.0",
"npm": ">=7.0.0"
"node": ">=16.13.0",
"npm": ">=8.0.0"
},
"type": "module",
"collective": {