You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -26,31 +26,24 @@ Running `app deploy` shows a spinner with "Deploying..." that auto-succeeds when
26
26
27
27
## Auto-Managed Progress
28
28
29
-
Use the `.progress()`builder method to configure automatic progress indicators. The indicator starts before validation and is automatically stopped on success or failure.
29
+
Use `padroneProgress()` to configure automatic progress indicators. Register it with `.intercept()` on a command. The indicator starts before validation and is automatically stopped on success or failure.
30
30
31
31
### Simple Message
32
32
33
33
```typescript
34
-
.progress('Deploying...')
35
-
```
36
-
37
-
### Boolean Shorthand
38
-
39
-
```typescript
40
-
.progress(true)
41
-
// Shows "Running <command-name>..."
34
+
c.extend(padroneProgress('Deploying...'))
42
35
```
43
36
44
37
### Full Configuration
45
38
46
39
```typescript
47
-
.progress({
40
+
c.extend(padroneProgress({
48
41
validation: 'Validating inputs...', // Shown during async validation
49
42
progress: 'Deploying...', // Shown during execution
50
43
success: 'Deployed successfully!', // Shown on success
51
44
error: 'Deploy failed', // Shown on failure
52
45
spinner: 'line', // Spinner preset
53
-
})
46
+
}))
54
47
```
55
48
56
49
The `validation` message is shown first (during schema validation), then replaced by the `progress` message when execution begins.
@@ -60,19 +53,19 @@ The `validation` message is shown first (during schema validation), then replace
60
53
The `success` and `error` fields accept callbacks that receive the actual result or error:
Lazily-created indicators are automatically stopped (not succeeded/failed) when execution finishes. When the runtime has no progress factory, `ctx.progress` is a silent no-op.
122
+
`padroneProgress()` uses the [context-providing interceptor](/guides/interceptors#context-providing-interceptors) mechanism — it declares `.provides<{ progress: PadroneProgressIndicator }>()`, so `ctx.context.progress` is fully typed when the interceptor is registered on the command.
144
123
145
124
### `PadroneProgressIndicator` Methods
146
125
@@ -167,24 +146,24 @@ Padrone includes four built-in spinner presets:
When auto-progress is active, `runtime.output` and `runtime.error` are automatically wrapped to pause/resume the spinner. This prevents garbled output when writing to the terminal while a spinner is animating.
250
229
251
-
Manual calls to `ctx.progress.pause()` and `ctx.progress.resume()` are available if you need explicit control.
230
+
Manual calls to `ctx.context.progress.pause()` and `ctx.context.progress.resume()` are available if you need explicit control.
252
231
253
232
## Integration with Interceptors
254
233
255
-
Progress indicators interact naturally with the interceptor system. The indicator starts before validation interceptors run and is cleaned up in the lifecycle shutdown. Interceptor errors are caught and reflected in the progress indicator:
234
+
Progress indicators interact naturally with the interceptor system. The indicator starts before validation interceptors run and is cleaned up after execution. Interceptor errors are caught and reflected in the progress indicator:
0 commit comments