specv 0.7.0 → 0.7.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/dist/server/cli.js +7 -1
- package/package.json +1 -1
package/dist/server/cli.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// src/server/cli.ts
|
|
4
4
|
import fs5 from "fs";
|
|
5
5
|
import path5 from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
6
7
|
import { serve } from "@hono/node-server";
|
|
7
8
|
import { serveStatic } from "@hono/node-server/serve-static";
|
|
8
9
|
import { program } from "commander";
|
|
@@ -391,6 +392,11 @@ var displayQrCode = (url) => {
|
|
|
391
392
|
};
|
|
392
393
|
|
|
393
394
|
// src/server/cli.ts
|
|
395
|
+
var packageJsonPath = path5.resolve(
|
|
396
|
+
path5.dirname(fileURLToPath(import.meta.url)),
|
|
397
|
+
"../../package.json"
|
|
398
|
+
);
|
|
399
|
+
var pkg = JSON.parse(fs5.readFileSync(packageJsonPath, "utf8"));
|
|
394
400
|
var currentDir = import.meta.dirname;
|
|
395
401
|
var DISCONNECT_GRACE_MS = 2e3;
|
|
396
402
|
var registerLifecycle = (app, onDisconnect) => {
|
|
@@ -447,7 +453,7 @@ var getNetworkConfig = (options) => ({
|
|
|
447
453
|
enableNetwork: options.host,
|
|
448
454
|
hostname: options.host ? "0.0.0.0" : "127.0.0.1"
|
|
449
455
|
});
|
|
450
|
-
program.name("specv").description("Local Markdown preview with GitHub-style rendering").version(
|
|
456
|
+
program.name("specv").description("Local Markdown preview with GitHub-style rendering").version(pkg.version).option("-p, --port <number>", "Port number", "4649").option("--host", "Expose to local network (enables QR code)").option("--no-auto-close", "Disable auto-close on client disconnect").action((options) => {
|
|
451
457
|
const baseDir = process.cwd();
|
|
452
458
|
const startPort = Number.parseInt(options.port, 10);
|
|
453
459
|
const clientDir = path5.join(currentDir, "../client");
|