@netlify/config 24.5.0 → 24.6.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.
@@ -41,8 +41,11 @@ export const FUNCTION_CONFIG_PROPERTIES = new Set([
41
41
  'external_node_modules',
42
42
  'ignored_node_modules',
43
43
  'included_files',
44
+ 'memory',
44
45
  'node_bundler',
46
+ 'region',
45
47
  'schedule',
48
+ 'vcpu',
46
49
  ]);
47
50
  // Takes a functions configuration object and looks for the functions directory
48
51
  // definition, returning it under the `directory` key. The rest of the config
@@ -279,6 +279,39 @@ export const POST_NORMALIZE_VALIDATIONS: ({
279
279
  directory: string;
280
280
  };
281
281
  };
282
+ } | {
283
+ property: string;
284
+ check: (value: any) => value is string | number;
285
+ message: string;
286
+ example: (value: any, key: any, prevPath: any) => {
287
+ functions: {
288
+ [x: number]: {
289
+ memory: string;
290
+ };
291
+ };
292
+ };
293
+ } | {
294
+ property: string;
295
+ check: (value: any) => value is string;
296
+ message: string;
297
+ example: (value: any, key: any, prevPath: any) => {
298
+ functions: {
299
+ [x: number]: {
300
+ region: string;
301
+ };
302
+ };
303
+ };
304
+ } | {
305
+ property: string;
306
+ check: (value: any) => boolean;
307
+ message: string;
308
+ example: (value: any, key: any, prevPath: any) => {
309
+ functions: {
310
+ [x: number]: {
311
+ vcpu: number;
312
+ };
313
+ };
314
+ };
282
315
  } | {
283
316
  property: string;
284
317
  check: (cron: string) => boolean;
@@ -247,6 +247,30 @@ export const POST_NORMALIZE_VALIDATIONS = [
247
247
  functions: { directory: 'my-functions' },
248
248
  }),
249
249
  },
250
+ {
251
+ property: 'functions.*.memory',
252
+ check: (value) => typeof value === 'number' || isString(value),
253
+ message: 'must be a number (in MB) or a string with a unit (e.g. "2gb").',
254
+ example: (value, key, prevPath) => ({
255
+ functions: { [prevPath[1]]: { memory: '2gb' } },
256
+ }),
257
+ },
258
+ {
259
+ property: 'functions.*.region',
260
+ check: isString,
261
+ message: 'must be a string.',
262
+ example: (value, key, prevPath) => ({
263
+ functions: { [prevPath[1]]: { region: 'cmh' } },
264
+ }),
265
+ },
266
+ {
267
+ property: 'functions.*.vcpu',
268
+ check: (value) => typeof value === 'number' && value >= 0.5 && value <= 2,
269
+ message: 'must be a number between 0.5 and 2.',
270
+ example: (value, key, prevPath) => ({
271
+ functions: { [prevPath[1]]: { vcpu: 1.5 } },
272
+ }),
273
+ },
250
274
  {
251
275
  property: 'functions.*.schedule',
252
276
  check: isValidCronExpression,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/config",
3
- "version": "24.5.0",
3
+ "version": "24.6.0",
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.18",
62
+ "@netlify/api": "^14.0.19",
63
63
  "@netlify/headers-parser": "^9.0.3",
64
64
  "@netlify/redirect-parser": "^15.0.4",
65
65
  "chalk": "^5.0.0",
@@ -96,5 +96,5 @@
96
96
  "engines": {
97
97
  "node": ">=18.14.0"
98
98
  },
99
- "gitHead": "c77982ba1d1886e81f1a517318fcf93123f2a260"
99
+ "gitHead": "b41ec05a2415f75122ef97422bf6d0ba3cd3ed63"
100
100
  }