@netlify/build 29.34.1 → 29.35.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/main.d.ts
CHANGED
|
@@ -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:
|
|
12
|
+
logs: BufferedLogs | undefined;
|
|
12
13
|
netlifyConfig?: any;
|
|
13
14
|
configMutations?: any;
|
|
14
15
|
}>;
|
|
@@ -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
|
-
|
|
28
|
-
|
|
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/plugin.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
3
|
+
"version": "29.35.0",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -163,5 +163,5 @@
|
|
|
163
163
|
"engines": {
|
|
164
164
|
"node": "^14.16.0 || >=16.0.0"
|
|
165
165
|
},
|
|
166
|
-
"gitHead": "
|
|
166
|
+
"gitHead": "536aea5ec8dc76503d247828c65c4d247fa2a7ae"
|
|
167
167
|
}
|