Build Log

Steps with their own output and timing bars. Failed steps open by default and successful ones stay closed — nobody opens a build log to read the steps that worked.

src/components/ui/build-log.tsx

About

From the component's own source, where it was written.

A build's steps, each with its own output and duration.

Failed steps open by default and successful ones stay closed. A build log is opened for exactly one reason and it is not to read the successful steps; a fully-expanded log means scrolling past 4,000 lines of dependency installation to find the error.

Durations get a bar relative to the slowest step, so the step that is making the build slow is visible without reading every number. That is the second reason anyone opens a build log.

A running step shows a spinner and no duration rather than a duration that ticks; a number that changes while you read it is harder to compare than one that is simply absent until final.

Install

npx astralyx-ui add build-log

Usage

import { BuildLog } from '@/components/ui/build-log'

<BuildLog steps={steps} />

Composer

Change the props and the source below follows.

  • ✗ src/lib/money.test.ts > rounds half to even
    AssertionError: expected 2.5 to be 2
    at money.test.ts:41:7
    1 failed, 418 passed
Total1m 29s
Props
tsx
<BuildLog steps={steps} />

Examples

A build in progress

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

BuildLog

Extends Omit<ComponentProps<'div'>, 'children'>.

PropTypeDefaultDescription
stepsBuildStep[]required{ id, name, status, duration?, output?, defaultOpen? }.
totalLabelReactNode'Total'—
runningLabelstring'Running'Accessible name for the in-progress spinner.
openfailures only—Expanding everything means scrolling past 4,000 lines of dependency installation to find the error.

Functions

FunctionSignatureDescription
formatBuildDuration(ms: number) => string—

Types

BuildStep

FieldTypeDescription
idstring—
nameReactNode—
statusBuildStepStatus—
duration?numberThe step making the build slow is visible without reading every number — the second reason anyone opens a build log.
output?string—
defaultOpen?booleanOverrides the default open/closed rule.
TypeDefinitionDescription
BuildStepStatus
'success' | 'failed' | 'running' | 'skipped' | 'pending'
A build's steps, each with its own output and duration.

Behaviour

TopicDetailDescription
runningspinner, no durationA number that ticks while you read it is harder to compare than one that is absent until final.