@netlify/build 29.21.2 → 29.22.0

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
@@ -360,6 +360,7 @@ const runBuild = async function ({ childProcesses, pluginsOptions, netlifyConfig
360
360
  logs,
361
361
  debug,
362
362
  verbose,
363
+ netlifyConfig,
363
364
  });
364
365
  const { steps, events } = timeline === 'dev' ? getDevSteps(devCommand, pluginsSteps) : getSteps(pluginsSteps);
365
366
  if (dry) {
@@ -1,8 +1,9 @@
1
- export declare const load: ({ pluginPath, inputs, packageJson, verbose }: {
1
+ export declare const load: ({ pluginPath, inputs, packageJson, verbose, netlifyConfig }: {
2
2
  pluginPath: any;
3
3
  inputs: any;
4
4
  packageJson: any;
5
5
  verbose: any;
6
+ netlifyConfig: any;
6
7
  }) => Promise<{
7
8
  events: string[];
8
9
  context: {
@@ -7,9 +7,9 @@ import { validatePlugin } from './validate.js';
7
7
  // This also validates the plugin.
8
8
  // Do it when parent requests it using the `load` event.
9
9
  // Also figure out the list of plugin steps. This is also passed to the parent.
10
- export const load = async function ({ pluginPath, inputs, packageJson, verbose }) {
10
+ export const load = async function ({ pluginPath, inputs, packageJson, verbose, netlifyConfig }) {
11
11
  const tsNodeService = registerTypeScript(pluginPath);
12
- const logic = await getLogic({ pluginPath, inputs, tsNodeService });
12
+ const logic = await getLogic({ pluginPath, inputs, tsNodeService, netlifyConfig });
13
13
  validatePlugin(logic);
14
14
  const methods = includeKeys(logic, isEventHandler);
15
15
  const events = Object.keys(methods);
@@ -1,5 +1,6 @@
1
- export function getLogic({ pluginPath, inputs, tsNodeService }: {
1
+ export function getLogic({ pluginPath, inputs, tsNodeService, netlifyConfig }: {
2
2
  pluginPath: any;
3
3
  inputs: any;
4
4
  tsNodeService: any;
5
+ netlifyConfig: any;
5
6
  }): Promise<any>;
@@ -6,9 +6,9 @@ import { addTsErrorInfo } from './typescript.js';
6
6
  const require = createRequire(import.meta.url);
7
7
  // Require the plugin file and fire its top-level function.
8
8
  // The returned object is the `logic` which includes all event handlers.
9
- export const getLogic = async function ({ pluginPath, inputs, tsNodeService }) {
9
+ export const getLogic = async function ({ pluginPath, inputs, tsNodeService, netlifyConfig }) {
10
10
  const logic = await importLogic(pluginPath, tsNodeService);
11
- const logicA = loadLogic({ logic, inputs });
11
+ const logicA = loadLogic({ logic, inputs, netlifyConfig });
12
12
  return logicA;
13
13
  };
14
14
  const importLogic = async function (pluginPath, tsNodeService) {
@@ -39,13 +39,14 @@ const importLogic = async function (pluginPath, tsNodeService) {
39
39
  throw error;
40
40
  }
41
41
  };
42
- const loadLogic = function ({ logic, inputs }) {
42
+ const loadLogic = function ({ logic, inputs, netlifyConfig }) {
43
43
  if (typeof logic !== 'function') {
44
44
  return logic;
45
45
  }
46
46
  const metadata = {
47
47
  events: new Set([...DEV_EVENTS, ...EVENTS]),
48
48
  version: ROOT_PACKAGE_JSON.version,
49
+ netlifyConfig,
49
50
  };
50
51
  try {
51
52
  return logic(inputs, metadata);
@@ -1,4 +1,4 @@
1
- export function loadPlugins({ pluginsOptions, childProcesses, packageJson, timers, logs, debug, verbose, }: {
1
+ export function loadPlugins({ pluginsOptions, childProcesses, packageJson, timers, logs, debug, verbose, netlifyConfig, }: {
2
2
  pluginsOptions: any;
3
3
  childProcesses: any;
4
4
  packageJson: any;
@@ -6,4 +6,5 @@ export function loadPlugins({ pluginsOptions, childProcesses, packageJson, timer
6
6
  logs: any;
7
7
  debug: any;
8
8
  verbose: any;
9
+ netlifyConfig: any;
9
10
  }): Promise<any>;
@@ -4,13 +4,13 @@ import { measureDuration } from '../time/main.js';
4
4
  import { callChild } from './ipc.js';
5
5
  // Retrieve all plugins steps
6
6
  // Can use either a module name or a file path to the plugin.
7
- export const loadPlugins = async function ({ pluginsOptions, childProcesses, packageJson, timers, logs, debug, verbose, }) {
7
+ export const loadPlugins = async function ({ pluginsOptions, childProcesses, packageJson, timers, logs, debug, verbose, netlifyConfig, }) {
8
8
  return pluginsOptions.length === 0
9
9
  ? { pluginsSteps: [], timers }
10
- : await loadAllPlugins({ pluginsOptions, childProcesses, packageJson, timers, logs, debug, verbose });
10
+ : await loadAllPlugins({ pluginsOptions, childProcesses, packageJson, timers, logs, debug, verbose, netlifyConfig });
11
11
  };
12
- const tLoadAllPlugins = async function ({ pluginsOptions, childProcesses, packageJson, logs, debug, verbose }) {
13
- const pluginsSteps = await Promise.all(pluginsOptions.map((pluginOptions, index) => loadPlugin(pluginOptions, { childProcesses, index, packageJson, logs, debug, verbose })));
12
+ const tLoadAllPlugins = async function ({ pluginsOptions, childProcesses, packageJson, logs, debug, verbose, netlifyConfig, }) {
13
+ const pluginsSteps = await Promise.all(pluginsOptions.map((pluginOptions, index) => loadPlugin(pluginOptions, { childProcesses, index, packageJson, logs, debug, verbose, netlifyConfig })));
14
14
  const pluginsStepsA = pluginsSteps.flat();
15
15
  return { pluginsSteps: pluginsStepsA };
16
16
  };
@@ -18,14 +18,14 @@ const tLoadAllPlugins = async function ({ pluginsOptions, childProcesses, packag
18
18
  const loadAllPlugins = measureDuration(tLoadAllPlugins, 'load_plugins');
19
19
  // Retrieve plugin steps for one plugin.
20
20
  // Do it by executing the plugin `load` event handler.
21
- const loadPlugin = async function ({ packageName, pluginPackageJson, pluginPackageJson: { version } = {}, pluginPath, inputs, loadedFrom, origin }, { childProcesses, index, packageJson, logs, debug, verbose }) {
21
+ const loadPlugin = async function ({ packageName, pluginPackageJson, pluginPackageJson: { version } = {}, pluginPath, inputs, loadedFrom, origin }, { childProcesses, index, packageJson, logs, debug, verbose, netlifyConfig }) {
22
22
  const { childProcess } = childProcesses[index];
23
23
  const loadEvent = 'load';
24
24
  try {
25
25
  const { events } = await callChild({
26
26
  childProcess,
27
27
  eventName: 'load',
28
- payload: { pluginPath, inputs, packageJson, verbose },
28
+ payload: { pluginPath, inputs, packageJson, verbose, netlifyConfig },
29
29
  logs,
30
30
  verbose: false,
31
31
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "29.21.2",
3
+ "version": "29.22.0",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -145,5 +145,5 @@
145
145
  "engines": {
146
146
  "node": "^14.16.0 || >=16.0.0"
147
147
  },
148
- "gitHead": "6f84bd6b90008cef1578295fbed11b82b9ccc8fa"
148
+ "gitHead": "9c540c920358ddaac7bacb8c16ad94d25307b5c3"
149
149
  }