specv 0.4.0 → 0.4.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.
Files changed (2) hide show
  1. package/dist/server/cli.js +18 -4
  2. package/package.json +1 -2
@@ -347,12 +347,26 @@ data: ${msg.data}
347
347
  return api;
348
348
  };
349
349
 
350
- // src/server/cli.ts
351
- var currentDir = import.meta.dirname;
350
+ // src/server/open-browser.ts
351
+ import { execFile as execFileCb } from "child_process";
352
+ import { promisify } from "util";
353
+ var execFile = promisify(execFileCb);
354
+ var getCommand = (url) => {
355
+ if (process.platform === "darwin") {
356
+ return { args: [url], command: "open" };
357
+ }
358
+ if (process.platform === "win32") {
359
+ return { args: ["/c", "start", "", url], command: "cmd" };
360
+ }
361
+ return { args: [url], command: "xdg-open" };
362
+ };
352
363
  var openInBrowser = async (url) => {
353
- const mod = await import("open");
354
- await mod.default(url);
364
+ const { args, command } = getCommand(url);
365
+ await execFile(command, args);
355
366
  };
367
+
368
+ // src/server/cli.ts
369
+ var currentDir = import.meta.dirname;
356
370
  var DISCONNECT_GRACE_MS = 2e3;
357
371
  var registerLifecycle = (app, onDisconnect) => {
358
372
  let connections = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specv",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Local Markdown preview with GitHub-style rendering",
5
5
  "keywords": [
6
6
  "cli",
@@ -46,7 +46,6 @@
46
46
  "hono": "^4.12.7",
47
47
  "katex": "^0.16.38",
48
48
  "mermaid": "^11.13.0",
49
- "open": "^11.0.0",
50
49
  "rehype-autolink-headings": "^7.1.0",
51
50
  "rehype-katex": "^7.0.1",
52
51
  "rehype-raw": "^7.0.0",