Skip to content

Commit

Permalink
chore!: drop support for Node 10 (#3873)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky authored Nov 24, 2021
1 parent cda427c commit ae8224d
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# We test on the oldest supported Node.js version, but only with a
# single combination (Ubuntu)
- os: ubuntu-latest
node-version: '10.18.0'
node-version: '12.20.0'
install-command: npm ci
# The buildbot pins Netlify Build's dependencies, like `npm ci`.
# But other consumers do not, like `npm install`.
Expand All @@ -46,7 +46,7 @@ jobs:
check-latest: true
- name: Install npm@7
run: npm install -g npm@7
if: ${{ matrix.node-version == '10.18.0' }}
if: ${{ matrix.node-version == '12.20.0' }}
- name: Install dependencies
run: ${{ matrix.install-command }}
- name: Linting
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@
"tsd": "^0.19.0"
},
"engines": {
"node": ">=10.18.0"
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,6 @@
"yarn": "^1.22.4"
},
"engines": {
"node": ">=10.18.0"
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/build/src/plugins/node_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const {
const { addErrorInfo } = require('../error/info')

// Local plugins and `package.json`-installed plugins use user's preferred Node.js version if higher than our minimum
// supported version (Node v10). Else default to the system Node version.
// supported version. Else default to the system Node version.
// Local and programmatic builds use `@netlify/build` Node.js version, which is
// usually the system's Node.js version.
// If the user Node version does not satisfy our supported engine range use our own system Node version
Expand Down
2 changes: 1 addition & 1 deletion packages/build/tests/core/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ test('--dry with build.command but no netlify.toml', async (t) => {
await runFixture(t, 'none', { flags: { dry: true, defaultConfig: { build: { command: 'echo' } } } })
})

const CHILD_NODE_VERSION = '10.17.0'
const CHILD_NODE_VERSION = '12.19.0'
const VERY_OLD_NODE_VERSION = '4.0.0'

// Try `get-node` several times because it sometimes fails due to network failures
Expand Down
2 changes: 2 additions & 0 deletions packages/build/tests/helpers/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ const NORMALIZE_REGEXPS = [
[/No valid versions/g, 'No versions'],
// TypeScript ES proposals differ per Node versions
[/es\d{4}/g, 'es2000'],
[/.*es(2000\.|1).*\n/g, ''],
[/^(\s+"es2000"),/gm, '$1'],
// Empty lines
[/^ +$/gm, ''],
// Hexadecimal identifiers, like commit hash
Expand Down
2 changes: 1 addition & 1 deletion packages/build/tests/plugins/fixtures/engines/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"license": "MIT",
"repository": "test",
"engines": {
"node": ">=13.0.0"
"node": ">=16.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"license": "MIT",
"repository": "test",
"engines": {
"node": ">=10.18.0"
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/build/tests/plugins/snapshots/tests.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -14545,7 +14545,7 @@ Generated by [AVA](https://avajs.dev).
Invalid --node-path CLI flag: /external/path␊
`

## Provided --node-path version is unused in buildbot for local plugin executions if <10.18.0
## Provided --node-path version is unused in buildbot for local plugin executions if older than supported version

> Snapshot 1

Expand Down
Binary file modified packages/build/tests/plugins/snapshots/tests.js.snap
Binary file not shown.
8 changes: 4 additions & 4 deletions packages/build/tests/plugins/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ test.serial('Compatibility order take precedence over the `featureFlag` property
})

const getNodePath = function (nodeVersion) {
return `/home/ether/.nvm/versions/node/v${nodeVersion}/bin/node`
return `/home/user/.nvm/versions/node/v${nodeVersion}/bin/node`
}

const runWithUpdatePluginMock = async function (t, fixture, { flags, status, sendStatus = true, testPlugin } = {}) {
Expand Down Expand Up @@ -1541,7 +1541,7 @@ test('Validate --node-path unsupported version does not fail when no plugins are
})

test('Validate --node-path version is supported by the plugin', async (t) => {
const nodePath = getNodePath('12.0.0')
const nodePath = getNodePath('14.14.0')
await runFixture(t, 'engines', {
flags: { nodePath },
})
Expand All @@ -1553,8 +1553,8 @@ test('Validate --node-path exists', async (t) => {
})
})

test('Provided --node-path version is unused in buildbot for local plugin executions if <10.18.0', async (t) => {
const nodePath = getNodePath('10.17.0')
test('Provided --node-path version is unused in buildbot for local plugin executions if older than supported version', async (t) => {
const nodePath = getNodePath('12.19.0')
await runFixture(t, 'version_greater_than_minimum', {
flags: { nodePath, mode: 'buildbot' },
})
Expand Down
2 changes: 1 addition & 1 deletion packages/cache-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
"tmp-promise": "^3.0.0"
},
"engines": {
"node": ">=10.18.0"
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@
"tmp-promise": "^3.0.2"
},
"engines": {
"node": ">=10.18.0"
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/functions-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
"tmp-promise": "^3.0.0"
},
"engines": {
"node": ">=10.18.0"
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/git-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
"ava": "^3.15.0"
},
"engines": {
"node": ">=10.18.0"
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/run-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
"semver": "^7.0.0"
},
"engines": {
"node": ">=10.18.0"
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
}
}

0 comments on commit ae8224d

Please sign in to comment.