Skip to content

Commit

Permalink
simplify NPM strict checks (#7973)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
chris48s and repo-ranger[bot] authored May 17, 2022
1 parent 22afe7b commit 07bc032
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
24 changes: 4 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -50,7 +49,6 @@ integration_steps: &integration_steps
- run:
name: Install dependencies
command: |
npm install --dry-run
npm ci
environment:
CYPRESS_INSTALL_BINARY: 0
Expand All @@ -73,7 +71,6 @@ services_steps: &services_steps
- run:
name: Install dependencies
command: |
npm install --dry-run
npm ci
environment:
CYPRESS_INSTALL_BINARY: 0
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -272,7 +257,6 @@ jobs:
- run:
name: Install dependencies
command: |
npm install --dry-run
npm ci
- run:
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
engine-strict=true
strict-peer-deps=true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion doc/TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 07bc032

Please sign in to comment.