@flanksource/page-runtime 0.0.0-stage → 0.1.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/LICENSE +17 -0
- package/README.md +494 -2
- package/dist/build/README.md +96 -0
- package/dist/build/cjs-export-names.mjs +24 -0
- package/dist/build/dependencies.mjs +279 -0
- package/dist/build/dependencies.mjs.map +1 -0
- package/dist/build/dependency-cache-Zg-FGasE.mjs +2130 -0
- package/dist/build/dependency-cache-Zg-FGasE.mjs.map +1 -0
- package/dist/build/index.mjs +42 -0
- package/dist/build/index.mjs.map +1 -0
- package/dist/build/package.json +19 -0
- package/dist/build/types/activity-schema.d.ts +62 -0
- package/dist/build/types/build/barrels.d.ts +70 -0
- package/dist/build/types/build/base.d.ts +2 -0
- package/dist/build/types/build/browser-runtime-exports.d.ts +19 -0
- package/dist/build/types/build/check-fragment.d.ts +5 -0
- package/dist/build/types/build/commonjs-exports.d.ts +5 -0
- package/dist/build/types/build/convert-commonjs.d.ts +12 -0
- package/dist/build/types/build/dependencies.d.ts +6 -0
- package/dist/build/types/build/dependency-barrel-index.d.ts +5 -0
- package/dist/build/types/build/dependency-barrels.d.ts +7 -0
- package/dist/build/types/build/dependency-cache.d.ts +7 -0
- package/dist/build/types/build/dependency-optional.d.ts +4 -0
- package/dist/build/types/build/dependency-plugin.d.ts +8 -0
- package/dist/build/types/build/dependency-runtime.d.ts +20 -0
- package/dist/build/types/build/dependency-workers.d.ts +8 -0
- package/dist/build/types/build/errors.d.ts +9 -0
- package/dist/build/types/build/fragment.d.ts +13 -0
- package/dist/build/types/build/index.d.ts +7 -0
- package/dist/build/types/build/library-runtime.d.ts +21 -0
- package/dist/build/types/build/module-utils.d.ts +3 -0
- package/dist/build/types/build/recipe-dependencies.d.ts +2 -0
- package/dist/build/types/build/runtime-entries.d.ts +4 -0
- package/dist/build/types/build/runtime-layer.d.ts +17 -0
- package/dist/build/types/build/trace.d.ts +140 -0
- package/dist/build/types/design-schema.d.ts +98 -0
- package/dist/build/types/host/agent-source.d.ts +2 -0
- package/dist/build/types/host/agent-validation.d.ts +3 -0
- package/dist/build/types/host/design-validation.d.ts +2 -0
- package/dist/build/types/host/message-values.d.ts +8 -0
- package/dist/build/types/host/review/validation.d.ts +5 -0
- package/dist/build/types/host/validation.d.ts +6 -0
- package/dist/build/types/link/page-sources.d.ts +31 -0
- package/dist/build/types/link/types.d.ts +62 -0
- package/dist/build/types/link/validation.d.ts +9 -0
- package/dist/build/types/markers.d.ts +10 -0
- package/dist/build/types/review-schema.d.ts +60 -0
- package/dist/build/types/schema.d.ts +319 -0
- package/dist/build/types/sw/barrels.d.ts +9 -0
- package/dist/build/types/sw/compiler-plugins.d.ts +6 -0
- package/dist/build/types/sw/composition.d.ts +8 -0
- package/dist/build/types/sw/module-transform.d.ts +68 -0
- package/dist/build/types/sw/profile.d.ts +7 -0
- package/dist/build/types/sw/source-provider.d.ts +7 -0
- package/dist/build/types/sw/versions.d.ts +10 -0
- package/dist/node/catalog.mjs +1 -0
- package/dist/node/chunks/publication-RchcQvxD.mjs +229 -0
- package/dist/node/chunks/publication-RchcQvxD.mjs.map +1 -0
- package/dist/node/chunks/schema-CaRTfg2x.mjs +12 -0
- package/dist/node/chunks/schema-CaRTfg2x.mjs.map +1 -0
- package/dist/node/dev.mjs +410 -0
- package/dist/node/dev.mjs.map +1 -0
- package/dist/node/publication/cli.mjs +13 -0
- package/dist/node/publication/cli.mjs.map +1 -0
- package/dist/node/publication.mjs +1 -0
- package/dist/node/schema.mjs +1 -0
- package/dist/node/styles.mjs +49 -0
- package/dist/node/styles.mjs.map +1 -0
- package/dist/static/boot.js +40938 -0
- package/dist/static/boot.js.map +1 -0
- package/dist/static/bootstrap.html +1 -0
- package/dist/static/devtools-hook.js +118 -0
- package/dist/static/document-bundle.js +1 -0
- package/dist/static/document.js +2621 -0
- package/dist/static/editing.js +37 -0
- package/dist/static/export-compiler.js +81521 -0
- package/dist/static/export-compiler.js.map +1 -0
- package/dist/static/page-agent.js +17193 -0
- package/dist/static/page-agent.js.map +1 -0
- package/dist/static/sw.js +86112 -0
- package/dist/static/sw.js.map +1 -0
- package/package.json +110 -3
- package/scripts/build-builder.ts +27 -0
- package/scripts/build-library-runtime.ts +9 -0
- package/scripts/build-node.ts +26 -0
- package/scripts/build-static.ts +86 -0
- package/scripts/build.ts +7 -0
- package/scripts/check-fragment.ts +12 -0
- package/scripts/local-workspaces.ts +55 -0
- package/scripts/react-externals.ts +18 -0
- package/scripts/release-version.ts +47 -0
- package/scripts/run-package-build.ts +8 -0
- package/scripts/serve-packages.ts +8 -0
- package/src/activity-schema.ts +92 -0
- package/src/build/README.md +96 -0
- package/src/build/barrels.ts +306 -0
- package/src/build/base.ts +2 -0
- package/src/build/browser-runtime-exports.ts +52 -0
- package/src/build/check-fragment.ts +45 -0
- package/src/build/cjs-export-names.mjs +24 -0
- package/src/build/commonjs-exports.ts +24 -0
- package/src/build/convert-commonjs.ts +183 -0
- package/src/build/dependencies.ts +6 -0
- package/src/build/dependency-barrel-index.ts +48 -0
- package/src/build/dependency-barrels.ts +80 -0
- package/src/build/dependency-cache.ts +40 -0
- package/src/build/dependency-optional.ts +15 -0
- package/src/build/dependency-plugin.ts +58 -0
- package/src/build/dependency-runtime.ts +182 -0
- package/src/build/dependency-workers.ts +41 -0
- package/src/build/errors.ts +9 -0
- package/src/build/fragment.ts +89 -0
- package/src/build/index.ts +7 -0
- package/src/build/library-runtime.ts +101 -0
- package/src/build/module-utils.ts +11 -0
- package/src/build/recipe-dependencies.ts +14 -0
- package/src/build/runtime-entries.ts +10 -0
- package/src/build/runtime-layer.ts +99 -0
- package/src/build/trace.ts +431 -0
- package/src/design-schema.ts +25 -0
- package/src/dev/README.md +78 -0
- package/src/dev/catalog.ts +79 -0
- package/src/dev/cli.ts +25 -0
- package/src/dev/index.ts +118 -0
- package/src/dev/runtime-origin.ts +63 -0
- package/src/editing.ts +25 -0
- package/src/form/entry-source.ts +68 -0
- package/src/form/form-page.ts +63 -0
- package/src/form/index.ts +2 -0
- package/src/form/source-update.ts +17 -0
- package/src/frame/activity.browser.ts +34 -0
- package/src/frame/activity.ts +52 -0
- package/src/frame/agent/README.md +47 -0
- package/src/frame/agent/agent.browser.ts +127 -0
- package/src/frame/agent/design.ts +62 -0
- package/src/frame/agent/frame-layout.ts +54 -0
- package/src/frame/agent/index.ts +151 -0
- package/src/frame/agent/overlay.ts +104 -0
- package/src/frame/agent/owner.ts +61 -0
- package/src/frame/agent/provider.tsx +14 -0
- package/src/frame/agent/react-override.ts +55 -0
- package/src/frame/agent/review.browser.ts +65 -0
- package/src/frame/agent/review.ts +108 -0
- package/src/frame/agent/testing/callsite.tsx +5 -0
- package/src/frame/agent/testing/client.ts +99 -0
- package/src/frame/agent/testing/library.ts +3 -0
- package/src/frame/agent/testing/modal.tsx +5 -0
- package/src/frame/agent/testing/review-client.ts +43 -0
- package/src/frame/agent/testing/review-server.ts +31 -0
- package/src/frame/agent/testing/server.ts +72 -0
- package/src/frame/agent/testing/vocabulary-host.ts +20 -0
- package/src/frame/agent/testing/vocabulary.tsx +10 -0
- package/src/frame/agent/vitest.browser.config.ts +6 -0
- package/src/frame/agent/vocabulary.browser.ts +30 -0
- package/src/frame/agent/vocabulary.ts +13 -0
- package/src/frame/agent.ts +3 -0
- package/src/frame/boot-styles.ts +50 -0
- package/src/frame/boot.ts +269 -0
- package/src/frame/bridge.ts +27 -0
- package/src/frame/devtools-hook.ts +1 -0
- package/src/frame/document-assets.ts +76 -0
- package/src/frame/document-entry.ts +68 -0
- package/src/frame/document-modules.ts +113 -0
- package/src/frame/document-mount.ts +32 -0
- package/src/frame/entry.ts +4 -0
- package/src/frame/export-compiler.ts +18 -0
- package/src/frame/export-page.ts +61 -0
- package/src/frame/export.ts +89 -0
- package/src/frame/index.ts +8 -0
- package/src/frame/local-runtime.browser.ts +36 -0
- package/src/frame/mount-page.ts +36 -0
- package/src/frame/page-agent.ts +2 -0
- package/src/frame/readiness.ts +51 -0
- package/src/frame/render-job.ts +101 -0
- package/src/frame/review-integration.browser.ts +48 -0
- package/src/frame/runtime.browser.ts +90 -0
- package/src/frame/tailwind/README.md +49 -0
- package/src/frame/tailwind/boot-styles.browser.ts +18 -0
- package/src/frame/tailwind/cache.ts +20 -0
- package/src/frame/tailwind/load.ts +75 -0
- package/src/frame/tailwind/recipe.ts +76 -0
- package/src/frame/tailwind/runtime.ts +113 -0
- package/src/frame/tailwind/store.ts +55 -0
- package/src/frame/tailwind/stylesheets.ts +42 -0
- package/src/frame/tailwind/tailwind.browser.ts +71 -0
- package/src/frame/tailwind/testing/client.ts +133 -0
- package/src/frame/tailwind/testing/compare.ts +91 -0
- package/src/frame/tailwind/testing/pages.ts +14 -0
- package/src/frame/tailwind/testing/server.ts +89 -0
- package/src/frame/tailwind/vitest.browser.config.ts +7 -0
- package/src/frame/testing/boot-layout.ts +3 -0
- package/src/frame/testing/boot-page.ts +3 -0
- package/src/frame/testing/host.ts +78 -0
- package/src/frame/testing/local-host.tsx +33 -0
- package/src/frame/testing/server.ts +135 -0
- package/src/host/BuildLog.tsx +28 -0
- package/src/host/DEBUG_CONSOLE.md +13 -0
- package/src/host/PageForm.tsx +63 -0
- package/src/host/PageFrame.tsx +49 -0
- package/src/host/RuntimeActivity.tsx +77 -0
- package/src/host/RuntimeDebugPanel.tsx +18 -0
- package/src/host/activity-state.ts +69 -0
- package/src/host/agent-source.ts +14 -0
- package/src/host/agent-validation.ts +73 -0
- package/src/host/bridge.ts +56 -0
- package/src/host/build-log.ts +29 -0
- package/src/host/clear-cache.ts +66 -0
- package/src/host/debug-runtime.tsx +17 -0
- package/src/host/design-validation.ts +96 -0
- package/src/host/index.ts +12 -0
- package/src/host/link/index.ts +66 -0
- package/src/host/link/transport.ts +68 -0
- package/src/host/link/watch.ts +62 -0
- package/src/host/message-values.ts +55 -0
- package/src/host/origin.ts +7 -0
- package/src/host/review/README.md +32 -0
- package/src/host/review/index.ts +43 -0
- package/src/host/review/validation.ts +55 -0
- package/src/host/runtime-diagnostics.ts +41 -0
- package/src/host/validation.ts +148 -0
- package/src/link/README.md +115 -0
- package/src/link/barrels.ts +5 -0
- package/src/link/build-cli.ts +12 -0
- package/src/link/build.ts +99 -0
- package/src/link/commonjs.ts +39 -0
- package/src/link/examples/server.ts +18 -0
- package/src/link/index.ts +6 -0
- package/src/link/link.browser.ts +66 -0
- package/src/link/local-relay.browser.ts +22 -0
- package/src/link/overrides.ts +69 -0
- package/src/link/page-sources.ts +69 -0
- package/src/link/source.ts +25 -0
- package/src/link/storage.ts +32 -0
- package/src/link/testing/client.ts +96 -0
- package/src/link/testing/folder.ts +19 -0
- package/src/link/testing/local-client.ts +30 -0
- package/src/link/testing/local-server.ts +26 -0
- package/src/link/testing/local-worker.ts +17 -0
- package/src/link/testing/server.ts +131 -0
- package/src/link/testing/worker.ts +32 -0
- package/src/link/testing-cache.ts +20 -0
- package/src/link/testing-fixtures.ts +16 -0
- package/src/link/types.ts +27 -0
- package/src/link/validation.ts +44 -0
- package/src/link/vitest.browser.config.ts +3 -0
- package/src/markers.ts +18 -0
- package/src/publication/build.ts +27 -0
- package/src/publication/fixtures/build.mjs +2 -0
- package/src/publication/index.ts +3 -0
- package/src/publication/lock.ts +32 -0
- package/src/publication/manifest.ts +14 -0
- package/src/publication/publish.ts +80 -0
- package/src/publication/runtime.ts +28 -0
- package/src/publication/schema.ts +13 -0
- package/src/review-schema.ts +17 -0
- package/src/schema.ts +175 -0
- package/src/storage/db.ts +64 -0
- package/src/styles.ts +40 -0
- package/src/sw/activity.ts +66 -0
- package/src/sw/barrels.ts +44 -0
- package/src/sw/candidates.ts +14 -0
- package/src/sw/compile.ts +92 -0
- package/src/sw/compiler-columns.ts +44 -0
- package/src/sw/compiler-internals.d.ts +8 -0
- package/src/sw/compiler-plugins.ts +18 -0
- package/src/sw/compiler.ts +93 -0
- package/src/sw/composition.ts +86 -0
- package/src/sw/content-types.ts +28 -0
- package/src/sw/converted.browser.ts +31 -0
- package/src/sw/converted.ts +64 -0
- package/src/sw/editable-sites.ts +42 -0
- package/src/sw/errors.ts +30 -0
- package/src/sw/esm-sh-fixtures/browser-client.ts +18 -0
- package/src/sw/esm-sh-fixtures/browser-server.ts +104 -0
- package/src/sw/esm-sh-fixtures/fixtures/copy-to-clipboard-entry.headers +15 -0
- package/src/sw/esm-sh-fixtures/fixtures/copy-to-clipboard-entry.mjs.txt +3 -0
- package/src/sw/esm-sh-fixtures/fixtures/copy-to-clipboard-module.headers +13 -0
- package/src/sw/esm-sh-fixtures/fixtures/copy-to-clipboard-module.mjs.txt +142 -0
- package/src/sw/esm-sh-fixtures/fixtures/react-copy-to-clipboard-entry.headers +15 -0
- package/src/sw/esm-sh-fixtures/fixtures/react-copy-to-clipboard-entry.mjs.txt +3 -0
- package/src/sw/esm-sh-fixtures/fixtures/react-copy-to-clipboard-module.headers +11 -0
- package/src/sw/esm-sh-fixtures/fixtures/react-copy-to-clipboard-module.mjs.txt +222 -0
- package/src/sw/esm-sh-fixtures/fixtures/toggle-selection-entry.headers +14 -0
- package/src/sw/esm-sh-fixtures/fixtures/toggle-selection-entry.mjs.txt +3 -0
- package/src/sw/esm-sh-fixtures/fixtures/toggle-selection-module.headers +11 -0
- package/src/sw/esm-sh-fixtures/fixtures/toggle-selection-module.mjs.txt +76 -0
- package/src/sw/esm-sh-fixtures/fixtures.ts +54 -0
- package/src/sw/esm-sh-fixtures/redact.ts +1 -0
- package/src/sw/index.ts +7 -0
- package/src/sw/integrity.ts +10 -0
- package/src/sw/legacy-storage.ts +18 -0
- package/src/sw/link-activity.ts +21 -0
- package/src/sw/link-cache.ts +19 -0
- package/src/sw/link-compiler.ts +120 -0
- package/src/sw/link-folder.ts +29 -0
- package/src/sw/link-relay.ts +40 -0
- package/src/sw/link-route.ts +239 -0
- package/src/sw/link-source.ts +41 -0
- package/src/sw/markers.ts +128 -0
- package/src/sw/module-transform.ts +364 -0
- package/src/sw/page-clients.ts +45 -0
- package/src/sw/profile.ts +90 -0
- package/src/sw/resolver.ts +224 -0
- package/src/sw/router.ts +360 -0
- package/src/sw/runtime-exports.ts +39 -0
- package/src/sw/runtime-module.ts +13 -0
- package/src/sw/source-hash.ts +37 -0
- package/src/sw/source-provider.ts +20 -0
- package/src/sw/versions.ts +96 -0
- package/src/sw/worker.ts +91 -0
- package/static/README.md +15 -0
- package/static/profile.example.json +15 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { parseSync } from "rolldown/utils";
|
|
2
|
+
import type { ImportMap, BarrelIndex } from "../schema.ts";
|
|
3
|
+
import { type TracedFile } from "./trace.ts";
|
|
4
|
+
type ModuleRecord = ReturnType<typeof parseSync>["module"];
|
|
5
|
+
/** What a module imports and exports, reduced to what barrel resolution needs. */
|
|
6
|
+
export type ModuleShape = {
|
|
7
|
+
/** Local binding → the module request it comes from and the name imported there (`*` for a namespace). */
|
|
8
|
+
imports: Map<string, {
|
|
9
|
+
from: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}>;
|
|
12
|
+
/** Exported name → the request and name it forwards, or only a local name for a binding defined here. */
|
|
13
|
+
exports: Map<string, {
|
|
14
|
+
from?: string;
|
|
15
|
+
name: string;
|
|
16
|
+
}>;
|
|
17
|
+
/** Requests of `export * from`. */
|
|
18
|
+
stars: string[];
|
|
19
|
+
/** Requests imported only for their side effects (`import "x"`). */
|
|
20
|
+
sideEffectImports: string[];
|
|
21
|
+
};
|
|
22
|
+
export type BarrelLocation = {
|
|
23
|
+
url: string;
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function shapeOf(module: ModuleRecord): ModuleShape;
|
|
27
|
+
export type BarrelIndexInput = {
|
|
28
|
+
/** Candidate barrels. */
|
|
29
|
+
urls: string[];
|
|
30
|
+
shape: (url: string) => ModuleShape | null;
|
|
31
|
+
/** The URL a module request in `url` loads, or null when it leaves the indexed files. */
|
|
32
|
+
resolve: (url: string, specifier: string) => string | null;
|
|
33
|
+
/** Whether the module's package declares it free of side effects, so a page may skip evaluating it. */
|
|
34
|
+
sideEffectFree: (url: string) => boolean;
|
|
35
|
+
};
|
|
36
|
+
export type BuiltBarrelIndex = {
|
|
37
|
+
index: BarrelIndex;
|
|
38
|
+
/** Modules declared side-effect-free that still cannot be skipped, with the reason. */
|
|
39
|
+
kept: Array<{
|
|
40
|
+
url: string;
|
|
41
|
+
reason: string;
|
|
42
|
+
}>;
|
|
43
|
+
/** Forwarding modules whose package does not declare them side-effect-free. */
|
|
44
|
+
blocked: string[];
|
|
45
|
+
names: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Follows every forwarding module's exports to the module that defines each name, the way a bundler honouring
|
|
49
|
+
* `sideEffects` skips re-export modules. A hop goes through a module only when that module may be skipped. A name the
|
|
50
|
+
* index cannot place exactly (a namespace, an ambiguous or unresolvable `export *`) stops at the module where the
|
|
51
|
+
* browser's own resolution would continue, which is always safe to import from.
|
|
52
|
+
*/
|
|
53
|
+
export declare function buildBarrelIndex(input: BarrelIndexInput): BuiltBarrelIndex;
|
|
54
|
+
/** Whether a package's `sideEffects` declaration lets a bundler skip the file at a package-relative path. */
|
|
55
|
+
export declare function sideEffectsRule(declaration: unknown, id: string): (path: string) => boolean;
|
|
56
|
+
export type LibraryBarrelOptions = {
|
|
57
|
+
files: Map<string, TracedFile>;
|
|
58
|
+
remapped: Set<string>;
|
|
59
|
+
/** A composed import map; the index never follows a hop into converted runtime files. */
|
|
60
|
+
map: ImportMap;
|
|
61
|
+
};
|
|
62
|
+
export type LibraryBarrelIndex = BuiltBarrelIndex & {
|
|
63
|
+
/** Forwarding modules each package does not declare side-effect-free, by `name@version`. */
|
|
64
|
+
undeclared: Record<string, number>;
|
|
65
|
+
ms: number;
|
|
66
|
+
bytes: number;
|
|
67
|
+
};
|
|
68
|
+
/** Builds the barrel index the libraries would publish, over every ESM file of a library set. */
|
|
69
|
+
export declare function libraryBarrelIndex(options: LibraryBarrelOptions): LibraryBarrelIndex;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type RuntimeExport } from "./runtime-layer.ts";
|
|
2
|
+
export declare function buildBrowserRuntimeExports(options: {
|
|
3
|
+
root: string;
|
|
4
|
+
entries: Record<string, RuntimeExport>;
|
|
5
|
+
outDir: string;
|
|
6
|
+
runtimeBase: string;
|
|
7
|
+
inherited: string[];
|
|
8
|
+
}): Promise<{
|
|
9
|
+
fragment: import("./index.ts").Fragment;
|
|
10
|
+
versions: {
|
|
11
|
+
[k: string]: string;
|
|
12
|
+
};
|
|
13
|
+
packages: {
|
|
14
|
+
[k: string]: string;
|
|
15
|
+
};
|
|
16
|
+
files: {
|
|
17
|
+
[k: string]: string;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ClosureTracer } from "./trace.ts";
|
|
2
|
+
export type ConversionStats = {
|
|
3
|
+
entries: number;
|
|
4
|
+
chunks: number;
|
|
5
|
+
bytes: number;
|
|
6
|
+
ms: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Converts every CommonJS-only entry the tracer found into the development runtime set. Converting
|
|
10
|
+
* can reach ESM packages, whose imports can reach more CommonJS entries, so discovery repeats until it is stable.
|
|
11
|
+
*/
|
|
12
|
+
export declare function convertCommonJs(tracer: ClosureTracer, outDir: string): Promise<ConversionStats[]>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { buildDependencyRuntime, buildInstalledDependencyRuntime, type DependencyRuntime, type DependencyRuntimeOptions } from "./dependency-runtime.ts";
|
|
2
|
+
export { ensureDependencyRuntime, type CachedDependencyRuntime } from "./dependency-cache.ts";
|
|
3
|
+
export { dependencyRuntimePlugin } from "./dependency-plugin.ts";
|
|
4
|
+
export { runtimeEntries } from "./runtime-entries.ts";
|
|
5
|
+
export { discoverRuntimeExports, runtimeExportPins, type RuntimeExport } from "./runtime-layer.ts";
|
|
6
|
+
export { buildBrowserRuntimeExports } from "./browser-runtime-exports.ts";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type DependencyRuntime, type DependencyRuntimeOptions } from "./dependency-runtime.ts";
|
|
2
|
+
export type CachedDependencyRuntime = DependencyRuntime & {
|
|
3
|
+
root: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function ensureDependencyRuntime(options: Omit<DependencyRuntimeOptions, "outDir"> & {
|
|
6
|
+
cacheDir: string;
|
|
7
|
+
}): Promise<CachedDependencyRuntime>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Plugin } from "rolldown";
|
|
2
|
+
import { type CachedDependencyRuntime } from "./dependency-cache.ts";
|
|
3
|
+
export declare function dependencyRuntimePlugin(options: {
|
|
4
|
+
root: string;
|
|
5
|
+
cacheDir: string;
|
|
6
|
+
base: CachedDependencyRuntime;
|
|
7
|
+
versions?: Record<string, string>;
|
|
8
|
+
}): Plugin;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DependencyRuntimeOptions {
|
|
2
|
+
root: string;
|
|
3
|
+
outDir: string;
|
|
4
|
+
entries: string[];
|
|
5
|
+
target: "node" | "browser";
|
|
6
|
+
external?: Record<string, string>;
|
|
7
|
+
externalVersions?: Record<string, string>;
|
|
8
|
+
resolvedEntries?: Record<string, string>;
|
|
9
|
+
exports?: Record<string, string[]>;
|
|
10
|
+
}
|
|
11
|
+
export interface DependencyRuntime {
|
|
12
|
+
schema: 1;
|
|
13
|
+
target: "node" | "browser";
|
|
14
|
+
imports: Record<string, string>;
|
|
15
|
+
integrity: Record<string, string>;
|
|
16
|
+
inputs: Record<string, string>;
|
|
17
|
+
styles: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare function buildInstalledDependencyRuntime(options: DependencyRuntimeOptions): Promise<DependencyRuntime>;
|
|
20
|
+
export declare function buildDependencyRuntime(options: DependencyRuntimeOptions, barrelSource?: "published" | "installed"): Promise<DependencyRuntime>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type PluginContext } from "rolldown";
|
|
2
|
+
export declare function bundleWorkerURLs(options: {
|
|
3
|
+
code: string;
|
|
4
|
+
id: string;
|
|
5
|
+
context: PluginContext;
|
|
6
|
+
workers: Map<string, Promise<string>>;
|
|
7
|
+
trackInput: (path: string, code: string) => void;
|
|
8
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Fragment, ImportMap } from "../schema.ts";
|
|
2
|
+
import type { ClosureTracer, Failure } from "./trace.ts";
|
|
3
|
+
export declare function fragmentOf(tracer: ClosureTracer, aliases?: Record<string, string>): Fragment;
|
|
4
|
+
/** Resolves a bare specifier the way a browser applies an import map: most specific scope first, then the top level. */
|
|
5
|
+
export declare function resolveSpecifier(map: ImportMap, specifier: string, referrer: string): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* Composes fragments into one page import map. Fragments are applied in order; a later fragment
|
|
8
|
+
* remapping a specifier or a scope entry is an error, and so is an inherited specifier nobody maps.
|
|
9
|
+
*/
|
|
10
|
+
export declare function composeImportMap(fragments: Fragment[], base: string): {
|
|
11
|
+
map: ImportMap;
|
|
12
|
+
failures: Failure[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { buildLibraryRuntime, BASE_PACKAGES, BASE_ENTRIES, type LibraryRuntimeOptions, type BuiltLibraryRuntime } from "./library-runtime.ts";
|
|
2
|
+
export { buildDependencyRuntime, type DependencyRuntime, type DependencyRuntimeOptions } from "./dependency-runtime.ts";
|
|
3
|
+
export { ensureDependencyRuntime, type CachedDependencyRuntime } from "./dependency-cache.ts";
|
|
4
|
+
export { checkFragment } from "./check-fragment.ts";
|
|
5
|
+
export { BaseSetRemapError, CommonJsConversionError, NodeBuiltinError } from "./errors.ts";
|
|
6
|
+
export { composeImportMap, resolveSpecifier } from "./fragment.ts";
|
|
7
|
+
export type { Fragment, BarrelIndex } from "../schema.ts";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BarrelIndex, Fragment } from "../schema.ts";
|
|
2
|
+
import { ClosureTracer, type FragmentSpec } from "./trace.ts";
|
|
3
|
+
export { BASE_PACKAGES, BASE_ENTRIES } from "./base.ts";
|
|
4
|
+
export type LibraryRuntimeOptions = {
|
|
5
|
+
libraryDir: string;
|
|
6
|
+
outDir: string;
|
|
7
|
+
base?: Fragment;
|
|
8
|
+
aliases?: Record<string, string>;
|
|
9
|
+
exclude?: string[];
|
|
10
|
+
};
|
|
11
|
+
export type BuiltLibraryRuntime = {
|
|
12
|
+
fragment: Fragment;
|
|
13
|
+
barrels: BarrelIndex;
|
|
14
|
+
};
|
|
15
|
+
export declare function librarySpec(options: {
|
|
16
|
+
libraryDir: string;
|
|
17
|
+
base?: Fragment;
|
|
18
|
+
exclude?: string[];
|
|
19
|
+
}): FragmentSpec;
|
|
20
|
+
export declare function assertTrace(tracer: ClosureTracer): void;
|
|
21
|
+
export declare function buildLibraryRuntime(options: LibraryRuntimeOptions): Promise<BuiltLibraryRuntime>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface RuntimeExport {
|
|
2
|
+
browser: string;
|
|
3
|
+
node: string;
|
|
4
|
+
version: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function runtimeExportPins(options: {
|
|
7
|
+
root: string;
|
|
8
|
+
library: string;
|
|
9
|
+
inherited: Record<string, string>;
|
|
10
|
+
}): Record<string, string>;
|
|
11
|
+
export declare function discoverRuntimeExports(options: {
|
|
12
|
+
root: string;
|
|
13
|
+
library?: string;
|
|
14
|
+
packages?: string[];
|
|
15
|
+
pinnedRoot?: string;
|
|
16
|
+
pins?: Record<string, string>;
|
|
17
|
+
}): Record<string, RuntimeExport>;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { ResolverFactory, type ResolveResult } from "rolldown/experimental";
|
|
2
|
+
import { parseSync } from "rolldown/utils";
|
|
3
|
+
export type FileKind = "esm" | "commonjs" | "css" | "json" | "asset";
|
|
4
|
+
export type PackageId = {
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
dir: string;
|
|
8
|
+
};
|
|
9
|
+
export type TracedFile = {
|
|
10
|
+
/** Package-relative URL, `<name>@<version>/<path>`, as the package origin serves it. */
|
|
11
|
+
url: string;
|
|
12
|
+
path: string;
|
|
13
|
+
kind: FileKind;
|
|
14
|
+
integrity: string;
|
|
15
|
+
/** Bare specifiers the file imports, as written. */
|
|
16
|
+
bareImports: string[];
|
|
17
|
+
};
|
|
18
|
+
/** A CommonJS-only package entry reached from ESM. It is converted into the owning library's runtime set. */
|
|
19
|
+
export type CommonJsEntry = {
|
|
20
|
+
specifier: string;
|
|
21
|
+
path: string;
|
|
22
|
+
pkg: PackageId;
|
|
23
|
+
name: string;
|
|
24
|
+
url: string;
|
|
25
|
+
};
|
|
26
|
+
export type Failure = {
|
|
27
|
+
name: string;
|
|
28
|
+
detail: string;
|
|
29
|
+
};
|
|
30
|
+
export type FragmentSpec = {
|
|
31
|
+
name: string;
|
|
32
|
+
/** Directory that top-level packages resolve from. */
|
|
33
|
+
resolveFrom: string;
|
|
34
|
+
/**
|
|
35
|
+
* URL prefix of converted CommonJS files, `<library>@<version>/runtime/`. A fragment without one (additional
|
|
36
|
+
* packages) cannot convert, so a CommonJS-only package there is a failure.
|
|
37
|
+
*/
|
|
38
|
+
runtimeBase?: string;
|
|
39
|
+
/** Top-level specifiers and the files they map to. */
|
|
40
|
+
entries: Array<{
|
|
41
|
+
specifier: string;
|
|
42
|
+
path: string;
|
|
43
|
+
}>;
|
|
44
|
+
files?: string[];
|
|
45
|
+
/** Packages mapped at the top level wherever they are imported: the base set, in the fragment that provides it. */
|
|
46
|
+
topLevel: string[];
|
|
47
|
+
/** Packages left to other fragments' top-level entries. */
|
|
48
|
+
inherits: string[];
|
|
49
|
+
/** Compiler plugins the library declares; each module is also one of `entries`. */
|
|
50
|
+
compiler?: import("../schema.ts").CompilerPlugins;
|
|
51
|
+
};
|
|
52
|
+
export declare const IMPORT_CONDITIONS: string[];
|
|
53
|
+
export declare const REQUIRE_CONDITIONS: string[];
|
|
54
|
+
export declare const EMPTY_MODULE = "export default {};\n";
|
|
55
|
+
export declare function createResolver(conditionNames: string[]): ResolverFactory;
|
|
56
|
+
export declare function resolveBrowser(options: {
|
|
57
|
+
resolver: ResolverFactory;
|
|
58
|
+
fromDir: string;
|
|
59
|
+
specifier: string;
|
|
60
|
+
}): ResolveResult & {
|
|
61
|
+
empty?: boolean;
|
|
62
|
+
};
|
|
63
|
+
export declare function integrityOf(bytes: Uint8Array | string): string;
|
|
64
|
+
export declare function packageName(specifier: string): string;
|
|
65
|
+
/** Parses a JavaScript file once and classifies it by its syntax, which is what a browser cares about. */
|
|
66
|
+
export declare function moduleFormat(path: string): {
|
|
67
|
+
format: "esm" | "commonjs";
|
|
68
|
+
code: string;
|
|
69
|
+
module: ReturnType<typeof parseSync>["module"];
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* The package that contains `path`: the nearest directory with a named, versioned package.json. Nested
|
|
73
|
+
* manifests without a version (subpath shims) and dependencies a library bundled into its own dist (no
|
|
74
|
+
* manifest at all) belong to the enclosing package.
|
|
75
|
+
*/
|
|
76
|
+
export declare function packageOf(path: string): PackageId;
|
|
77
|
+
/** Every entry point a package's `exports` declares for the browser, with `*` patterns expanded. */
|
|
78
|
+
export declare function exportEntries(dir: string): Array<{
|
|
79
|
+
specifier: string;
|
|
80
|
+
path: string;
|
|
81
|
+
}>;
|
|
82
|
+
export declare function resolveEntry(resolver: ResolverFactory, fromDir: string, specifier: string): {
|
|
83
|
+
specifier: string;
|
|
84
|
+
path: string;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Traces a fragment's dependency closure: every file a browser loads from the fragment's entries, the bare
|
|
88
|
+
* imports each package needs mapped, and the CommonJS-only entries that must be converted.
|
|
89
|
+
*/
|
|
90
|
+
export declare class ClosureTracer {
|
|
91
|
+
readonly spec: FragmentSpec;
|
|
92
|
+
readonly imports: Record<string, string>;
|
|
93
|
+
readonly scopes: Record<string, Record<string, string>>;
|
|
94
|
+
/** URL remaps: CommonJS files that ESM code imports by a relative path, redirected to their converted file. */
|
|
95
|
+
readonly remaps: Record<string, string>;
|
|
96
|
+
/** Relative imports without a file name, by package: the runtime rewrites them to canonical URLs. */
|
|
97
|
+
readonly canonicalRewrites: Map<string, number>;
|
|
98
|
+
readonly inherited: Map<string, Set<string>>;
|
|
99
|
+
readonly files: Map<string, TracedFile>;
|
|
100
|
+
readonly packages: Map<string, string>;
|
|
101
|
+
readonly commonJs: Map<string, CommonJsEntry>;
|
|
102
|
+
readonly failures: Failure[];
|
|
103
|
+
readonly untraced: Array<{
|
|
104
|
+
url: string;
|
|
105
|
+
expression: string;
|
|
106
|
+
}>;
|
|
107
|
+
/** Resources on other origins that traced files load, which the frame's CSP and egress allowlist must permit. */
|
|
108
|
+
readonly external: Array<{
|
|
109
|
+
url: string;
|
|
110
|
+
reference: string;
|
|
111
|
+
}>;
|
|
112
|
+
readonly resolver: ResolverFactory;
|
|
113
|
+
private readonly targets;
|
|
114
|
+
private readonly queue;
|
|
115
|
+
constructor(spec: FragmentSpec);
|
|
116
|
+
trace(): this;
|
|
117
|
+
traceDependencies(options: {
|
|
118
|
+
path: string;
|
|
119
|
+
dependencies: string[];
|
|
120
|
+
}): void;
|
|
121
|
+
private emptyModule;
|
|
122
|
+
/** Traces files queued after `trace`, such as ESM packages that converted CommonJS code imports. */
|
|
123
|
+
drain(): void;
|
|
124
|
+
fail(name: string, detail: string): void;
|
|
125
|
+
inherit(specifier: string, importer: string): void;
|
|
126
|
+
mapTopLevel(specifier: string, url: string): void;
|
|
127
|
+
mapInScope(scope: string, specifier: string, url: string): void;
|
|
128
|
+
/** Maps a base-set specifier at the top level, resolved from the fragment root so every importer shares one copy. */
|
|
129
|
+
provideTopLevel(specifier: string): string | null;
|
|
130
|
+
/**
|
|
131
|
+
* Registers a file and returns the URL an import of it maps to: the file itself, or, for a CommonJS-only
|
|
132
|
+
* package entry, its converted file in the runtime set.
|
|
133
|
+
*/
|
|
134
|
+
target(path: string, specifier: string, via: "bare" | "relative"): string | null;
|
|
135
|
+
private commonJsEntry;
|
|
136
|
+
private addFile;
|
|
137
|
+
private addCss;
|
|
138
|
+
private visit;
|
|
139
|
+
private follow;
|
|
140
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { AgentSelection, JsonValue } from "./schema.ts";
|
|
2
|
+
export type DesignEdit = {
|
|
3
|
+
kind: "delete";
|
|
4
|
+
} | {
|
|
5
|
+
kind: "style";
|
|
6
|
+
prop: "variant" | "role";
|
|
7
|
+
value: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "text";
|
|
10
|
+
prop: string;
|
|
11
|
+
from: string;
|
|
12
|
+
to: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: "attributes";
|
|
15
|
+
values: Record<string, string | number | null>;
|
|
16
|
+
textFrom?: string;
|
|
17
|
+
};
|
|
18
|
+
export type DesignWriteRequest = {
|
|
19
|
+
page: string;
|
|
20
|
+
source: string;
|
|
21
|
+
edit: DesignEdit;
|
|
22
|
+
choose?: string;
|
|
23
|
+
};
|
|
24
|
+
export type DesignWriteCandidate = {
|
|
25
|
+
id: string;
|
|
26
|
+
file: string;
|
|
27
|
+
line: number;
|
|
28
|
+
column: number;
|
|
29
|
+
context: string;
|
|
30
|
+
};
|
|
31
|
+
export type DesignWriteResult = {
|
|
32
|
+
status: "applied";
|
|
33
|
+
file: string;
|
|
34
|
+
path: string;
|
|
35
|
+
line: number;
|
|
36
|
+
hash: string;
|
|
37
|
+
} | {
|
|
38
|
+
status: "stale";
|
|
39
|
+
error: string;
|
|
40
|
+
file: string;
|
|
41
|
+
} | {
|
|
42
|
+
status: "refused";
|
|
43
|
+
error: string;
|
|
44
|
+
reason: string;
|
|
45
|
+
file: string;
|
|
46
|
+
line: number;
|
|
47
|
+
column: number;
|
|
48
|
+
attribute?: string;
|
|
49
|
+
} | {
|
|
50
|
+
status: "ambiguous";
|
|
51
|
+
error: string;
|
|
52
|
+
candidates: DesignWriteCandidate[];
|
|
53
|
+
} | {
|
|
54
|
+
status: "invalid";
|
|
55
|
+
error: string;
|
|
56
|
+
};
|
|
57
|
+
export type DesignHostMessage = {
|
|
58
|
+
type: "design-override";
|
|
59
|
+
requestId: string;
|
|
60
|
+
source: string;
|
|
61
|
+
props: Record<string, JsonValue>;
|
|
62
|
+
} | {
|
|
63
|
+
type: "design-write";
|
|
64
|
+
requestId: string;
|
|
65
|
+
page: string;
|
|
66
|
+
source: string;
|
|
67
|
+
edit: DesignEdit;
|
|
68
|
+
choose?: string;
|
|
69
|
+
} | {
|
|
70
|
+
type: "design-write-result";
|
|
71
|
+
requestId: string;
|
|
72
|
+
result: DesignWriteResult;
|
|
73
|
+
};
|
|
74
|
+
export type DesignFrameMessage = {
|
|
75
|
+
type: "design-selection";
|
|
76
|
+
selection: AgentSelection;
|
|
77
|
+
source: string;
|
|
78
|
+
props: Record<string, JsonValue>;
|
|
79
|
+
} | {
|
|
80
|
+
type: "design-override-result";
|
|
81
|
+
requestId: string;
|
|
82
|
+
source: string;
|
|
83
|
+
ok: true;
|
|
84
|
+
} | {
|
|
85
|
+
type: "design-override-result";
|
|
86
|
+
requestId: string;
|
|
87
|
+
source: string;
|
|
88
|
+
ok: false;
|
|
89
|
+
error: string;
|
|
90
|
+
} | {
|
|
91
|
+
type: "design-write-request";
|
|
92
|
+
requestId: string;
|
|
93
|
+
request: DesignWriteRequest;
|
|
94
|
+
} | {
|
|
95
|
+
type: "design-write-result";
|
|
96
|
+
requestId: string;
|
|
97
|
+
result: DesignWriteResult;
|
|
98
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JsonValue } from "../schema.ts";
|
|
2
|
+
export declare function text(value: unknown, max?: number, empty?: boolean): asserts value is string;
|
|
3
|
+
export declare function number(value: unknown, min?: number): asserts value is number;
|
|
4
|
+
export declare function list(value: unknown): unknown[];
|
|
5
|
+
export declare function rect(value: unknown): void;
|
|
6
|
+
export declare function locator(value: unknown): void;
|
|
7
|
+
export declare function validateAgentSelection(value: unknown): void;
|
|
8
|
+
export declare function validateJson(value: unknown, depth?: number): asserts value is JsonValue;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReviewHostMessage, ReviewFrameMessage } from "../../review-schema.ts";
|
|
2
|
+
export declare const REVIEW_ID: RegExp;
|
|
3
|
+
export declare const REVIEW_ACTIONS: readonly ["mark", "approved", "rejected", "revision_requested", "delete", "export"];
|
|
4
|
+
export declare function validateReviewHostMessage(value: unknown): ReviewHostMessage;
|
|
5
|
+
export declare function validateReviewFrameMessage(value: unknown): ReviewFrameMessage;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BridgeEnvelope, FrameMessage, HostMessage } from "../schema.ts";
|
|
2
|
+
export declare function validateFrameMessage(value: unknown): FrameMessage;
|
|
3
|
+
export declare function validateHostMessage(value: unknown): HostMessage;
|
|
4
|
+
export declare function validateSourcePath(path: string): void;
|
|
5
|
+
export declare function validateLock(value: unknown): void;
|
|
6
|
+
export declare function validateEnvelope(value: unknown, direction: "host" | "frame"): BridgeEnvelope;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PageLock } from "../schema.ts";
|
|
2
|
+
import type { LibraryLink } from "./types.ts";
|
|
3
|
+
export type PageSourceRoot = {
|
|
4
|
+
link: string;
|
|
5
|
+
root: string;
|
|
6
|
+
prefix: string;
|
|
7
|
+
editable: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type PageSourceLock = PageLock & {
|
|
10
|
+
pageSources?: PageSourceRoot[];
|
|
11
|
+
};
|
|
12
|
+
export type PageSourceContext = {
|
|
13
|
+
pageSources?: PageSourceRoot[];
|
|
14
|
+
};
|
|
15
|
+
export declare function isPageModule(options: {
|
|
16
|
+
path: string;
|
|
17
|
+
lock: PageSourceContext;
|
|
18
|
+
}): boolean;
|
|
19
|
+
export declare function pageSourceModule(options: {
|
|
20
|
+
page: string;
|
|
21
|
+
roots: PageSourceRoot[];
|
|
22
|
+
}): string | undefined;
|
|
23
|
+
export declare function validatePageSources(value: unknown): asserts value is PageSourceRoot[];
|
|
24
|
+
export declare function pageSourcePath(options: {
|
|
25
|
+
path: string;
|
|
26
|
+
roots: PageSourceRoot[];
|
|
27
|
+
}): string | undefined;
|
|
28
|
+
export declare function validatePageSourceLinks(options: {
|
|
29
|
+
lock: PageSourceLock;
|
|
30
|
+
links: LibraryLink[];
|
|
31
|
+
}): void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { BarrelIndex, Fragment } from "../schema.ts";
|
|
2
|
+
export type CommonJsSource = {
|
|
3
|
+
hash: string;
|
|
4
|
+
target: string;
|
|
5
|
+
};
|
|
6
|
+
export type LinkBuild = {
|
|
7
|
+
link: 1;
|
|
8
|
+
library: string;
|
|
9
|
+
version: string;
|
|
10
|
+
fragment: Fragment;
|
|
11
|
+
entries: Record<string, string>;
|
|
12
|
+
modules: Record<string, {
|
|
13
|
+
resolutions: Record<string, string>;
|
|
14
|
+
}>;
|
|
15
|
+
barrels: BarrelIndex;
|
|
16
|
+
defines: Record<string, string | boolean | number>;
|
|
17
|
+
generated: Record<string, string>;
|
|
18
|
+
pageSources?: Array<Omit<import("./page-sources.ts").PageSourceRoot, "link">>;
|
|
19
|
+
commonjs?: Record<string, CommonJsSource>;
|
|
20
|
+
package?: {
|
|
21
|
+
dependencies?: Record<string, string>;
|
|
22
|
+
peerDependencies?: Record<string, string>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export type LinkSource = {
|
|
26
|
+
kind: "server";
|
|
27
|
+
url: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: "folder";
|
|
30
|
+
session?: string;
|
|
31
|
+
};
|
|
32
|
+
export type LibraryLink = {
|
|
33
|
+
id: string;
|
|
34
|
+
build: LinkBuild;
|
|
35
|
+
source: LinkSource;
|
|
36
|
+
};
|
|
37
|
+
export type StoredLink = LibraryLink & {
|
|
38
|
+
directory?: FileSystemDirectoryHandle;
|
|
39
|
+
};
|
|
40
|
+
export type LinkCommand = {
|
|
41
|
+
type: "install";
|
|
42
|
+
link: StoredLink;
|
|
43
|
+
} | {
|
|
44
|
+
type: "remove";
|
|
45
|
+
id: string;
|
|
46
|
+
} | {
|
|
47
|
+
type: "files";
|
|
48
|
+
id: string;
|
|
49
|
+
} | {
|
|
50
|
+
type: "invalidate";
|
|
51
|
+
id: string;
|
|
52
|
+
paths: string[];
|
|
53
|
+
};
|
|
54
|
+
export type LinkReply = {
|
|
55
|
+
ok: true;
|
|
56
|
+
files?: Record<string, string>;
|
|
57
|
+
};
|
|
58
|
+
export type LinkFrame = {
|
|
59
|
+
id: string;
|
|
60
|
+
links: readonly string[];
|
|
61
|
+
reload(): void | Promise<void>;
|
|
62
|
+
};
|