@twobirds/microcomponents 0.9.0 → 0.10.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.
Files changed (45) hide show
  1. package/README.md +2 -16
  2. package/dist/cli/bundle.d.ts +106 -0
  3. package/dist/cli/bundle.d.ts.map +1 -0
  4. package/dist/cli/bundler.d.ts +44 -0
  5. package/dist/cli/bundler.d.ts.map +1 -0
  6. package/dist/cli/create.d.ts.map +1 -1
  7. package/dist/cli/dev.d.ts +87 -0
  8. package/dist/cli/dev.d.ts.map +1 -0
  9. package/dist/cli/dispatch.d.ts +6 -2
  10. package/dist/cli/dispatch.d.ts.map +1 -1
  11. package/dist/cli/index.js +1807 -1
  12. package/dist/cli/inliner.d.ts +42 -0
  13. package/dist/cli/inliner.d.ts.map +1 -0
  14. package/dist/cli/preview.d.ts +48 -0
  15. package/dist/cli/preview.d.ts.map +1 -0
  16. package/dist/core/elements.js +1294 -75
  17. package/dist/core/mcGuards.js +5 -8
  18. package/dist/mcp/api.json +2 -17
  19. package/dist/mcp/concepts/project-layout.md +9 -8
  20. package/dist/mcp/index.js +450 -230
  21. package/dist/microcomponents.js +2882 -9
  22. package/dist/state/formValues.js +2236 -281
  23. package/dist/state/observables.js +1794 -342
  24. package/dist/utils/events.js +171 -197
  25. package/package.json +3 -7
  26. package/dist/cli/create.js +0 -653
  27. package/dist/cli/dispatch.js +0 -316
  28. package/dist/cli/scaffold.js +0 -109
  29. package/dist/cli/writeScaffold.js +0 -114
  30. package/dist/core/MC.js +0 -837
  31. package/dist/core/index.js +0 -72
  32. package/dist/state/index.js +0 -5
  33. package/dist/state/placeholders.js +0 -187
  34. package/dist/types/index.js +0 -1
  35. package/dist/types/mcTypes.js +0 -9
  36. package/dist/utils/autoload.js +0 -160
  37. package/dist/utils/helpers.js +0 -532
  38. package/dist/utils/index.js +0 -12
  39. package/dist/utils/resolveComponentPath.js +0 -39
  40. package/dist/vite/index.d.ts +0 -7
  41. package/dist/vite/index.d.ts.map +0 -1
  42. package/dist/vite/index.js +0 -6
  43. package/dist/vite/loadAssets.d.ts +0 -36
  44. package/dist/vite/loadAssets.d.ts.map +0 -1
  45. package/dist/vite/loadAssets.js +0 -221
package/README.md CHANGED
@@ -75,23 +75,9 @@ There is no hand-written API list in the server. The whole index is extracted fr
75
75
 
76
76
  `get-source-file` reads package-root relative paths (`dist/core/MC.d.ts`, `dist/mcp/concepts/event-system.md`) and refuses any path outside the package sources.
77
77
 
78
- ## Vite Plugin
79
-
80
- The package ships a Vite plugin as its own entry, `@twobirds/microcomponents/vite`, for the bundled production build:
81
-
82
- ```ts
83
- import { loadAssetsPlugin } from '@twobirds/microcomponents/vite';
84
-
85
- export default defineConfig({
86
- plugins: [loadAssetsPlugin(sourceRoot)],
87
- });
88
- ```
89
-
90
- `loadAssetsPlugin` reads the companion `.css` / `.html` files of every DC class that declares `static assets = [...]` and embeds them as a `static _assets` property inside the class, so `loadAssets()` never fetches them at runtime. `mc create` wires it into the generated `vite.config.ts`, which bundles a single `bundle.js` into `public/`.
91
-
92
78
  ## CLI
93
79
 
94
- A small command-line tool scaffolds new components so the tag-to-file convention is never hand-written:
80
+ A small command-line tool scaffolds new components and runs the dev/build/preview chain, with no Vite dependency in the generated project:
95
81
 
