@netlify/config 24.0.9 → 24.1.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/env/main.d.ts +2 -1
- package/lib/env/main.js +12 -3
- package/lib/main.js +2 -1
- package/lib/options/main.js +1 -0
- package/package.json +3 -3
package/lib/env/main.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const getEnv: ({ api, mode, config, siteInfo, accounts, buildDir, branch, deployId, buildId, context, cachedEnv, }: {
|
|
1
|
+
export declare const getEnv: ({ api, mode, config, siteInfo, accounts, buildDir, branch, deployId, skewProtectionToken, buildId, context, cachedEnv, }: {
|
|
2
2
|
api: any;
|
|
3
3
|
mode: any;
|
|
4
4
|
config: any;
|
|
@@ -7,6 +7,7 @@ export declare const getEnv: ({ api, mode, config, siteInfo, accounts, buildDir,
|
|
|
7
7
|
buildDir: any;
|
|
8
8
|
branch: any;
|
|
9
9
|
deployId: any;
|
|
10
|
+
skewProtectionToken: any;
|
|
10
11
|
buildId: any;
|
|
11
12
|
context: any;
|
|
12
13
|
cachedEnv: any;
|
package/lib/env/main.js
CHANGED
|
@@ -8,12 +8,20 @@ import { getGitEnv } from './git.js';
|
|
|
8
8
|
// meant so that local builds can mimic production builds
|
|
9
9
|
// TODO: add `netlify.toml` `build.environment`, after normalization
|
|
10
10
|
// TODO: add `CONTEXT` and others
|
|
11
|
-
export const getEnv = async function ({ api, mode, config, siteInfo, accounts, buildDir, branch, deployId, buildId, context, cachedEnv, }) {
|
|
11
|
+
export const getEnv = async function ({ api, mode, config, siteInfo, accounts, buildDir, branch, deployId, skewProtectionToken, buildId, context, cachedEnv, }) {
|
|
12
12
|
if (mode === 'buildbot') {
|
|
13
13
|
return {};
|
|
14
14
|
}
|
|
15
15
|
const internalEnv = getInternalEnv(cachedEnv);
|
|
16
|
-
const generalEnv = await getGeneralEnv({
|
|
16
|
+
const generalEnv = await getGeneralEnv({
|
|
17
|
+
siteInfo,
|
|
18
|
+
buildDir,
|
|
19
|
+
branch,
|
|
20
|
+
deployId,
|
|
21
|
+
skewProtectionToken,
|
|
22
|
+
buildId,
|
|
23
|
+
context,
|
|
24
|
+
});
|
|
17
25
|
const [accountEnv, uiEnv, configFileEnv] = await getUserEnv({
|
|
18
26
|
api,
|
|
19
27
|
config,
|
|
@@ -64,13 +72,14 @@ const convertToString = (value) => {
|
|
|
64
72
|
};
|
|
65
73
|
// Environment variables not set by users, but meant to mimic the production
|
|
66
74
|
// environment.
|
|
67
|
-
const getGeneralEnv = async function ({ siteInfo, siteInfo: { id, name, account_id: accountId }, buildDir, branch, deployId, buildId, context, }) {
|
|
75
|
+
const getGeneralEnv = async function ({ siteInfo, siteInfo: { id, name, account_id: accountId }, buildDir, branch, deployId, skewProtectionToken, buildId, context, }) {
|
|
68
76
|
const gitEnv = await getGitEnv(buildDir, branch);
|
|
69
77
|
const deployUrls = getDeployUrls({ siteInfo: siteInfo, branch, deployId });
|
|
70
78
|
return removeFalsy({
|
|
71
79
|
SITE_ID: id,
|
|
72
80
|
SITE_NAME: name,
|
|
73
81
|
DEPLOY_ID: deployId,
|
|
82
|
+
NETLIFY_SKEW_PROTECTION_TOKEN: skewProtectionToken,
|
|
74
83
|
BUILD_ID: buildId,
|
|
75
84
|
ACCOUNT_ID: accountId,
|
|
76
85
|
...deployUrls,
|
package/lib/main.js
CHANGED
|
@@ -39,7 +39,7 @@ export const resolveConfig = async function (opts) {
|
|
|
39
39
|
const extensionApiBaseUrl = host?.includes(NETLIFY_API_STAGING_HOSTNAME)
|
|
40
40
|
? EXTENSION_API_STAGING_BASE_URL
|
|
41
41
|
: EXTENSION_API_BASE_URL;
|
|
42
|
-
const { config: configOpt, defaultConfig, inlineConfig, configMutations, cwd, context, repositoryRoot, base, branch, siteId, accountId, deployId, buildId, baseRelDir, mode, debug, logs, featureFlags, } = await normalizeOpts(optsA);
|
|
42
|
+
const { config: configOpt, defaultConfig, inlineConfig, configMutations, cwd, context, repositoryRoot, base, branch, siteId, accountId, deployId, skewProtectionToken, buildId, baseRelDir, mode, debug, logs, featureFlags, } = await normalizeOpts(optsA);
|
|
43
43
|
let { siteInfo, accounts, integrations: extensions } = parsedCachedConfig || {};
|
|
44
44
|
// If we have cached site info, we don't need to fetch it again
|
|
45
45
|
const useCachedSiteInfo = Boolean(featureFlags?.use_cached_site_info && siteInfo && accounts && extensions);
|
|
@@ -96,6 +96,7 @@ export const resolveConfig = async function (opts) {
|
|
|
96
96
|
buildDir,
|
|
97
97
|
branch,
|
|
98
98
|
deployId,
|
|
99
|
+
skewProtectionToken,
|
|
99
100
|
buildId,
|
|
100
101
|
context,
|
|
101
102
|
cachedEnv: parsedCachedConfig?.env || {},
|
package/lib/options/main.js
CHANGED
|
@@ -36,6 +36,7 @@ const getDefaultOpts = function ({ env: envOpt = {}, cwd: cwdOpt, defaultConfig
|
|
|
36
36
|
token: combinedEnv.NETLIFY_AUTH_TOKEN,
|
|
37
37
|
siteId: combinedEnv.NETLIFY_SITE_ID,
|
|
38
38
|
deployId: combinedEnv.DEPLOY_ID || DEFAULT_DEPLOY_ID,
|
|
39
|
+
skewProtectionToken: combinedEnv.NETLIFY_SKEW_PROTECTION_TOKEN,
|
|
39
40
|
buildId: combinedEnv.BUILD_ID || DEFAULT_BUILD_ID,
|
|
40
41
|
mode: 'require',
|
|
41
42
|
offline: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/config",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.1.1",
|
|
4
4
|
"description": "Netlify config module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"license": "MIT",
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@iarna/toml": "^2.2.5",
|
|
62
|
-
"@netlify/api": "^14.0.
|
|
62
|
+
"@netlify/api": "^14.0.11",
|
|
63
63
|
"@netlify/headers-parser": "^9.0.2",
|
|
64
64
|
"@netlify/redirect-parser": "^15.0.3",
|
|
65
65
|
"chalk": "^5.0.0",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"engines": {
|
|
97
97
|
"node": ">=18.14.0"
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "53fb9a92fe3083c9a82c524291d162d257bc5cce"
|
|
100
100
|
}
|