@netlify/config 21.0.1 → 21.0.3
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.js +1 -2
- package/lib/main.js +22 -13
- package/package.json +3 -3
package/lib/env/main.js
CHANGED
|
@@ -123,8 +123,7 @@ const getUserEnv = async function ({ api, config, siteInfo, accounts, addons, co
|
|
|
123
123
|
// Account-wide environment variables
|
|
124
124
|
const getAccountEnv = async function ({ api, siteInfo, accounts, context, }) {
|
|
125
125
|
if (siteInfo.use_envelope) {
|
|
126
|
-
|
|
127
|
-
return envelope;
|
|
126
|
+
return await getEnvelope({ api, accountId: siteInfo.account_slug, context });
|
|
128
127
|
}
|
|
129
128
|
const { site_env: siteEnv = {} } = accounts.find(({ slug }) => slug === siteInfo.account_slug) || {};
|
|
130
129
|
return siteEnv;
|
package/lib/main.js
CHANGED
|
@@ -37,19 +37,28 @@ export const resolveConfig = async function (opts) {
|
|
|
37
37
|
// TODO(kh): remove this mapping and get the extensionApiHost from the opts
|
|
38
38
|
const extensionApiBaseUrl = host === 'api-staging.netlify.com' ? 'https://api-staging.netlifysdk.com' : 'https://api.netlifysdk.com';
|
|
39
39
|
const { config: configOpt, defaultConfig, inlineConfig, configMutations, cwd, context, repositoryRoot, base, branch, siteId, accountId, deployId, buildId, baseRelDir, mode, debug, logs, featureFlags, } = await normalizeOpts(optsA);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
let { siteInfo, accounts, addons, integrations } = parsedCachedConfig || {};
|
|
41
|
+
// If we have cached site info, we don't need to fetch it again
|
|
42
|
+
const useCachedSiteInfo = Boolean(featureFlags?.use_cached_site_info && siteInfo && accounts && addons && integrations);
|
|
43
|
+
if (!useCachedSiteInfo) {
|
|
44
|
+
const updatedSiteInfo = await getSiteInfo({
|
|
45
|
+
api,
|
|
46
|
+
context,
|
|
47
|
+
siteId,
|
|
48
|
+
accountId,
|
|
49
|
+
mode,
|
|
50
|
+
siteFeatureFlagPrefix,
|
|
51
|
+
offline,
|
|
52
|
+
featureFlags,
|
|
53
|
+
testOpts,
|
|
54
|
+
token,
|
|
55
|
+
extensionApiBaseUrl,
|
|
56
|
+
});
|
|
57
|
+
siteInfo = updatedSiteInfo.siteInfo;
|
|
58
|
+
accounts = updatedSiteInfo.accounts;
|
|
59
|
+
addons = updatedSiteInfo.addons;
|
|
60
|
+
integrations = updatedSiteInfo.integrations;
|
|
61
|
+
}
|
|
53
62
|
const { defaultConfig: defaultConfigA, baseRelDir: baseRelDirA } = parseDefaultConfig({
|
|
54
63
|
defaultConfig,
|
|
55
64
|
base,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/config",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.3",
|
|
4
4
|
"description": "Netlify config module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@iarna/toml": "^2.2.5",
|
|
62
62
|
"@netlify/headers-parser": "^8.0.0",
|
|
63
|
-
"@netlify/redirect-parser": "^14.5.
|
|
63
|
+
"@netlify/redirect-parser": "^14.5.1",
|
|
64
64
|
"chalk": "^5.0.0",
|
|
65
65
|
"cron-parser": "^4.1.0",
|
|
66
66
|
"deepmerge": "^4.2.2",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"engines": {
|
|
96
96
|
"node": "^14.16.0 || >=16.0.0"
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "180306dc6d37736969b5fa951f8588c2c85e6109"
|
|
99
99
|
}
|