leglas 1.1.1 → 1.2.0

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/args.d.ts CHANGED
@@ -24,6 +24,9 @@ export type ClassifyChange = {
24
24
  path: string;
25
25
  kind: "change" | "rewrite";
26
26
  };
27
+ /** How far a viewer may reach into the dev server behind a share. */
28
+ export type ShareReach = "open" | "listed";
29
+ export type ShareTunnel = "cloudflared" | "ngrok" | "none";
27
30
  export type ParseResult = {
28
31
  kind: "run";
29
32
  options: RunOptions;
@@ -55,6 +58,16 @@ export type ParseResult = {
55
58
  screenshot: boolean;
56
59
  width: number | null;
57
60
  port: number | null;
61
+ } | {
62
+ kind: "share";
63
+ /** None shares the rail; one shares that direction alone; two compare them. */
64
+ titles: string[];
65
+ reach: ShareReach;
66
+ /** Null lets the running Leglas pick the first tunnel program it finds. */
67
+ tunnel: ShareTunnel | null;
68
+ stop: boolean;
69
+ port: number | null;
70
+ json: boolean;
58
71
  } | {
59
72
  kind: "requests";
60
73
  json: boolean;
@@ -0,0 +1,16 @@
1
+ import { createUpdateService } from "@leglas/server";
2
+ import type { RunOptions } from "./args.js";
3
+ import { run } from "./run.js";
4
+ import { installShutdown } from "./shutdown.js";
5
+ /** Wire the long-running CLI instance to its updater and signal handlers. */
6
+ export declare function startViewer(options: RunOptions & {
7
+ cwd: string;
8
+ }, deps: {
9
+ entry: string;
10
+ version: string;
11
+ open(url: string): Promise<void>;
12
+ realpath?: (path: string) => string;
13
+ createUpdateService?: typeof createUpdateService;
14
+ run?: typeof run;
15
+ installShutdown?: typeof installShutdown;
16
+ }): Promise<void>;