@tokenoftrust/cli 4.15.0 → 5.0.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 +1 -1
- package/src/commands/go-live.mjs +27 -7
- package/src/commands/image.mjs +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Token of Trust developer CLI — clone a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Token of Trust",
|
package/src/commands/go-live.mjs
CHANGED
|
@@ -113,6 +113,10 @@ export function normalizeReadiness(r) {
|
|
|
113
113
|
return {
|
|
114
114
|
ownerCapable: o.ownerCapable === true,
|
|
115
115
|
ready: rd.ready === true,
|
|
116
|
+
// Absent is a worker that does not send the field yet: the store stays on
|
|
117
|
+
// the declared path. Only an explicit false is undeclared.
|
|
118
|
+
domainConnect: rd.domainConnect !== false,
|
|
119
|
+
nextStep: typeof rd.nextStep === "string" ? rd.nextStep : "",
|
|
116
120
|
checks,
|
|
117
121
|
blockedReasons: Array.isArray(rd.blockedReasons)
|
|
118
122
|
? rd.blockedReasons.filter((s) => typeof s === "string")
|
|
@@ -201,7 +205,11 @@ export function goLiveReadinessGate(readiness, action) {
|
|
|
201
205
|
|
|
202
206
|
/** Render the readiness itemization — one ✓/✗ line per check + a headline. Pure. */
|
|
203
207
|
export function renderReadiness({ appDomain, readiness, action }) {
|
|
204
|
-
const
|
|
208
|
+
const domainConnect = readiness.domainConnect === true;
|
|
209
|
+
const headline = !domainConnect && action === "connect"
|
|
210
|
+
? `Publish readiness for ${appDomain ?? "this store"}:`
|
|
211
|
+
: `Apex ${action === "rollback" ? "rollback" : "cutover"} readiness for ${appDomain ?? "this store"}:`;
|
|
212
|
+
const lines = ["", ` ${headline}`];
|
|
205
213
|
for (const c of readiness.checks) {
|
|
206
214
|
lines.push(` ${c.ok ? "✓" : "✗"} ${c.label}${c.detail ? ` — ${c.detail}` : ""}`);
|
|
207
215
|
// Blocked checks carry a "how to clear this" remedy from the server gate —
|
|
@@ -213,12 +221,18 @@ export function renderReadiness({ appDomain, readiness, action }) {
|
|
|
213
221
|
"",
|
|
214
222
|
` Uncaptured images by type: ${readiness.imageTypes ? formatImageTypes(readiness.imageTypes) : "not recorded for the live bundle"}`,
|
|
215
223
|
);
|
|
216
|
-
lines.push(
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
lines.push("");
|
|
225
|
+
if (domainConnect) {
|
|
226
|
+
lines.push(
|
|
227
|
+
readiness.ready
|
|
228
|
+
? " All preconditions green. Next: tot go-live --rehearsal."
|
|
229
|
+
: " Not ready — the failing preconditions above block the cutover.",
|
|
230
|
+
);
|
|
231
|
+
} else {
|
|
232
|
+
lines.push(
|
|
233
|
+
` ${readiness.nextStep || "Apex connect is not available for this store. DNS stays with whoever holds the zone."}`,
|
|
234
|
+
);
|
|
235
|
+
}
|
|
222
236
|
}
|
|
223
237
|
return lines;
|
|
224
238
|
}
|
|
@@ -279,6 +293,12 @@ export async function runGoLive(http, { appDomain, action, rehearsal, noOpen, dn
|
|
|
279
293
|
const domain = appDomain || readiness.appDomain;
|
|
280
294
|
for (const line of renderReadiness({ appDomain: domain, readiness, action })) console.log(line);
|
|
281
295
|
|
|
296
|
+
// A store that does not declare Connect apex has nothing to rehearse, confirm,
|
|
297
|
+
// or dispatch. Image rows above are the whole checklist. DNS stays with the zone holder.
|
|
298
|
+
if (readiness.domainConnect !== true) {
|
|
299
|
+
return readiness.ready ? 0 : 1;
|
|
300
|
+
}
|
|
301
|
+
|
|
282
302
|
// 2. Gate — owner-only + (for connect) fail-closed on the readiness verdict.
|
|
283
303
|
const gate = goLiveReadinessGate(readiness, action);
|
|
284
304
|
if (gate.kind === "not-owner") {
|
package/src/commands/image.mjs
CHANGED
|
@@ -59,7 +59,8 @@ Never commit image files to your store repo — the pool holds them, your repo h
|
|
|
59
59
|
these URLs. The same file always prints the same URL; uploading it again is a no-op.
|
|
60
60
|
|
|
61
61
|
Accepted: PNG, JPEG, GIF, WebP, AVIF, up to 8 MiB (30 MiB with the High Fidelity / Large Images
|
|
62
|
-
add-on). SVG is
|
|
62
|
+
add-on), and SVG up to 8 MiB. An SVG is stored sanitized (scripts, event handlers and external
|
|
63
|
+
references removed), so its URL is the hash of the sanitized file; print it with this command.
|
|
63
64
|
|
|
64
65
|
Options:
|
|
65
66
|
--tenant <appDomain> Store to upload to. Defaults to the current checkout's store.
|