@netlify/build 29.33.4 → 29.33.5

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.
package/lib/core/build.js CHANGED
@@ -274,6 +274,7 @@ const initAndRunBuild = async function ({ pluginsOptions, netlifyConfig, configO
274
274
  featureFlags,
275
275
  integrations,
276
276
  context,
277
+ systemLog,
277
278
  });
278
279
  errorParams.pluginsOptions = pluginsOptionsA;
279
280
  const { childProcesses, timers: timersB } = await startPlugins({
@@ -14,10 +14,11 @@ 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 }: {
17
+ export declare const addPluginsNodeVersion: ({ featureFlags, pluginsOptions, nodePath, userNodeVersion, logs, systemLog, }: {
18
18
  featureFlags: any;
19
19
  pluginsOptions: any;
20
20
  nodePath: any;
21
21
  userNodeVersion: any;
22
22
  logs: any;
23
- }) => any;
23
+ systemLog: any;
24
+ }) => Promise<any[]>;
@@ -1,7 +1,9 @@
1
+ import { dirname } from 'path';
1
2
  import { execPath, version as currentVersion } from 'process';
2
3
  import semver from 'semver';
3
4
  import link from 'terminal-link';
4
5
  import { logWarning, logWarningSubHeader } from '../log/logger.js';
6
+ import { getPackageJson } from '../utils/package.js';
5
7
  /**
6
8
  * This node version is minimum required to run the plugins code.
7
9
  * If the users preferred Node.js version is below that we have to fall back to the system node version
@@ -15,11 +17,19 @@ const UPCOMING_MINIMUM_REQUIRED_NODE_VERSION = '>=18.14.0';
15
17
  * usually the system's Node.js version.
16
18
  * If the user Node version does not satisfy our supported engine range use our own system Node version
17
19
  */
