@netlify/config 20.4.6 → 20.5.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.
@@ -8,13 +8,13 @@ import { ERROR_CALL_TO_ACTION } from '../log/messages.js';
8
8
  // Requires knowing the `siteId` and having the access `token`.
9
9
  // Silently ignore API errors. For example the network connection might be down,
10
10
  // but local builds should still work regardless.
11
- export const getSiteInfo = async function ({ api, siteId, mode, testOpts: { env: testEnv = true } = {} }) {
11
+ export const getSiteInfo = async function ({ api, siteId, mode, siteFeatureFlagPrefix, testOpts: { env: testEnv = true } = {}, }) {
12
12
  if (api === undefined || mode === 'buildbot' || !testEnv) {
13
13
  const siteInfo = siteId === undefined ? {} : { id: siteId };
14
14
  return { siteInfo, accounts: [], addons: [] };
15
15
  }
16
16
  const [siteInfo, accounts, addons] = await Promise.all([
17
- getSite(api, siteId),
17
+ getSite(api, siteId, siteFeatureFlagPrefix),
18
18
  getAccounts(api),
19
19
  getAddons(api, siteId),
20
20
  ]);
@@ -24,12 +24,12 @@ export const getSiteInfo = async function ({ api, siteId, mode, testOpts: { env:
24
24
  }
25
25
  return { siteInfo, accounts, addons };
26
26
  };
27
- const getSite = async function (api, siteId) {
27
+ const getSite = async function (api, siteId, siteFeatureFlagPrefix = null) {
28
28
  if (siteId === undefined) {
29
29
  return {};
30
30
  }
31
31
  try {
32
- const site = await api.getSite({ siteId });
32
+ const site = await api.getSite({ siteId, feature_flags: siteFeatureFlagPrefix });
33
33
  return { ...site, id: siteId };
34
34
  }
35
35
  catch (error) {
package/lib/main.js CHANGED
@@ -21,7 +21,7 @@ import { getRedirectsPath, addRedirects } from './redirects.js';
21
21
  // Takes an optional configuration file path as input and return the resolved
22
22
  // `config` together with related properties such as the `configPath`.
23
23
  export const resolveConfig = async function (opts) {
24
- const { cachedConfig, cachedConfigPath, host, scheme, pathPrefix, testOpts, token, offline, ...optsA } = addDefaultOpts(opts);
24
+ const { cachedConfig, cachedConfigPath, host, scheme, pathPrefix, testOpts, token, offline, siteFeatureFlagPrefix, ...optsA } = addDefaultOpts(opts);
25
25
  // `api` is not JSON-serializable, so we cannot cache it inside `cachedConfig`
26
26
  const api = getApiClient({ token, offline, host, scheme, pathPrefix, testOpts });
27
27
  const parsedCachedConfig = await getCachedConfig({ cachedConfig, cachedConfigPath, token, api });
@@ -29,7 +29,7 @@ export const resolveConfig = async function (opts) {
29
29
  return parsedCachedConfig;
30
30
  }
31
31
  const { config: configOpt, defaultConfig, inlineConfig, configMutations, cwd, context, repositoryRoot, base, branch, siteId, deployId, buildId, baseRelDir, mode, debug, logs, featureFlags, } = await normalizeOpts(optsA);
32
- const { siteInfo, accounts, addons } = await getSiteInfo({ api, siteId, mode, testOpts });
32
+ const { siteInfo, accounts, addons } = await getSiteInfo({ api, siteId, mode, testOpts, siteFeatureFlagPrefix });
33
33
  const { defaultConfig: defaultConfigA, baseRelDir: baseRelDirA } = parseDefaultConfig({
34
34
  defaultConfig,
35
35
  base,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/config",
3
- "version": "20.4.6",
3
+ "version": "20.5.1",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -93,5 +93,5 @@
93
93
  "engines": {
94
94
  "node": "^14.16.0 || >=16.0.0"
95
95
  },
96
- "gitHead": "2f5a0d4c921ca8f8ae7e559410908f538ffb3d72"
96
+ "gitHead": "a6c1b829ea47b4600dae206cdc5df2dda7296eed"
97
97
  }