Skip to content

Commit 9917ef4

Browse files
authored
feat!: end of support for v14 and v16 (#6223)
* feat!: end of support for v14 and v16 * test: cleanup semver checks surrounding node v16 * ci: remove npm@7 installation step * test: restore test for min plugin version warning * ci: set up corepack after installing node * test: skip pnpm monorepo tests in node versions that don't support it
1 parent fa49ed2 commit 9917ef4

File tree

33 files changed

+164
-223
lines changed

33 files changed

+164
-223
lines changed

.github/workflows/workflow.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
include:
5555
- os: ubuntu-24.04
5656
# Earliest supported version
57-
node-version: '14.16.0'
57+
node-version: '18.14.0'
5858
deno-version: 'v2.2.4'
5959
fail-fast: false
6060
steps:
@@ -76,9 +76,6 @@ jobs:
7676
node-version: ${{ matrix.node-version }}
7777
cache: 'npm'
7878
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
79-
- name: Install npm@7
80-
run: npm install -g npm@7
81-
if: ${{ matrix.node-version == '14.16.0' && !steps.release-check.outputs.IS_RELEASE }}
8279
- name: Setup Deno
8380
uses: denoland/setup-deno@v1
8481
with:
@@ -115,23 +112,23 @@ jobs:
115112
# We test on the oldest supported Node.js version, but only with a
116113
# single combination (Ubuntu)
117114
- os: ubuntu-24.04
118-
node-version: '14.16.0'
115+
node-version: '18.14.0'
119116
install-command: npm ci
120117
machine: '0'
121118
- os: ubuntu-24.04
122-
node-version: '14.16.0'
119+
node-version: '18.14.0'
123120
install-command: npm ci
124121
machine: '1'
125122
- os: ubuntu-24.04
126-
node-version: '14.16.0'
123+
node-version: '18.14.0'
127124
install-command: npm ci
128125
machine: '2'
129126
- os: ubuntu-24.04
130-
node-version: '14.16.0'
127+
node-version: '18.14.0'
131128
install-command: npm ci
132129
machine: '3'
133130
- os: ubuntu-24.04
134-
node-version: '14.16.0'
131+
node-version: '18.14.0'
135132
install-command: npm ci
136133
machine: '4'
137134
fail-fast: false
@@ -149,13 +146,6 @@ jobs:
149146
with:
150147
fetch-depth: 0
151148
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
152-
- name: corepack update
153-
# corepack version distributed with Node.js has a problem with new package manager releases,
154-
# so forcing fixed version of corepack here
155-
run: npm i -g corepack --force
156-
- name: setup pnpm/yarn
157-
run: corepack enable
158-
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
159149
- name: Setup Deno
160150
uses: denoland/setup-deno@v1
161151
with:
@@ -167,9 +157,13 @@ jobs:
167157
node-version: ${{ matrix.node-version }}
168158
cache: 'npm'
169159
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
170-
- name: Install npm@7
171-
run: npm install -g npm@7
172-
if: ${{ matrix.node-version == '14.16.0' && !steps.release-check.outputs.IS_RELEASE }}
160+
- name: corepack update
161+
# corepack version distributed with Node.js has a problem with new package manager releases,
162+
# so forcing fixed version of corepack here
163+
run: npm i -g corepack --force
164+
- name: setup pnpm/yarn
165+
run: corepack enable
166+
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
173167
- name: Set up Go
174168
uses: actions/setup-go@v5
175169
with:

package-lock.json

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"prettier": "^3.0.0"
6464
},
6565
"engines": {
66-
"node": "^14.16.0 || >=16.0.0"
66+
"node": ">=18.14.0"
6767
},
6868
"lint-staged": {
6969
"!(packages/*/tests/**/fixtures/**/*)*.+(j|t)s": "eslint --ignore-path .gitignore --cache --fix",

packages/build-info/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@
6969
"vitest": "^0.34.0"
7070
},
7171
"engines": {
72-
"node": "^14.16.0 || >=16.0.0"
72+
"node": ">=18.14.0"
7373
}
7474
}

packages/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@
157157
}
158158
},
159159
"engines": {
160-
"node": "^14.16.0 || >=16.0.0"
160+
"node": ">=18.14.0"
161161
}
162162
}

packages/build/src/plugins/node_version.ts

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import { dirname } from 'path'
21
import { execPath, version as currentVersion } from 'process'
32

43
import semver from 'semver'
54
import link from 'terminal-link'
65

76
import { logWarning, logWarningSubHeader } from '../log/logger.js'
8-
import { getPackageJson } from '../utils/package.js'
97

108
export type PluginsLoadedFrom = 'auto_install' | 'local' | 'package.json'
119

