@netlify/build 29.34.0 → 29.34.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,27 +1,12 @@
|
|
|
1
1
|
import { promises as fs } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
|
-
import {
|
|
3
|
+
import { getConfigMutations } from '../../plugins/child/diff.js';
|
|
4
4
|
import { filterConfig } from './util.js';
|
|
5
5
|
// The properties that can be set using this API. Each element represents a
|
|
6
6
|
// path using dot-notation — e.g. `["build", "functions"]` represents the
|
|
7
7
|
// `build.functions` property.
|
|
8
|
-
const ALLOWED_PROPERTIES = [
|
|
9
|
-
|
|
10
|
-
['build', 'functions'],
|
|
11
|
-
['build', 'publish'],
|
|
12
|
-
['functions', '*'],
|
|
13
|
-
['functions', '*', '*'],
|
|
14
|
-
['headers'],
|
|
15
|
-
['images', 'remote_images'],
|
|
16
|
-
['redirects'],
|
|
17
|
-
];
|
|
18
|
-
// For array properties, any values set in this API will be merged with the
|
|
19
|
-
// main configuration file in such a way that user-defined values always take
|
|
20
|
-
// precedence. The exception are these properties that let frameworks set
|
|
21
|
-
// values that should be evaluated before any user-defined values. They use
|
|
22
|
-
// a special notation where `headers!` represents "forced headers", etc.
|
|
23
|
-
const OVERRIDE_PROPERTIES = new Set(['headers!', 'redirects!']);
|
|
24
|
-
const coreStep = async function ({ buildDir, netlifyConfig, systemLog = () => {
|
|
8
|
+
const ALLOWED_PROPERTIES = [['images', 'remote_images']];
|
|
9
|
+
const coreStep = async function ({ buildDir, systemLog = () => {
|
|
25
10
|
// no-op
|
|
26
11
|
}, }) {
|
|
27
12
|
const configPath = resolve(buildDir, '.netlify/deploy/v1/config.json');
|
|
@@ -38,26 +23,12 @@ const coreStep = async function ({ buildDir, netlifyConfig, systemLog = () => {
|
|
|
38
23
|
systemLog(`Failed to read Deploy Configuration API: ${err.message}`);
|
|
39
24
|
throw new Error('An error occured while processing the platform configurarion defined by your framework');
|
|
40
25
|
}
|
|
41
|
-
const configOverrides = {};
|
|
42
|
-
for (const key in config) {
|
|
43
|
-
// If the key uses the special notation for defining mutations that should
|
|
44
|
-
// take precedence over user-defined properties, extract the canonical
|
|
45
|
-
// property, set it on a different object, and delete it from the main one.
|
|
46
|
-
if (OVERRIDE_PROPERTIES.has(key)) {
|
|
47
|
-
const canonicalKey = key.slice(0, -1);
|
|
48
|
-
configOverrides[canonicalKey] = config[key];
|
|
49
|
-
delete config[key];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
26
|
// Filtering out any properties that can't be mutated using this API.
|
|
53
27
|
config = filterConfig(config, [], ALLOWED_PROPERTIES, systemLog);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
netlifyConfig[key] = newConfig[key];
|
|
59
|
-
}
|
|
60
|
-
return {};
|
|
28
|
+
const configMutations = getConfigMutations({}, config, applyDeployConfig.event);
|
|
29
|
+
return {
|
|
30
|
+
configMutations,
|
|
31
|
+
};
|
|
61
32
|
};
|
|
62
33
|
export const applyDeployConfig = {
|
|
63
34
|
event: 'onBuild',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "29.34.
|
|
3
|
+
"version": "29.34.1",
|
|
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": "a3aeeffb4beb614aa4b20d03dd2228c55c825509"
|
|
167
167
|
}
|