diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 8548fdd4cb..a33e2828ca 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -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: @@ -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: @@ -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 @@ -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: @@ -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: diff --git a/package-lock.json b/package-lock.json index df5a34547a..59dfa3b0b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "prettier": "^3.0.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "node_modules/@ampproject/remapping": { @@ -31872,7 +31872,7 @@ "yarn": "^1.22.22" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" }, "peerDependencies": { "@netlify/opentelemetry-sdk-setup": "^1.1.0", @@ -31916,7 +31916,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/build-info/node_modules/@types/node": { @@ -31954,7 +31954,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/cache-utils/node_modules/@types/node": { @@ -32019,7 +32019,7 @@ "typescript": "^5.0.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/config/node_modules/@types/node": { @@ -32070,7 +32070,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/edge-bundler/node_modules/@types/node": { @@ -32343,7 +32343,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.14.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/functions-utils": { @@ -32363,7 +32363,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/functions-utils/node_modules/@types/node": { @@ -32390,7 +32390,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/git-utils/node_modules/@types/node": { @@ -32418,7 +32418,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/headers-parser/node_modules/@types/node": { @@ -32452,7 +32452,7 @@ "uuid": "^9.0.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/js-client/node_modules/@types/node": { @@ -32472,7 +32472,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/nock-udp/node_modules/@types/node": { @@ -32507,7 +32507,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=18.14.0" }, "peerDependencies": { "@opentelemetry/api": "~1.8.0" @@ -32535,7 +32535,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=18.14.0" }, "peerDependencies": { "@opentelemetry/api": "~1.8.0" @@ -32565,7 +32565,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/redirect-parser/node_modules/@types/node": { @@ -32589,7 +32589,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/run-utils/node_modules/@types/node": { @@ -32623,7 +32623,7 @@ "typescript": "^5.0.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/testing/node_modules/@types/node": { @@ -32713,7 +32713,7 @@ "vitest": "0.34.6" }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": ">=18.14.0" } }, "packages/zip-it-and-ship-it/node_modules/@types/semver": { diff --git a/package.json b/package.json index a34b0feaef..c65807e6e0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/build-info/package.json b/packages/build-info/package.json index ac93c51772..24a1febc7e 100644 --- a/packages/build-info/package.json +++ b/packages/build-info/package.json @@ -69,6 +69,6 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } } diff --git a/packages/build/package.json b/packages/build/package.json index 110cd5a93a..cc2a0220ae 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -157,6 +157,6 @@ } }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } } diff --git a/packages/build/src/plugins/node_version.ts b/packages/build/src/plugins/node_version.ts index c515e609a2..3a1b0224c4 100644 --- a/packages/build/src/plugins/node_version.ts +++ b/packages/build/src/plugins/node_version.ts @@ -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' @@ -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 @@ -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 @@ -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 } @@ -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', )}`, ) diff --git a/packages/build/src/plugins/resolve.js b/packages/build/src/plugins/resolve.js index 1d971857c6..dee2eb1324 100644 --- a/packages/build/src/plugins/resolve.js +++ b/packages/build/src/plugins/resolve.js @@ -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 }) diff --git a/packages/build/tests/blobs_upload/tests.js b/packages/build/tests/blobs_upload/tests.js index d4d95d776a..5891c377ff 100644 --- a/packages/build/tests/blobs_upload/tests.js +++ b/packages/build/tests/blobs_upload/tests.js @@ -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 diff --git a/packages/build/tests/core/snapshots/tests.js.md b/packages/build/tests/core/snapshots/tests.js.md index f492542cc4..277f9bef75 100644 --- a/packages/build/tests/core/snapshots/tests.js.md +++ b/packages/build/tests/core/snapshots/tests.js.md @@ -1173,7 +1173,7 @@ Generated by [AVA](https://avajs.dev). > Warning: ./plugin.js will be executed with Node.js version 1.0.0␊ The plugin cannot be executed with your defined Node.js version 1.0.0␊ ␊ - Read more about our minimum required version in our forums announcement (https://answers.netlify.com/t/build-plugins-dropping-support-for-node-js-12/79421)␊ + Read more about our minimum required version in our forums announcement (https://answers.netlify.com/t/build-plugins-end-of-support-for-node-js-14-node-js-16/136405)␊ ␊ > Loading plugins␊ - ./plugin.js@1.0.0 from netlify.toml␊ @@ -1232,7 +1232,7 @@ Generated by [AVA](https://avajs.dev). > Warning: netlify-plugin-test will be executed with Node.js version 1.0.0␊ The plugin cannot be executed with your defined Node.js version 1.0.0␊ ␊ - Read more about our minimum required version in our forums announcement (https://answers.netlify.com/t/build-plugins-dropping-support-for-node-js-12/79421)␊ + Read more about our minimum required version in our forums announcement (https://answers.netlify.com/t/build-plugins-end-of-support-for-node-js-14-node-js-16/136405)␊ ␊ > Loading plugins␊ - netlify-plugin-test@1.0.0 from netlify.toml and package.json␊ diff --git a/packages/build/tests/core/snapshots/tests.js.snap b/packages/build/tests/core/snapshots/tests.js.snap index dcdb301de0..aa1ca0226d 100644 Binary files a/packages/build/tests/core/snapshots/tests.js.snap and b/packages/build/tests/core/snapshots/tests.js.snap differ diff --git a/packages/build/tests/edge_functions/tests.js b/packages/build/tests/edge_functions/tests.js index fb15cdab26..673cc15855 100644 --- a/packages/build/tests/edge_functions/tests.js +++ b/packages/build/tests/edge_functions/tests.js @@ -1,12 +1,11 @@ import { promises as fs } from 'fs' import { join } from 'path' -import { platform, version as nodeVersion } from 'process' +import { platform } from 'process' import { fileURLToPath } from 'url' import { Fixture, normalizeOutput } from '@netlify/testing' import test from 'ava' import { pathExists } from 'path-exists' -import semver from 'semver' import tmp from 'tmp-promise' import { importJsonFile } from '../../lib/utils/json.js' @@ -215,10 +214,31 @@ test.serial('cleans up the edge functions dist directory before bundling', async t.false(await pathExists(oldBundlePath)) }) -// Targeting Node 16.7.0+ because these fixtures rely on `fs.cp()`. -if (semver.gte(nodeVersion, '16.7.0')) { - test.serial('builds edge functions generated with the Frameworks API', async (t) => { - const output = await new Fixture('./fixtures/functions_user_framework') +test.serial('builds edge functions generated with the Frameworks API', async (t) => { + const output = await new Fixture('./fixtures/functions_user_framework') + .withFlags({ + debug: false, + mode: 'buildbot', + }) + .runWithBuild() + + t.snapshot(normalizeOutput(output)) + + const { routes } = await assertManifest(t, 'functions_user_framework') + + t.is(routes.length, 1) + t.deepEqual(routes[0], { + function: 'function-2', + pattern: '^/framework(?:/(.*))/?$', + excluded_patterns: ['^/framework/skip_(.*)/?$'], + path: '/framework/*', + }) +}) + +test.serial( + 'builds both edge functions generated with the Frameworks API and the ones in the internal directory', + async (t) => { + const output = await new Fixture('./fixtures/functions_user_internal_framework') .withFlags({ debug: false, mode: 'buildbot', @@ -227,69 +247,45 @@ if (semver.gte(nodeVersion, '16.7.0')) { t.snapshot(normalizeOutput(output)) - const { routes } = await assertManifest(t, 'functions_user_framework') - - t.is(routes.length, 1) - t.deepEqual(routes[0], { - function: 'function-2', - pattern: '^/framework(?:/(.*))/?$', - excluded_patterns: ['^/framework/skip_(.*)/?$'], - path: '/framework/*', - }) - }) - - test.serial( - 'builds both edge functions generated with the Frameworks API and the ones in the internal directory', - async (t) => { - const output = await new Fixture('./fixtures/functions_user_internal_framework') - .withFlags({ - debug: false, - mode: 'buildbot', - }) - .runWithBuild() - - t.snapshot(normalizeOutput(output)) - - const { routes } = await assertManifest(t, 'functions_user_internal_framework') - - t.deepEqual(routes, [ - { - function: 'frameworks-internal-conflict', - pattern: '^/frameworks-internal-conflict/frameworks/?$', - excluded_patterns: [], - path: '/frameworks-internal-conflict/frameworks', - }, - { - function: 'function-3', - pattern: '^/internal(?:/(.*))/?$', - excluded_patterns: ['^/internal/skip_(.*)/?$'], - path: '/internal/*', - }, - { - function: 'frameworks-user-conflict', - pattern: '^/frameworks-user-conflict/frameworks/?$', - excluded_patterns: [], - path: '/frameworks-user-conflict/frameworks', - }, - { - function: 'function-2', - pattern: '^/framework(?:/(.*))/?$', - excluded_patterns: ['^/framework/skip_(.*)/?$'], - path: '/framework/*', - }, - { - function: 'frameworks-user-conflict', - pattern: '^/frameworks-user-conflict/user/?$', - excluded_patterns: [], - path: '/frameworks-user-conflict/user', - }, - { - function: 'function-1', - pattern: '^/user/?$', - excluded_patterns: [], - path: '/user', - }, - ]) - }, - ) -} + const { routes } = await assertManifest(t, 'functions_user_internal_framework') + + t.deepEqual(routes, [ + { + function: 'frameworks-internal-conflict', + pattern: '^/frameworks-internal-conflict/frameworks/?$', + excluded_patterns: [], + path: '/frameworks-internal-conflict/frameworks', + }, + { + function: 'function-3', + pattern: '^/internal(?:/(.*))/?$', + excluded_patterns: ['^/internal/skip_(.*)/?$'], + path: '/internal/*', + }, + { + function: 'frameworks-user-conflict', + pattern: '^/frameworks-user-conflict/frameworks/?$', + excluded_patterns: [], + path: '/frameworks-user-conflict/frameworks', + }, + { + function: 'function-2', + pattern: '^/framework(?:/(.*))/?$', + excluded_patterns: ['^/framework/skip_(.*)/?$'], + path: '/framework/*', + }, + { + function: 'frameworks-user-conflict', + pattern: '^/frameworks-user-conflict/user/?$', + excluded_patterns: [], + path: '/frameworks-user-conflict/user', + }, + { + function: 'function-1', + pattern: '^/user/?$', + excluded_patterns: [], + path: '/user', + }, + ]) + }, +) diff --git a/packages/build/tests/frameworks_api/tests.js b/packages/build/tests/frameworks_api/tests.js index 36d4e9e623..3a3108001b 100644 --- a/packages/build/tests/frameworks_api/tests.js +++ b/packages/build/tests/frameworks_api/tests.js @@ -95,8 +95,8 @@ test('Loads configuration data that has been generated by the build command usin } }) -// pnpm is not available in Node 14. -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('In a monorepo setup, loads package-specific configuration data', async (t) => { const fixture = await new Fixture('./fixtures/monorepo').withCopyRoot({ git: false }) const { success, netlifyConfig } = await fixture diff --git a/packages/build/tests/functions/tests.js b/packages/build/tests/functions/tests.js index e83549e9ba..57f86829ed 100644 --- a/packages/build/tests/functions/tests.js +++ b/packages/build/tests/functions/tests.js @@ -121,55 +121,52 @@ test('Functions: cleanup is only triggered when there are internal functions', a t.false(output.includes('Cleaning up leftover files from previous builds')) }) -// Targeting Node 16.7.0+ because these fixtures rely on `fs.cp()`. -if (semver.gte(nodeVersion, '16.7.0')) { - test('Functions: loads functions generated with the Frameworks API', async (t) => { - const fixture = await new Fixture('./fixtures/functions_user_and_frameworks') - .withFlags({ debug: false }) - .withCopyRoot() +test('Functions: loads functions generated with the Frameworks API', async (t) => { + const fixture = await new Fixture('./fixtures/functions_user_and_frameworks') + .withFlags({ debug: false }) + .withCopyRoot() - const output = await fixture.runWithBuild() - const functionsDist = await readdir(resolve(fixture.repositoryRoot, '.netlify/functions')) + const output = await fixture.runWithBuild() + const functionsDist = await readdir(resolve(fixture.repositoryRoot, '.netlify/functions')) - t.true(functionsDist.includes('manifest.json')) - t.true(functionsDist.includes('server.zip')) - t.true(functionsDist.includes('user.zip')) + t.true(functionsDist.includes('manifest.json')) + t.true(functionsDist.includes('server.zip')) + t.true(functionsDist.includes('user.zip')) - t.snapshot(normalizeOutput(output)) - }) + t.snapshot(normalizeOutput(output)) +}) - test('Functions: loads functions from the `.netlify/functions-internal` directory and the Frameworks API', async (t) => { - const fixture = await new Fixture('./fixtures/functions_user_internal_and_frameworks') - .withFlags({ debug: false }) - .withCopyRoot() +test('Functions: loads functions from the `.netlify/functions-internal` directory and the Frameworks API', async (t) => { + const fixture = await new Fixture('./fixtures/functions_user_internal_and_frameworks') + .withFlags({ debug: false }) + .withCopyRoot() - const output = await fixture.runWithBuild() - const functionsDist = await readdir(resolve(fixture.repositoryRoot, '.netlify/functions')) + const output = await fixture.runWithBuild() + const functionsDist = await readdir(resolve(fixture.repositoryRoot, '.netlify/functions')) - t.true(functionsDist.includes('manifest.json')) - t.true(functionsDist.includes('server.zip')) - t.true(functionsDist.includes('user.zip')) - t.true(functionsDist.includes('server-internal.zip')) + t.true(functionsDist.includes('manifest.json')) + t.true(functionsDist.includes('server.zip')) + t.true(functionsDist.includes('user.zip')) + t.true(functionsDist.includes('server-internal.zip')) - const manifest = await readFile(resolve(fixture.repositoryRoot, '.netlify/functions/manifest.json'), 'utf8') - const { functions } = JSON.parse(manifest) + const manifest = await readFile(resolve(fixture.repositoryRoot, '.netlify/functions/manifest.json'), 'utf8') + const { functions } = JSON.parse(manifest) - t.is(functions.length, 5) + t.is(functions.length, 5) - // The Frameworks API takes precedence over the legacy internal directory. - const frameworksInternalConflict = functions.find(({ name }) => name === 'frameworks-internal-conflict') - t.is(frameworksInternalConflict.routes[0].pattern, '/frameworks-internal-conflict/frameworks') + // The Frameworks API takes precedence over the legacy internal directory. + const frameworksInternalConflict = functions.find(({ name }) => name === 'frameworks-internal-conflict') + t.is(frameworksInternalConflict.routes[0].pattern, '/frameworks-internal-conflict/frameworks') - // User code takes precedence over the Frameworks API. - const frameworksUserConflict = functions.find(({ name }) => name === 'frameworks-user-conflict') - t.is(frameworksUserConflict.routes[0].pattern, '/frameworks-user-conflict/user') + // User code takes precedence over the Frameworks API. + const frameworksUserConflict = functions.find(({ name }) => name === 'frameworks-user-conflict') + t.is(frameworksUserConflict.routes[0].pattern, '/frameworks-user-conflict/user') - t.snapshot(normalizeOutput(output)) - }) -} + t.snapshot(normalizeOutput(output)) +}) -// pnpm is not available in Node 14. -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('Functions: loads functions generated with the Frameworks API in a monorepo setup', async (t) => { const fixture = await new Fixture('./fixtures/functions_monorepo').withCopyRoot({ git: false }) const app1 = await fixture diff --git a/packages/build/tests/plugins/fixtures/engines/package.json b/packages/build/tests/plugins/fixtures/engines/package.json index 2592b5e111..8aa0c5ab3f 100644 --- a/packages/build/tests/plugins/fixtures/engines/package.json +++ b/packages/build/tests/plugins/fixtures/engines/package.json @@ -6,6 +6,6 @@ "license": "MIT", "repository": "test", "engines": { - "node": ">=18.0.0" + "node": ">=99.0.0" } } diff --git a/packages/build/tests/plugins/fixtures/version_greater_than_minimum/package.json b/packages/build/tests/plugins/fixtures/version_greater_than_minimum/package.json index 9ecce58068..7625bb67ef 100644 --- a/packages/build/tests/plugins/fixtures/version_greater_than_minimum/package.json +++ b/packages/build/tests/plugins/fixtures/version_greater_than_minimum/package.json @@ -6,6 +6,6 @@ "license": "MIT", "repository": "test", "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } } diff --git a/packages/build/tests/plugins/snapshots/tests.js.md b/packages/build/tests/plugins/snapshots/tests.js.md index b3215f627a..1e7a15a797 100644 --- a/packages/build/tests/plugins/snapshots/tests.js.md +++ b/packages/build/tests/plugins/snapshots/tests.js.md @@ -870,7 +870,7 @@ Generated by [AVA](https://avajs.dev). > Warning: ./plugin.js will be executed with Node.js version 1.0.0␊ The plugin cannot be executed with your defined Node.js version 1.0.0␊ ␊ - Read more about our minimum required version in our forums announcement (https://answers.netlify.com/t/build-plugins-dropping-support-for-node-js-12/79421)␊ + Read more about our minimum required version in our forums announcement (https://answers.netlify.com/t/build-plugins-end-of-support-for-node-js-14-node-js-16/136405)␊ ␊ > Loading plugins␊ - ./plugin.js@1.0.0 from netlify.toml␊ diff --git a/packages/build/tests/plugins/snapshots/tests.js.snap b/packages/build/tests/plugins/snapshots/tests.js.snap index cf15bdff62..2aa6b35155 100644 Binary files a/packages/build/tests/plugins/snapshots/tests.js.snap and b/packages/build/tests/plugins/snapshots/tests.js.snap differ diff --git a/packages/build/tests/plugins/tests.js b/packages/build/tests/plugins/tests.js index 2cccf82df1..efb481bae9 100644 --- a/packages/build/tests/plugins/tests.js +++ b/packages/build/tests/plugins/tests.js @@ -111,22 +111,14 @@ 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 systemLog = await tmp.file() - const nodePath = getNodePath('16.14.0') const output = await new Fixture('./fixtures/engines') .withFlags({ nodePath, - featureFlags: { build_warn_upcoming_system_version_change: true }, - systemLogFile: systemLog.fd, debug: false, }) .runWithBuild() t.true(normalizeOutput(output).includes('The Node.js version is 1.0.0 but the plugin "./plugin.js" requires >=1.0.0')) - const systemLogContents = await fs.readFile(systemLog.path, 'utf8') - await systemLog.cleanup() - - t.true(systemLogContents.includes('plugin "./plugin.js" node support range includes v22')) }) test('Validate --node-path exists', async (t) => { diff --git a/packages/cache-utils/package.json b/packages/cache-utils/package.json index 7f11877f93..8b0ec8f289 100644 --- a/packages/cache-utils/package.json +++ b/packages/cache-utils/package.json @@ -66,6 +66,6 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } } diff --git a/packages/config/package.json b/packages/config/package.json index 0b6aa2d129..73fe173493 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -93,6 +93,6 @@ "typescript": "^5.0.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } } diff --git a/packages/edge-bundler/package.json b/packages/edge-bundler/package.json index 028fbcd1be..e6a931d3bd 100644 --- a/packages/edge-bundler/package.json +++ b/packages/edge-bundler/package.json @@ -54,7 +54,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" }, "dependencies": { "@import-maps/resolve": "^1.0.1", diff --git a/packages/framework-info/package.json b/packages/framework-info/package.json index e0da4e5c78..3be787ec28 100644 --- a/packages/framework-info/package.json +++ b/packages/framework-info/package.json @@ -81,7 +81,7 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.14.0 || >=16.0.0" + "node": ">=18.14.0" }, "ava": { "verbose": true, diff --git a/packages/functions-utils/package.json b/packages/functions-utils/package.json index d7dffd9e8d..b38492bcf4 100644 --- a/packages/functions-utils/package.json +++ b/packages/functions-utils/package.json @@ -62,6 +62,6 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } } diff --git a/packages/git-utils/package.json b/packages/git-utils/package.json index 2193a8c965..87ce6f9fb1 100644 --- a/packages/git-utils/package.json +++ b/packages/git-utils/package.json @@ -62,6 +62,6 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } } diff --git a/packages/headers-parser/package.json b/packages/headers-parser/package.json index ad6128af2e..32506539ee 100644 --- a/packages/headers-parser/package.json +++ b/packages/headers-parser/package.json @@ -21,7 +21,7 @@ "netlify" ], "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" }, "author": "Netlify", "license": "MIT", diff --git a/packages/js-client/package.json b/packages/js-client/package.json index 30da7ce205..96d930e20d 100644 --- a/packages/js-client/package.json +++ b/packages/js-client/package.json @@ -60,6 +60,6 @@ "uuid": "^9.0.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } } diff --git a/packages/nock-udp/package.json b/packages/nock-udp/package.json index 076e8f4fb2..f5ce608e01 100644 --- a/packages/nock-udp/package.json +++ b/packages/nock-udp/package.json @@ -33,6 +33,6 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } } diff --git a/packages/opentelemetry-sdk-setup/package.json b/packages/opentelemetry-sdk-setup/package.json index 25d42c75cd..1b9eccb515 100644 --- a/packages/opentelemetry-sdk-setup/package.json +++ b/packages/opentelemetry-sdk-setup/package.json @@ -50,6 +50,6 @@ "vitest": "^0.34.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=18.14.0" } } diff --git a/packages/opentelemetry-utils/package.json b/packages/opentelemetry-utils/package.json index bfb02c1d67..f2905e996c 100644 --- a/packages/opentelemetry-utils/package.json +++ b/packages/opentelemetry-utils/package.json @@ -41,6 +41,6 @@ "vitest": "^0.34.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=18.14.0" } } diff --git a/packages/redirect-parser/package.json b/packages/redirect-parser/package.json index cd46f1d12f..3285dc4ca2 100644 --- a/packages/redirect-parser/package.json +++ b/packages/redirect-parser/package.json @@ -21,7 +21,7 @@ "netlify" ], "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" }, "author": "Netlify", "license": "MIT", diff --git a/packages/run-utils/package.json b/packages/run-utils/package.json index 91d5971b1f..4e743350d1 100644 --- a/packages/run-utils/package.json +++ b/packages/run-utils/package.json @@ -59,6 +59,6 @@ "vitest": "^0.34.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" } } diff --git a/packages/testing/package.json b/packages/testing/package.json index 9eb01cb345..39b5bd5a3c 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -9,7 +9,7 @@ "lib/**" ], "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=18.14.0" }, "scripts": { "prebuild": "rm -rf lib", diff --git a/packages/zip-it-and-ship-it/package.json b/packages/zip-it-and-ship-it/package.json index fffa6cb43c..280af08e20 100644 --- a/packages/zip-it-and-ship-it/package.json +++ b/packages/zip-it-and-ship-it/package.json @@ -100,6 +100,6 @@ "vitest": "0.34.6" }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": ">=18.14.0" } }