@spunto/design-system 0.24.0 → 0.25.0
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
CHANGED
|
@@ -26,7 +26,7 @@ export interface WorkerCardWorker {
|
|
|
26
26
|
name?: string | null
|
|
27
27
|
/** Fallback identity when `name` is empty — renders as "Workspace #3". */
|
|
28
28
|
index?: number | null
|
|
29
|
-
/** Lifecycle state: `provisioning` | `pulling` | `starting` | `setup` | `ready` | `stopping` | `stopped` | `deleting` | `error`. */
|
|
29
|
+
/** Lifecycle state: `provisioning` | `building` | `pulling` | `starting` | `setup` | `ready` | `stopping` | `stopped` | `deleting` | `error`. */
|
|
30
30
|
state?: string | null
|
|
31
31
|
/** Docker-level state: `running` | `stopped` | `exited` | `created` | `not_found` | `error`. */
|
|
32
32
|
dockerState?: string | null
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
// This module is the union of both, plus the transient states (`pulling`,
|
|
7
7
|
// `stopping`, `deleting`) that only ever existed as ad-hoc `if`s above the table.
|
|
8
8
|
//
|
|
9
|
+
// `building` is the odd one out: it is the state a *control plane* reports, and
|
|
10
|
+
// the only one here that Spunto Lite names and the dashboard does not. Both wait
|
|
11
|
+
// for a project image before a container exists — Cloud does it inside
|
|
12
|
+
// `provisioning` and rebuilds the fact client-side by joining the project's image
|
|
13
|
+
// builds, Lite says it in the field. It is deliberately not folded into
|
|
14
|
+
// `pulling`: building an image and pulling one are different waits, and only one
|
|
15
|
+
// of them has a log worth opening.
|
|
16
|
+
//
|
|
9
17
|
// No "use client": pure functions and hookless components, so a React Server
|
|
10
18
|
// Component can call them.
|
|
11
19
|
|
|
@@ -21,6 +29,7 @@ export type WorkerStatusKey =
|
|
|
21
29
|
| "error"
|
|
22
30
|
| "pending"
|
|
23
31
|
| "setup"
|
|
32
|
+
| "building"
|
|
24
33
|
| "pulling"
|
|
25
34
|
| "stopping"
|
|
26
35
|
| "deleting"
|
|
@@ -79,6 +88,7 @@ export const workerStatusConfig: Record<WorkerStatusKey, WorkerStatusConfig> = {
|
|
|
79
88
|
},
|
|
80
89
|
pending: BUSY,
|
|
81
90
|
setup: { ...BUSY, label: "Setting up…" },
|
|
91
|
+
building: { ...BUSY, label: "Building image…" },
|
|
82
92
|
pulling: { ...BUSY, label: "Pulling image…" },
|
|
83
93
|
stopping: { ...BUSY, label: "Stopping…" },
|
|
84
94
|
deleting: { ...BUSY, label: "Deleting…" },
|
|
@@ -99,7 +109,7 @@ const SETUP_STATES = new Set(["provisioning", "starting", "setup"])
|
|
|
99
109
|
* Worker snapshot → one status, tolerant of shapes it has never seen.
|
|
100
110
|
*
|
|
101
111
|
* Order matters: the *lifecycle* state wins whenever it describes an action in
|
|
102
|
-
* flight (deleting, stopping, pulling, setting up), because docker still reports
|
|
112
|
+
* flight (deleting, stopping, building, pulling, setting up), because docker still reports
|
|
103
113
|
* the container as `running` throughout — showing "Running" while a worker is
|
|
104
114
|
* being deleted is the bug this ordering exists to prevent. Past that, the
|
|
105
115
|
* docker state is the truth. Apps with a single `state` field (Spunto Lite) fall
|
|
@@ -120,6 +130,7 @@ export function resolveWorkerStatus(worker: WorkerCardWorker): WorkerStatus {
|
|
|
120
130
|
|
|
121
131
|
if (state === "deleting") return of("deleting")
|
|
122
132
|
if (state === "stopping") return of("stopping")
|
|
133
|
+
if (state === "building") return of("building", { settingUp: true })
|
|
123
134
|
if (state === "pulling") return of("pulling", { settingUp: true })
|
|
124
135
|
if (state && SETUP_STATES.has(state)) return of("setup", { settingUp: true })
|
|
125
136
|
|