@netlify/build 29.50.0 → 29.50.1

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.
@@ -32,9 +32,10 @@ export declare const startBuild: (flags: Partial<BuildFlags>) => {
32
32
  };
33
33
  };
34
34
  export declare const execBuild: any;
35
- export declare const runAndReportBuild: ({ pluginsOptions, netlifyConfig, configOpts, siteInfo, configPath, outputConfigPath, headersPath, redirectsPath, packagePath, buildDir, repositoryRoot, nodePath, packageJson, userNodeVersion, childEnv, context, branch, buildbotServerSocket, constants, dry, mode, api, token, errorMonitor, deployId, errorParams, logs, debug, systemLog, systemLogFile, verbose, timers, sendStatus, saveConfig, testOpts, featureFlags, timeline, devCommand, quiet, integrations, explicitSecretKeys, edgeFunctionsBootstrapURL, eventHandlers, }: {
35
+ export declare const runAndReportBuild: ({ pluginsOptions, netlifyConfig, cachedConfig, configOpts, siteInfo, configPath, outputConfigPath, headersPath, redirectsPath, packagePath, buildDir, repositoryRoot, nodePath, packageJson, userNodeVersion, childEnv, context, branch, buildbotServerSocket, constants, dry, mode, api, token, errorMonitor, deployId, errorParams, logs, debug, systemLog, systemLogFile, verbose, timers, sendStatus, saveConfig, testOpts, featureFlags, timeline, devCommand, quiet, integrations, explicitSecretKeys, edgeFunctionsBootstrapURL, eventHandlers, }: {
36
36
  pluginsOptions: any;
37
37
  netlifyConfig: any;
38
+ cachedConfig: any;
38
39
  configOpts: any;
39
40
  siteInfo: any;
40
41
  configPath: any;
package/lib/core/build.js CHANGED
@@ -97,6 +97,7 @@ const tExecBuild = async function ({ config, defaultConfig, cachedConfig, cached
97
97
  const { pluginsOptions: pluginsOptionsA, netlifyConfig: netlifyConfigA, stepsCount, timers: timersB, configMutations, metrics, } = await runAndReportBuild({
98
98
  pluginsOptions,
99
99
  netlifyConfig,
100
+ cachedConfig,
100
101
  configOpts,
101
102
  siteInfo,
102
103
  configPath,
@@ -152,11 +153,12 @@ const tExecBuild = async function ({ config, defaultConfig, cachedConfig, cached
152
153
  };
153
154
  export const execBuild = measureDuration(tExecBuild, 'total', { parentTag: 'build_site' });
154
155
  // Runs a build then report any plugin statuses
155
- export const runAndReportBuild = async function ({ pluginsOptions, netlifyConfig, configOpts, siteInfo, configPath, outputConfigPath, headersPath, redirectsPath, packagePath, buildDir, repositoryRoot, nodePath, packageJson, userNodeVersion, childEnv, context, branch, buildbotServerSocket, constants, dry, mode, api, token, errorMonitor, deployId, errorParams, logs, debug, systemLog, systemLogFile, verbose, timers, sendStatus, saveConfig, testOpts, featureFlags, timeline, devCommand, quiet, integrations, explicitSecretKeys, edgeFunctionsBootstrapURL, eventHandlers, }) {
156
+ export const runAndReportBuild = async function ({ pluginsOptions, netlifyConfig, cachedConfig, configOpts, siteInfo, configPath, outputConfigPath, headersPath, redirectsPath, packagePath, buildDir, repositoryRoot, nodePath, packageJson, userNodeVersion, childEnv, context, branch, buildbotServerSocket, constants, dry, mode, api, token, errorMonitor, deployId, errorParams, logs, debug, systemLog, systemLogFile, verbose, timers, sendStatus, saveConfig, testOpts, featureFlags, timeline, devCommand, quiet, integrations, explicitSecretKeys, edgeFunctionsBootstrapURL, eventHandlers, }) {
156
157
  try {
157
158
  const { stepsCount, netlifyConfig: netlifyConfigA, statuses, pluginsOptions: pluginsOptionsA, failedPlugins, timers: timersA, configMutations, metrics, } = await initAndRunBuild({
158
159
  pluginsOptions,
159
160
  netlifyConfig,
161
+ cachedConfig,
160
162
  configOpts,
161
163
  siteInfo,
162
164
  configPath,
@@ -258,7 +260,7 @@ export const runAndReportBuild = async function ({ pluginsOptions, netlifyConfig
258
260
  }
259
261
  };
260
262
  // Initialize plugin processes then runs a build
261
- const initAndRunBuild = async function ({ pluginsOptions, netlifyConfig, configOpts, siteInfo, configPath, outputConfigPath, headersPath, redirectsPath, buildDir, packagePath, repositoryRoot, nodePath, packageJson, userNodeVersion, childEnv, context, branch, dry, mode, api, token, errorMonitor, deployId, errorParams, logs, debug, systemLog, systemLogFile, verbose, sendStatus, saveConfig, timers, testOpts, buildbotServerSocket, constants, featureFlags, timeline, devCommand, quiet, integrations, explicitSecretKeys, edgeFunctionsBootstrapURL, eventHandlers, }) {
263
+ const initAndRunBuild = async function ({ pluginsOptions, netlifyConfig, cachedConfig, configOpts, siteInfo, configPath, outputConfigPath, headersPath, redirectsPath, buildDir, packagePath, repositoryRoot, nodePath, packageJson, userNodeVersion, childEnv, context, branch, dry, mode, api, token, errorMonitor, deployId, errorParams, logs, debug, systemLog, systemLogFile, verbose, sendStatus, saveConfig, timers, testOpts, buildbotServerSocket, constants, featureFlags, timeline, devCommand, quiet, integrations, explicitSecretKeys, edgeFunctionsBootstrapURL, eventHandlers, }) {
262
264
  const { pluginsOptions: pluginsOptionsA, timers: timersA } = await getPluginsOptions({
263
265
  pluginsOptions,
264
266
  netlifyConfig,
@@ -311,6 +313,7 @@ const initAndRunBuild = async function ({ pluginsOptions, netlifyConfig, configO
311
313
  childProcesses,
312
314
  pluginsOptions: pluginsOptionsA,
313
315
  netlifyConfig,
316
+ cachedConfig,
314
317
  configOpts,
315
318
  packageJson,
316
319
  configPath,
@@ -380,7 +383,7 @@ const initAndRunBuild = async function ({ pluginsOptions, netlifyConfig, configO
380
383
  };
381
384
  // Load plugin main files, retrieve their event handlers then runs them,
382
385
  // together with the build command
383
- const runBuild = async function ({ childProcesses, pluginsOptions, netlifyConfig, configOpts, packageJson, configPath, outputConfigPath, userNodeVersion, headersPath, redirectsPath, buildDir, repositoryRoot, packagePath, nodePath, childEnv, context, branch, dry, buildbotServerSocket, constants, mode, api, errorMonitor, deployId, errorParams, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, timeline, devCommand, quiet, explicitSecretKeys, edgeFunctionsBootstrapURL, eventHandlers, }) {
386
+ const runBuild = async function ({ childProcesses, pluginsOptions, netlifyConfig, cachedConfig, configOpts, packageJson, configPath, outputConfigPath, userNodeVersion, headersPath, redirectsPath, buildDir, repositoryRoot, packagePath, nodePath, childEnv, context, branch, dry, buildbotServerSocket, constants, mode, api, errorMonitor, deployId, errorParams, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, timeline, devCommand, quiet, explicitSecretKeys, edgeFunctionsBootstrapURL, eventHandlers, }) {
384
387
  const { pluginsSteps, timers: timersA } = await loadPlugins({
385
388
  pluginsOptions,
386
389
  childProcesses,
@@ -420,6 +423,7 @@ const runBuild = async function ({ childProcesses, pluginsOptions, netlifyConfig
420
423
  deployId,
421
424
  errorParams,
422
425
  netlifyConfig,
426
+ cachedConfig,
423
427
  configOpts,
424
428
  logs,
425
429
  debug,
@@ -38,7 +38,7 @@ export function getConfigOpts({ config, defaultConfig, cwd, repositoryRoot, pack
38
38
  featureFlags: any;
39
39
  };
40
40
  export const loadConfig: any;
41
- export function resolveUpdatedConfig(configOpts: any, configMutations: any): Promise<any>;
41
+ export function resolveUpdatedConfig(configOpts: any, configMutations: any, cachedConfig: any): Promise<any>;
42
42
  export function saveUpdatedConfig({ configMutations, buildDir, repositoryRoot, configPath, outputConfigPath, headersPath, redirectsPath, logs, featureFlags, context, branch, debug, saveConfig, }: {
43
43
  configMutations: any;
44
44
  buildDir: any;
@@ -1,9 +1,9 @@
1
- import { resolveConfig, updateConfig, restoreConfig } from '@netlify/config';
1
+ import { resolveConfig, restoreConfig, updateConfig } from '@netlify/config';
2
2
  import mapObj from 'map-obj';
3
3
  import { getChildEnv } from '../env/main.js';
4
4
  import { addApiErrorHandlers } from '../error/api.js';
5
5
  import { changeErrorType } from '../error/info.js';
6
- import { logBuildDir, logConfigPath, logConfig, logContext } from '../log/messages/config.js';
6
+ import { logBuildDir, logConfig, logConfigPath, logContext } from '../log/messages/config.js';
7
7
  import { logConfigOnUpload, logHeadersOnUpload, logRedirectsOnUpload } from '../log/messages/mutations.js';
8
8
  import { measureDuration } from '../time/main.js';
9
9
  import { getPackageJson } from '../utils/package.js';
@@ -85,9 +85,14 @@ const logConfigInfo = function ({ logs, configPath, buildDir, netlifyConfig, con
85
85
  // change would create debug logs which would be too verbose.
86
86
  // Errors are propagated and assigned to the specific plugin or core step
87
87
  // which changed the configuration.
88
- export const resolveUpdatedConfig = async function (configOpts, configMutations) {
88
+ export const resolveUpdatedConfig = async function (configOpts, configMutations, cachedConfig) {
89
89
  try {
90
- return await resolveConfig({ ...configOpts, configMutations, debug: false });
90
+ return await resolveConfig({
91
+ ...configOpts,
92
+ configMutations,
93
+ cachedConfig,
94
+ debug: false,
95
+ });
91
96
  }
92
97
  catch (error) {
93
98
  changeErrorType(error, 'resolveConfig', 'pluginValidation');
@@ -1,4 +1,4 @@
1
- export declare const fireCoreStep: ({ coreStep, coreStepId, coreStepName, configPath, outputConfigPath, buildDir, repositoryRoot, packagePath, constants, buildbotServerSocket, events, logs, quiet, nodePath, childEnv, context, branch, envChanges, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, featureFlags, debug, systemLog, saveConfig, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, deployId, outputFlusher, }: {
1
+ export declare const fireCoreStep: ({ coreStep, coreStepId, coreStepName, configPath, outputConfigPath, buildDir, repositoryRoot, packagePath, constants, buildbotServerSocket, events, logs, quiet, nodePath, childEnv, context, branch, envChanges, errorParams, configOpts, netlifyConfig, cachedConfig, configMutations, headersPath, redirectsPath, featureFlags, debug, systemLog, saveConfig, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, deployId, outputFlusher, }: {
2
2
  coreStep: any;
3
3
  coreStepId: any;
4
4
  coreStepName: any;
@@ -20,6 +20,7 @@ export declare const fireCoreStep: ({ coreStep, coreStepId, coreStepName, config
20
20
  errorParams: any;
21
21
  configOpts: any;
22
22
  netlifyConfig: any;
23
+ cachedConfig: any;
23
24
  configMutations: any;
24
25
  headersPath: any;
25
26
  redirectsPath: any;
@@ -3,7 +3,7 @@ import { addErrorInfo, isBuildError } from '../error/info.js';
3
3
  import { addOutputFlusher } from '../log/logger.js';
4
4
  import { updateNetlifyConfig, listConfigSideFiles } from './update_config.js';
5
5
  // Fire a core step
6
- export const fireCoreStep = async function ({ coreStep, coreStepId, coreStepName, configPath, outputConfigPath, buildDir, repositoryRoot, packagePath, constants, buildbotServerSocket, events, logs, quiet, nodePath, childEnv, context, branch, envChanges, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, featureFlags, debug, systemLog, saveConfig, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, deployId, outputFlusher, }) {
6
+ export const fireCoreStep = async function ({ coreStep, coreStepId, coreStepName, configPath, outputConfigPath, buildDir, repositoryRoot, packagePath, constants, buildbotServerSocket, events, logs, quiet, nodePath, childEnv, context, branch, envChanges, errorParams, configOpts, netlifyConfig, cachedConfig, configMutations, headersPath, redirectsPath, featureFlags, debug, systemLog, saveConfig, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, deployId, outputFlusher, }) {
7
7
  const logsA = outputFlusher ? addOutputFlusher(logs, outputFlusher) : logs;
8
8
  try {
9
9
  const configSideFiles = await listConfigSideFiles([headersPath, redirectsPath]);
@@ -23,6 +23,7 @@ export const fireCoreStep = async function ({ coreStep, coreStepId, coreStepName
23
23
  branch,
24
24
  childEnv: childEnvA,
25
25
  netlifyConfig,
26
+ cachedConfig,
26
27
  nodePath,
27
28
  configMutations,
28
29
  headersPath,
@@ -39,6 +40,7 @@ export const fireCoreStep = async function ({ coreStep, coreStepId, coreStepName
39
40
  const { netlifyConfig: netlifyConfigA, configMutations: configMutationsA, headersPath: headersPathA, redirectsPath: redirectsPathA, } = await updateNetlifyConfig({
40
41
  configOpts,
41
42
  netlifyConfig,
43
+ cachedConfig,
42
44
  headersPath,
43
45
  redirectsPath,
44
46
  configMutations,
@@ -1,5 +1,5 @@
1
1
  export function isTrustedPlugin(packageName: any): any;
2
- export function firePluginStep({ event, childProcess, packageName, packagePath, pluginPackageJson, loadedFrom, origin, envChanges, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, constants, steps, error, logs, outputFlusher, systemLog, featureFlags, debug, verbose, }: {
2
+ export function firePluginStep({ event, childProcess, packageName, packagePath, pluginPackageJson, loadedFrom, origin, envChanges, errorParams, configOpts, netlifyConfig, cachedConfig, configMutations, headersPath, redirectsPath, constants, steps, error, logs, outputFlusher, systemLog, featureFlags, debug, verbose, }: {
3
3
  event: any;
4
4
  childProcess: any;
5
5
  packageName: any;
@@ -11,6 +11,7 @@ export function firePluginStep({ event, childProcess, packageName, packagePath,
11
11
  errorParams: any;
12
12
  configOpts: any;
13
13
  netlifyConfig: any;
14
+ cachedConfig: any;
14
15
  configMutations: any;
15
16
  headersPath: any;
16
17
  redirectsPath: any;
@@ -10,7 +10,7 @@ import { getPluginErrorType } from './error.js';
10
10
  import { updateNetlifyConfig, listConfigSideFiles } from './update_config.js';
11
11
  export const isTrustedPlugin = (packageName) => packageName?.startsWith('@netlify/');
12
12
  // Fire a plugin step
13
- export const firePluginStep = async function ({ event, childProcess, packageName, packagePath, pluginPackageJson, loadedFrom, origin, envChanges, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, constants, steps, error, logs, outputFlusher, systemLog, featureFlags, debug, verbose, }) {
13
+ export const firePluginStep = async function ({ event, childProcess, packageName, packagePath, pluginPackageJson, loadedFrom, origin, envChanges, errorParams, configOpts, netlifyConfig, cachedConfig, configMutations, headersPath, redirectsPath, constants, steps, error, logs, outputFlusher, systemLog, featureFlags, debug, verbose, }) {
14
14
  const standardStreams = getStandardStreams(outputFlusher);
15
15
  const listeners = pipePluginOutput(childProcess, logs, standardStreams);
16
16
  const otelCarrier = {};
@@ -36,6 +36,7 @@ export const firePluginStep = async function ({ event, childProcess, packageName
36
36
  const { netlifyConfig: netlifyConfigA, configMutations: configMutationsA, headersPath: headersPathA, redirectsPath: redirectsPathA, } = await updateNetlifyConfig({
37
37
  configOpts,
38
38
  netlifyConfig,
39
+ cachedConfig,
39
40
  headersPath,
40
41
  packagePath,
41
42
  redirectsPath,
@@ -70,6 +70,7 @@ const executeBuildStep = async function ({ config, packagePath, defaultConfig, c
70
70
  Object.assign(errorParams, { netlifyConfig, siteInfo, childEnv, userNodeVersion });
71
71
  try {
72
72
  const { netlifyConfig: netlifyConfigA, configMutations } = await runBuildStep({
73
+ cachedConfig,
73
74
  netlifyConfig,
74
75
  buildDir,
75
76
  nodePath,
@@ -106,13 +107,14 @@ const executeBuildStep = async function ({ config, packagePath, defaultConfig, c
106
107
  throw error;
107
108
  }
108
109
  };
109
- const runBuildStep = async function ({ netlifyConfig, buildDir, nodePath, constants, logs, debug, featureFlags, packagePath, childEnv, buildSteps, repositoryRoot, systemLog, edgeFunctionsBootstrapURL, deployId, quiet, }) {
110
+ const runBuildStep = async function ({ cachedConfig, netlifyConfig, buildDir, nodePath, constants, logs, debug, featureFlags, packagePath, childEnv, buildSteps, repositoryRoot, systemLog, edgeFunctionsBootstrapURL, deployId, quiet, }) {
110
111
  const { netlifyConfig: netlifyConfigA, configMutations } = await runSteps({
111
112
  steps: getBuildSteps(buildSteps),
112
113
  buildDir,
113
114
  nodePath,
114
115
  constants,
115
116
  netlifyConfig,
117
+ cachedConfig,
116
118
  logs,
117
119
  debug,
118
120
  timers: [],
@@ -1,4 +1,4 @@
1
- export declare const runStep: ({ event, childProcess, packageName, coreStep, coreStepId, coreStepName, coreStepDescription, coreStepQuiet, pluginPackageJson, loadedFrom, origin, condition, configPath, outputConfigPath, buildDir, packagePath, repositoryRoot, nodePath, index, childEnv, context, branch, envChanges, constants, steps, buildbotServerSocket, events, mode, api, errorMonitor, deployId, errorParams, error, failedPlugins, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, quiet, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }: {
1
+ export declare const runStep: ({ event, childProcess, packageName, coreStep, coreStepId, coreStepName, coreStepDescription, coreStepQuiet, pluginPackageJson, loadedFrom, origin, condition, configPath, outputConfigPath, buildDir, packagePath, repositoryRoot, nodePath, index, childEnv, context, branch, envChanges, constants, steps, buildbotServerSocket, events, mode, api, errorMonitor, deployId, errorParams, error, failedPlugins, configOpts, netlifyConfig, cachedConfig, configMutations, headersPath, redirectsPath, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, quiet, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }: {
2
2
  event: any;
3
3
  childProcess: any;
4
4
  packageName: any;
@@ -35,6 +35,7 @@ export declare const runStep: ({ event, childProcess, packageName, coreStep, cor
35
35
  failedPlugins: any;
36
36
  configOpts: any;
37
37
  netlifyConfig: any;
38
+ cachedConfig: any;
38
39
  configMutations: any;
39
40
  headersPath: any;
40
41
  redirectsPath: any;
@@ -11,7 +11,7 @@ import { firePluginStep } from './plugin.js';
11
11
  import { getStepReturn } from './return.js';
12
12
  const tracer = trace.getTracer('steps');
13
13
  // Run a step (core, build command or plugin)
14
- export const runStep = async function ({ event, childProcess, packageName, coreStep, coreStepId, coreStepName, coreStepDescription, coreStepQuiet, pluginPackageJson, loadedFrom, origin, condition, configPath, outputConfigPath, buildDir, packagePath, repositoryRoot, nodePath, index, childEnv, context, branch, envChanges, constants, steps, buildbotServerSocket, events, mode, api, errorMonitor, deployId, errorParams, error, failedPlugins, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, quiet, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }) {
14
+ export const runStep = async function ({ event, childProcess, packageName, coreStep, coreStepId, coreStepName, coreStepDescription, coreStepQuiet, pluginPackageJson, loadedFrom, origin, condition, configPath, outputConfigPath, buildDir, packagePath, repositoryRoot, nodePath, index, childEnv, context, branch, envChanges, constants, steps, buildbotServerSocket, events, mode, api, errorMonitor, deployId, errorParams, error, failedPlugins, configOpts, netlifyConfig, cachedConfig, configMutations, headersPath, redirectsPath, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, quiet, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }) {
15
15
  // Add relevant attributes to the upcoming span context
16
16
  const attributes = {
17
17
  'build.execution.step.name': coreStepName,
@@ -67,6 +67,7 @@ export const runStep = async function ({ event, childProcess, packageName, coreS
67
67
  }
68
68
  const fireStep = getFireStep(packageName, coreStepId, event);
69
69
  const { newEnvChanges, netlifyConfig: netlifyConfigA = netlifyConfig, configMutations: configMutationsA = configMutations, headersPath: headersPathA = headersPath, redirectsPath: redirectsPathA = redirectsPath, newError, newStatus, timers: timersA, durationNs, metrics, } = await fireStep({
70
+ cachedConfig,
70
71
  event,
71
72
  childProcess,
72
73
  packageName,
@@ -202,7 +203,7 @@ const getFireStep = function (packageName, coreStepId, event) {
202
203
  const parentTag = normalizeTagName(packageName);
203
204
  return measureDuration(tFireStep, event, { parentTag, category: 'pluginEvent' });
204
205
  };
205
- const tFireStep = function ({ event, childProcess, packageName, pluginPackageJson, loadedFrom, outputFlusher, origin, coreStep, coreStepId, coreStepName, configPath, outputConfigPath, buildDir, repositoryRoot, packagePath, nodePath, childEnv, context, branch, envChanges, constants, steps, buildbotServerSocket, events, error, logs, debug, quiet, systemLog, verbose, saveConfig, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, featureFlags, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, deployId, }) {
206
+ const tFireStep = function ({ cachedConfig, event, childProcess, packageName, pluginPackageJson, loadedFrom, outputFlusher, origin, coreStep, coreStepId, coreStepName, configPath, outputConfigPath, buildDir, repositoryRoot, packagePath, nodePath, childEnv, context, branch, envChanges, constants, steps, buildbotServerSocket, events, error, logs, debug, quiet, systemLog, verbose, saveConfig, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, featureFlags, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, deployId, }) {
206
207
  if (coreStep !== undefined) {
207
208
  return fireCoreStep({
208
209
  coreStep,
@@ -227,6 +228,7 @@ const tFireStep = function ({ event, childProcess, packageName, pluginPackageJso
227
228
  errorParams,
228
229
  configOpts,
229
230
  netlifyConfig,
231
+ cachedConfig,
230
232
  configMutations,
231
233
  headersPath,
232
234
  redirectsPath,
@@ -253,6 +255,7 @@ const tFireStep = function ({ event, childProcess, packageName, pluginPackageJso
253
255
  errorParams,
254
256
  configOpts,
255
257
  netlifyConfig,
258
+ cachedConfig,
256
259
  configMutations,
257
260
  headersPath,
258
261
  redirectsPath,
@@ -1,4 +1,5 @@
1
- export function runSteps({ steps, buildbotServerSocket, events, configPath, outputConfigPath, headersPath, redirectsPath, buildDir, packagePath, repositoryRoot, nodePath, childEnv, context, branch, constants, mode, api, errorMonitor, deployId, errorParams, netlifyConfig, configOpts, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, quiet, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }: {
1
+ export function runSteps({ cachedConfig, steps, buildbotServerSocket, events, configPath, outputConfigPath, headersPath, redirectsPath, buildDir, packagePath, repositoryRoot, nodePath, childEnv, context, branch, constants, mode, api, errorMonitor, deployId, errorParams, netlifyConfig, configOpts, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, quiet, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }: {
2
+ cachedConfig: any;
2
3
  steps: any;
3
4
  buildbotServerSocket: any;
4
5
  events: any;
@@ -7,7 +7,7 @@ import { runStep } from './run_step.js';
7
7
  // list of `failedPlugins` (that ran `utils.build.failPlugin()`).
8
8
  // If an error arises, runs `onError` events.
9
9
  // Runs `onEnd` events at the end, whether an error was thrown or not.
10
- export const runSteps = async function ({ steps, buildbotServerSocket, events, configPath, outputConfigPath, headersPath, redirectsPath, buildDir, packagePath, repositoryRoot, nodePath, childEnv, context, branch, constants, mode, api, errorMonitor, deployId, errorParams, netlifyConfig, configOpts, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, quiet, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }) {
10
+ export const runSteps = async function ({ cachedConfig, steps, buildbotServerSocket, events, configPath, outputConfigPath, headersPath, redirectsPath, buildDir, packagePath, repositoryRoot, nodePath, childEnv, context, branch, constants, mode, api, errorMonitor, deployId, errorParams, netlifyConfig, configOpts, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, quiet, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }) {
11
11
  const { index: stepsCount, error: errorA, netlifyConfig: netlifyConfigC, statuses: statusesB, failedPlugins: failedPluginsA, timers: timersC, configMutations: configMutationsB, metrics: metricsC, } = await pReduce(steps, async ({ index, error, failedPlugins, envChanges, netlifyConfig: netlifyConfigA, configMutations, headersPath: headersPathA, redirectsPath: redirectsPathA, statuses, timers: timersA, metrics: metricsA, }, { event, childProcess, packageName, coreStep, coreStepId, coreStepName, coreStepDescription, pluginPackageJson, loadedFrom, origin, condition, quiet: coreStepQuiet, }) => {
12
12
  const { newIndex = index, newError = error, failedPlugin = [], newEnvChanges = {}, netlifyConfig: netlifyConfigB = netlifyConfigA, configMutations: configMutationsA = configMutations, headersPath: headersPathB = headersPathA, redirectsPath: redirectsPathB = redirectsPathA, newStatus, timers: timersB = timersA, metrics: metricsB = [], } = await runStep({
13
13
  event,
@@ -45,6 +45,7 @@ export const runSteps = async function ({ steps, buildbotServerSocket, events, c
45
45
  error,
46
46
  failedPlugins,
47
47
  configOpts,
48
+ cachedConfig,
48
49
  netlifyConfig: netlifyConfigA,
49
50
  configMutations,
50
51
  headersPath: headersPathA,
@@ -1,6 +1,7 @@
1
- export function updateNetlifyConfig({ configOpts, netlifyConfig, headersPath, redirectsPath, configMutations, newConfigMutations, configSideFiles, errorParams, logs, systemLog, debug, source, }: {
1
+ export function updateNetlifyConfig({ configOpts, netlifyConfig, cachedConfig, headersPath, redirectsPath, configMutations, newConfigMutations, configSideFiles, errorParams, logs, systemLog, debug, source, }: {
2
2
  configOpts: any;
3
3
  netlifyConfig: any;
4
+ cachedConfig: any;
4
5
  headersPath: any;
5
6
  redirectsPath: any;
6
7
  configMutations: any;
@@ -7,7 +7,7 @@ import { logConfigOnUpdate } from '../log/messages/config.js';
7
7
  import { logConfigMutations, systemLogConfigMutations } from '../log/messages/mutations.js';
8
8
  // If `netlifyConfig` was updated or `_redirects` was created, the configuration
9
9
  // is updated by calling `@netlify/config` again.
10
- export const updateNetlifyConfig = async function ({ configOpts, netlifyConfig, headersPath, redirectsPath, configMutations, newConfigMutations, configSideFiles, errorParams, logs, systemLog, debug, source = '', }) {
10
+ export const updateNetlifyConfig = async function ({ configOpts, netlifyConfig, cachedConfig, headersPath, redirectsPath, configMutations, newConfigMutations, configSideFiles, errorParams, logs, systemLog, debug, source = '', }) {
11
11
  if (!(await shouldUpdateConfig({ newConfigMutations, configSideFiles, headersPath, redirectsPath }))) {
12
12
  return { netlifyConfig, configMutations };
13
13
  }
@@ -23,13 +23,13 @@ export const updateNetlifyConfig = async function ({ configOpts, netlifyConfig,
23
23
  else {
24
24
  systemLogConfigMutations(systemLog, newConfigMutations);
25
25
  }
26
- const configMutationsA = [...configMutations, ...newConfigMutations];
27
- const { config: netlifyConfigA, headersPath: headersPathA, redirectsPath: redirectsPathA, } = await resolveUpdatedConfig(configOpts, configMutationsA);
26
+ const mergedConfigMutations = [...configMutations, ...newConfigMutations];
27
+ const { config: netlifyConfigA, headersPath: headersPathA, redirectsPath: redirectsPathA, } = await resolveUpdatedConfig(configOpts, mergedConfigMutations, cachedConfig);
28
28
  logConfigOnUpdate({ logs, netlifyConfig: netlifyConfigA, debug });
29
29
  errorParams.netlifyConfig = netlifyConfigA;
30
30
  return {
31
31
  netlifyConfig: netlifyConfigA,
32
- configMutations: configMutationsA,
32
+ configMutations: mergedConfigMutations,
33
33
  headersPath: headersPathA,
34
34
  redirectsPath: redirectsPathA,
35
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "29.50.0",
3
+ "version": "29.50.1",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -165,5 +165,5 @@
165
165
  "engines": {
166
166
  "node": "^14.16.0 || >=16.0.0"
167
167
  },
168
- "gitHead": "73b6616a85923ed3c436747b5d69353400236a71"
168
+ "gitHead": "9c70c485d48f98c4f2a3ec46ddd918af3c845084"
169
169
  }