@homespunapps/cli 1.6.22 → 1.6.24
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/dist/commands/apps.js +47 -2
- package/dist/help-catalog.js +6 -1
- package/package.json +2 -2
package/dist/commands/apps.js
CHANGED
|
@@ -25,7 +25,7 @@ export async function runApps(args) {
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
if (verb === undefined) {
|
|
28
|
-
fail("missing verb: homespun apps <list|show|update|share-link|delete|wake|watch>", "invalid_args");
|
|
28
|
+
fail("missing verb: homespun apps <list|show|update|share-link|delete|wake|watch|domain>", "invalid_args");
|
|
29
29
|
}
|
|
30
30
|
const sub = {
|
|
31
31
|
positionals: args.positionals.slice(1),
|
|
@@ -50,8 +50,10 @@ export async function runApps(args) {
|
|
|
50
50
|
return runWake(sub);
|
|
51
51
|
case "watch":
|
|
52
52
|
return runWatch(sub);
|
|
53
|
+
case "domain":
|
|
54
|
+
return runDomain(sub);
|
|
53
55
|
default:
|
|
54
|
-
fail(`unknown verb '${verb}': homespun apps <list|show|update|share-link|delete|wake|watch>`, "invalid_args");
|
|
56
|
+
fail(`unknown verb '${verb}': homespun apps <list|show|update|share-link|delete|wake|watch|domain>`, "invalid_args");
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
// ---------------------------------------------------------------------------
|
|
@@ -383,3 +385,46 @@ async function runWatch(args) {
|
|
|
383
385
|
/* never resolves — SIGINT or a terminal condition exits */
|
|
384
386
|
});
|
|
385
387
|
}
|
|
388
|
+
// ---------------------------------------------------------------------------
|
|
389
|
+
// `homespun apps domain <show|add|remove> <app> [domain]`
|
|
390
|
+
//
|
|
391
|
+
// Binding a domain is a two-party job: this side creates the certificate and
|
|
392
|
+
// the routing, and the DOMAIN OWNER publishes the DNS records that prove they
|
|
393
|
+
// hold it. `add` therefore prints those records as its whole point, and
|
|
394
|
+
// `show` reprints them for as long as the domain has not gone active.
|
|
395
|
+
// ---------------------------------------------------------------------------
|
|
396
|
+
const DOMAIN_USAGE = "usage: homespun apps domain <show|add|remove> <app> [domain]";
|
|
397
|
+
async function runDomain(args) {
|
|
398
|
+
const action = args.positionals[0];
|
|
399
|
+
if (action !== "show" && action !== "add" && action !== "remove") {
|
|
400
|
+
fail(DOMAIN_USAGE, "invalid_args");
|
|
401
|
+
}
|
|
402
|
+
assertKnownFlags(args, ...specFor("apps", "domain"));
|
|
403
|
+
const appArg = args.positionals[1];
|
|
404
|
+
if (!appArg)
|
|
405
|
+
fail(DOMAIN_USAGE, "invalid_args");
|
|
406
|
+
const domain = args.positionals[2];
|
|
407
|
+
if (action === "add" && !domain) {
|
|
408
|
+
fail("usage: homespun apps domain add <app> <domain>", "invalid_args");
|
|
409
|
+
}
|
|
410
|
+
const client = makeClient(args);
|
|
411
|
+
const id = await resolveAppId(client, appArg);
|
|
412
|
+
try {
|
|
413
|
+
if (action === "show") {
|
|
414
|
+
printJson(await client.getAppDomain(id));
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
if (action === "add") {
|
|
418
|
+
printJson(await client.setAppDomain(id, domain));
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
// remove: a bare `remove` unbinds every domain the app holds, which is
|
|
422
|
+
// what "remove the custom domain" means to someone who never asked for
|
|
423
|
+
// aliases. Naming one removes just that binding.
|
|
424
|
+
await client.deleteAppDomain(id, domain);
|
|
425
|
+
printJson({ app_id: id, removed: domain ?? "all" });
|
|
426
|
+
}
|
|
427
|
+
catch (e) {
|
|
428
|
+
failFromError(e);
|
|
429
|
+
}
|
|
430
|
+
}
|
package/dist/help-catalog.js
CHANGED
|
@@ -31,7 +31,7 @@ const APPS = {
|
|
|
31
31
|
noun: "apps",
|
|
32
32
|
tagline: "app lifecycle management",
|
|
33
33
|
group: "app",
|
|
34
|
-
rootSummary: "App lifecycle: list, show, update, delete, wake, watch (stream the app's change feed as JSON-lines).",
|
|
34
|
+
rootSummary: "App lifecycle: list, show, update, delete, wake, domain (custom domains), watch (stream the app's change feed as JSON-lines).",
|
|
35
35
|
verbs: [
|
|
36
36
|
{
|
|
37
37
|
verb: "list",
|
|
@@ -89,6 +89,11 @@ const APPS = {
|
|
|
89
89
|
positionals: "<app>",
|
|
90
90
|
summary: "Wakes a dormant app.",
|
|
91
91
|
},
|
|
92
|
+
{
|
|
93
|
+
verb: "domain",
|
|
94
|
+
positionals: "<show|add|remove> <app> [domain]",
|
|
95
|
+
summary: "Manages the app's custom domains. The first domain added serves the app; later ones redirect to it. `add` prints the DNS records the domain owner must publish. `remove` with no domain unbinds them all.",
|
|
96
|
+
},
|
|
92
97
|
{
|
|
93
98
|
verb: "watch",
|
|
94
99
|
positionals: "<app>",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homespunapps/cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.24",
|
|
4
4
|
"description": "Command-line client for the Homespun relay: deploy a real multi-user web app from your agent, then keep reading and writing its data.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"test:unit": "vitest run"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@homespunapps/core": "^1.6.
|
|
39
|
+
"@homespunapps/core": "^1.6.24",
|
|
40
40
|
"qrcode-terminal": "^0.12.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|