@netlify/build 29.31.2 → 29.31.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,15 +12,15 @@ export const addExpectedVersions = async function ({ pluginsOptions, autoPlugins
12
12
  return pluginsOptions;
13
13
  }
14
14
  const pluginsList = await getPluginsList({ debug, logs, testOpts });
15
- return await Promise.all(pluginsOptions.map((pluginOptions) => addExpectedVersion({ pluginsList, autoPluginsDir, packageJson, pluginOptions, buildDir, featureFlags })));
15
+ return await Promise.all(pluginsOptions.map((pluginOptions) => addExpectedVersion({ pluginsList, autoPluginsDir, packageJson, pluginOptions, buildDir, featureFlags, testOpts })));
16
16
  };
17
17
  // Any `pluginOptions` with `expectedVersion` set will be automatically installed
18
- const addExpectedVersion = async function ({ pluginsList, autoPluginsDir, packageJson, pluginOptions, pluginOptions: { packageName, pluginPath, loadedFrom, nodeVersion, pinnedVersion }, buildDir, featureFlags, }) {
18
+ const addExpectedVersion = async function ({ pluginsList, autoPluginsDir, packageJson, pluginOptions, pluginOptions: { packageName, pluginPath, loadedFrom, nodeVersion, pinnedVersion }, buildDir, featureFlags, testOpts, }) {
19
19
  if (!needsExpectedVersion(pluginOptions)) {
20
20
  return pluginOptions;
21
21
  }
22
22
  if (pluginsList[packageName] === undefined) {
23
- validateUnlistedPlugin(packageName, loadedFrom);
23
+ validateUnlistedPlugin(packageName, loadedFrom, testOpts);
24
24
  return pluginOptions;
25
25
  }
26
26
  const unfilteredVersions = pluginsList[packageName];
@@ -70,7 +70,10 @@ const needsExpectedVersion = function ({ loadedFrom }) {
70
70
  // Plugins that are not in our official list can only be specified in
71
71
  // `netlify.toml` providing they are also installed in the site's package.json.
72
72
  // Otherwise, the build should fail.
73
- const validateUnlistedPlugin = function (packageName, loadedFrom) {
73
+ const validateUnlistedPlugin = function (packageName, loadedFrom, testOpts) {
74
+ if (testOpts.skipPluginList) {
75
+ return;
76
+ }
74
77
  if (loadedFrom === 'package.json') {
75
78
  return;
76
79
  }
@@ -14,8 +14,7 @@ export type PluginsOptions = {
14
14
  * usually the system's Node.js version.
15
15
  * If the user Node version does not satisfy our supported engine range use our own system Node version
16
16
  */
17
- export declare const addPluginsNodeVersion: ({ featureFlags, pluginsOptions, nodePath, userNodeVersion, logs }: {
18
- featureFlags: any;
17
+ export declare const addPluginsNodeVersion: ({ pluginsOptions, nodePath, userNodeVersion, logs }: {
19
18
  pluginsOptions: any;
20
19
  nodePath: any;
21
20
  userNodeVersion: any;
@@ -7,7 +7,6 @@ import { logWarning, logWarningSubHeader } from '../log/logger.js';
7
7
  * If the users preferred Node.js version is below that we have to fall back to the system node version
8
8
  */
9
9
  const MINIMUM_REQUIRED_NODE_VERSION = '^14.14.0 || >=16.0.0';
10
- const UPCOMING_MINIMUM_REQUIRED_NODE_VERSION = '>=18.14.0';
11
10
  /**
12
11
  * Local plugins and `package.json`-installed plugins use user's preferred Node.js version if higher than our minimum
13
12
  * supported version. Else default to the system Node version.
@@ -15,30 +14,22 @@ const UPCOMING_MINIMUM_REQUIRED_NODE_VERSION = '>=18.14.0';
15
14
  * usually the system's Node.js version.
16
15
  * If the user Node version does not satisfy our supported engine range use our own system Node version
17
16
  */
18
- export const addPluginsNodeVersion = function ({ featureFlags, pluginsOptions, nodePath, userNodeVersion, logs }) {
17
+ export const addPluginsNodeVersion = function ({ pluginsOptions, nodePath, userNodeVersion, logs }) {
19
18
  const currentNodeVersion = semver.clean(currentVersion);
20
- return pluginsOptions.map((pluginOptions) => addPluginNodeVersion({ featureFlags, pluginOptions, currentNodeVersion, userNodeVersion, nodePath, logs }));
19
+ return pluginsOptions.map((pluginOptions) => addPluginNodeVersion({ pluginOptions, currentNodeVersion, userNodeVersion, nodePath, logs }));
21
20
  };
22
- const addPluginNodeVersion = function ({ featureFlags, pluginOptions, pluginOptions: { loadedFrom, packageName }, currentNodeVersion, userNodeVersion, nodePath, logs, }) {
21
+ const addPluginNodeVersion = function ({ pluginOptions, pluginOptions: { loadedFrom, packageName }, currentNodeVersion, userNodeVersion, nodePath, logs, }) {
23
22
  // if the plugin is a local one and the users node version does not satisfy
24
23
  // our minimum required node version log a warning as we will default to the system node version
25
- if (loadedFrom === 'local' || loadedFrom === 'package.json') {
26
- if (!semver.satisfies(userNodeVersion, MINIMUM_REQUIRED_NODE_VERSION)) {
27
- logWarningSubHeader(logs, `Warning: ${packageName} will be executed with Node.js version ${currentNodeVersion}`);
28
- logWarning(logs, ` The plugin cannot be executed with your defined Node.js version ${userNodeVersion}
29
-
24
+ if ((loadedFrom === 'local' || loadedFrom === 'package.json') &&
25
+ !semver.satisfies(userNodeVersion, MINIMUM_REQUIRED_NODE_VERSION)) {
26
+ logWarningSubHeader(logs, `Warning: ${packageName} will be executed with Node.js version ${currentNodeVersion}`);
27
+ logWarning(logs, ` The plugin cannot be executed with your defined Node.js version ${userNodeVersion}
28
+
30
29
  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')}`);
31
- return { ...pluginOptions, nodePath: execPath, nodeVersion: currentNodeVersion };
32
- }
33
- if (featureFlags.build_warn_upcoming_system_version_change &&
34
- !semver.satisfies(userNodeVersion, UPCOMING_MINIMUM_REQUIRED_NODE_VERSION)) {
35
- logWarningSubHeader(logs, `Warning: Starting January 30, 2024 plugin "${packageName}" will be executed with Node.js version 20.`);
36
- logWarning(logs, ` We're upgrading our system node version on that day, which means the plugin cannot be executed with your defined Node.js version ${userNodeVersion}.
37
-
38
- Please make sure your plugin supports being run on Node.js 20.
39
-
40
- Read more about our minimum required version in our ${link('forums announcement', 'https://answers.netlify.com/t/build-plugin-update-system-node-js-version-upgrade-to-20/108633')}`);
41
- }
42
30
  }
43
- return { ...pluginOptions, nodePath, nodeVersion: userNodeVersion };
31
+ return (loadedFrom === 'local' || loadedFrom === 'package.json') &&
32
+ semver.satisfies(userNodeVersion, MINIMUM_REQUIRED_NODE_VERSION)
33
+ ? { ...pluginOptions, nodePath, nodeVersion: userNodeVersion }
34
+ : { ...pluginOptions, nodePath: execPath, nodeVersion: currentNodeVersion };
44
35
  };
@@ -15,7 +15,6 @@ export const resolvePluginsPath = async function ({ pluginsOptions, siteInfo, bu
15
15
  const autoPluginsDir = getAutoPluginsDir(buildDir, packagePath);
16
16
  const pluginsOptionsA = await Promise.all(pluginsOptions.map((pluginOptions) => resolvePluginPath({ pluginOptions, buildDir, autoPluginsDir })));
17
17
  const pluginsOptionsB = addPluginsNodeVersion({
18
- featureFlags,
19
18
  pluginsOptions: pluginsOptionsA,
20
19
  nodePath,
21
20
  userNodeVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "29.31.2",
3
+ "version": "29.31.3",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -157,5 +157,5 @@
157
157
  "engines": {
158
158
  "node": "^14.16.0 || >=16.0.0"
159
159
  },
160
- "gitHead": "48233ae2f82661d3b5f877b9bf62869e6bfb3939"
160
+ "gitHead": "a623ef20d9da0c1ce753e5c97db1de8dd987c857"
161
161
  }