@netlify/build 27.18.9-rc → 27.19.0-rc

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/bin.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ // This is a workaround for npm issue: https://github.com/npm/cli/issues/2632
4
+ // eslint-disable-next-line import/no-unassigned-import
5
+ import './lib/core/bin.js'
package/lib/core/build.js CHANGED
@@ -385,7 +385,7 @@ const initAndRunBuild = async function ({
385
385
  testOpts,
386
386
  featureFlags,
387
387
  })
388
- // eslint-disable-next-line fp/no-mutation, no-param-reassign
388
+
389
389
  errorParams.pluginsOptions = pluginsOptionsA
390
390
 
391
391
  const { childProcesses, timers: timersB } = await startPlugins({
@@ -43,7 +43,6 @@ const setEnvChange = function (name, value, currentEnv) {
43
43
 
44
44
  if (value === null) {
45
45
  // `currentEnv` is a mutable variable
46
- // eslint-disable-next-line fp/no-delete
47
46
  delete currentEnv[name]
48
47
  return
49
48
  }
@@ -29,7 +29,7 @@ const ERROR_PROPS = ['name', 'message', 'stack']
29
29
 
30
30
  const assignErrorProp = function (error, name, value) {
31
31
  // `Object.defineProperty()` requires direct mutation
32
- // eslint-disable-next-line fp/no-mutating-methods
32
+
33
33
  Object.defineProperty(error, name, { value, enumerable: false, writable: true, configurable: true })
34
34
  }
35
35
 
@@ -39,7 +39,6 @@ export const errorToJson = function (error) {
39
39
 
40
40
  // diagnosticText is not enumerable in TSError so we need to grab it manually. destructuring won't work.
41
41
  if (error.diagnosticText) {
42
- // eslint-disable-next-line fp/no-mutation
43
42
  errorProps.diagnosticText = error.diagnosticText
44
43
  }
45
44
 
@@ -76,7 +76,7 @@ const INTERNAL_STACK_STRINGS = [
76
76
  ]
77
77
 
78
78
  // This is only needed for local builds and tests
79
- const INTERNAL_STACK_REGEXP = /(packages|@netlify)\/build\/(lib\/|tests\/helpers\/|tests\/.*\/tests.js|node_modules)/
79
+ const INTERNAL_STACK_REGEXP = /(lib\/|tests\/helpers\/|tests\/.*\/tests.js|node_modules)/
80
80
 
81
81
  const INITIAL_NEWLINES = /^\n+/
82
82
 
@@ -23,6 +23,7 @@ export const getFullErrorInfo = function ({ error, colors, debug }) {
23
23
  locationType,
24
24
  showErrorProps,
25
25
  rawStack,
26
+ extraInfo,
26
27
  } = basicErrorInfo
27
28
 
28
29
  const titleA = getTitle(title, errorInfo)
@@ -42,6 +43,7 @@ export const getFullErrorInfo = function ({ error, colors, debug }) {
42
43
  pluginInfo,
43
44
  locationInfo,
44
45
  errorProps: errorPropsA,
46
+ extraInfo,
45
47
  }
46
48
  }
47
49
 
@@ -58,6 +60,7 @@ const getTsConfigInfo = function (tsConfig) {
58
60
  export const parseErrorInfo = function (error) {
59
61
  const { message, stack, ...errorProps } = normalizeError(error)
60
62
  const [errorInfo, errorPropsA] = getErrorInfo(errorProps)
63
+ const { extraInfo } = errorInfo
61
64
  const {
62
65
  type,
63
66
  severity,
@@ -83,6 +86,7 @@ export const parseErrorInfo = function (error) {
83
86
  showInBuildLog,
84
87
  showErrorProps,
85
88
  rawStack,
89
+ extraInfo,
86
90
  }
87
91
  return basicErrorInfo
88
92
  }
@@ -1,7 +1,10 @@
1
1
  // Serialize an error object to `statuses` properties
2
- export const serializeErrorStatus = function ({ fullErrorInfo: { title, message, locationInfo, errorProps }, state }) {
2
+ export const serializeErrorStatus = function ({
3
+ fullErrorInfo: { title, message, locationInfo, errorProps, extraInfo },
4
+ state,
5
+ }) {
3
6
  const text = getText({ locationInfo, errorProps })
4
- return { state, title, summary: message, text }
7
+ return { state, title, summary: message, text, extraData: extraInfo }
5
8
  }
6
9
 
7
10
  const getText = function ({ locationInfo, errorProps }) {
package/lib/log/colors.js CHANGED
@@ -25,7 +25,7 @@ export const setInspectColors = function () {
25
25
  }
26
26
 
27
27
  // `inspect.defaultOptions` requires direct mutation
28
- // eslint-disable-next-line fp/no-mutation
28
+
29
29
  inspect.defaultOptions.colors = true
30
30
  }
31
31
 
package/lib/log/logger.js CHANGED
@@ -27,7 +27,7 @@ export const log = function (logs, string, { indent = false, color } = {}) {
27
27
 
28
28
  if (logs !== undefined) {
29
29
  // `logs` is a stateful variable
30
- // eslint-disable-next-line fp/no-mutating-methods
30
+
31
31
  logs.stdout.push(stringC)
32
32
  return
33
33
  }
@@ -14,7 +14,6 @@ export const logPluginsList = function ({ pluginsList, debug, logs }) {
14
14
  return
15
15
  }
16
16
 
17
- // eslint-disable-next-line fp/no-mutating-methods
18
17
  const pluginsListArray = Object.entries(pluginsList).map(getPluginsListItem).sort()
19
18
 
20
19
  logSubHeader(logs, 'Available plugins')
@@ -27,7 +27,7 @@ const getCorePackageJson = function (testOpts) {
27
27
  // `update-notifier` does not do anything if not in a TTY.
28
28
  // In tests, we need to monkey patch this
29
29
  // Mutation is required due to how `stdout.isTTY` works
30
- // eslint-disable-next-line fp/no-mutation
30
+
31
31
  stdout.isTTY = true
32
32
 
33
33
  return { ...ROOT_PACKAGE_JSON, version: '0.0.1' }
@@ -5,7 +5,7 @@ import memoizeOne from 'memoize-one'
5
5
  export const addLazyProp = function (object, propName, getFunc) {
6
6
  const mGetFunc = memoizeOne(getFunc, returnTrue)
7
7
  // Mutation is required due to the usage of `Object.defineProperty()`
8
- // eslint-disable-next-line fp/no-mutating-methods
8
+
9
9
  Object.defineProperty(object, propName, {
10
10
  get: mGetFunc,
11
11
  enumerable: true,
@@ -15,7 +15,6 @@ export const getUtils = function ({
15
15
  constants: { FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC, CACHE_DIR },
16
16
  runState,
17
17
  }) {
18
- // eslint-disable-next-line fp/no-mutation
19
18
  run.command = runCommand
20
19
 
21
20
  const build = getBuildUtils(event)
@@ -28,9 +28,9 @@ export const failPluginWithWarning = function (methodName, event, message, opts)
28
28
 
29
29
  // An `error` option can be passed to keep the original error message and
30
30
  // stack trace. An additional `message` string is always required.
31
- const normalizeError = function (type, func, message, { error } = {}) {
31
+ const normalizeError = function (type, func, message, { error, extraInfo } = {}) {
32
32
  const errorA = getError(error, message, func)
33
- addErrorInfo(errorA, { type })
33
+ addErrorInfo(errorA, { type, extraInfo })
34
34
  return errorA
35
35
  }
36
36
 
@@ -35,7 +35,7 @@ export const updateNetlifyConfig = async function ({
35
35
  redirectsPath: redirectsPathA,
36
36
  } = await resolveUpdatedConfig(configOpts, configMutationsA)
37
37
  logConfigOnUpdate({ logs, netlifyConfig: netlifyConfigA, debug })
38
- // eslint-disable-next-line fp/no-mutation,no-param-reassign
38
+
39
39
  errorParams.netlifyConfig = netlifyConfigA
40
40
  return {
41
41
  netlifyConfig: netlifyConfigA,
@@ -67,7 +67,7 @@ const haveConfigSideFilesChanged = async function (configSideFiles, headersPath,
67
67
  // apply any configuration update on `netlify.toml`.
68
68
  export const listConfigSideFiles = async function (sideFiles) {
69
69
  const configSideFiles = await pFilter(sideFiles, pathExists)
70
- // eslint-disable-next-line fp/no-mutating-methods
70
+
71
71
  return configSideFiles.sort()
72
72
  }
73
73
 
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "27.18.9-rc",
3
+ "version": "27.19.0-rc",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/core/main.js",
7
7
  "main": "./lib/core/main.js",
8
- "types": "types/index.d.ts",
8
+ "types": "./types/index.d.ts",
9
9
  "bin": {
10
- "netlify-build": "./lib/core/bin.js"
10
+ "netlify-build": "./bin.js"
11
11
  },
12
12
  "files": [
13
+ "bin.js",
13
14
  "lib/**/*.js",
14
15
  "lib/**/*.yml",
15
16
  "types/**/*.d.ts"
@@ -21,7 +22,11 @@
21
22
  ],
22
23
  "scripts": {
23
24
  "prepublishOnly": "cd ../../ && npm run prepublishOnly",
24
- "build": "cp -a src lib/"
25
+ "prebuild": "rm -rf lib",
26
+ "build": "cp -a src lib/",
27
+ "test": "ava",
28
+ "test:ci": "c8 -r lcovonly -r text -r json ava",
29
+ "test:measure": "node tools/tests_duration.mjs"
25
30
  },
26
31
  "keywords": [
27
32
  "nodejs",
@@ -58,12 +63,12 @@
58
63
  "dependencies": {
59
64
  "@bugsnag/js": "^7.0.0",
60
65
  "@netlify/edge-bundler": "^2.2.0",
61
- "@netlify/cache-utils": "^4.1.6-rc",
62
- "@netlify/config": "^18.2.6-rc-rc",
63
- "@netlify/functions-utils": "^4.2.11-rc",
64
- "@netlify/git-utils": "^4.1.3-rc",
65
- "@netlify/plugins-list": "^6.45.0",
66
- "@netlify/run-utils": "^4.0.3-rc",
66
+ "@netlify/cache-utils": "^4.1.5",
67
+ "@netlify/config": "^18.2.4",
68
+ "@netlify/functions-utils": "^4.2.10",
69
+ "@netlify/git-utils": "^4.1.2",
70
+ "@netlify/plugins-list": "^6.46.0",
71
+ "@netlify/run-utils": "^4.0.2",
67
72
  "@netlify/zip-it-and-ship-it": "^7.1.2",
68
73
  "@sindresorhus/slugify": "^2.0.0",
69
74
  "@types/node": "^16.0.0",