@@ -23,8 +21,7 @@ export type PluginsOptions = {
2321
* This node version is minimum required to run the plugins code.
2422
* If the users preferred Node.js version is below that we have to fall back to the system node version
2523
*/
26-
const MINIMUM_REQUIRED_NODE_VERSION = '^14.14.0 || >=16.0.0'
27-
const UPCOMING_MINIMUM_REQUIRED_NODE_VERSION = '>=18.14.0'
24+
const MINIMUM_REQUIRED_NODE_VERSION = '>=18.14.0'
2825

2926
/**
3027
* Local plugins and `package.json`-installed plugins use user's preferred Node.js version if higher than our minimum
@@ -33,39 +30,28 @@ const UPCOMING_MINIMUM_REQUIRED_NODE_VERSION = '>=18.14.0'
3330
* usually the system's Node.js version.
3431
* If the user Node version does not satisfy our supported engine range use our own system Node version
3532
*/
36-
export const addPluginsNodeVersion = function ({
37-
featureFlags,
38-
pluginsOptions,
39-
nodePath,
40-
userNodeVersion,
41-
logs,
42-
systemLog,
43-
}) {
33+
export const addPluginsNodeVersion = function ({ pluginsOptions, nodePath, userNodeVersion, logs }) {
4434
const currentNodeVersion = semver.clean(currentVersion)
4535
return Promise.all(
4636
pluginsOptions.map((pluginOptions) =>
4737
addPluginNodeVersion({
48-
featureFlags,
4938
pluginOptions,
5039
currentNodeVersion,
5140
userNodeVersion,
5241
nodePath,
5342
logs,
54-
systemLog,
5543
}),
5644
),
5745
)
5846
}
5947

6048
const addPluginNodeVersion = async function ({
61-
featureFlags,
6249
pluginOptions,
63-
pluginOptions: { loadedFrom, packageName, pluginPath },
50+
pluginOptions: { loadedFrom, packageName },
6451
currentNodeVersion,
6552
userNodeVersion,
6653
nodePath,
6754
logs,
68-
systemLog,
6955
}: {
7056
pluginOptions: PluginsOptions
7157
[key: string]: any
@@ -80,28 +66,6 @@ const addPluginNodeVersion = async function ({
8066
return systemNode
8167
}
8268

83-
if (
84-
featureFlags.build_warn_upcoming_system_version_change &&
85-
!semver.satisfies(userNodeVersion, UPCOMING_MINIMUM_REQUIRED_NODE_VERSION)
86-
) {
87-
if (pluginPath) {
88-
const pluginDir = dirname(pluginPath)
89-
const { packageJson: pluginPackageJson } = await getPackageJson(pluginDir)
90-
91-
// Ensure Node.js version is compatible with plugin's `engines.node`
92-
const pluginNodeVersionRange = pluginPackageJson?.engines?.node
93-
if (!pluginNodeVersionRange) {
94-
systemLog(`plugin "${packageName}" does not specify node support range`)
95-
} else if (semver.satisfies('22.0.0', pluginNodeVersionRange)) {
96-
systemLog(`plugin "${packageName}" node support range includes v22`)
97-
} else {
98-
systemLog(`plugin "${packageName}" node support range does NOT include v22`)
99-
}
100-
} else {
101-
systemLog(`plugin "${packageName}" pluginPath not available`)
102-
}
103-
}
104-
10569
if (semver.satisfies(userNodeVersion, MINIMUM_REQUIRED_NODE_VERSION)) {
10670
return userNode
10771
}
@@ -113,7 +77,7 @@ const addPluginNodeVersion = async function ({
11377
11478
Read more about our minimum required version in our ${link(
11579
'forums announcement',
116-
'https://answers.netlify.com/t/build-plugins-dropping-support-for-node-js-12/79421',
80+
'https://answers.netlify.com/t/build-plugins-end-of-support-for-node-js-14-node-js-16/136405',
11781
)}`,
11882
)
11983

packages/build/src/plugins/resolve.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ export const resolvePluginsPath = async function ({
4040
pluginsOptions.map((pluginOptions) => resolvePluginPath({ pluginOptions, buildDir, packagePath, autoPluginsDir })),
4141
)
4242
const pluginsOptionsB = await addPluginsNodeVersion({
43-
featureFlags,
4443
pluginsOptions: pluginsOptionsA,
4544
nodePath,
4645
userNodeVersion,
4746
logs,
48-
systemLog,
4947
})
5048

5149
const pluginsOptionsC = await addPinnedVersions({ pluginsOptions: pluginsOptionsB, api, siteInfo, sendStatus })

packages/build/tests/blobs_upload/tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ test.serial('Blobs upload step cancels deploy if blob metadata is malformed', as
210210
t.is(severityCode, 4)
211211
})
212212

213-
// the monorepo works with pnpm which is not available on node 14 tests
214-
if (semver.gte(nodeVersion, '16.9.0')) {
213+
// the monorepo works with pnpm which is not always available
214+
if (semver.gte(nodeVersion, '18.19.0')) {
215215
test.serial('monorepo > blobs upload, uploads files to deploy store', async (t) => {
216216
const fixture = await new Fixture('./fixtures/monorepo').withCopyRoot({ git: false })
217217
const { success } = await fixture

0 commit comments

Comments
 (0)