96
82
  ```bash
97
83
  pnpm run cli -- new my-card --target-html --target-css
@@ -125,7 +111,7 @@ pnpm run cli -- create --namespace mc --dir mc-app
125
111
  # project "mc" created in mc-app/ — run: cd mc-app && pnpm install && pnpm dev
126
112
  ```
127
113
 
128
- `pnpm dev` runs `tsc -w` and serves `build/`, so a saved component reaches the browser through `autoload()` with nothing bundled; companion assets are mirrored into `build/` next to the compiled component, which is where the autoloader looks for them. `pnpm build` emits one minified `bundle.js` into `public/` with every companion asset inlined by `loadAssetsPlugin`, the concatenated `bundle.css`, and the production shell — a single script tag, no autoloader. `opencode.jsonc` registers the MCP server, so opencode picks it up when you open the project.
114
+ `pnpm dev` runs `mc dev`: `tsc -w` plus a `node:http` server serving `build/`, so a saved component reaches the browser through `autoload()` with nothing bundled; companion assets are mirrored into `build/` next to the compiled component, and the library is resolved through an import map to the served `microcomponents.min.js`. `pnpm build` runs `tsc` then `mc bundle`, which emits one `bundle.js` into `public/` with every companion asset inlined by the CLI bundler, the concatenated `bundle.css`, and the production shell — a single script tag, no autoloader. `pnpm preview` serves `public/`. `opencode.jsonc` registers the MCP server, so opencode picks it up when you open the project.
129
115
 
130
116
  The namespace (1 to 4 lowercase letters) becomes the `src/<namespace>/` folder and the first segment of every component tag, so `mc` is the home of tags like `<mc-app>`. Because the dev shell is the autoload base, `import.meta.url` + the tag-to-path rule resolves `<mc-app>` to `build/mc/app.js` — the compiled starter. New components are served automatically by the autoloader, but the bundle walks one entry, so add each one to `src/<namespace>/bundle.ts`. `--dir` defaults to the namespace, `--dry-run` prints the plan without touching disk.
131
117
 