18
- export const addPluginsNodeVersion = function ({ featureFlags, pluginsOptions, nodePath, userNodeVersion, logs }) {
20
+ export const addPluginsNodeVersion = function ({ featureFlags, pluginsOptions, nodePath, userNodeVersion, logs, systemLog, }) {
19
21
  const currentNodeVersion = semver.clean(currentVersion);
20
- return pluginsOptions.map((pluginOptions) => addPluginNodeVersion({ featureFlags, pluginOptions, currentNodeVersion, userNodeVersion, nodePath, logs }));
22
+ return Promise.all(pluginsOptions.map((pluginOptions) => addPluginNodeVersion({
23
+ featureFlags,
24
+ pluginOptions,
25
+ currentNodeVersion,
26
+ userNodeVersion,
27
+ nodePath,
28
+ logs,
29
+ systemLog,
30
+ })));
21
31
  };
22
- const addPluginNodeVersion = function ({ featureFlags, pluginOptions, pluginOptions: { loadedFrom, packageName }, currentNodeVersion, userNodeVersion, nodePath, logs, }) {
32
+ const addPluginNodeVersion = async function ({ featureFlags, pluginOptions, pluginOptions: { loadedFrom, packageName, pluginPath }, currentNodeVersion, userNodeVersion, nodePath, logs, systemLog, }) {
23
33
  const systemNode = { ...pluginOptions, nodePath: execPath, nodeVersion: currentNodeVersion };
24
34
  const userNode = { ...pluginOptions, nodePath, nodeVersion: userNodeVersion };
25
35
  const isLocalPlugin = loadedFrom === 'local' || loadedFrom === 'package.json';
@@ -35,6 +45,25 @@ const addPluginNodeVersion = function ({ featureFlags, pluginOptions, pluginOpti
35
45
  Please make sure your plugin supports being run on Node.js 20.
36
46
 
37
47
  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')}`);
48
+ if (pluginPath) {
49
+ const pluginDir = dirname(pluginPath);
50
+ const { packageJson: pluginPackageJson } = await getPackageJson(pluginDir);
51
+ // Ensure Node.js version is compatible with plugin's `engines.node`
52
+ const pluginNodeVersionRange = pluginPackageJson?.engines?.node;
53
+ if (!pluginNodeVersionRange) {
54
+ systemLog(`plugin "${packageName}" might be affected by node.js 20 change`);
55
+ }
56
+ else if (semver.satisfies('20.0.0', pluginNodeVersionRange)) {
57
+ systemLog(`plugin "${packageName}" probably not affected by node.js 20 change`);
58
+ }
59
+ else {
60
+ logWarning(logs, `In its package.json, the plugin says it's incompatible with Node.js 20 (version range: "${pluginNodeVersionRange}"). Please upgrade the plugin, so it can be used with Node.js 20.`);
61
+ systemLog(`plugin "${packageName}" will be affected by node.js 20 change`);
62
+ }
63
+ }
64
+ else {
65
+ systemLog(`plugin "${packageName}" might be affected by node.js 20 change, pluginPath not available to determine its compatibility`);
66
+ }
38
67
  }
39
68
  if (semver.satisfies(userNodeVersion, MINIMUM_REQUIRED_NODE_VERSION)) {
40
69
  return userNode;
@@ -8,7 +8,7 @@ import { getPackageJson } from '../utils/package.js';
8
8
  import { useManifest } from './manifest/main.js';
9
9
  import { resolvePluginsPath } from './resolve.js';
10
10
  // Load core plugins and user plugins
11
- const tGetPluginsOptions = async function ({ pluginsOptions, netlifyConfig: { plugins }, siteInfo, buildDir, packagePath, nodePath, packageJson, userNodeVersion, mode, api, logs, debug, sendStatus, testOpts, featureFlags, integrations, context, }) {
11
+ const tGetPluginsOptions = async function ({ pluginsOptions, netlifyConfig: { plugins }, siteInfo, buildDir, packagePath, nodePath, packageJson, userNodeVersion, mode, api, logs, debug, sendStatus, testOpts, featureFlags, integrations, context, systemLog, }) {
12
12
  const pluginsOptionsA = await resolvePluginsPath({
13
13
  pluginsOptions,
14
14
  siteInfo,
@@ -26,6 +26,7 @@ const tGetPluginsOptions = async function ({ pluginsOptions, netlifyConfig: { pl
26
26
  featureFlags,
27
27
  integrations,
28
28
  context,
29
+ systemLog,
29
30
  });
30
31
  const pluginsOptionsB = await Promise.all(pluginsOptionsA.map((pluginOptions) => loadPluginFiles({ pluginOptions, debug })));
31
32
  const pluginsOptionsC = pluginsOptionsB.filter(isNotRedundantCorePlugin);
@@ -1,4 +1,4 @@
1
- export function resolvePluginsPath({ pluginsOptions, siteInfo, buildDir, packagePath, nodePath, packageJson, userNodeVersion, mode, api, logs, debug, sendStatus, testOpts, featureFlags, integrations, context, }: {
1
+ export function resolvePluginsPath({ pluginsOptions, siteInfo, buildDir, packagePath, nodePath, packageJson, userNodeVersion, mode, api, logs, debug, sendStatus, testOpts, featureFlags, integrations, context, systemLog, }: {
2
2
  pluginsOptions: any;
3
3
  siteInfo: any;
4
4
  buildDir: any;
@@ -15,4 +15,5 @@ export function resolvePluginsPath({ pluginsOptions, siteInfo, buildDir, package
15
15
  featureFlags: any;
16
16
  integrations: any;
17
17
  context: any;
18
+ systemLog: any;
18
19
  }): Promise<any[]>;
@@ -11,15 +11,16 @@ const AUTO_PLUGINS_DIR = '.netlify/plugins/';
11
11
  // - local plugin
12
12
  // - external plugin already installed in `node_modules`, most likely through `package.json`
13
13
  // - automatically installed by us, to `.netlify/plugins/`
14
- export const resolvePluginsPath = async function ({ pluginsOptions, siteInfo, buildDir, packagePath, nodePath, packageJson, userNodeVersion, mode, api, logs, debug, sendStatus, testOpts, featureFlags, integrations, context, }) {
14
+ export const resolvePluginsPath = async function ({ pluginsOptions, siteInfo, buildDir, packagePath, nodePath, packageJson, userNodeVersion, mode, api, logs, debug, sendStatus, testOpts, featureFlags, integrations, context, systemLog, }) {
15
15
  const autoPluginsDir = getAutoPluginsDir(buildDir, packagePath);
16
16
  const pluginsOptionsA = await Promise.all(pluginsOptions.map((pluginOptions) => resolvePluginPath({ pluginOptions, buildDir, autoPluginsDir })));
17
- const pluginsOptionsB = addPluginsNodeVersion({
17
+ const pluginsOptionsB = await addPluginsNodeVersion({
18
18
  featureFlags,
19
19
  pluginsOptions: pluginsOptionsA,
20
20
  nodePath,
21
21
  userNodeVersion,
22
22
  logs,
23
+ systemLog,
23
24
  });
24
25
  const pluginsOptionsC = await addPinnedVersions({ pluginsOptions: pluginsOptionsB, api, siteInfo, sendStatus });
25
26
  const pluginsOptionsD = await addExpectedVersions({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "29.33.4",
3
+ "version": "29.33.5",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -70,7 +70,7 @@
70
70
  "@bugsnag/js": "^7.0.0",
71
71
  "@netlify/blobs": "^6.4.2",
72
72
  "@netlify/cache-utils": "^5.1.5",
73
- "@netlify/config": "^20.10.3",
73
+ "@netlify/config": "^20.11.0",
74
74
  "@netlify/edge-bundler": "11.2.2",
75
75
  "@netlify/framework-info": "^9.8.10",
76
76
  "@netlify/functions-utils": "^5.2.49",
@@ -163,5 +163,5 @@
163
163
  "engines": {
164
164
  "node": "^14.16.0 || >=16.0.0"
165
165
  },
166
- "gitHead": "d541d710120351fba5559f6f68a7ca5990e13291"
166
+ "gitHead": "96d48f78b912d9d7491ca110480efa247a1ecfca"
167
167
  }