@netlify/build 18.13.12 → 18.15.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 +4 -2
- package/src/core/config.js +1 -1
- package/src/core/constants.js +1 -1
- package/src/core/dry.js +10 -10
- package/src/core/feature_flags.js +1 -0
- package/src/core/flags.js +2 -2
- package/src/core/main.js +21 -21
- package/src/error/parse/location.js +3 -3
- package/src/error/type.js +4 -4
- package/src/log/messages/{core_commands.js → core_steps.js} +0 -0
- package/src/log/messages/dry.js +14 -14
- package/src/log/messages/steps.js +32 -0
- package/src/log/stream.js +2 -2
- package/src/plugins/child/load.js +5 -5
- package/src/plugins/child/run.js +2 -2
- package/src/plugins/load.js +9 -9
- package/src/plugins_core/build_command.js +7 -7
- package/src/plugins_core/deploy/buildbot_client.js +1 -3
- package/src/plugins_core/deploy/index.js +5 -5
- package/src/plugins_core/functions/index.js +8 -11
- package/src/status/success.js +5 -7
- package/src/{commands/core_command.js → steps/core_step.js} +7 -7
- package/src/{commands → steps}/error.js +5 -5
- package/src/steps/get.js +35 -0
- package/src/{commands → steps}/plugin.js +5 -5
- package/src/{commands → steps}/return.js +10 -10
- package/src/{commands/run_command.js → steps/run_step.js} +38 -38
- package/src/{commands/run_commands.js → steps/run_steps.js} +19 -19
- package/src/{commands → steps}/update_config.js +0 -0
- package/src/telemetry/main.js +4 -4
- package/types/config/build.d.ts +61 -0
- package/types/config/functions.d.ts +38 -0
- package/types/config/netlify_config.d.ts +51 -0
- package/types/index.d.ts +3 -0
- package/types/netlify_event.d.ts +5 -0
- package/types/netlify_plugin.d.ts +29 -0
- package/types/netlify_plugin_options.d.ts +56 -0
- package/types/options/index.d.ts +1 -0
- package/types/options/netlify_plugin_build_util.d.ts +7 -0
- package/types/options/netlify_plugin_cache_util.d.ts +39 -0
- package/types/options/netlify_plugin_git_util.d.ts +41 -0
- package/types/options/netlify_plugin_run_util.d.ts +24 -0
- package/types/options/netlify_plugin_status_util.d.ts +24 -0
- package/types/options/netlify_plugin_utils.d.ts +13 -0
- package/types/utils/json_value.d.ts +1 -0
- package/types/utils/many.d.ts +6 -0
- package/src/commands/get.js +0 -35
- package/src/log/messages/commands.js +0 -32
package/src/status/success.js
CHANGED
|
@@ -4,19 +4,17 @@ const { runsOnlyOnBuildFailure } = require('../plugins/events')
|
|
|
4
4
|
|
|
5
5
|
// The last event handler of a plugin (except for `onError` and `onEnd`)
|
|
6
6
|
// defaults to `utils.status.show({ state: 'success' })` without any `summary`.
|
|
7
|
-
const getSuccessStatus = function (newStatus, {
|
|
8
|
-
if (newStatus === undefined &&
|
|
7
|
+
const getSuccessStatus = function (newStatus, { steps, event, packageName }) {
|
|
8
|
+
if (newStatus === undefined && isLastNonErrorStep({ steps, event, packageName })) {
|
|
9
9
|
return IMPLICIT_STATUS
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
return newStatus
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
)
|
|
19
|
-
return nonErrorCommands.length === 0 || nonErrorCommands[nonErrorCommands.length - 1].event === event
|
|
15
|
+
const isLastNonErrorStep = function ({ steps, event, packageName }) {
|
|
16
|
+
const nonErrorSteps = steps.filter((step) => step.packageName === packageName && !runsOnlyOnBuildFailure(step.event))
|
|
17
|
+
return nonErrorSteps.length === 0 || nonErrorSteps[nonErrorSteps.length - 1].event === event
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
const IMPLICIT_STATUS = { state: 'success', implicit: true }
|
|
@@ -5,10 +5,10 @@ const { addErrorInfo, isBuildError } = require('../error/info')
|
|
|
5
5
|
|
|
6
6
|
const { updateNetlifyConfig, listConfigSideFiles } = require('./update_config')
|
|
7
7
|
|
|
8
|
-
// Fire a core
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
// Fire a core step
|
|
9
|
+
const fireCoreStep = async function ({
|
|
10
|
+
coreStep,
|
|
11
|
+
coreStepName,
|
|
12
12
|
configPath,
|
|
13
13
|
buildDir,
|
|
14
14
|
repositoryRoot,
|
|
@@ -38,7 +38,7 @@ const fireCoreCommand = async function ({
|
|
|
38
38
|
newEnvChanges = {},
|
|
39
39
|
configMutations: newConfigMutations = [],
|
|
40
40
|
tags,
|
|
41
|
-
} = await
|
|
41
|
+
} = await coreStep({
|
|
42
42
|
configPath,
|
|
43
43
|
buildDir,
|
|
44
44
|
repositoryRoot,
|
|
@@ -85,10 +85,10 @@ const fireCoreCommand = async function ({
|
|
|
85
85
|
}
|
|
86
86
|
} catch (newError) {
|
|
87
87
|
if (!isBuildError(newError)) {
|
|
88
|
-
addErrorInfo(newError, { type: '
|
|
88
|
+
addErrorInfo(newError, { type: 'coreStep', location: { coreStepName } })
|
|
89
89
|
}
|
|
90
90
|
return { newError }
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
module.exports = {
|
|
94
|
+
module.exports = { fireCoreStep }
|
|
@@ -13,7 +13,7 @@ const { isSoftFailEvent } = require('../plugins/events')
|
|
|
13
13
|
// stop, but are still reported, and prevent future events from the same
|
|
14
14
|
// plugin.
|
|
15
15
|
// This also computes error statuses that are sent to the API.
|
|
16
|
-
const
|
|
16
|
+
const handleStepError = function ({
|
|
17
17
|
event,
|
|
18
18
|
newError,
|
|
19
19
|
childEnv,
|
|
@@ -21,14 +21,14 @@ const handleCommandError = function ({
|
|
|
21
21
|
api,
|
|
22
22
|
errorMonitor,
|
|
23
23
|
deployId,
|
|
24
|
-
|
|
24
|
+
coreStep,
|
|
25
25
|
netlifyConfig,
|
|
26
26
|
logs,
|
|
27
27
|
debug,
|
|
28
28
|
testOpts,
|
|
29
29
|
}) {
|
|
30
|
-
// Core
|
|
31
|
-
if (
|
|
30
|
+
// Core steps do not report error statuses
|
|
31
|
+
if (coreStep !== undefined) {
|
|
32
32
|
return { newError }
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -103,4 +103,4 @@ const isCorePluginBug = function (error, loadedFrom) {
|
|
|
103
103
|
return severity === 'warning' && loadedFrom === 'core'
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
module.exports = {
|
|
106
|
+
module.exports = { handleStepError, getPluginErrorType }
|
package/src/steps/get.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { EVENTS } = require('../plugins/events')
|
|
4
|
+
const { buildCommandCore } = require('../plugins_core/build_command')
|
|
5
|
+
const { deploySite } = require('../plugins_core/deploy')
|
|
6
|
+
const { bundleFunctions } = require('../plugins_core/functions')
|
|
7
|
+
|
|
8
|
+
// Get all build steps
|
|
9
|
+
const getSteps = function (steps) {
|
|
10
|
+
const stepsA = addCoreSteps(steps)
|
|
11
|
+
const stepsB = sortSteps(stepsA)
|
|
12
|
+
const events = getEvents(stepsB)
|
|
13
|
+
return { steps: stepsB, events }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const addCoreSteps = function (steps) {
|
|
17
|
+
return [buildCommandCore, ...steps, bundleFunctions, deploySite]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Sort plugin steps by event order.
|
|
21
|
+
const sortSteps = function (steps) {
|
|
22
|
+
return EVENTS.flatMap((event) => steps.filter((step) => step.event === event))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Retrieve list of unique events
|
|
26
|
+
const getEvents = function (steps) {
|
|
27
|
+
const events = steps.map(getEvent)
|
|
28
|
+
return [...new Set(events)]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const getEvent = function ({ event }) {
|
|
32
|
+
return event
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = { getSteps }
|
|
@@ -8,8 +8,8 @@ const { getSuccessStatus } = require('../status/success')
|
|
|
8
8
|
const { getPluginErrorType } = require('./error')
|
|
9
9
|
const { updateNetlifyConfig, listConfigSideFiles } = require('./update_config')
|
|
10
10
|
|
|
11
|
-
// Fire a plugin
|
|
12
|
-
const
|
|
11
|
+
// Fire a plugin step
|
|
12
|
+
const firePluginStep = async function ({
|
|
13
13
|
event,
|
|
14
14
|
childProcess,
|
|
15
15
|
packageName,
|
|
@@ -24,7 +24,7 @@ const firePluginCommand = async function ({
|
|
|
24
24
|
headersPath,
|
|
25
25
|
redirectsPath,
|
|
26
26
|
constants,
|
|
27
|
-
|
|
27
|
+
steps,
|
|
28
28
|
error,
|
|
29
29
|
logs,
|
|
30
30
|
debug,
|
|
@@ -61,7 +61,7 @@ const firePluginCommand = async function ({
|
|
|
61
61
|
logs,
|
|
62
62
|
debug,
|
|
63
63
|
})
|
|
64
|
-
const newStatus = getSuccessStatus(status, {
|
|
64
|
+
const newStatus = getSuccessStatus(status, { steps, event, packageName })
|
|
65
65
|
return {
|
|
66
66
|
newEnvChanges,
|
|
67
67
|
netlifyConfig: netlifyConfigA,
|
|
@@ -83,4 +83,4 @@ const firePluginCommand = async function ({
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
module.exports = {
|
|
86
|
+
module.exports = { firePluginStep }
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { logCommandSuccess } = require('../log/messages/commands')
|
|
4
3
|
const { logTimer } = require('../log/messages/core')
|
|
4
|
+
const { logStepSuccess } = require('../log/messages/steps')
|
|
5
5
|
|
|
6
|
-
const {
|
|
6
|
+
const { handleStepError } = require('./error')
|
|
7
7
|
|
|
8
|
-
// Retrieve the return value of a
|
|
9
|
-
const
|
|
8
|
+
// Retrieve the return value of a step
|
|
9
|
+
const getStepReturn = function ({
|
|
10
10
|
event,
|
|
11
11
|
packageName,
|
|
12
12
|
newError,
|
|
13
13
|
newEnvChanges,
|
|
14
14
|
newStatus,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
coreStep,
|
|
16
|
+
coreStepName: timerName = `${packageName} ${event}`,
|
|
17
17
|
childEnv,
|
|
18
18
|
mode,
|
|
19
19
|
api,
|
|
@@ -30,7 +30,7 @@ const getCommandReturn = function ({
|
|
|
30
30
|
testOpts,
|
|
31
31
|
}) {
|
|
32
32
|
if (newError !== undefined) {
|
|
33
|
-
return
|
|
33
|
+
return handleStepError({
|
|
34
34
|
event,
|
|
35
35
|
newError,
|
|
36
36
|
childEnv,
|
|
@@ -38,7 +38,7 @@ const getCommandReturn = function ({
|
|
|
38
38
|
api,
|
|
39
39
|
errorMonitor,
|
|
40
40
|
deployId,
|
|
41
|
-
|
|
41
|
+
coreStep,
|
|
42
42
|
netlifyConfig,
|
|
43
43
|
logs,
|
|
44
44
|
debug,
|
|
@@ -46,11 +46,11 @@ const getCommandReturn = function ({
|
|
|
46
46
|
})
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
logStepSuccess(logs)
|
|
50
50
|
|
|
51
51
|
logTimer(logs, durationNs, timerName)
|
|
52
52
|
|
|
53
53
|
return { newEnvChanges, netlifyConfig, configMutations, headersPath, redirectsPath, newStatus, timers }
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
module.exports = {
|
|
56
|
+
module.exports = { getStepReturn }
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
'use strict'
|
|
3
3
|
|
|
4
4
|
const { addMutableConstants } = require('../core/constants')
|
|
5
|
-
const {
|
|
5
|
+
const { logStepStart } = require('../log/messages/steps')
|
|
6
6
|
const { runsAlsoOnBuildFailure, runsOnlyOnBuildFailure } = require('../plugins/events')
|
|
7
7
|
const { measureDuration, normalizeTimerName } = require('../time/main')
|
|
8
8
|
|
|
9
|
-
const {
|
|
10
|
-
const {
|
|
11
|
-
const {
|
|
9
|
+
const { fireCoreStep } = require('./core_step')
|
|
10
|
+
const { firePluginStep } = require('./plugin')
|
|
11
|
+
const { getStepReturn } = require('./return')
|
|
12
12
|
|
|
13
|
-
// Run a
|
|
14
|
-
const
|
|
13
|
+
// Run a step (core, build command or plugin)
|
|
14
|
+
const runStep = async function ({
|
|
15
15
|
event,
|
|
16
16
|
childProcess,
|
|
17
17
|
packageName,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
coreStep,
|
|
19
|
+
coreStepId,
|
|
20
|
+
coreStepName,
|
|
21
|
+
coreStepDescription,
|
|
22
22
|
pluginPackageJson,
|
|
23
23
|
loadedFrom,
|
|
24
24
|
origin,
|
|
@@ -33,7 +33,7 @@ const runCommand = async function ({
|
|
|
33
33
|
branch,
|
|
34
34
|
envChanges,
|
|
35
35
|
constants,
|
|
36
|
-
|
|
36
|
+
steps,
|
|
37
37
|
buildbotServerSocket,
|
|
38
38
|
events,
|
|
39
39
|
mode,
|
|
@@ -58,7 +58,7 @@ const runCommand = async function ({
|
|
|
58
58
|
const constantsA = await addMutableConstants({ constants, buildDir, netlifyConfig })
|
|
59
59
|
|
|
60
60
|
if (
|
|
61
|
-
!(await
|
|
61
|
+
!(await shouldRunStep({
|
|
62
62
|
event,
|
|
63
63
|
packageName,
|
|
64
64
|
error,
|
|
@@ -73,9 +73,9 @@ const runCommand = async function ({
|
|
|
73
73
|
return {}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
logStepStart({ logs, event, packageName, coreStepDescription, index, error, netlifyConfig })
|
|
77
77
|
|
|
78
|
-
const
|
|
78
|
+
const fireStep = getFireStep(packageName, coreStepId, event)
|
|
79
79
|
const {
|
|
80
80
|
newEnvChanges,
|
|
81
81
|
netlifyConfig: netlifyConfigA = netlifyConfig,
|
|
@@ -86,15 +86,15 @@ const runCommand = async function ({
|
|
|
86
86
|
newStatus,
|
|
87
87
|
timers: timersA,
|
|
88
88
|
durationNs,
|
|
89
|
-
} = await
|
|
89
|
+
} = await fireStep({
|
|
90
90
|
event,
|
|
91
91
|
childProcess,
|
|
92
92
|
packageName,
|
|
93
93
|
pluginPackageJson,
|
|
94
94
|
loadedFrom,
|
|
95
95
|
origin,
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
coreStep,
|
|
97
|
+
coreStepName,
|
|
98
98
|
configPath,
|
|
99
99
|
buildDir,
|
|
100
100
|
repositoryRoot,
|
|
@@ -104,7 +104,7 @@ const runCommand = async function ({
|
|
|
104
104
|
branch,
|
|
105
105
|
envChanges,
|
|
106
106
|
constants: constantsA,
|
|
107
|
-
|
|
107
|
+
steps,
|
|
108
108
|
buildbotServerSocket,
|
|
109
109
|
events,
|
|
110
110
|
error,
|
|
@@ -121,14 +121,14 @@ const runCommand = async function ({
|
|
|
121
121
|
featureFlags,
|
|
122
122
|
})
|
|
123
123
|
|
|
124
|
-
const newValues = await
|
|
124
|
+
const newValues = await getStepReturn({
|
|
125
125
|
event,
|
|
126
126
|
packageName,
|
|
127
127
|
newError,
|
|
128
128
|
newEnvChanges,
|
|
129
129
|
newStatus,
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
coreStep,
|
|
131
|
+
coreStepName,
|
|
132
132
|
childEnv,
|
|
133
133
|
mode,
|
|
134
134
|
api,
|
|
@@ -178,7 +178,7 @@ const runCommand = async function ({
|
|
|
178
178
|
// or available. However, one might be created by a build plugin, in which case,
|
|
179
179
|
// those core plugins should be triggered. We use a dynamic `condition()` to
|
|
180
180
|
// model this behavior.
|
|
181
|
-
const
|
|
181
|
+
const shouldRunStep = async function ({
|
|
182
182
|
event,
|
|
183
183
|
packageName,
|
|
184
184
|
error,
|
|
@@ -203,25 +203,25 @@ const shouldRunCommand = async function ({
|
|
|
203
203
|
return !runsOnlyOnBuildFailure(event)
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
// Wrap
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
return measureDuration(
|
|
206
|
+
// Wrap step function to measure its time
|
|
207
|
+
const getFireStep = function (packageName, coreStepId, event) {
|
|
208
|
+
if (coreStepId !== undefined) {
|
|
209
|
+
return measureDuration(tFireStep, coreStepId)
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
const parentTag = normalizeTimerName(packageName)
|
|
213
|
-
return measureDuration(
|
|
213
|
+
return measureDuration(tFireStep, event, { parentTag, category: 'pluginEvent' })
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
const
|
|
216
|
+
const tFireStep = function ({
|
|
217
217
|
event,
|
|
218
218
|
childProcess,
|
|
219
219
|
packageName,
|
|
220
220
|
pluginPackageJson,
|
|
221
221
|
loadedFrom,
|
|
222
222
|
origin,
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
coreStep,
|
|
224
|
+
coreStepName,
|
|
225
225
|
configPath,
|
|
226
226
|
buildDir,
|
|
227
227
|
repositoryRoot,
|
|
@@ -231,7 +231,7 @@ const tFireCommand = function ({
|
|
|
231
231
|
branch,
|
|
232
232
|
envChanges,
|
|
233
233
|
constants,
|
|
234
|
-
|
|
234
|
+
steps,
|
|
235
235
|
buildbotServerSocket,
|
|
236
236
|
events,
|
|
237
237
|
error,
|
|
@@ -246,10 +246,10 @@ const tFireCommand = function ({
|
|
|
246
246
|
redirectsPath,
|
|
247
247
|
featureFlags,
|
|
248
248
|
}) {
|
|
249
|
-
if (
|
|
250
|
-
return
|
|
251
|
-
|
|
252
|
-
|
|
249
|
+
if (coreStep !== undefined) {
|
|
250
|
+
return fireCoreStep({
|
|
251
|
+
coreStep,
|
|
252
|
+
coreStepName,
|
|
253
253
|
configPath,
|
|
254
254
|
buildDir,
|
|
255
255
|
repositoryRoot,
|
|
@@ -274,7 +274,7 @@ const tFireCommand = function ({
|
|
|
274
274
|
})
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
return
|
|
277
|
+
return firePluginStep({
|
|
278
278
|
event,
|
|
279
279
|
childProcess,
|
|
280
280
|
packageName,
|
|
@@ -289,12 +289,12 @@ const tFireCommand = function ({
|
|
|
289
289
|
headersPath,
|
|
290
290
|
redirectsPath,
|
|
291
291
|
constants,
|
|
292
|
-
|
|
292
|
+
steps,
|
|
293
293
|
error,
|
|
294
294
|
logs,
|
|
295
295
|
debug,
|
|
296
296
|
})
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
module.exports = {
|
|
299
|
+
module.exports = { runStep }
|
|
300
300
|
/* eslint-enable max-lines */
|
|
@@ -6,15 +6,15 @@ const pReduce = require('p-reduce')
|
|
|
6
6
|
const { addErrorInfo } = require('../error/info')
|
|
7
7
|
const { addStatus } = require('../status/add')
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const { runStep } = require('./run_step')
|
|
10
10
|
|
|
11
|
-
// Run all
|
|
12
|
-
// Each
|
|
11
|
+
// Run all steps.
|
|
12
|
+
// Each step can change some state: last `error`, environment variables changes,
|
|
13
13
|
// list of `failedPlugins` (that ran `utils.build.failPlugin()`).
|
|
14
14
|
// If an error arises, runs `onError` events.
|
|
15
15
|
// Runs `onEnd` events at the end, whether an error was thrown or not.
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const runSteps = async function ({
|
|
17
|
+
steps,
|
|
18
18
|
buildbotServerSocket,
|
|
19
19
|
events,
|
|
20
20
|
configPath,
|
|
@@ -42,7 +42,7 @@ const runCommands = async function ({
|
|
|
42
42
|
featureFlags,
|
|
43
43
|
}) {
|
|
44
44
|
const {
|
|
45
|
-
index:
|
|
45
|
+
index: stepsCount,
|
|
46
46
|
error: errorA,
|
|
47
47
|
netlifyConfig: netlifyConfigC,
|
|
48
48
|
statuses: statusesB,
|
|
@@ -50,7 +50,7 @@ const runCommands = async function ({
|
|
|
50
50
|
timers: timersC,
|
|
51
51
|
configMutations: configMutationsB,
|
|
52
52
|
} = await pReduce(
|
|
53
|
-
|
|
53
|
+
steps,
|
|
54
54
|
async (
|
|
55
55
|
{
|
|
56
56
|
index,
|
|
@@ -68,10 +68,10 @@ const runCommands = async function ({
|
|
|
68
68
|
event,
|
|
69
69
|
childProcess,
|
|
70
70
|
packageName,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
coreStep,
|
|
72
|
+
coreStepId,
|
|
73
|
+
coreStepName,
|
|
74
|
+
coreStepDescription,
|
|
75
75
|
pluginPackageJson,
|
|
76
76
|
loadedFrom,
|
|
77
77
|
origin,
|
|
@@ -89,14 +89,14 @@ const runCommands = async function ({
|
|
|
89
89
|
redirectsPath: redirectsPathB = redirectsPathA,
|
|
90
90
|
newStatus,
|
|
91
91
|
timers: timersB = timersA,
|
|
92
|
-
} = await
|
|
92
|
+
} = await runStep({
|
|
93
93
|
event,
|
|
94
94
|
childProcess,
|
|
95
95
|
packageName,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
coreStep,
|
|
97
|
+
coreStepId,
|
|
98
|
+
coreStepName,
|
|
99
|
+
coreStepDescription,
|
|
100
100
|
pluginPackageJson,
|
|
101
101
|
loadedFrom,
|
|
102
102
|
origin,
|
|
@@ -111,7 +111,7 @@ const runCommands = async function ({
|
|
|
111
111
|
branch,
|
|
112
112
|
envChanges,
|
|
113
113
|
constants,
|
|
114
|
-
|
|
114
|
+
steps,
|
|
115
115
|
buildbotServerSocket,
|
|
116
116
|
events,
|
|
117
117
|
mode,
|
|
@@ -168,7 +168,7 @@ const runCommands = async function ({
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
return {
|
|
171
|
-
|
|
171
|
+
stepsCount,
|
|
172
172
|
netlifyConfig: netlifyConfigC,
|
|
173
173
|
statuses: statusesB,
|
|
174
174
|
failedPlugins: failedPluginsA,
|
|
@@ -177,5 +177,5 @@ const runCommands = async function ({
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
module.exports = {
|
|
180
|
+
module.exports = { runSteps }
|
|
181
181
|
/* eslint-enable max-lines */
|
|
File without changes
|
package/src/telemetry/main.js
CHANGED
|
@@ -21,7 +21,7 @@ const trackBuildComplete = async function ({
|
|
|
21
21
|
deployId,
|
|
22
22
|
buildId,
|
|
23
23
|
status,
|
|
24
|
-
|
|
24
|
+
stepsCount,
|
|
25
25
|
pluginsOptions,
|
|
26
26
|
durationNs,
|
|
27
27
|
siteInfo,
|
|
@@ -39,7 +39,7 @@ const trackBuildComplete = async function ({
|
|
|
39
39
|
deployId,
|
|
40
40
|
buildId,
|
|
41
41
|
status,
|
|
42
|
-
|
|
42
|
+
stepsCount,
|
|
43
43
|
pluginsOptions,
|
|
44
44
|
durationNs,
|
|
45
45
|
siteInfo,
|
|
@@ -73,7 +73,7 @@ const getPayload = function ({
|
|
|
73
73
|
deployId,
|
|
74
74
|
buildId,
|
|
75
75
|
status,
|
|
76
|
-
|
|
76
|
+
stepsCount,
|
|
77
77
|
pluginsOptions,
|
|
78
78
|
durationNs,
|
|
79
79
|
userNodeVersion,
|
|
@@ -88,7 +88,7 @@ const getPayload = function ({
|
|
|
88
88
|
deployId,
|
|
89
89
|
buildId,
|
|
90
90
|
status,
|
|
91
|
-
steps:
|
|
91
|
+
steps: stepsCount,
|
|
92
92
|
buildVersion,
|
|
93
93
|
// We're passing the node version set by the buildbot/user which will run the `build.command` and
|
|
94
94
|
// the `package.json`/locally defined plugins
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { JSONValue } from '../utils/json_value'
|
|
2
|
+
|
|
3
|
+
interface NetlifyPlugin {
|
|
4
|
+
package: string
|
|
5
|
+
inputs: JSONValue
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* eslint-disable camelcase -- some properties are named in snake case in this API */
|
|
9
|
+
|
|
10
|
+
export interface Build {
|
|
11
|
+
/**
|
|
12
|
+
* Includes a site's [build command](https://docs.netlify.com/configure-builds/get-started/#definitions)
|
|
13
|
+
*/
|
|
14
|
+
command?: string
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* the path to your static content folder
|
|
18
|
+
*/
|
|
19
|
+
publish: string
|
|
20
|
+
base: string
|
|
21
|
+
services: Record<string, unknown>
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Allows specifying a Bash command that will be run from the base directory to determine whether the site needs rebuilding or not.
|
|
25
|
+
* Check out our [ignore builds](https://docs.netlify.com/configure-builds/common-configurations/ignore-builds/) doc for more information on the default ignore behavior and details about constructing a custom ignore command.
|
|
26
|
+
*/
|
|
27
|
+
ignore?: string
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Includes the path to a site's [Edge Handlers directory](https://docs.netlify.com/edge-handlers/configure-and-build/#choose-an-edge-handlers-directory)
|
|
31
|
+
*/
|
|
32
|
+
edge_handlers?: string
|
|
33
|
+
/**
|
|
34
|
+
* Contains a site's [environment variables](https://docs.netlify.com/configure-builds/environment-variables/#netlify-configuration-variables)
|
|
35
|
+
*/
|
|
36
|
+
environment: Partial<Record<string, string>>
|
|
37
|
+
/**
|
|
38
|
+
* Includes options for [post processing](https://docs.netlify.com/configure-builds/file-based-configuration/#post-processing) HTML, CSS, JavaScript, and images
|
|
39
|
+
*/
|
|
40
|
+
processing: {
|
|
41
|
+
skip_processing?: boolean
|
|
42
|
+
css: {
|
|
43
|
+
bundle?: boolean
|
|
44
|
+
minify?: boolean
|
|
45
|
+
}
|
|
46
|
+
js: {
|
|
47
|
+
bundle?: boolean
|
|
48
|
+
minify?: boolean
|
|
49
|
+
}
|
|
50
|
+
html: {
|
|
51
|
+
pretty_url?: boolean
|
|
52
|
+
}
|
|
53
|
+
images: {
|
|
54
|
+
compress?: boolean
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
plugins: readonly NetlifyPlugin[]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* eslint-enable camelcase */
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type GlobPattern = string
|
|
2
|
+
|
|
3
|
+
/* eslint-disable camelcase -- some properties are named in snake case in this API */
|
|
4
|
+
type FunctionsObject = {
|
|
5
|
+
/**
|
|
6
|
+
* string that includes the path to a site's [functions directory](https://docs.netlify.com/functions/configure-and-deploy/#configure-the-functions-folder)
|
|
7
|
+
*/
|
|
8
|
+
directory: string
|
|
9
|
+
} & (
|
|
10
|
+
| {
|
|
11
|
+
/**
|
|
12
|
+
* the function bundling method used in [`@netlify/zip-it-and-ship-it`](https://github.com/netlify/zip-it-and-ship-it).
|
|
13
|
+
*/
|
|
14
|
+
node_bundler: 'zisi'
|
|
15
|
+
}
|
|
16
|
+
| {
|
|
17
|
+
/**
|
|
18
|
+
* the function bundling method used in [`@netlify/zip-it-and-ship-it`](https://github.com/netlify/zip-it-and-ship-it).
|
|
19
|
+
*/
|
|
20
|
+
node_bundler: 'esbuild'
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* a list of Node.js modules that are copied to the bundled artifact without adjusting their source or references during the bundling process.
|
|
24
|
+
* This property helps handle dependencies that can’t be inlined, such as modules with native add-ons.
|
|
25
|
+
*/
|
|
26
|
+
external_node_modules: string[]
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* a list of additional paths to include in the function bundle. Although our build system includes statically referenced files (like `require("./some-file.js")`) by default, `included_files` lets you specify additional files or directories and reference them dynamically in function code. You can use `*` to match any character or prefix an entry with `!` to exclude files. Paths are relative to the [base directory](https://docs.netlify.com/configure-builds/get-started/#definitions-1).
|
|
30
|
+
*/
|
|
31
|
+
included_files: string[]
|
|
32
|
+
|
|
33
|
+
ignored_node_modules: string[]
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
/* eslint-enable camelcase */
|
|
37
|
+
|
|
38
|
+
export type Functions = Record<GlobPattern, FunctionsObject>
|