@getdial/cli 0.2.0 → 0.2.2
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/cli.js +2 -1
- package/dist/commands/doctor.js +2 -1
- package/dist/lib/version.js +8 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { VERSION } from "./lib/version.js";
|
|
3
4
|
import { runDoctor } from "./commands/doctor.js";
|
|
4
5
|
import { runSignup } from "./commands/signup.js";
|
|
5
6
|
import { runOnboard } from "./commands/onboard.js";
|
|
@@ -15,7 +16,7 @@ const program = new Command();
|
|
|
15
16
|
program
|
|
16
17
|
.name("dial")
|
|
17
18
|
.description("Dial CLI — set up your account and run the listen service.")
|
|
18
|
-
.version(
|
|
19
|
+
.version(VERSION);
|
|
19
20
|
program
|
|
20
21
|
.command("doctor")
|
|
21
22
|
.description("Report state and what to do next.")
|
package/dist/commands/doctor.js
CHANGED
|
@@ -2,6 +2,7 @@ import { readPendingSignup, readAuth } from "../lib/state.js";
|
|
|
2
2
|
import { apiGet, baseUrl, pingBackend } from "../lib/api.js";
|
|
3
3
|
import { supervisorStatus, lastEventAtFromLog } from "../lib/supervisor/index.js";
|
|
4
4
|
import { paths } from "../lib/paths.js";
|
|
5
|
+
import { VERSION } from "../lib/version.js";
|
|
5
6
|
const OTP_EXPIRY_MS = 10 * 60 * 1000;
|
|
6
7
|
async function buildReport() {
|
|
7
8
|
const ping = await pingBackend();
|
|
@@ -45,7 +46,7 @@ async function buildReport() {
|
|
|
45
46
|
nextStep = "ready";
|
|
46
47
|
}
|
|
47
48
|
return {
|
|
48
|
-
cli: { version:
|
|
49
|
+
cli: { version: VERSION, node: process.versions.node },
|
|
49
50
|
backend: { url: baseUrl(), reachable: ping.reachable, latency_ms: ping.latencyMs },
|
|
50
51
|
auth: {
|
|
51
52
|
signed_in: Boolean(auth),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
// Resolves the published package.json regardless of where the compiled
|
|
5
|
+
// module lands (dist/lib/version.js → ../../package.json at the package root).
|
|
6
|
+
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "package.json");
|
|
7
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
8
|
+
export const VERSION = pkg.version;
|