@netlify/config 20.18.0 → 20.19.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.
- package/lib/api/site_info.js +10 -2
- package/lib/base.d.ts +1 -3
- package/lib/env/envelope.js +3 -3
- package/lib/env/main.js +1 -1
- package/lib/log/cleanup.d.ts +1 -9
- package/lib/log/logger.d.ts +1 -3
- package/lib/merge.d.ts +1 -3
- package/lib/origin.js +1 -1
- package/lib/simplify.d.ts +1 -8
- package/lib/validate/helpers.d.ts +1 -3
- package/lib/validate/identical.d.ts +1 -1
- package/lib/validate/validations.d.ts +1 -3
- package/package.json +3 -3
package/lib/api/site_info.js
CHANGED
|
@@ -16,7 +16,11 @@ export const getSiteInfo = async function ({ api, siteId, accountId, mode, conte
|
|
|
16
16
|
const useV2Endpoint = !!accountId && featureFlags.cli_integration_installations_meta;
|
|
17
17
|
if (useV2Endpoint) {
|
|
18
18
|
if (api === undefined || mode === 'buildbot' || testEnv) {
|
|
19
|
-
const siteInfo =
|
|
19
|
+
const siteInfo = {};
|
|
20
|
+
if (siteId !== undefined)
|
|
21
|
+
siteInfo.id = siteId;
|
|
22
|
+
if (accountId !== undefined)
|
|
23
|
+
siteInfo.account_id = accountId;
|
|
20
24
|
const integrations = mode === 'buildbot' && !offline
|
|
21
25
|
? await getIntegrations({ siteId, testOpts, offline, useV2Endpoint, accountId })
|
|
22
26
|
: [];
|
|
@@ -36,7 +40,11 @@ export const getSiteInfo = async function ({ api, siteId, accountId, mode, conte
|
|
|
36
40
|
return { siteInfo, accounts, addons, integrations };
|
|
37
41
|
}
|
|
38
42
|
if (api === undefined || mode === 'buildbot' || testEnv) {
|
|
39
|
-
const siteInfo =
|
|
43
|
+
const siteInfo = {};
|
|
44
|
+
if (siteId !== undefined)
|
|
45
|
+
siteInfo.id = siteId;
|
|
46
|
+
if (accountId !== undefined)
|
|
47
|
+
siteInfo.account_id = accountId;
|
|
40
48
|
const integrations = mode === 'buildbot' && !offline ? await getIntegrations({ siteId, testOpts, offline }) : [];
|
|
41
49
|
return { siteInfo, accounts: [], addons: [], integrations };
|
|
42
50
|
}
|
package/lib/base.d.ts
CHANGED
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
export declare const getInitialBase: ({ repositoryRoot, defaultConfig: { build: { base: defaultBase } }, inlineConfig: { build: { base: initialBase } }, }: {
|
|
5
5
|
repositoryRoot: any;
|
|
6
6
|
defaultConfig: {
|
|
7
|
-
build?: {
|
|
8
|
-
base: any;
|
|
9
|
-
} | undefined;
|
|
7
|
+
build?: {} | undefined;
|
|
10
8
|
};
|
|
11
9
|
inlineConfig: {
|
|
12
10
|
build?: {
|
package/lib/env/envelope.js
CHANGED
|
@@ -4,10 +4,10 @@ export const getEnvelope = async function ({ api, accountId, siteId, context, })
|
|
|
4
4
|
}
|
|
5
5
|
try {
|
|
6
6
|
const environmentVariables = await api.getEnvVars({ accountId, siteId, context_name: context });
|
|
7
|
-
const
|
|
7
|
+
const sortedEnvVarsFromContext = environmentVariables
|
|
8
8
|
.sort((left, right) => (left.key.toLowerCase() < right.key.toLowerCase() ? -1 : 1))
|
|
9
9
|
.reduce((acc, cur) => {
|
|
10
|
-
const envVar = cur.values.find((val) => ['
|
|
10
|
+
const envVar = cur.values.find((val) => ['all', context].includes(val.context));
|
|
11
11
|
if (envVar && envVar.value) {
|
|
12
12
|
return {
|
|
13
13
|
...acc,
|
|
@@ -16,7 +16,7 @@ export const getEnvelope = async function ({ api, accountId, siteId, context, })
|
|
|
16
16
|
}
|
|
17
17
|
return acc;
|
|
18
18
|
}, {});
|
|
19
|
-
return
|
|
19
|
+
return sortedEnvVarsFromContext;
|
|
20
20
|
}
|
|
21
21
|
catch {
|
|
22
22
|
return {};
|
package/lib/env/main.js
CHANGED
|
@@ -122,7 +122,7 @@ const getUserEnv = async function ({ api, config, siteInfo, accounts, addons, co
|
|
|
122
122
|
// Account-wide environment variables
|
|
123
123
|
const getAccountEnv = async function ({ api, siteInfo, accounts, context, }) {
|
|
124
124
|
if (siteInfo.use_envelope) {
|
|
125
|
-
const envelope = await getEnvelope({ api, accountId: siteInfo.account_slug, context });
|
|
125
|
+
const envelope = await getEnvelope({ api, accountId: siteInfo.account_slug, siteId: siteInfo.site_id, context });
|
|
126
126
|
return envelope;
|
|
127
127
|
}
|
|
128
128
|
const { site_env: siteEnv = {} } = accounts.find(({ slug }) => slug === siteInfo.account_slug) || {};
|
package/lib/log/cleanup.d.ts
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
export function cleanupConfig({ build: { base, command, commandOrigin, environment, edge_functions: edgeFunctions, ignore, processing, publish, publishOrigin, }, headers, headersOrigin, plugins, redirects, redirectsOrigin, baseRelDir, functions, functionsDirectory, }: {
|
|
2
2
|
build?: {
|
|
3
|
-
base: any;
|
|
4
|
-
command: any;
|
|
5
|
-
commandOrigin: any;
|
|
6
3
|
environment?: {} | undefined;
|
|
7
|
-
edge_functions: any;
|
|
8
|
-
ignore: any;
|
|
9
|
-
processing: any;
|
|
10
|
-
publish: any;
|
|
11
|
-
publishOrigin: any;
|
|
12
4
|
} | undefined;
|
|
13
5
|
headers: any;
|
|
14
6
|
headersOrigin: any;
|
|
15
|
-
plugins?:
|
|
7
|
+
plugins?: never[] | undefined;
|
|
16
8
|
redirects: any;
|
|
17
9
|
redirectsOrigin: any;
|
|
18
10
|
baseRelDir: any;
|
package/lib/log/logger.d.ts
CHANGED
|
@@ -5,9 +5,7 @@ export function getBufferLogs({ buffer }: {
|
|
|
5
5
|
stdout: never[];
|
|
6
6
|
stderr: never[];
|
|
7
7
|
} | undefined;
|
|
8
|
-
export function log(logs: any, string: any, { color }?: {
|
|
9
|
-
color: any;
|
|
10
|
-
}): void;
|
|
8
|
+
export function log(logs: any, string: any, { color }?: {}): void;
|
|
11
9
|
export function logWarning(logs: any, string: any, opts: any): void;
|
|
12
10
|
export function logObject(logs: any, object: any, opts: any): void;
|
|
13
11
|
export function logSubHeader(logs: any, string: any, opts: any): void;
|
package/lib/merge.d.ts
CHANGED
package/lib/origin.js
CHANGED
|
@@ -21,7 +21,7 @@ const addBuildPublishOrigin = function ({ config, config: { build = {} }, origin
|
|
|
21
21
|
return isTruthy(build.publish) ? { ...config, build: { ...build, publishOrigin: origin } } : config;
|
|
22
22
|
};
|
|
23
23
|
const addConfigPluginOrigin = function ({ config, config: { plugins }, origin }) {
|
|
24
|
-
return Array.isArray(plugins) ? { ...config, plugins: plugins.map((plugin) => ({ ...plugin
|
|
24
|
+
return Array.isArray(plugins) ? { ...config, plugins: plugins.map((plugin) => ({ origin, ...plugin })) } : config;
|
|
25
25
|
};
|
|
26
26
|
const addHeadersOrigin = function ({ config, config: { headers }, origin }) {
|
|
27
27
|
return isTruthy(headers) ? { ...config, headersOrigin: origin } : config;
|
package/lib/simplify.d.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
export function simplifyConfig({ build: { environment, processing: { css, html, images, js, ...processing }, services, ...build }, functions, plugins, headers, redirects, context, ...config }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
build?: {
|
|
4
|
-
|
|
5
|
-
processing?: {
|
|
6
|
-
css: any;
|
|
7
|
-
html: any;
|
|
8
|
-
images: any;
|
|
9
|
-
js: any;
|
|
10
|
-
} | undefined;
|
|
11
|
-
services: any;
|
|
4
|
+
processing?: {} | undefined;
|
|
12
5
|
} | undefined;
|
|
13
6
|
functions: any;
|
|
14
7
|
plugins: any;
|
|
@@ -6,9 +6,7 @@ export function validProperties(propNames: any, legacyPropNames: any): {
|
|
|
6
6
|
message: string;
|
|
7
7
|
};
|
|
8
8
|
export namespace functionsDirectoryCheck {
|
|
9
|
-
function formatInvalid({ functionsDirectory }?: {
|
|
10
|
-
functionsDirectory: any;
|
|
11
|
-
}): {
|
|
9
|
+
function formatInvalid({ functionsDirectory }?: {}): {
|
|
12
10
|
functions: {
|
|
13
11
|
directory: any;
|
|
14
12
|
};
|
|
@@ -276,9 +276,7 @@ export const POST_NORMALIZE_VALIDATIONS: ({
|
|
|
276
276
|
directory: string;
|
|
277
277
|
};
|
|
278
278
|
};
|
|
279
|
-
formatInvalid: ({ functionsDirectory }?: {
|
|
280
|
-
functionsDirectory: any;
|
|
281
|
-
}) => {
|
|
279
|
+
formatInvalid: ({ functionsDirectory }?: {}) => {
|
|
282
280
|
functions: {
|
|
283
281
|
directory: any;
|
|
284
282
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/config",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.19.1",
|
|
4
4
|
"description": "Netlify config module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"is-plain-obj": "^4.0.0",
|
|
73
73
|
"js-yaml": "^4.0.0",
|
|
74
74
|
"map-obj": "^5.0.0",
|
|
75
|
-
"netlify": "^13.1.
|
|
75
|
+
"netlify": "^13.1.21",
|
|
76
76
|
"netlify-headers-parser": "^7.1.4",
|
|
77
77
|
"netlify-redirect-parser": "^14.3.0",
|
|
78
78
|
"node-fetch": "^3.3.1",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"engines": {
|
|
96
96
|
"node": "^14.16.0 || >=16.0.0"
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "319d6b39f8382f114b1f7d138b3ea3a312a7b55c"
|
|
99
99
|
}
|