Skip to content

Commit

Permalink
feat!: drop node 12 support for plugin execution (#4741)
Browse files Browse the repository at this point in the history
* feat!: drop node 12 support for plugin execution

* chore: update snapshots
  • Loading branch information
lukasholzer committed Dec 5, 2022
1 parent 7550ebd commit c8d5a5e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
14 changes: 3 additions & 11 deletions packages/build/src/plugins/node_version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ export type PluginsOptions = {
inputs: Record<string, any>
}

/**
* @deprecated will be replaced with `MINIMUM_REQUIRED_NODE_VERSION` at the 5th. of December 2022
*/
const OLD_MINIMUM_REQUIRED_NODE_VERSION = '^12.20.0 || ^14.14.0 || >=16.0.0'
/**
* 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
Expand Down Expand Up @@ -57,14 +53,10 @@ const addPluginNodeVersion = function ({
(loadedFrom === 'local' || loadedFrom === 'package.json') &&
!semver.satisfies(userNodeVersion, MINIMUM_REQUIRED_NODE_VERSION)
) {
logWarningSubHeader(
logs,
`Warning: ${packageName} will be executed with Node.js version ${currentNodeVersion} in the future`,
)
logWarningSubHeader(logs, `Warning: ${packageName} will be executed with Node.js version ${currentNodeVersion}`)
logWarning(
logs,
` The plugin cannot be executed with your defined Node.js version ${userNodeVersion} in the future.
Starting December 5th 2022 our minimum required Node version range for executing plugins will be: ${MINIMUM_REQUIRED_NODE_VERSION}
` The plugin cannot be executed with your defined Node.js version ${userNodeVersion}
Read more about our minimum required version in our ${link(
'forums announcement',
Expand All @@ -74,7 +66,7 @@ const addPluginNodeVersion = function ({
}

return (loadedFrom === 'local' || loadedFrom === 'package.json') &&
semver.satisfies(userNodeVersion, OLD_MINIMUM_REQUIRED_NODE_VERSION)
semver.satisfies(userNodeVersion, MINIMUM_REQUIRED_NODE_VERSION)
? { ...pluginOptions, nodePath, nodeVersion: userNodeVersion }
: { ...pluginOptions, nodePath: execPath, nodeVersion: currentNodeVersion }
}
10 changes: 4 additions & 6 deletions packages/build/tests/core/snapshots/tests.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1108,9 +1108,8 @@ Generated by [AVA](https://avajs.dev).
> Context␊
production␊
> Warning: ./plugin.js will be executed with Node.js version 1.0.0 in the future␊
The plugin cannot be executed with your defined Node.js version 1.0.0 in the future.␊
Starting December 5th 2022 our minimum required Node version range for executing plugins will be: ^1.0.0 || >=1.0.0␊
> 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)␊
Expand Down Expand Up @@ -1171,9 +1170,8 @@ Generated by [AVA](https://avajs.dev).
> Context␊
production␊
> Warning: netlify-plugin-test will be executed with Node.js version 1.0.0 in the future␊
The plugin cannot be executed with your defined Node.js version 1.0.0 in the future.␊
Starting December 5th 2022 our minimum required Node version range for executing plugins will be: ^1.0.0 || >=1.0.0␊
> 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)␊
Expand Down
Binary file modified packages/build/tests/core/snapshots/tests.js.snap
Binary file not shown.
5 changes: 2 additions & 3 deletions packages/build/tests/plugins/snapshots/tests.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1009,9 +1009,8 @@ Generated by [AVA](https://avajs.dev).
> Context␊
production␊
> Warning: ./plugin.js will be executed with Node.js version 1.0.0 in the future␊
The plugin cannot be executed with your defined Node.js version 1.0.0 in the future.␊
Starting December 5th 2022 our minimum required Node version range for executing plugins will be: ^1.0.0 || >=1.0.0␊
> 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)␊
Expand Down
Binary file modified packages/build/tests/plugins/snapshots/tests.js.snap
Binary file not shown.

0 comments on commit c8d5a5e

Please sign in to comment.