@netlify/build 27.4.0 → 27.5.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/package.json +5 -5
- package/src/plugins/child/status.js +10 -3
- package/src/status/report.js +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.5.0-rc",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./src/core/main.js",
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@bugsnag/js": "^7.0.0",
|
|
59
|
-
"@netlify/edge-bundler": "^1.
|
|
59
|
+
"@netlify/edge-bundler": "^1.6.0",
|
|
60
60
|
"@netlify/cache-utils": "^4.0.0",
|
|
61
61
|
"@netlify/config": "^18.1.1",
|
|
62
|
-
"@netlify/functions-utils": "^4.2.
|
|
62
|
+
"@netlify/functions-utils": "^4.2.2",
|
|
63
63
|
"@netlify/git-utils": "^4.0.0",
|
|
64
|
-
"@netlify/plugins-list": "^6.
|
|
64
|
+
"@netlify/plugins-list": "^6.35.0",
|
|
65
65
|
"@netlify/run-utils": "^4.0.0",
|
|
66
|
-
"@netlify/zip-it-and-ship-it": "5.13.
|
|
66
|
+
"@netlify/zip-it-and-ship-it": "5.13.2",
|
|
67
67
|
"@sindresorhus/slugify": "^2.0.0",
|
|
68
68
|
"@types/node": "^16.0.0",
|
|
69
69
|
"ansi-escapes": "^5.0.0",
|
|
@@ -6,18 +6,19 @@ import { addErrorInfo } from '../../error/info.js'
|
|
|
6
6
|
// Report status information to the UI
|
|
7
7
|
export const show = function (runState, showArgs) {
|
|
8
8
|
validateShowArgs(showArgs)
|
|
9
|
-
const { title, summary, text } = removeEmptyStrings(showArgs)
|
|
10
|
-
runState.status = { state: 'success', title, summary, text }
|
|
9
|
+
const { title, summary, text, extraData } = removeEmptyStrings(showArgs)
|
|
10
|
+
runState.status = { state: 'success', title, summary, text, extraData }
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// Validate arguments of `utils.status.show()`
|
|
14
14
|
const validateShowArgs = function (showArgs) {
|
|
15
15
|
try {
|
|
16
16
|
validateShowArgsObject(showArgs)
|
|
17
|
-
const { title, summary, text, ...otherArgs } = showArgs
|
|
17
|
+
const { title, summary, text, extraData, ...otherArgs } = showArgs
|
|
18
18
|
validateShowArgsKeys(otherArgs)
|
|
19
19
|
Object.entries({ title, summary, text }).forEach(validateStringArg)
|
|
20
20
|
validateShowArgsSummary(summary)
|
|
21
|
+
validateShowArgsExtraData(extraData)
|
|
21
22
|
} catch (error) {
|
|
22
23
|
error.message = `utils.status.show() ${error.message}`
|
|
23
24
|
addErrorInfo(error, { type: 'pluginValidation' })
|
|
@@ -54,6 +55,12 @@ const validateShowArgsSummary = function (summary) {
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
const validateShowArgsExtraData = function (extraData) {
|
|
59
|
+
if (extraData !== undefined && Array.isArray(extraData) === false) {
|
|
60
|
+
throw new TypeError('provided extra data must be an array')
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
57
64
|
const removeEmptyStrings = function (showArgs) {
|
|
58
65
|
return mapObj(showArgs, removeEmptyString)
|
|
59
66
|
}
|
package/src/status/report.js
CHANGED
|
@@ -104,7 +104,7 @@ const sendApiStatuses = async function ({
|
|
|
104
104
|
|
|
105
105
|
const sendApiStatus = async function ({
|
|
106
106
|
api,
|
|
107
|
-
status: { packageName, version, state, event, title, summary, text },
|
|
107
|
+
status: { packageName, version, state, event, title, summary, text, extraData },
|
|
108
108
|
childEnv,
|
|
109
109
|
mode,
|
|
110
110
|
netlifyConfig,
|
|
@@ -117,7 +117,16 @@ const sendApiStatus = async function ({
|
|
|
117
117
|
try {
|
|
118
118
|
await api.createPluginRun({
|
|
119
119
|
deploy_id: deployId,
|
|
120
|
-
body: {
|
|
120
|
+
body: {
|
|
121
|
+
package: packageName,
|
|
122
|
+
version,
|
|
123
|
+
state,
|
|
124
|
+
reporting_event: event,
|
|
125
|
+
title,
|
|
126
|
+
summary,
|
|
127
|
+
text,
|
|
128
|
+
extra_data: extraData,
|
|
129
|
+
},
|
|
121
130
|
})
|
|
122
131
|
// Bitballoon API randomly fails with 502.
|
|
123
132
|
// Builds should be successful when this API call fails, but we still want
|