@netlify/build 29.35.1 → 29.36.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.
@@ -1,4 +1,5 @@
1
1
  export function logConfigMutations(logs: any, newConfigMutations: any, debug: any): void;
2
+ export function systemLogConfigMutations(systemLog: any, configMutations: any): void;
2
3
  export function logConfigOnUpload({ logs, configPath, debug }: {
3
4
  logs: any;
4
5
  configPath: any;
@@ -5,7 +5,14 @@ import { log, logMessage, logSubHeader } from '../logger.js';
5
5
  export const logConfigMutations = function (logs, newConfigMutations, debug) {
6
6
  const configMutationsToLog = debug ? newConfigMutations : newConfigMutations.filter(shouldLogConfigMutation);
7
7
  configMutationsToLog.forEach(({ keysString, value }) => {
8
- logConfigMutation(logs, keysString, value);
8
+ const message = getConfigMutationLog(keysString, value);
9
+ log(logs, message);
10
+ });
11
+ };
12
+ export const systemLogConfigMutations = function (systemLog, configMutations) {
13
+ configMutations.forEach(({ keysString, value }) => {
14
+ const message = getConfigMutationLog(keysString, value);
15
+ systemLog(message);
9
16
  });
10
17
  };
11
18
  // Some configuration mutations are only logged in debug mode
@@ -16,9 +23,9 @@ const shouldLogConfigMutation = function ({ keysString }) {
16
23
  // function file. This can be very verbose, especially for plugins which create
17
24
  // many function files like Essential Next.js
18
25
  const HIDDEN_PROPS = ['functions'];
19
- const logConfigMutation = function (logs, keysString, value) {
26
+ const getConfigMutationLog = function (keysString, value) {
20
27
  const newValue = shouldHideConfigValue(keysString) ? '' : ` to ${inspect(value, { colors: false })}`;
21
- log(logs, `Netlify configuration property "${keysString}" value changed${newValue}.`);
28
+ return `Netlify configuration property "${keysString}" value changed${newValue}.`;
22
29
  };
23
30
  const shouldHideConfigValue = function (keysString) {
24
31
  return SECRET_PROPS.some((secretProp) => keysString.startsWith(secretProp));
@@ -44,6 +44,7 @@ export const fireCoreStep = async function ({ coreStep, coreStepId, coreStepName
44
44
  configSideFiles,
45
45
  errorParams,
46
46
  logs,
47
+ systemLog,
47
48
  debug,
48
49
  });
49
50
  return {
@@ -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, featureFlags, debug, verbose, }: {
2
+ export function firePluginStep({ event, childProcess, packageName, packagePath, pluginPackageJson, loadedFrom, origin, envChanges, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, constants, steps, error, logs, systemLog, featureFlags, debug, verbose, }: {
3
3
  event: any;
4
4
  childProcess: any;
5
5
  packageName: any;
@@ -18,6 +18,7 @@ export function firePluginStep({ event, childProcess, packageName, packagePath,
18
18
  steps: any;
19
19
  error: any;
20
20
  logs: any;
21
+ systemLog: any;
21
22
  featureFlags: any;
22
23
  debug: any;
23
24
  verbose: any;
@@ -7,7 +7,7 @@ import { getPluginErrorType } from './error.js';
7
7
  import { updateNetlifyConfig, listConfigSideFiles } from './update_config.js';
8
8
  export const isTrustedPlugin = (packageName) => packageName?.startsWith('@netlify/');
9
9
  // Fire a plugin step
10
- export const firePluginStep = async function ({ event, childProcess, packageName, packagePath, pluginPackageJson, loadedFrom, origin, envChanges, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, constants, steps, error, logs, featureFlags, debug, verbose, }) {
10
+ export const firePluginStep = async function ({ event, childProcess, packageName, packagePath, pluginPackageJson, loadedFrom, origin, envChanges, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, constants, steps, error, logs, systemLog, featureFlags, debug, verbose, }) {
11
11
  const listeners = pipePluginOutput(childProcess, logs);
12
12
  try {
13
13
  const configSideFiles = await listConfigSideFiles([headersPath, redirectsPath]);
@@ -36,6 +36,7 @@ export const firePluginStep = async function ({ event, childProcess, packageName
36
36
  configSideFiles,
37
37
  errorParams,
38
38
  logs,
39
+ systemLog,
39
40
  debug,
40
41
  source: packageName,
41
42
  });
@@ -242,6 +242,7 @@ const tFireStep = function ({ event, childProcess, packageName, pluginPackageJso
242
242
  steps,
243
243
  error,
244
244
  logs,
245
+ systemLog,
245
246
  featureFlags,
246
247
  debug,
247
248
  verbose,
@@ -1,4 +1,4 @@
1
- export function updateNetlifyConfig({ configOpts, netlifyConfig, headersPath, redirectsPath, configMutations, newConfigMutations, configSideFiles, errorParams, logs, debug, source, }: {
1
+ export function updateNetlifyConfig({ configOpts, netlifyConfig, headersPath, redirectsPath, configMutations, newConfigMutations, configSideFiles, errorParams, logs, systemLog, debug, source, }: {
2
2
  configOpts: any;
3
3
  netlifyConfig: any;
4
4
  headersPath: any;
@@ -8,6 +8,7 @@ export function updateNetlifyConfig({ configOpts, netlifyConfig, headersPath, re
8
8
  configSideFiles: any;
9
9
  errorParams: any;
10
10
  logs: any;
11
+ systemLog: any;
11
12
  debug: any;
12
13
  source?: string | undefined;
13
14
  }): Promise<{
@@ -4,20 +4,25 @@ import { pathExists } from 'path-exists';
4
4
  import { resolveUpdatedConfig } from '../core/config.js';
5
5
  import { addErrorInfo } from '../error/info.js';
6
6
  import { logConfigOnUpdate } from '../log/messages/config.js';
7
- import { logConfigMutations } from '../log/messages/mutations.js';
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, debug, source = '', }) {
10
+ export const updateNetlifyConfig = async function ({ configOpts, netlifyConfig, 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
  }
14
14
  validateConfigMutations(newConfigMutations);
15
15
  // Don't log configuration mutations performed by code that has been authored
16
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/')) {
17
+ // since that won't give users any useful or actionable information. For
18
+ // these, emit a system log instead.
19
+ const shouldLogConfigMutationsToUser = source !== '' && !source.startsWith('@netlify/');
20
+ if (shouldLogConfigMutationsToUser) {
19
21
  logConfigMutations(logs, newConfigMutations, debug);
20
22
  }
23
+ else {
24
+ systemLogConfigMutations(systemLog, newConfigMutations);
25
+ }
21
26
  const configMutationsA = [...configMutations, ...newConfigMutations];
22
27
  const { config: netlifyConfigA, headersPath: headersPathA, redirectsPath: redirectsPathA, } = await resolveUpdatedConfig(configOpts, configMutationsA);
23
28
  logConfigOnUpdate({ logs, netlifyConfig: netlifyConfigA, debug });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "29.35.1",
3
+ "version": "29.36.0",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -75,11 +75,11 @@
75
75
  "@netlify/framework-info": "^9.8.10",
76
76
  "@netlify/functions-utils": "^5.2.51",
77
77
  "@netlify/git-utils": "^5.1.1",
78
- "@netlify/opentelemetry-utils": "^1.0.1",
78
+ "@netlify/opentelemetry-utils": "^1.0.2",
79
79
  "@netlify/plugins-list": "^6.73.0",
80
80
  "@netlify/run-utils": "^5.1.1",
81
81
  "@netlify/zip-it-and-ship-it": "9.29.2",
82
- "@opentelemetry/api": "~1.6.0",
82
+ "@opentelemetry/api": "~1.7.0",
83
83
  "@sindresorhus/slugify": "^2.0.0",
84
84
  "ansi-escapes": "^6.0.0",
85
85
  "chalk": "^5.0.0",
@@ -153,7 +153,7 @@
153
153
  "yarn": "^1.22.4"
154
154
  },
155
155
  "peerDependencies": {
156
- "@netlify/opentelemetry-sdk-setup": "^1.0.2"
156
+ "@netlify/opentelemetry-sdk-setup": "^1.0.3"
157
157
  },
158
158
  "peerDependenciesMeta": {
159
159
  "@netlify/opentelemetry-sdk-setup": {
@@ -163,5 +163,5 @@
163
163
  "engines": {
164
164
  "node": "^14.16.0 || >=16.0.0"
165
165
  },
166
- "gitHead": "3b4449ddf0a4c4107fb0f1a4a56408839c927583"
166
+ "gitHead": "a8bdf29ae5ff7adbf74cf5600b40660da000a602"
167
167
  }