@@ -0,0 +1,106 @@
1
+ /**
2
+ Filesystem side of `mc bundle`: assembles the production site in `public/` from
3
+ the `tsc`-emitted `build/` tree, with no Vite.
4
+
5
+ The chain is `src/` → `build/` → `public/`. The scaffolded `build` script runs
6
+ `tsc -p tsconfig.json` (so `build/` holds one `.js` per component at its
7
+ autoload path), then `mc bundle` mirrors the companion assets into `build/`,
8
+ walks the barrel entry named by `src/bundle.json` through {@link bundleEntry}
9
+ (inlining every `static assets`), rewrites the `@twobirds/microcomponents`
10
+ specifier to the self-contained `microcomponents.min.js` shipped next to the
11
+ bundle, concatenates the plain `.css` token presets into `bundle.css`, and
12
+ copies the production shell. The result is a complete static site: a single
13
+ `bundle.js` loads every component, no autoloader needed.
14
+
15
+ @module CLI/Bundle
16
+ */
17
+ /**
18
+ * Shape of `src/bundle.json`: the single source of truth for the production bundle.
19
+ * The bundler reads it, so changing the entry, the output name, or the output folder
20
+ * is a config edit in `src/` — not an edit of the CLI.
21
+ */
22
+ export interface BundleConfig {
23
+ /** Barrel entry to bundle, relative to `src/` (e.g. `mc/bundle.ts`). */
24
+ entry: string;
25
+ /** Output file name (default `bundle.js`). */
26
+ fileName?: string;
27
+ /** Output folder, relative to the project root (default `public`). */
28
+ outDir?: string;
29
+ }
30
+ /**
31
+ * Whether a file is a companion asset to mirror into `build/`.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * isCompanion('app.target.html'); // true
36
+ * isCompanion('index.html'); // false
37
+ * ```
38
+ * @param name Basename of the file.
39
+ */
40
+ export declare function isCompanion(name: string): boolean;
41
+ /**
42
+ * Mirror companion assets (`.css`, `.html`, `.json`) from `src/` into `build/`,
43
+ * preserving the tree, so the bundler reads each asset next to its compiled `.js`.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * await mirrorCompanions('<root>/src', '<root>/build');
48
+ * ```
49
+ * @param srcDir Source root to walk.
50
+ * @param buildDir Folder to write into.
51
+ * @param rel Path of the walked directory relative to `srcDir`.
52
+ */
53
+ export declare function mirrorCompanions(srcDir: string, buildDir: string, rel?: string): Promise<void>;
54
+ /**
55
+ * Collect the plain `.css` token presets under `src/`, skipping the companion
56
+ * `.target.css` / `.shadow.css` files, which the bundler inlines into the JS.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const css = await collectPlainCss('<root>/src');
61
+ * ```
62
+ * @param srcDir Source root to walk.
63
+ * @param rel Path of the walked directory relative to `srcDir`.
64
+ * @param found Accumulated absolute paths.
65
+ */
66
+ export declare function collectPlainCss(srcDir: string, rel?: string, found?: string[]): Promise<string[]>;
67
+ /**
68
+ * Rewrite the library specifier in a bundled module to the self-contained bundle
69
+ * shipped next to it, so the browser can resolve `@twobirds/microcomponents`
70
+ * without a bare-specifier import map.
71
+ *
72
+ * @example Turns the package specifier into a relative path.
73
+ * ```ts
74
+ * rewriteLibrarySpecifier("import { DC } from '@twobirds/microcomponents';");
75
+ * ```
76
+ * @param code Bundled module source.
77
+ * @param target Relative specifier to point the import at.
78
+ */
79
+ export declare function rewriteLibrarySpecifier(code: string, target?: string): string;
80
+ /**
81
+ * Assemble the production site in `public/` from the compiled `build/` tree.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * await bundleProject('<root>', { minJs: '<pkg>/dist/microcomponents.min.js' });
86
+ * ```
87
+ * @param projectRoot Project root (the folder holding `src/`, `build/`, `public/`).
88
+ * @param options.minJs Absolute path of the self-contained `microcomponents.min.js` to ship next to the bundle.
89
+ * @param options.bundleEntry Optional override of the barrel entry (defaults to `src/bundle.json`).
90
+ * @returns The names of the files written into `public/`.
91
+ */
92
+ export declare function bundleProject(projectRoot: string, options: {
93
+ minJs: string;
94
+ bundleEntry?: string;
95
+ outDir?: string;
96
+ }): Promise<string[]>;
97
+ /**
98
+ * CLI entry for `mc bundle`: runs {@link bundleProject} against the current
99
+ * project, reading the self-contained library from this package's own `dist/`.
100
+ *
101
+ * @param projectRoot Project root (defaults to the current directory).
102
+ * @param minJs Path of `microcomponents.min.js` (defaults to this package's `dist/`).
103
+ * @returns The process exit code.
104
+ */
105
+ export declare function runBundle(projectRoot?: string, minJs?: string): Promise<number>;
106
+ //# sourceMappingURL=bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/cli/bundle.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;GAeG;AAMH;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGjD;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAYhG;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CACpC,MAAM,EAAE,MAAM,EACd,GAAG,SAAK,EACR,KAAK,GAAE,MAAM,EAAO,GAClB,OAAO,CAAC,MAAM,EAAE,CAAC,CAUnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAA6B,GAAG,MAAM,CAEjG;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAClC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/D,OAAO,CAAC,MAAM,EAAE,CAAC,CAkCnB;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC9B,WAAW,GAAE,MAAsB,EACnC,KAAK,GAAE,MAAuE,GAC5E,OAAO,CAAC,MAAM,CAAC,CAIjB"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ Pure-TypeScript global bundler — no Vite, no Rolldown, no oxc.
3
+
4
+ Reads the `tsc`-emitted ESM files in a project's `build/` and flattens the
5
+ barrel entry's dependency graph into one self-contained ES module. Each source
6
+ module is wrapped in a function scope keyed by its path (relative to the root),
7
+ its `import`/`export` statements are rewritten to a tiny `require` registry,
8
+ and the entry's re-exported names are emitted as the bundle's public exports.
9
+
10
+ When `inline` is set, every module body is first run through
11
+ {@link inlineAssets}, so a DC class declaring `static assets = [...]` gets its
12
+ companion `.css` / `.html` embedded as `static _assets` and `loadAssets()`
13
+ never fetches them at runtime.
14
+
15
+ The rewrite is comment-aware: `import`/`export` lines inside JSDoc `@example`
16
+ blocks are left untouched, so the self-referential `@twobirds/microcomponents`
17
+ specifiers in documentation never break resolution.
18
+
19
+ @module CLI/Bundler
20
+ */
21
+ /**
22
+ * Assemble one entry's flattened ES module string from its collected graph.
23
+ *
24
+ * @example Produces a self-contained bundle for the barrel entry.
25
+ * ```ts
26
+ * const code = await bundleEntry('mc/bundle.js', 'build', true);
27
+ * ```
28
+ * @param entryId Entry module id, relative to `root` (e.g. `mc/bundle.js`).
29
+ * @param root Folder holding the compiled `.js` files.
30
+ * @param inline Inline companion assets into DC classes before wrapping.
31
+ */
32
+ export declare function bundleEntry(entryId: string, root: string, inline?: boolean): Promise<string>;
33
+ /**
34
+ * Token-aware minifier: strips comments and collapses indentation/blank lines.
35
+ * Identifier mangling is intentionally omitted — the registry form is small
36
+ * enough and mangling a hand-rolled tokenizer risks breaking regex literals.
37
+ *
38
+ * @example Collapses a module to comment-free, single-line-per-statement code.
39
+ * ```ts
40
+ * minify(' // note\n export function a() { return 1; }\n');
41
+ * ```
42
+ */
43
+ export declare function minify(code: string): string;
44
+ //# sourceMappingURL=bundler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../src/cli/bundler.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;GAmBG;AA2NH;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAiC/F;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/cli/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;EAkBE;AAUF;;;;;;;;;;EAUE;AACF,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,yCAAyC;AACzC,MAAM,WAAW,aAAa;IAC7B,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;EAYE;AACF,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CA2BhE"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/cli/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;EAkBE;AAUF;;;;;;;;;;EAUE;AACF,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,yCAAyC;AACzC,MAAM,WAAW,aAAa;IAC7B,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;EAYE;AACF,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CA0BhE"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ Vite-free dev server for `mc dev`.
3
+
4
+ A minimal `node:http` static server rooted at the project's `build/` folder, so
5
+ a saved component reaches the browser through `autoload()` with no bundling. It
6
+ mirrors companion assets from `src/` into `build/` (on startup and on every
7
+ change), runs `tsc -w` for the lifetime of the server, serves companion
8
+ `.css` / `.html` / `.json` as raw text (so `loadAssets()` receives markup it
9
+ can use), redirects `/` to the autoload shell (`index-dev.html`), and serves
10
+ the self-contained library at `/microcomponents.min.js` — the target of the
11
+ import map in the dev shell.
12
+
13
+ There is no HMR: a page reload picks up the recompiled component.
14
+
15
+ @module CLI/Dev
16
+ */
17
+ import { type Server } from 'node:http';
18
+ /**
19
+ * Content type for a served file. Companion `.html` / `.json` stay raw text so
20
+ * `loadAssets()` gets usable markup; the page shells are HTML.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * mimeFor('app.target.html'); // 'text/plain'
25
+ * mimeFor('index-dev.html'); // 'text/html'
26
+ * mimeFor('app.js'); // 'text/javascript'
27
+ * ```
28
+ * @param name Basename of the file.
29
+ */
30
+ export declare function mimeFor(name: string): string;
31
+ /**
32
+ * Resolve a request URL to a file to serve, given the served `build/` root and
33
+ * the library bundle. `/` and `/index.html` map to the autoload shell;
34
+ * `/microcomponents.min.js` maps to the library; everything else to `build/`.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * resolveTarget('/mc/app.target.html', buildRoot, minJs);
39
+ * resolveTarget('/', buildRoot, minJs);
40
+ * ```
41
+ * @param url Request URL (path only, no query).
42
+ * @param buildRoot Served folder.
43
+ * @param minJs Absolute path of the self-contained library.
44
+ * @returns Absolute file path, or `undefined` when nothing matches.
45
+ */
46
+ export declare function resolveTarget(url: string, buildRoot: string, minJs: string): string | undefined;
47
+ /**
48
+ * Mirror companion assets from `src/` into `build/`, preserving the tree, so the
49
+ * served folder stays autoload-ready.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * await mirrorInto(sourceRoot, buildRoot);
54
+ * ```
55
+ * @param sourceRoot Source root to walk.
56
+ * @param buildRoot Folder to write into.
57
+ * @param rel Path of the walked directory relative to `sourceRoot`.
58
+ */
59
+ export declare function mirrorInto(sourceRoot: string, buildRoot: string, rel?: string): Promise<void>;
60
+ /**
61
+ * Build the dev server for a project: an `node:http` server rooted at `build/`.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * const server = createDevServer('<root>', { minJs: '<pkg>/dist/microcomponents.min.js', port: 5173 });
66
+ * server.listen(port);
67
+ * ```
68
+ * @param projectRoot Project root (the folder holding `src/`, `build/`).
69
+ * @param options.minJs Absolute path of the self-contained library.
70
+ * @param options.port Dev-server port.
71
+ * @returns The HTTP server (not yet listening).
72
+ */
73
+ export declare function createDevServer(projectRoot: string, options: {
74
+ minJs: string;
75
+ port: number;
76
+ }): Server;
77
+ /**
78
+ * CLI entry for `mc dev`: mirror companions, start the server, and run `tsc -w`
79
+ * for the lifetime of the process.
80
+ *
81
+ * @param projectRoot Project root (defaults to the current directory).
82
+ * @param minJs Path of `microcomponents.min.js` (defaults to this package's `dist/`).
83
+ * @param port Dev-server port.
84
+ * @returns The process exit code (the server keeps running until killed).
85
+ */
86
+ export declare function runDev(projectRoot?: string, minJs?: string, port?: number): Promise<number>;
87
+ //# sourceMappingURL=dev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAsC,KAAK,MAAM,EAAuB,MAAM,WAAW,CAAC;AASjG;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO5C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO/F;AA8BD;;;;;;;;;;;GAWG;AACH,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAW/F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC9B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACtC,MAAM,CAKR;AAED;;;;;;;;GAQG;AAEH,wBAAsB,MAAM,CAC3B,WAAW,GAAE,MAAsB,EACnC,KAAK,GAAE,MAAuE,EAC9E,IAAI,GAAE,MAAa,GACjB,OAAO,CAAC,MAAM,CAAC,CA8BjB"}
@@ -11,7 +11,9 @@ so the command works in any consumer project.
11
11
 
12
12
  @module CLI/Dispatch
13
13
  */
14
- export type Runner = (script: string) => Promise<number>;
14
+ export type Runner = (script: string, options?: {
15
+ port?: number;
16
+ }) => Promise<number>;
15
17
  /**
16
18
  Runs a package.json script through pnpm and resolves with its exit code.
17
19
 
@@ -25,7 +27,9 @@ against the current project, so the command works in any consumer project.
25
27
  const code = await runScript('check');
26
28
  ```
27
29
  */
28
- export declare function runScript(script: string): Promise<number>;
30
+ export declare function runScript(script: string, options?: {
31
+ port?: number;
32
+ }): Promise<number>;
29
33
  /**
30
34
  Parses `argv` and routes it to the matching command, returning a process exit
31
35
  code. `run` is injectable so the script-wrapping commands can be tested without
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/cli/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AA0DF,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAwHzD;;;;;;;;;;;;EAYE;AACF,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ/D;AAED;;;;;;;;;;;;;;;;EAgBE;AACF,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8GnF"}
1
+ {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/cli/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AAoEF,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAwHtF;;;;;;;;;;;;EAYE;AACF,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAW5F;AAED;;;;;;;;;;;;;;;;EAgBE;AACF,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsHnF"}