@netlify/config 18.1.3 → 18.2.1

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": "18.1.3",
3
+ "version": "18.2.1",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./src/main.js",
package/src/env/main.js CHANGED
@@ -53,12 +53,12 @@ export const getEnv = async function ({
53
53
 
54
54
  env.set(key, {
55
55
  sources: [...envSources, source.key],
56
- value,
56
+ value: convertToString(value),
57
57
  })
58
58
  } else {
59
59
  env.set(key, {
60
60
  sources: [source.key],
61
- value: source.values[key],
61
+ value: convertToString(source.values[key]),
62
62
  })
63
63
  }
64
64
  })
@@ -67,6 +67,18 @@ export const getEnv = async function ({
67
67
  return Object.fromEntries(env)
68
68
  }
69
69
 
70
+ const convertToString = (value) => {
71
+ if (value === null || value === undefined) {
72
+ return value
73
+ }
74
+
75
+ if (typeof value === 'string') {
76
+ return value
77
+ }
78
+
79
+ return value.toString()
80
+ }
81
+
70
82
  // Environment variables not set by users, but meant to mimic the production
71
83
  // environment.
72
84
  const getGeneralEnv = async function ({
package/src/events.js CHANGED
@@ -13,3 +13,10 @@ export const EVENTS = [
13
13
  // After build error or success
14
14
  'onEnd',
15
15
  ]
16
+
17
+ export const DEV_EVENTS = [
18
+ // Before dev command
19
+ 'onPreDev',
20
+ // The dev command
21
+ 'onDev',
22
+ ]
package/src/main.js CHANGED
@@ -18,7 +18,7 @@ import { parseConfig } from './parse.js'
18
18
  import { getConfigPath } from './path.js'
19
19
  import { getRedirectsPath, addRedirects } from './redirects.js'
20
20
 
21
- export { EVENTS } from './events.js'
21
+ export { DEV_EVENTS, EVENTS } from './events.js'
22
22
  export { cleanupConfig } from './log/cleanup.js'
23
23
  // eslint-disable-next-line import/max-dependencies
24
24
  export { updateConfig, restoreConfig } from './mutations/update.js'