@netlify/build 29.35.0 → 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));
@@ -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);
@@ -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 {
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
  };
@@ -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.0",
3
+ "version": "29.36.0",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -73,13 +73,13 @@
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
- "@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
- "@netlify/zip-it-and-ship-it": "9.29.1",
82
- "@opentelemetry/api": "~1.6.0",
81
+ "@netlify/zip-it-and-ship-it": "9.29.2",
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": "536aea5ec8dc76503d247828c65c4d247fa2a7ae"
166
+ "gitHead": "a8bdf29ae5ff7adbf74cf5600b40660da000a602"
167
167
  }