@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 +5 -0
- package/lib/core/build.js +1 -1
- package/lib/env/changes.js +0 -1
- package/lib/error/build.js +1 -2
- package/lib/error/parse/clean_stack.js +1 -1
- package/lib/error/parse/parse.js +4 -0
- package/lib/error/parse/serialize_status.js +5 -2
- package/lib/log/colors.js +1 -1
- package/lib/log/logger.js +1 -1
- package/lib/log/messages/plugins.js +0 -1
- package/lib/log/old_version.js +1 -1
- package/lib/plugins/child/lazy.js +1 -1
- package/lib/plugins/child/utils.js +0 -1
- package/lib/plugins/error.js +2 -2
- package/lib/steps/update_config.js +2 -2
- package/package.json +15 -10
package/bin.js
ADDED
package/lib/core/build.js
CHANGED
|
@@ -385,7 +385,7 @@ const initAndRunBuild = async function ({
|
|
|
385
385
|
testOpts,
|
|
386
386
|
featureFlags,
|
|
387
387
|
})
|
|
388
|
-
|
|
388
|
+
|
|
389
389
|
errorParams.pluginsOptions = pluginsOptionsA
|
|
390
390
|
|
|
391
391
|
const { childProcesses, timers: timersB } = await startPlugins({
|
package/lib/env/changes.js
CHANGED
package/lib/error/build.js
CHANGED
|
@@ -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
|
-
|
|
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 = /(
|
|
79
|
+
const INTERNAL_STACK_REGEXP = /(lib\/|tests\/helpers\/|tests\/.*\/tests.js|node_modules)/
|
|
80
80
|
|
|
81
81
|
const INITIAL_NEWLINES = /^\n+/
|
|
82
82
|
|
package/lib/error/parse/parse.js
CHANGED
|
@@ -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 ({
|
|
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
package/lib/log/logger.js
CHANGED
|
@@ -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')
|
package/lib/log/old_version.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
8
|
+
|
|
9
9
|
Object.defineProperty(object, propName, {
|
|
10
10
|
get: mGetFunc,
|
|
11
11
|
enumerable: true,
|
package/lib/plugins/error.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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.
|
|
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": "./
|
|
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
|
-
"
|
|
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.
|
|
62
|
-
"@netlify/config": "^18.2.
|
|
63
|
-
"@netlify/functions-utils": "^4.2.
|
|
64
|
-
"@netlify/git-utils": "^4.1.
|
|
65
|
-
"@netlify/plugins-list": "^6.
|
|
66
|
-
"@netlify/run-utils": "^4.0.
|
|
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",
|