Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 13 additions & 19 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
include:
- os: ubuntu-24.04
# Earliest supported version
node-version: '14.16.0'
node-version: '18.14.0'
deno-version: 'v2.2.4'
fail-fast: false
steps:
Expand All @@ -76,9 +76,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Install npm@7
run: npm install -g npm@7
if: ${{ matrix.node-version == '14.16.0' && !steps.release-check.outputs.IS_RELEASE }}
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
Expand Down Expand Up @@ -115,23 +112,23 @@ jobs:
# We test on the oldest supported Node.js version, but only with a
# single combination (Ubuntu)
- os: ubuntu-24.04
node-version: '14.16.0'
node-version: '18.14.0'
install-command: npm ci
machine: '0'
- os: ubuntu-24.04
node-version: '14.16.0'
node-version: '18.14.0'
install-command: npm ci
machine: '1'
- os: ubuntu-24.04
node-version: '14.16.0'
node-version: '18.14.0'
install-command: npm ci
machine: '2'
- os: ubuntu-24.04
node-version: '14.16.0'
node-version: '18.14.0'
install-command: npm ci
machine: '3'
- os: ubuntu-24.04
node-version: '14.16.0'
node-version: '18.14.0'
install-command: npm ci
machine: '4'
fail-fast: false
Expand All @@ -149,13 +146,6 @@ jobs:
with:
fetch-depth: 0
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: corepack update
# corepack version distributed with Node.js has a problem with new package manager releases,
# so forcing fixed version of corepack here
run: npm i -g corepack --force
- name: setup pnpm/yarn
run: corepack enable
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
Expand All @@ -167,9 +157,13 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Install npm@7
run: npm install -g npm@7
if: ${{ matrix.node-version == '14.16.0' && !steps.release-check.outputs.IS_RELEASE }}
- name: corepack update
# corepack version distributed with Node.js has a problem with new package manager releases,
# so forcing fixed version of corepack here
run: npm i -g corepack --force
- name: setup pnpm/yarn
run: corepack enable
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand Down
36 changes: 18 additions & 18 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 @@ -63,7 +63,7 @@
"prettier": "^3.0.0"
},
"engines": {
"node": "^14.16.0 || >=16.0.0"
"node": ">=18.14.0"
},
"lint-staged": {
"!(packages/*/tests/**/fixtures/**/*)*.+(j|t)s": "eslint --ignore-path .gitignore --cache --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/build-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@
"vitest": "^0.34.0"
},
"engines": {
"node": "^14.16.0 || >=16.0.0"
"node": ">=18.14.0"
}
}
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@
}
},
"engines": {
"node": "^14.16.0 || >=16.0.0"
"node": ">=18.14.0"
}
}
44 changes: 4 additions & 40 deletions packages/build/src/plugins/node_version.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { dirname } from 'path'
import { execPath, version as currentVersion } from 'process'

import semver from 'semver'
import link from 'terminal-link'

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

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

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

/**
* Local plugins and `package.json`-installed plugins use user's preferred Node.js version if higher than our minimum
Expand All @@ -33,39 +30,28 @@ const UPCOMING_MINIMUM_REQUIRED_NODE_VERSION = '>=18.14.0'
* 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
*/
export const addPluginsNodeVersion = function ({
featureFlags,
pluginsOptions,
nodePath,
userNodeVersion,
logs,
systemLog,
}) {
export const addPluginsNodeVersion = function ({ pluginsOptions, nodePath, userNodeVersion, logs }) {
const currentNodeVersion = semver.clean(currentVersion)
return Promise.all(
pluginsOptions.map((pluginOptions) =>
addPluginNodeVersion({
featureFlags,
pluginOptions,
currentNodeVersion,
userNodeVersion,
nodePath,
logs,
systemLog,
}),
),
)
}

const addPluginNodeVersion = async function ({
featureFlags,
pluginOptions,
pluginOptions: { loadedFrom, packageName, pluginPath },
pluginOptions: { loadedFrom, packageName },
currentNodeVersion,
userNodeVersion,
nodePath,
logs,
systemLog,
}: {
pluginOptions: PluginsOptions
[key: string]: any
Expand All @@ -80,28 +66,6 @@ const addPluginNodeVersion = async function ({
return systemNode
}

if (
featureFlags.build_warn_upcoming_system_version_change &&
!semver.satisfies(userNodeVersion, UPCOMING_MINIMUM_REQUIRED_NODE_VERSION)
) {
if (pluginPath) {
const pluginDir = dirname(pluginPath)
const { packageJson: pluginPackageJson } = await getPackageJson(pluginDir)

// Ensure Node.js version is compatible with plugin's `engines.node`
const pluginNodeVersionRange = pluginPackageJson?.engines?.node
if (!pluginNodeVersionRange) {
systemLog(`plugin "${packageName}" does not specify node support range`)
} else if (semver.satisfies('22.0.0', pluginNodeVersionRange)) {
systemLog(`plugin "${packageName}" node support range includes v22`)
} else {
systemLog(`plugin "${packageName}" node support range does NOT include v22`)
}
} else {
systemLog(`plugin "${packageName}" pluginPath not available`)
}
}

if (semver.satisfies(userNodeVersion, MINIMUM_REQUIRED_NODE_VERSION)) {
return userNode
}
Expand All @@ -113,7 +77,7 @@ const addPluginNodeVersion = async function ({

Read more about our minimum required version in our ${link(
'forums announcement',
'https://answers.netlify.com/t/build-plugins-dropping-support-for-node-js-12/79421',
'https://answers.netlify.com/t/build-plugins-end-of-support-for-node-js-14-node-js-16/136405',
)}`,
)

Expand Down
2 changes: 0 additions & 2 deletions packages/build/src/plugins/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ export const resolvePluginsPath = async function ({
pluginsOptions.map((pluginOptions) => resolvePluginPath({ pluginOptions, buildDir, packagePath, autoPluginsDir })),
)
const pluginsOptionsB = await addPluginsNodeVersion({
featureFlags,
pluginsOptions: pluginsOptionsA,
nodePath,
userNodeVersion,
logs,
systemLog,
})

const pluginsOptionsC = await addPinnedVersions({ pluginsOptions: pluginsOptionsB, api, siteInfo, sendStatus })
Expand Down
4 changes: 2 additions & 2 deletions packages/build/tests/blobs_upload/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ test.serial('Blobs upload step cancels deploy if blob metadata is malformed', as
t.is(severityCode, 4)
})

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