@netlify/config 20.6.1 → 20.6.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.
@@ -11,11 +11,16 @@ import { ERROR_CALL_TO_ACTION } from '../log/messages.js';
11
11
  // but local builds should still work regardless.
12
12
  export const getSiteInfo = async function ({ api, siteId, mode, siteFeatureFlagPrefix, featureFlags = {}, testOpts = {}, }) {
13
13
  const { env: testEnv = true } = testOpts;
14
+ const fetchIntegrations = featureFlags.buildbot_fetch_integrations;
14
15
  if (api === undefined || mode === 'buildbot' || !testEnv) {
15
16
  const siteInfo = siteId === undefined ? {} : { id: siteId };
16
- return { siteInfo, accounts: [], addons: [] };
17
+ let integrations = [];
18
+ if (fetchIntegrations && api !== undefined && !testEnv) {
19
+ // we still want to fetch integrations within buildbot
20
+ integrations = await getIntegrations({ api, ownerType: 'site', ownerId: siteId, testOpts });
21
+ }
22
+ return { siteInfo, accounts: [], addons: [], integrations };
17
23
  }
18
- const fetchIntegrations = featureFlags.buildbot_fetch_integrations;
19
24
  const promises = [getSite(api, siteId, siteFeatureFlagPrefix), getAccounts(api), getAddons(api, siteId)];
20
25
  if (fetchIntegrations) {
21
26
  promises.push(getIntegrations({ api, ownerType: 'site', ownerId: siteId, testOpts }));
@@ -25,7 +30,7 @@ export const getSiteInfo = async function ({ api, siteId, mode, siteFeatureFlagP
25
30
  const envelope = await getEnvelope({ api, accountId: siteInfo.account_slug, siteId });
26
31
  siteInfo.build_settings.env = envelope;
27
32
  }
28
- return { siteInfo, accounts, addons, integrations: integrations };
33
+ return { siteInfo, accounts, addons, integrations };
29
34
  };
30
35
  const getSite = async function (api, siteId, siteFeatureFlagPrefix = null) {
31
36
  if (siteId === undefined) {
@@ -18,6 +18,12 @@ export const validations = [
18
18
  message: '"path" and "pattern" are mutually exclusive.',
19
19
  example: () => ({ edge_functions: [{ path: '/hello', function: 'hello' }] }),
20
20
  },
21
+ {
22
+ property: 'edge_functions.*',
23
+ check: (edgeFunction) => !(edgeFunction.excludedPath !== undefined && edgeFunction.excludedPattern !== undefined),
24
+ message: '"excludedPath" and "excludedPattern" are mutually exclusive.',
25
+ example: () => ({ edge_functions: [{ path: '/hello/*', function: 'hello', excludedPath: '/hello/no' }] }),
26
+ },
21
27
  {
22
28
  property: 'edge_functions.*',
23
29
  check: (edgeFunction) => edgeFunction.function !== undefined,
@@ -38,14 +44,6 @@ export const validations = [
38
44
  edge_functions: [{ path: '/products/*', excludedPath: ['/products/*.jpg'], function: 'customise' }],
39
45
  }),
40
46
  },
41
- {
42
- property: 'edge_functions.*',
43
- check: (value) => value.excludedPath === undefined || value.path !== undefined,
44
- message: '"excludedPath" can only be specified together with "path".',
45
- example: () => ({
46
- edge_functions: [{ path: '/products/*', excludedPath: ['/products/*.jpg'], function: 'customise' }],
47
- }),
48
- },
49
47
  {
50
48
  property: 'edge_functions.*.pattern',
51
49
  check: isString,
@@ -57,15 +55,7 @@ export const validations = [
57
55
  check: (value) => isString(value) || (Array.isArray(value) && value.every(isString)),
58
56
  message: 'must be a string or array of strings.',
59
57
  example: () => ({
60
- edge_functions: [{ path: '/products/(.*)', excludedPath: ['/products/(.*)\\.jpg'], function: 'customise' }],
61
- }),
62
- },
63
- {
64
- property: 'edge_functions.*.excludedPattern',
65
- check: (value) => value.excludedPattern === undefined || value.pattern !== undefined,
66
- message: '"excludedPattern" can only be specified together with "pattern".',
67
- example: () => ({
68
- edge_functions: [{ path: '/products/(.*)', excludedPath: ['/products/(.*)\\.jpg'], function: 'customise' }],
58
+ edge_functions: [{ path: '/products/(.*)', excludedPattern: ['^/products/(.*)\\.jpg$'], function: 'customise' }],
69
59
  }),
70
60
  },
71
61
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/config",
3
- "version": "20.6.1",
3
+ "version": "20.6.3",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -94,5 +94,5 @@
94
94
  "engines": {
95
95
  "node": "^14.16.0 || >=16.0.0"
96
96
  },
97
- "gitHead": "955ef6d9b44d9dd92cef78ba80b15f416044bfc9"
97
+ "gitHead": "28f104de3b83def70a633289c72c70c9c7360ce0"
98
98
  }