Skip to content

Commit

Permalink
feat: drop node 10, 11, and programmatic api
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
 - Drop official support for node versions less than v12.
 - Drop support for `require('npm')`
 - Update a few subdependencies that dropped node10 support, and brought
   in the latest node-gyp

PR-URL: #3762
Credit: @wraithgar
Close: #3762
Reviewed-by: @fritzy
  • Loading branch information
wraithgar committed Oct 7, 2021
1 parent 32e163f commit a13d9d5
Show file tree
Hide file tree
Showing 110 changed files with 3,528 additions and 1,895 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/ci.yml
Expand Up @@ -14,10 +14,10 @@ jobs:
node-version: 14.x
- name: Install dependencies
run: |
node . install --ignore-scripts --no-audit
node . rebuild
node ./bin/npm-cli.js install --ignore-scripts --no-audit
node ./bin/npm-cli.js rebuild
- name: Run linting
run: node . run posttest
run: node ./bin/npm-cli.js run posttest
env:
DEPLOY_VERSION: testing

Expand All @@ -31,7 +31,7 @@ jobs:
node-version: 14.x
- name: Install dependencies
run: |
node . install --ignore-scripts --no-audit
node ./bin/npm-cli.js install --ignore-scripts --no-audit
- name: Rebuild the docs
run: make freshdocs
- name: Git should not be dirty
Expand All @@ -49,16 +49,16 @@ jobs:
node-version: 14.x
- name: Install dependencies
run: |
node . install --ignore-scripts --no-audit
node . rebuild
node ./bin/npm-cli.js install --ignore-scripts --no-audit
node ./bin/npm-cli.js rebuild
- name: Run linting
run: node . run licenses
run: node ./bin/npm-cli.js run licenses

smoke-tests:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down Expand Up @@ -87,20 +87,20 @@ jobs:
# Run the installer script
- name: Install dependencies
run: |
node . install --ignore-scripts --no-audit
node . rebuild
node ./bin/npm-cli.js install --ignore-scripts --no-audit
node ./bin/npm-cli.js rebuild
# Run the smoke tests
- name: Run Smoke tests
run: node . run --ignore-scripts smoke-tests -- --no-check-coverage -t600 -Rbase -c
run: node ./bin/npm-cli.js run --ignore-scripts smoke-tests -- --no-check-coverage -t600 -Rbase -c
env:
DEPLOY_VERSION: testing

workspaces-tests:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down Expand Up @@ -129,19 +129,19 @@ jobs:
# Run the installer script
- name: Install dependencies
run: |
node . install --ignore-scripts --no-audit
node . rebuild
node ./bin/npm-cli.js install --ignore-scripts --no-audit
node ./bin/npm-cli.js rebuild
- name: Run workspaces tests
run: node . test -w ./packages -- --no-check-coverage -t600 -Rbase -c
run: node ./bin/npm-cli.js test -w ./packages -- --no-check-coverage -t600 -Rbase -c
env:
DEPLOY_VERSION: testing

build:
strategy:
fail-fast: false
matrix:
node-version: ['10.1', 10.x, '12.1', 12.x, '14.1', 14.x, '16.1', 16.x]
node-version: ['12.13.0', 12.x, '14.15.0', 14.x, '16.0.0', 16.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down Expand Up @@ -170,21 +170,21 @@ jobs:
# Run the installer script
- name: Install dependencies
run: |
node . install --ignore-scripts --no-audit
node . rebuild
node ./bin/npm-cli.js install --ignore-scripts --no-audit
node ./bin/npm-cli.js rebuild
# Run the tests, but not if we're just gonna do coveralls later anyway
- name: Run Tap tests
if: matrix.platform.os != 'ubuntu-latest' || matrix.node-version != '12.x'
run: node . run --ignore-scripts test -- -t600 -Rbase -c
if: matrix.platform.os != 'ubuntu-latest' || matrix.node-version != '16.x'
run: node ./bin/npm-cli.js run --ignore-scripts test -- -t600 -Rbase -c
env:
DEPLOY_VERSION: testing

# Run coverage check
- name: Run coverage report
if: matrix.platform.os == 'ubuntu-latest' && matrix.node-version == '12.x'
if: matrix.platform.os == 'ubuntu-latest' && matrix.node-version == '16.x'
# turn off --check-coverage until 100%, so CI failure is relevant
run: node . run check-coverage -- -t600 --no-check-coverage -Rbase -c
run: node ./bin/npm-cli.js run check-coverage -- -t600 --no-check-coverage -Rbase -c
env:
DEPLOY_VERSION: testing
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_OPTIONAL_TOKEN }}
Expand Down
5 changes: 5 additions & 0 deletions index.js
@@ -0,0 +1,5 @@
if (require.main === module) {
require('./lib/cli.js')(process)
} else {
throw new Error('The programmatic API was removed in npm v8.0.0')
}
3 changes: 0 additions & 3 deletions lib/npm.js
Expand Up @@ -355,6 +355,3 @@ const npm = module.exports = new class extends EventEmitter {
this.log.showProgress()
}
}()

if (require.main === module)
require('./cli.js')(process)
49 changes: 0 additions & 49 deletions node_modules/@npmcli/arborist/bin/dedupe.js

This file was deleted.

11 changes: 10 additions & 1 deletion node_modules/@npmcli/arborist/lib/arborist/audit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion node_modules/@npmcli/arborist/lib/arborist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion node_modules/@npmcli/arborist/lib/arborist/rebuild.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion node_modules/@npmcli/arborist/lib/arborist/reify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a13d9d5

Please sign in to comment.