@netlify/config 20.9.0 → 20.10.0

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.
@@ -1,5 +1,8 @@
1
1
  import fetch from 'node-fetch';
2
- export const getAvailableIntegrations = async function ({ testOpts, }) {
2
+ export const getAvailableIntegrations = async function ({ testOpts, offline, }) {
3
+ if (offline) {
4
+ return [];
5
+ }
3
6
  const { host } = testOpts;
4
7
  const baseUrl = new URL(host ? `http://${host}/` : `https://api.netlifysdk.com/`);
5
8
  try {
@@ -15,14 +15,14 @@ export const getSiteInfo = async function ({ api, siteId, mode, siteFeatureFlagP
15
15
  const { env: testEnv = false } = testOpts;
16
16
  if (api === undefined || mode === 'buildbot' || testEnv) {
17
17
  const siteInfo = siteId === undefined ? {} : { id: siteId };
18
- const integrations = mode === 'buildbot' && !offline ? await getIntegrations({ siteId, testOpts }) : [];
18
+ const integrations = mode === 'buildbot' && !offline ? await getIntegrations({ siteId, testOpts, offline }) : [];
19
19
  return { siteInfo, accounts: [], addons: [], integrations };
20
20
  }
21
21
  const promises = [
22
22
  getSite(api, siteId, siteFeatureFlagPrefix),
23
23
  getAccounts(api),
24
24
  getAddons(api, siteId),
25
- getIntegrations({ siteId, testOpts }),
25
+ getIntegrations({ siteId, testOpts, offline }),
26
26
  ];
27
27
  const [siteInfo, accounts, addons, integrations] = await Promise.all(promises);
28
28
  if (siteInfo.use_envelope) {
@@ -64,8 +64,8 @@ const getAddons = async function (api, siteId) {
64
64
  throwUserError(`Failed retrieving addons for site ${siteId}: ${error.message}. ${ERROR_CALL_TO_ACTION}`);
65
65
  }
66
66
  };
67
- const getIntegrations = async function ({ siteId, testOpts }) {
68
- if (!siteId) {
67
+ const getIntegrations = async function ({ siteId, testOpts, offline, }) {
68
+ if (!siteId || offline) {
69
69
  return [];
70
70
  }
71
71
  const { host } = testOpts;
@@ -1,6 +1,6 @@
1
1
  import { getAvailableIntegrations } from './api/integrations.js';
2
- export const mergeIntegrations = async function ({ configIntegrations = [], apiIntegrations, context, testOpts = {}, }) {
3
- const availableIntegrations = await getAvailableIntegrations({ testOpts });
2
+ export const mergeIntegrations = async function ({ configIntegrations = [], apiIntegrations, context, testOpts = {}, offline, }) {
3
+ const availableIntegrations = await getAvailableIntegrations({ testOpts, offline });
4
4
  // Include all API integrations, unless they have a `dev` property and we are in the `dev` context
5
5
  const resolvedApiIntegrations = apiIntegrations.filter((integration) => !configIntegrations.some((configIntegration) => configIntegration.name === integration.slug &&
6
6
  typeof configIntegration.dev !== 'undefined' &&
package/lib/main.js CHANGED
@@ -83,6 +83,7 @@ export const resolveConfig = async function (opts) {
83
83
  configIntegrations: configA.integrations,
84
84
  context: context,
85
85
  testOpts,
86
+ offline,
86
87
  });
87
88
  const result = {
88
89
  siteInfo,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/config",
3
- "version": "20.9.0",
3
+ "version": "20.10.0",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -70,7 +70,7 @@
70
70
  "is-plain-obj": "^4.0.0",
71
71
  "js-yaml": "^4.0.0",
72
72
  "map-obj": "^5.0.0",
73
- "netlify": "^13.1.10",
73
+ "netlify": "^13.1.11",
74
74
  "netlify-headers-parser": "^7.1.2",
75
75
  "netlify-redirect-parser": "^14.2.0",
76
76
  "node-fetch": "^3.3.1",
@@ -94,5 +94,5 @@
94
94
  "engines": {
95
95
  "node": "^14.16.0 || >=16.0.0"
96
96
  },
97
- "gitHead": "5521b954cc7944141d095434e39cce2af3d3ccaf"
97
+ "gitHead": "01ca6c705c4b568b7552a7d90a9801ebdc747594"
98
98
  }