@netlify/config 17.0.7 → 17.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/config",
3
- "version": "17.0.7",
3
+ "version": "17.0.11",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./src/main.js",
@@ -54,23 +54,23 @@
54
54
  "chalk": "^5.0.0",
55
55
  "cron-parser": "^4.1.0",
56
56
  "deepmerge": "^4.2.2",
57
- "dot-prop": "^6.0.0",
57
+ "dot-prop": "^7.0.0",
58
58
  "execa": "^6.0.0",
59
59
  "fast-safe-stringify": "^2.0.7",
60
- "figures": "^3.2.0",
60
+ "figures": "^4.0.0",
61
61
  "filter-obj": "^3.0.0",
62
- "find-up": "^5.0.0",
63
- "indent-string": "^4.0.0",
62
+ "find-up": "^6.0.0",
63
+ "indent-string": "^5.0.0",
64
64
  "is-plain-obj": "^4.0.0",
65
65
  "js-yaml": "^4.0.0",
66
66
  "map-obj": "^5.0.0",
67
67
  "netlify": "^11.0.0",
68
- "netlify-headers-parser": "^6.0.1",
69
- "netlify-redirect-parser": "^13.0.2",
68
+ "netlify-headers-parser": "^6.0.2",
69
+ "netlify-redirect-parser": "^13.0.3",
70
70
  "omit.js": "^2.0.2",
71
71
  "p-locate": "^6.0.0",
72
72
  "path-exists": "^5.0.0",
73
- "path-type": "^4.0.0",
73
+ "path-type": "^5.0.0",
74
74
  "toml": "^3.0.0",
75
75
  "tomlify-j0.4": "^3.0.0",
76
76
  "validate-npm-package-name": "^3.0.0",
@@ -79,7 +79,7 @@
79
79
  "devDependencies": {
80
80
  "ava": "^3.15.0",
81
81
  "del": "^6.0.0",
82
- "has-ansi": "^4.0.0",
82
+ "has-ansi": "^5.0.0",
83
83
  "is-ci": "^3.0.0",
84
84
  "tmp-promise": "^3.0.2"
85
85
  },
package/src/files.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { resolve, relative, parse } from 'path'
2
2
 
3
- import dotProp from 'dot-prop'
3
+ import { getProperty, setProperty, deleteProperty } from 'dot-prop'
4
4
  import { pathExists } from 'path-exists'
5
5
 
6
6
  import { throwUserError } from './error.js'
@@ -25,14 +25,14 @@ const resolvePaths = function (config, propNames, baseRel, repositoryRoot) {
25
25
  }
26
26
 
27
27
  const resolvePathProp = function (config, propName, baseRel, repositoryRoot) {
28
- const path = dotProp.get(config, propName)
28
+ const path = getProperty(config, propName)
29
29
 
30
30
  if (!isTruthy(path)) {
31
- dotProp.delete(config, propName)
31
+ deleteProperty(config, propName)
32
32
  return config
33
33
  }
34
34
 
35
- return dotProp.set(config, propName, resolvePath(repositoryRoot, baseRel, path, propName))
35
+ return setProperty(config, propName, resolvePath(repositoryRoot, baseRel, path, propName))
36
36
  }
37
37
 
38
38
  export const resolvePath = function (repositoryRoot, baseRel, originalPath, propName) {
@@ -1,6 +1,6 @@
1
1
  import { dirname } from 'path'
2
2
 
3
- import findUp from 'find-up'
3
+ import { findUp } from 'find-up'
4
4
 
5
5
  // Find out repository root among (in priority order):
6
6
  // - `repositoryRoot` option
package/src/path.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { resolve } from 'path'
2
2
 
3
- import findUp from 'find-up'
3
+ import { findUp } from 'find-up'
4
4
  import pLocate from 'p-locate'
5
5
  import { pathExists } from 'path-exists'
6
6
 
package/src/simplify.js CHANGED
@@ -33,8 +33,8 @@ export const simplifyConfig = function ({
33
33
  ...removeEmptyObject(simplifyFunctions(functions), 'functions'),
34
34
  ...removeEmptyObject(buildA, 'build'),
35
35
  ...removeEmptyArray(plugins, 'plugins'),
36
- ...removeEmptyArray(headers, 'headers'),
37
- ...removeEmptyArray(simplifyRedirects(redirects), 'redirects'),
36
+ ...removeEmptyArray(truncateArray(headers), 'headers'),
37
+ ...removeEmptyArray(simplifyRedirects(truncateArray(redirects)), 'redirects'),
38
38
  ...removeEmptyObject(simplifyContexts(context), 'context'),
39
39
  })
40
40
  }
@@ -85,6 +85,14 @@ const removeDefaultValue = function (value, propName, defaultValue) {
85
85
  return value === defaultValue ? {} : { [propName]: value }
86
86
  }
87
87
 
88
+ // `headers` and `redirects` can be very long, which can take several minutes
89
+ // to print in the build logs. We truncate them before logging.
90
+ const truncateArray = function (array) {
91
+ return !Array.isArray(array) || array.length < MAX_ARRAY_LENGTH ? array : array.slice(0, MAX_ARRAY_LENGTH)
92
+ }
93
+
94
+ const MAX_ARRAY_LENGTH = 100
95
+
88
96
  export const removeEmptyObject = function (object, propName) {
89
97
  if (!isPlainObj(object)) {
90
98
  return {}