1- import { dirname } from 'path'
21import { execPath , version as currentVersion } from 'process'
32
43import semver from 'semver'
54import link from 'terminal-link'
65
76import { logWarning , logWarningSubHeader } from '../log/logger.js'
8- import { getPackageJson } from '../utils/package.js'
97
108export 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
6048const 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
0 commit comments