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: This will drop official support for node versions less
than v12.  It also removes the `main` export as something that will
work, effectively dropping a supported programmatic api via
`require('npm')`
  • Loading branch information
wraithgar committed Sep 15, 2021
1 parent 2def17a commit 2404704
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -58,7 +58,7 @@ jobs:
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 @@ -100,7 +100,7 @@ jobs:
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 @@ -141,7 +141,7 @@ jobs:
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.1', 16.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down
1 change: 1 addition & 0 deletions lib/no-api.js
@@ -0,0 +1 @@
throw new Error('The programmatic API was removed in npm v8.0.0')
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -38,17 +38,17 @@
"lib": "./lib",
"man": "./man"
},
"main": "./lib/npm.js",
"main": "./lib/no-api.js",
"bin": {
"npm": "bin/npm-cli.js",
"npx": "bin/npx-cli.js"
},
"exports": {
".": [
{
"default": "./lib/npm.js"
"default": "./lib/no-api.js"
},
"./lib/npm.js"
"./lib/no-api.js"
],
"./package.json": "./package.json"
},
Expand Down Expand Up @@ -235,6 +235,6 @@
},
"license": "Artistic-2.0",
"engines": {
"node": ">=10"
"node": "^12.13.0 || ^14.15.0 || >=16"
}
}
13 changes: 9 additions & 4 deletions test/lib/utils/unsupported.js
Expand Up @@ -27,10 +27,15 @@ const versions = [
['v7.2.3', false, true],
['v8.4.0', false, true],
['v9.3.0', false, true],
['v10.0.0-0', false, false],
['v11.0.0-0', false, false],
['v12.0.0-0', false, false],
['v13.0.0-0', false, false],
['v10.0.0-0', false, true],
['v11.0.0-0', false, true],
['v12.0.0-0', false, true],
['v12.13.0-0', false, false],
['v13.0.0-0', false, true],
['v14.0.0-0', false, true],
['v14.15.0-0', false, false],
['v15.0.0-0', false, true],
['v16.0.0-0', false, false],
]

t.test('versions', function (t) {
Expand Down

0 comments on commit 2404704

Please sign in to comment.