@letterstory/cli 0.176.85 → 0.176.87
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/lib/cli.mjs +2 -1
- package/lib/commands/deploy.mjs +18 -2
- package/lib/commands/replicate.mjs +7 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
86
86
|
|
|
87
87
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
88
|
-
export const VERSION = "0.176.
|
|
88
|
+
export const VERSION = "0.176.87";
|
|
89
89
|
|
|
90
90
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
91
91
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -1983,6 +1983,7 @@ Deploy (websites and apps Letter builds from your words and hosts on their own d
|
|
|
1983
1983
|
deploy update <id> [--name <n>] [--domain <d>] The domain only before it is built
|
|
1984
1984
|
deploy pause <id> | deploy resume <id> | deploy archive <id>
|
|
1985
1985
|
deploy advance <id> [--retry] Move it on now; --retry once blocked_on is done
|
|
1986
|
+
deploy page <id> Add a landing page to it now (Letter adds one a week)
|
|
1986
1987
|
deploy source <id> A link to download its source, as Letter keeps it
|
|
1987
1988
|
deploy connect <id> <owner/name> Move its source to your GitHub repo (empty); it's
|
|
1988
1989
|
pushed once the Letter GitHub App can reach it
|
package/lib/commands/deploy.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// `deploy` — Deployments from a terminal (docs/architecture/deployments.md): websites and apps Letter
|
|
2
2
|
// builds from your words and hosts on their own domains, with your phantoms and benches in the list.
|
|
3
3
|
// Thin wrappers over the deployment tools (create_deployment, list_deployments, get_deployment,
|
|
4
|
-
// update_deployment, advance_deployment), the same lib functions the app calls.
|
|
4
|
+
// update_deployment, advance_deployment, add_deployment_page), the same lib functions the app calls.
|
|
5
5
|
//
|
|
6
6
|
// letterstory deploy create "Build me a website for HVAC contractors to collect leads" [--name <n>] [--domain <d>] [--ref <visual-ref-id>] [--wait]
|
|
7
7
|
// letterstory deploy list [--kind app|phantom|bench]
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
// letterstory deploy update <id> [--name <n>] [--domain <d>]
|
|
10
10
|
// letterstory deploy pause <id> | resume <id> | archive <id>
|
|
11
11
|
// letterstory deploy advance <id> [--retry]
|
|
12
|
+
// letterstory deploy page <id>
|
|
12
13
|
|
|
13
14
|
import { CliError } from "../client.mjs";
|
|
14
15
|
import { argsFromFlags, flagStr, printResult, refuseUnknownFlags } from "./shared.mjs";
|
|
@@ -41,6 +42,7 @@ export const ARGS = {
|
|
|
41
42
|
status: { flag: "status", enum: ["live", "paused", "archived"] },
|
|
42
43
|
},
|
|
43
44
|
advance_deployment: { id: appId, retry: { flag: "retry", type: "bool" } },
|
|
45
|
+
add_deployment_page: { id: appId },
|
|
44
46
|
connect_deployment_repo: {
|
|
45
47
|
id: appId,
|
|
46
48
|
repo_owner: { value: (_flags, positionals) => repoPart(positionals[1], 0) },
|
|
@@ -83,6 +85,9 @@ export async function cmdDeploy(ctx) {
|
|
|
83
85
|
case "advance":
|
|
84
86
|
refuseUnknownFlags(rest, ARGS.advance_deployment, []);
|
|
85
87
|
return deployShow(rest, await call(rest, "advance_deployment"));
|
|
88
|
+
case "page":
|
|
89
|
+
refuseUnknownFlags(rest, ARGS.add_deployment_page, []);
|
|
90
|
+
return deployShow(rest, await call(rest, "add_deployment_page"));
|
|
86
91
|
case "connect":
|
|
87
92
|
return deployShow(rest, await call(rest, "connect_deployment_repo"));
|
|
88
93
|
case "source": {
|
|
@@ -96,7 +101,9 @@ export async function cmdDeploy(ctx) {
|
|
|
96
101
|
return 0;
|
|
97
102
|
}
|
|
98
103
|
default:
|
|
99
|
-
throw new CliError(
|
|
104
|
+
throw new CliError(
|
|
105
|
+
"Usage: deploy [list|create|show|update|pause|resume|archive|advance|page|connect|source]"
|
|
106
|
+
);
|
|
100
107
|
}
|
|
101
108
|
}
|
|
102
109
|
|
|
@@ -135,6 +142,15 @@ function deployShow(ctx, result) {
|
|
|
135
142
|
...(a.source?.pending
|
|
136
143
|
? [` Moving to ${a.source.pending.repo}: ${a.source.pending.note ?? "trying now"}`]
|
|
137
144
|
: []),
|
|
145
|
+
...(a.writing?.state === "on"
|
|
146
|
+
? [
|
|
147
|
+
` Writing posts at /blog from letterbase ${a.writing.collection_id} (automations list --collection ${a.writing.collection_id}), a landing page a week (deploy page ${a.id} adds one now)`,
|
|
148
|
+
]
|
|
149
|
+
: a.writing?.state === "failed"
|
|
150
|
+
? [` Writing not set up: ${a.writing.note ?? "no reason given"} (deploy advance ${a.id} --retry)`]
|
|
151
|
+
: a.writing?.state === "pending"
|
|
152
|
+
? [" Writing starts once the site is live: posts at /blog and a landing page a week"]
|
|
153
|
+
: []),
|
|
138
154
|
];
|
|
139
155
|
if (a.dns?.to_set?.length) {
|
|
140
156
|
lines.push("", `Set these where ${a.domain}'s DNS is:`);
|
|
@@ -180,6 +180,13 @@ function replicationShow(ctx, result) {
|
|
|
180
180
|
function replicationDetail(ctx, result) {
|
|
181
181
|
printResult(ctx.io, ctx.flags, result, (r) => {
|
|
182
182
|
const lines = headline(r.replication);
|
|
183
|
+
// Waiting for its domain to be verified: the tag for the homepage (then advance --retry checks it).
|
|
184
|
+
if (r.domain_verification)
|
|
185
|
+
lines.push(
|
|
186
|
+
"",
|
|
187
|
+
`Add this tag to the <head> of ${r.domain_verification.host}'s homepage:`,
|
|
188
|
+
r.domain_verification.tag
|
|
189
|
+
);
|
|
183
190
|
if (r.pages?.length) {
|
|
184
191
|
lines.push("", "Pages:");
|
|
185
192
|
for (const p of r.pages) {
|