Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -351,19 +351,14 @@ export class ExtensionInstance<TConfiguration extends BaseConfigType = BaseConfi
extension: this,
options,
stepResults: new Map(),
signal: options.signal,
}

const steps = buildConfig.mode === 'none' ? [] : buildConfig.steps
const steps = buildConfig.steps ?? []

for (const step of steps) {
// eslint-disable-next-line no-await-in-loop
const result = await executeStep(step, context)
context.stepResults.set(step.id, result)

if (!result.success && !step.continueOnError) {
throw new Error(`Build step "${step.displayName}" failed: ${result.error?.message}`)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {Writable} from 'stream'
function buildOptions(): ExtensionBuildOptions {
return {
stdout: new Writable({
write(chunk, encoding, callback) {
write(_chunk, _encoding, callback) {
callback()
},
}),
stderr: new Writable({
write(chunk, encoding, callback) {
write(_chunk, _encoding, callback) {
callback()
},
}),
Expand Down
6 changes: 2 additions & 4 deletions packages/app/src/cli/services/build/build-steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface BuildStep {
/** Step type (determines which executor handles it) */
readonly type:
| 'copy_files'
| 'build_manifest'
| 'build_theme'
| 'bundle_theme'
| 'bundle_ui'
Expand Down Expand Up @@ -60,15 +61,12 @@ export interface BuildContext {

/** Results from previous steps (for step dependencies) */
readonly stepResults: Map<string, StepResult>

/** Custom data that steps can write to (extensible) */
[key: string]: unknown
}

/**
* Result of a step execution
*/
interface StepResult {
export interface StepResult {
readonly stepId: string
readonly displayName: string
readonly success: boolean
Expand Down
Loading
Loading