@netlify/build 29.34.1 → 29.35.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.
@@ -1,3 +1,4 @@
1
+ import type { BufferedLogs } from '../log/logger.js';
1
2
  import { BuildFlags } from './types.js';
2
3
  /**
3
4
  * Main entry point of Netlify Build.
@@ -8,7 +9,7 @@ import { BuildFlags } from './types.js';
8
9
  export declare function buildSite(flags?: Partial<BuildFlags>): Promise<{
9
10
  success: boolean;
10
11
  severityCode: number;
11
- logs: any;
12
+ logs: BufferedLogs | undefined;
12
13
  netlifyConfig?: any;
13
14
  configMutations?: any;
14
15
  }>;
@@ -1,4 +1,4 @@
1
- import { join } from 'path';
1
+ import { join, resolve } from 'path';
2
2
  import { addErrorInfo } from '../error/info.js';
3
3
  import { installMissingPlugins, installIntegrationPlugins } from '../install/missing.js';
4
4
  import { resolvePath, tryResolvePath } from '../utils/resolve.js';
@@ -129,12 +129,14 @@ const handleIntegrations = async function ({ integrations, autoPluginsDir, mode,
129
129
  autoPluginsDir,
130
130
  buildDir,
131
131
  context,
132
+ testOpts,
132
133
  })));
133
134
  };
134
- const resolveIntegration = async function ({ integration, autoPluginsDir, buildDir, context }) {
135
+ const resolveIntegration = async function ({ integration, autoPluginsDir, buildDir, context, testOpts }) {
135
136
  if (typeof integration.dev !== 'undefined' && context === 'dev') {
136
137
  const { path } = integration.dev;
137
- const pluginPath = await resolvePath(`${path}/.ntli/build`, buildDir);
138
+ const integrationDir = testOpts.cwd ? resolve(testOpts.cwd, path) : resolve(path);
139
+ const pluginPath = await resolvePath(`${integrationDir}/.ntli/build`, buildDir);
138
140
  return { pluginPath, packageName: `${integration.slug}`, isIntegration: true, integration, loadedFrom: 'local' };
139
141
  }
140
142
  const pluginPath = await resolvePath(`${integration.slug}-buildhooks`, autoPluginsDir);
@@ -1,12 +1,13 @@
1
1
  import { promises as fs } from 'fs';
2
2
  import { resolve } from 'path';
3
+ import { mergeConfigs } from '@netlify/config';
3
4
  import { getConfigMutations } from '../../plugins/child/diff.js';
4
5
  import { filterConfig } from './util.js';
5
6
  // The properties that can be set using this API. Each element represents a
6
7
  // path using dot-notation — e.g. `["build", "functions"]` represents the
7
8
  // `build.functions` property.
8
9
  const ALLOWED_PROPERTIES = [['images', 'remote_images']];
9
- const coreStep = async function ({ buildDir, systemLog = () => {
10
+ const coreStep = async function ({ buildDir, netlifyConfig, systemLog = () => {
10
11
  // no-op
11
12
  }, }) {
12
13
  const configPath = resolve(buildDir, '.netlify/deploy/v1/config.json');
@@ -24,8 +25,12 @@ const coreStep = async function ({ buildDir, systemLog = () => {
24
25
  throw new Error('An error occured while processing the platform configurarion defined by your framework');
25
26
  }
26
27
  // Filtering out any properties that can't be mutated using this API.
27
- config = filterConfig(config, [], ALLOWED_PROPERTIES, systemLog);
28
- const configMutations = getConfigMutations({}, config, applyDeployConfig.event);
28
+ const filteredConfig = filterConfig(config, [], ALLOWED_PROPERTIES, systemLog);
29
+ // Merging the config extracted from the API with the initial config.
30
+ const newConfig = mergeConfigs([filteredConfig, netlifyConfig], { concatenateArrays: true });
31
+ // Diffing the initial and the new configs to compute the mutations (what
32
+ // changed between them).
33
+ const configMutations = getConfigMutations(netlifyConfig, newConfig, applyDeployConfig.event);
29
34
  return {
30
35
  configMutations,
31
36
  };
package/lib/steps/get.js CHANGED
@@ -32,7 +32,7 @@ export const getDevSteps = function (command, steps, eventHandlers) {
32
32
  coreStepDescription: () => 'Run command for local development',
33
33
  };
34
34
  const eventSteps = getEventSteps(eventHandlers);
35
- const sortedSteps = sortSteps([...steps, eventSteps, preDevCleanup, devCommandStep], DEV_EVENTS);
35
+ const sortedSteps = sortSteps([preDevCleanup, ...steps, eventSteps, devCommandStep], DEV_EVENTS);
36
36
  const events = getEvents(sortedSteps);
37
37
  return { steps: sortedSteps, events };
38
38
  };
@@ -37,6 +37,7 @@ export const firePluginStep = async function ({ event, childProcess, packageName
37
37
  errorParams,
38
38
  logs,
39
39
  debug,
40
+ source: packageName,
40
41
  });
41
42
  const newStatus = getSuccessStatus(status, { steps, event, packageName });
42
43
  return {
@@ -1,4 +1,4 @@
1
- export function updateNetlifyConfig({ configOpts, netlifyConfig, headersPath, redirectsPath, configMutations, newConfigMutations, configSideFiles, errorParams, logs, debug, }: {
1
+ export function updateNetlifyConfig({ configOpts, netlifyConfig, headersPath, redirectsPath, configMutations, newConfigMutations, configSideFiles, errorParams, logs, debug, source, }: {
2
2
  configOpts: any;
3
3
  netlifyConfig: any;
4
4
  headersPath: any;
@@ -9,6 +9,7 @@ export function updateNetlifyConfig({ configOpts, netlifyConfig, headersPath, re
9
9
  errorParams: any;
10
10
  logs: any;
11
11
  debug: any;
12
+ source?: string | undefined;
12
13
  }): Promise<{
13
14
  netlifyConfig: any;
14
15
  configMutations: any;
@@ -7,12 +7,17 @@ import { logConfigOnUpdate } from '../log/messages/config.js';
7
7
  import { logConfigMutations } 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, debug, }) {
10
+ export const updateNetlifyConfig = async function ({ configOpts, netlifyConfig, headersPath, redirectsPath, configMutations, newConfigMutations, configSideFiles, errorParams, logs, debug, source = '', }) {
11
11
  if (!(await shouldUpdateConfig({ newConfigMutations, configSideFiles, headersPath, redirectsPath }))) {
12
12
  return { netlifyConfig, configMutations };
13
13
  }
14
14
  validateConfigMutations(newConfigMutations);
15
- logConfigMutations(logs, newConfigMutations, debug);
15
+ // Don't log configuration mutations performed by code that has been authored
16
+ // by Netlify (i.e. core steps or build plugins in the `@netlify/` scope),
17
+ // since that won't give users any useful or actionable information.
18
+ if (source !== '' && !source.startsWith('@netlify/')) {
19
+ logConfigMutations(logs, newConfigMutations, debug);
20
+ }
16
21
  const configMutationsA = [...configMutations, ...newConfigMutations];
17
22
  const { config: netlifyConfigA, headersPath: headersPathA, redirectsPath: redirectsPathA, } = await resolveUpdatedConfig(configOpts, configMutationsA);
18
23
  logConfigOnUpdate({ logs, netlifyConfig: netlifyConfigA, debug });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "29.34.1",
3
+ "version": "29.35.1",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -73,12 +73,12 @@
73
73
  "@netlify/config": "^20.12.0",
74
74
  "@netlify/edge-bundler": "11.2.2",
75
75
  "@netlify/framework-info": "^9.8.10",
76
- "@netlify/functions-utils": "^5.2.50",
76
+ "@netlify/functions-utils": "^5.2.51",
77
77
  "@netlify/git-utils": "^5.1.1",
78
78
  "@netlify/opentelemetry-utils": "^1.0.1",
79
79
  "@netlify/plugins-list": "^6.73.0",
80
80
  "@netlify/run-utils": "^5.1.1",
81
- "@netlify/zip-it-and-ship-it": "9.29.1",
81
+ "@netlify/zip-it-and-ship-it": "9.29.2",
82
82
  "@opentelemetry/api": "~1.6.0",
83
83
  "@sindresorhus/slugify": "^2.0.0",
84
84
  "ansi-escapes": "^6.0.0",
@@ -163,5 +163,5 @@
163
163
  "engines": {
164
164
  "node": "^14.16.0 || >=16.0.0"
165
165
  },
166
- "gitHead": "a3aeeffb4beb614aa4b20d03dd2228c55c825509"
166
+ "gitHead": "3b4449ddf0a4c4107fb0f1a4a56408839c927583"
167
167
  }