@netlify/config 20.3.3 → 20.3.4
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/index.js +5 -0
- package/lib/main.js +0 -3
- package/lib/mutations/config_prop_name.js +11 -12
- package/package.json +6 -6
package/lib/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DEV_EVENTS, EVENTS } from './events.js';
|
|
2
|
+
export { cleanupConfig } from './log/cleanup.js';
|
|
3
|
+
export { resolveConfig } from './main.js';
|
|
4
|
+
export { applyMutations } from './mutations/apply.js';
|
|
5
|
+
export { restoreConfig, updateConfig } from './mutations/update.js';
|
package/lib/main.js
CHANGED
|
@@ -17,9 +17,6 @@ import { UI_ORIGIN, CONFIG_ORIGIN, INLINE_ORIGIN } from './origin.js';
|
|
|
17
17
|
import { parseConfig } from './parse.js';
|
|
18
18
|
import { getConfigPath } from './path.js';
|
|
19
19
|
import { getRedirectsPath, addRedirects } from './redirects.js';
|
|
20
|
-
export { DEV_EVENTS, EVENTS } from './events.js';
|
|
21
|
-
export { cleanupConfig } from './log/cleanup.js';
|
|
22
|
-
export { updateConfig, restoreConfig } from './mutations/update.js';
|
|
23
20
|
// Load the configuration file.
|
|
24
21
|
// Takes an optional configuration file path as input and return the resolved
|
|
25
22
|
// `config` together with related properties such as the `configPath`.
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/** Properties with dynamic children */
|
|
2
|
+
const DYNAMIC_OBJECT_PROPS = new Set(['build.services', 'build.environment', 'functions', 'functions.*']);
|
|
3
|
+
/** Retrieve normalized property name */
|
|
2
4
|
export const getPropName = function (keys) {
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return propName === '' ? normalizedKey : `${propName}.${normalizedKey}`;
|
|
5
|
+
// Some properties are user-defined, i.e. we need to replace them with a "*" token
|
|
6
|
+
// Check if a property name is dynamic, such as `functions.{functionName}`, or
|
|
7
|
+
// is an array index.
|
|
8
|
+
// In those cases, we replace it by "*".
|
|
9
|
+
return keys.reduce((propName, key) => {
|
|
10
|
+
const normalizedKey = Number.isInteger(key) || DYNAMIC_OBJECT_PROPS.has(propName) ? '*' : String(key);
|
|
11
|
+
return propName === '' ? normalizedKey : `${propName}.${normalizedKey}`;
|
|
12
|
+
}, '');
|
|
12
13
|
};
|
|
13
|
-
// Properties with dynamic children
|
|
14
|
-
const DYNAMIC_OBJECT_PROPS = new Set(['build.services', 'build.environment', 'functions', 'functions.*']);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/config",
|
|
3
|
-
"version": "20.3.
|
|
3
|
+
"version": "20.3.4",
|
|
4
4
|
"description": "Netlify config module",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"exports": "./lib/
|
|
7
|
-
"main": "./lib/
|
|
8
|
-
"types": "./lib/
|
|
6
|
+
"exports": "./lib/index.js",
|
|
7
|
+
"main": "./lib/index.js",
|
|
8
|
+
"types": "./lib/index.d.ts",
|
|
9
9
|
"bin": {
|
|
10
10
|
"netlify-config": "./bin.js"
|
|
11
11
|
},
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"yargs": "^17.6.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@types/node": "^14.
|
|
85
|
+
"@types/node": "^18.14.2",
|
|
86
86
|
"ava": "^4.0.0",
|
|
87
87
|
"c8": "^7.12.0",
|
|
88
88
|
"del": "^6.0.0",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"engines": {
|
|
95
95
|
"node": "^14.16.0 || >=16.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "28a5471ea9834e4a137692213db2e510f74ef535"
|
|
98
98
|
}
|