@netlify/config 17.0.4 → 17.0.8

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.4",
3
+ "version": "17.0.8",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./src/main.js",
@@ -51,35 +51,35 @@
51
51
  },
52
52
  "license": "MIT",
53
53
  "dependencies": {
54
- "chalk": "^4.1.2",
54
+ "chalk": "^5.0.0",
55
55
  "cron-parser": "^4.1.0",
56
56
  "deepmerge": "^4.2.2",
57
- "dot-prop": "^5.3.0",
58
- "execa": "^5.1.1",
57
+ "dot-prop": "^7.0.0",
58
+ "execa": "^6.0.0",
59
59
  "fast-safe-stringify": "^2.0.7",
60
- "figures": "^3.2.0",
61
- "filter-obj": "^2.0.1",
62
- "find-up": "^5.0.0",
63
- "indent-string": "^4.0.0",
64
- "is-plain-obj": "^3.0.0",
60
+ "figures": "^4.0.0",
61
+ "filter-obj": "^3.0.0",
62
+ "find-up": "^6.0.0",
63
+ "indent-string": "^5.0.0",
64
+ "is-plain-obj": "^4.0.0",
65
65
  "js-yaml": "^4.0.0",
66
- "map-obj": "^4.0.0",
67
- "netlify": "^10.1.2",
66
+ "map-obj": "^5.0.0",
67
+ "netlify": "^11.0.0",
68
68
  "netlify-headers-parser": "^6.0.1",
69
- "netlify-redirect-parser": "^13.0.1",
69
+ "netlify-redirect-parser": "^13.0.2",
70
70
  "omit.js": "^2.0.2",
71
- "p-locate": "^5.0.0",
72
- "path-exists": "^4.0.0",
73
- "path-type": "^4.0.0",
71
+ "p-locate": "^6.0.0",
72
+ "path-exists": "^5.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",
77
- "yargs": "^16.0.0"
77
+ "yargs": "^17.3.1"
78
78
  },
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/bin/flags.js CHANGED
@@ -20,6 +20,10 @@ export const parseFlags = function () {
20
20
  return flagsB
21
21
  }
22
22
 
23
+ const jsonParse = function (value) {
24
+ return value === undefined ? undefined : JSON.parse(value)
25
+ }
26
+
23
27
  // List of CLI flags
24
28
  const FLAGS = {
25
29
  config: {
@@ -32,7 +36,7 @@ Defaults to any netlify.toml in the git repository root directory or the base di
32
36
  describe: `JSON configuration object containing default values.
33
37
  Each configuration default value is used unless overriden through the main configuration file.
34
38
  Default: none.`,
35
- coerce: JSON.parse,
39
+ coerce: jsonParse,
36
40
  hidden: true,
37
41
  },
38
42
  cachedConfig: {
@@ -41,7 +45,7 @@ Default: none.`,
41
45
  or when using @netlify/config programmatically.
42
46
  This is done as a performance optimization to cache the configuration loading logic.
43
47
  Default: none.`,
44
- coerce: JSON.parse,
48
+ coerce: jsonParse,
45
49
  hidden: true,
46
50
  },
47
51
  cachedConfigPath: {
@@ -56,7 +60,7 @@ Default: none.`,
56
60
  string: true,
57
61
  describe: `JSON configuration object overriding the configuration file and other settings.
58
62
  Default: none.`,
59
- coerce: JSON.parse,
63
+ coerce: jsonParse,
60
64
  hidden: true,
61
65
  },
62
66
  configMutations: {
@@ -67,7 +71,7 @@ Each change must be an object with three properties:
67
71
  - "value": new value of that property
68
72
  - "event": build event when this change was applied, e.g. "onPreBuild"
69
73
  Default: empty array.`,
70
- coerce: JSON.parse,
74
+ coerce: jsonParse,
71
75
  hidden: true,
72
76
  },
73
77
  cwd: {
package/src/env/git.js CHANGED
@@ -1,4 +1,4 @@
1
- import execa from 'execa'
1
+ import { execa } from 'execa'
2
2
 
3
3
  import { removeFalsy } from '../utils/remove_falsy.js'
4
4
 
package/src/files.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { resolve, relative, parse } from 'path'
2
2
 
3
- import dotProp from 'dot-prop'
4
- import pathExists from 'path-exists'
3
+ import { getProperty, setProperty, deleteProperty } from 'dot-prop'
4
+ import { pathExists } from 'path-exists'
5
5
 
6
6
  import { throwUserError } from './error.js'
7
7
  import { mergeConfigs } from './merge.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 { promises as fs } from 'fs'
2
2
 
3
- import pathExists from 'path-exists'
3
+ import { pathExists } from 'path-exists'
4
4
 
5
5
  import { ensureConfigPriority } from '../context.js'
6
6
  import { addHeaders } from '../headers.js'
@@ -1,7 +1,7 @@
1
1
  import { promises as fs } from 'fs'
2
2
  import { dirname, relative, sep } from 'path'
3
3
 
4
- import pathExists from 'path-exists'
4
+ import { pathExists } from 'path-exists'
5
5
 
6
6
  // Retrieve `base` override.
7
7
  // This uses any directory below `repositoryRoot` and above (or equal to)
@@ -1,4 +1,4 @@
1
- import execa from 'execa'
1
+ import { execaCommand } from 'execa'
2
2
 
3
3
  // Find out git branch among (in priority order):
4
4
  // - `branch` option
@@ -26,7 +26,7 @@ export const getBranch = async function ({ branch, repositoryRoot }) {
26
26
 
27
27
  const getGitBranch = async function (repositoryRoot, gitRef) {
28
28
  try {
29
- const { stdout } = await execa.command(`git rev-parse --abbrev-ref ${gitRef}`, { cwd: repositoryRoot })
29
+ const { stdout } = await execaCommand(`git rev-parse --abbrev-ref ${gitRef}`, { cwd: repositoryRoot })
30
30
  return stdout
31
31
  } catch {}
32
32
  }
@@ -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/parse.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { promises as fs } from 'fs'
2
2
 
3
- import pathExists from 'path-exists'
3
+ import { pathExists } from 'path-exists'
4
4
 
5
5
  import { throwUserError } from './error.js'
6
6
  import { throwOnInvalidTomlSequence } from './log/messages.js'
package/src/path.js CHANGED
@@ -1,8 +1,8 @@
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
- import pathExists from 'path-exists'
5
+ import { pathExists } from 'path-exists'
6
6
 
7
7
  // Configuration location can be:
8
8
  // - a local path with the --config CLI flag