sproutboat 0.4.9 → 0.4.10
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/SURFACE.md +1 -1
- package/package.json +1 -1
- package/src/main.ts +14 -3
package/SURFACE.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> Generated by `src/surface.test.ts` from `src/surface.ts` + the pinned
|
|
4
4
|
> toolchain constants. Do not edit by hand — run `UPDATE_SURFACE=1 bun test`.
|
|
5
5
|
|
|
6
|
-
**Package:** `sproutboat` 0.4.
|
|
6
|
+
**Package:** `sproutboat` 0.4.10 · runs on Bun (use `bunx`, not `npx`)
|
|
7
7
|
|
|
8
8
|
## Commands
|
|
9
9
|
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -409,21 +409,32 @@ async function tail(args: string[]) {
|
|
|
409
409
|
process.stdout.write(await responseText(response, "could not read logs"));
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
-
type DomainView = {
|
|
412
|
+
type DomainView = {
|
|
413
|
+
hostname: string;
|
|
414
|
+
verified: boolean;
|
|
415
|
+
verification: { type: string; name: string; value: string } | null;
|
|
416
|
+
serverAddresses: string[];
|
|
417
|
+
warning?: string;
|
|
418
|
+
};
|
|
413
419
|
function parseDomain(source: string): DomainView | undefined {
|
|
414
420
|
const record = jsonObject(parseJsonValue(source));
|
|
415
421
|
if (!record || !isString(record.hostname) || typeof record.verified !== "boolean") return undefined;
|
|
416
422
|
const v = jsonObject(record.verification ?? null);
|
|
417
423
|
const verification = v && isString(v.type) && isString(v.name) && isString(v.value) ? { type: v.type, name: v.name, value: v.value } : null;
|
|
418
|
-
|
|
424
|
+
const serverAddresses = Array.isArray(record.serverAddresses) ? record.serverAddresses.filter(isString) : [];
|
|
425
|
+
return { hostname: record.hostname, verified: record.verified, verification, serverAddresses, warning: isString(record.warning) ? record.warning : undefined };
|
|
419
426
|
}
|
|
420
427
|
function printDomain(domain: DomainView) {
|
|
421
428
|
const status = domain.verified ? "verified" : "unverified";
|
|
422
429
|
console.log(`${status.padEnd(10)} ${domain.hostname}`);
|
|
423
430
|
if (domain.verification) {
|
|
424
|
-
console.log(
|
|
431
|
+
console.log(" add these DNS records, then run: sproutboat domains verify " + domain.hostname);
|
|
425
432
|
console.log(` ${domain.verification.type} ${domain.verification.name} "${domain.verification.value}"`);
|
|
433
|
+
if (domain.serverAddresses[0]) {
|
|
434
|
+
console.log(` A ${domain.hostname} ${domain.serverAddresses[0]} (point the hostname here, DNS-only / not proxied)`);
|
|
435
|
+
}
|
|
426
436
|
}
|
|
437
|
+
if (domain.warning) console.log(amber(` ! ${domain.warning}`));
|
|
427
438
|
}
|
|
428
439
|
|
|
429
440
|
async function domains(args: string[]) {
|