@portel/photon 1.32.5 → 1.33.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/auto-ui/beam/routes/api-config.js +1 -1
- package/dist/auto-ui/beam/routes/api-config.js.map +1 -1
- package/dist/auto-ui/beam/types.d.ts +1 -0
- package/dist/auto-ui/beam/types.d.ts.map +1 -1
- package/dist/auto-ui/beam.d.ts.map +1 -1
- package/dist/auto-ui/beam.js +58 -9
- package/dist/auto-ui/beam.js.map +1 -1
- package/dist/auto-ui/components/card.d.ts +1 -1
- package/dist/auto-ui/components/card.d.ts.map +1 -1
- package/dist/auto-ui/components/card.js +1 -1
- package/dist/auto-ui/components/card.js.map +1 -1
- package/dist/auto-ui/components/checklist.d.ts +1 -1
- package/dist/auto-ui/components/checklist.d.ts.map +1 -1
- package/dist/auto-ui/components/checklist.js +1 -1
- package/dist/auto-ui/components/checklist.js.map +1 -1
- package/dist/auto-ui/components/form.d.ts +1 -1
- package/dist/auto-ui/components/form.d.ts.map +1 -1
- package/dist/auto-ui/components/form.js +2 -2
- package/dist/auto-ui/components/form.js.map +1 -1
- package/dist/auto-ui/components/list.d.ts +1 -1
- package/dist/auto-ui/components/list.d.ts.map +1 -1
- package/dist/auto-ui/components/list.js +1 -1
- package/dist/auto-ui/components/list.js.map +1 -1
- package/dist/auto-ui/components/progress.d.ts +1 -1
- package/dist/auto-ui/components/progress.d.ts.map +1 -1
- package/dist/auto-ui/components/progress.js +1 -1
- package/dist/auto-ui/components/progress.js.map +1 -1
- package/dist/auto-ui/components/table.d.ts +1 -1
- package/dist/auto-ui/components/table.d.ts.map +1 -1
- package/dist/auto-ui/components/table.js +1 -1
- package/dist/auto-ui/components/table.js.map +1 -1
- package/dist/auto-ui/components/tree.d.ts +1 -1
- package/dist/auto-ui/components/tree.d.ts.map +1 -1
- package/dist/auto-ui/components/tree.js +1 -1
- package/dist/auto-ui/components/tree.js.map +1 -1
- package/dist/auto-ui/streamable-http-transport.d.ts +1 -0
- package/dist/auto-ui/streamable-http-transport.d.ts.map +1 -1
- package/dist/auto-ui/streamable-http-transport.js +40 -5
- package/dist/auto-ui/streamable-http-transport.js.map +1 -1
- package/dist/auto-ui/ui-resolver.d.ts +12 -1
- package/dist/auto-ui/ui-resolver.d.ts.map +1 -1
- package/dist/auto-ui/ui-resolver.js +19 -3
- package/dist/auto-ui/ui-resolver.js.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +13 -5
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/ps.d.ts +4 -0
- package/dist/cli/commands/ps.d.ts.map +1 -1
- package/dist/cli/commands/ps.js +19 -5
- package/dist/cli/commands/ps.js.map +1 -1
- package/dist/daemon/manager.d.ts +8 -0
- package/dist/daemon/manager.d.ts.map +1 -1
- package/dist/daemon/manager.js +46 -9
- package/dist/daemon/manager.js.map +1 -1
- package/dist/deploy/cloudflare.d.ts.map +1 -1
- package/dist/deploy/cloudflare.js +55 -7
- package/dist/deploy/cloudflare.js.map +1 -1
- package/dist/resource-server.d.ts.map +1 -1
- package/dist/resource-server.js +5 -2
- package/dist/resource-server.js.map +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +206 -14
- package/dist/server.js.map +1 -1
- package/dist/tsx-compiler.d.ts +65 -5
- package/dist/tsx-compiler.d.ts.map +1 -1
- package/dist/tsx-compiler.js +531 -52
- package/dist/tsx-compiler.js.map +1 -1
- package/package.json +3 -3
- package/templates/cloudflare/worker.ts.template +60 -0
package/dist/tsx-compiler.d.ts
CHANGED
|
@@ -9,15 +9,75 @@
|
|
|
9
9
|
* ui/ folder to use React/Preact/Solid if they prefer.
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Result of compiling a .tsx view.
|
|
13
|
+
*
|
|
14
|
+
* The bundled JS is written to a content-hashed sidecar file rather than
|
|
15
|
+
* inlined, so every serving path (local server, Beam, `photon build`, the
|
|
16
|
+
* Cloudflare [assets] binding) gets URL-level cache-busting for free: the
|
|
17
|
+
* hash changes whenever the source or the esbuild toolchain changes, so a
|
|
18
|
+
* browser never executes a stale bundle. The tiny HTML shell carries no
|
|
19
|
+
* code and is served with revalidation; the hashed JS is immutable.
|
|
20
|
+
*/
|
|
21
|
+
export interface CompiledTsx {
|
|
22
|
+
/** sha256 of (bundle + esbuild version), 12 hex chars. Empty on build error. */
|
|
23
|
+
hash: string;
|
|
24
|
+
/** Hashed JS filename the shell references, e.g. `app.1a2b3c4d5e6f.js`. */
|
|
25
|
+
jsFileName: string;
|
|
26
|
+
/** The HTML shell (references `./<jsFileName>`). On error this is the error page. */
|
|
27
|
+
html: string;
|
|
28
|
+
/** The bundled browser JS. Empty on build error. */
|
|
29
|
+
js: string;
|
|
30
|
+
/** On-disk cache directory holding `<jsFileName>` and `index.html`. */
|
|
31
|
+
dir: string;
|
|
32
|
+
/** Absolute path to the written HTML shell. */
|
|
33
|
+
htmlPath: string;
|
|
34
|
+
/** Absolute path to the written hashed JS (empty string on build error). */
|
|
35
|
+
jsPath: string;
|
|
36
|
+
/** Absolute paths of every module in the bundle (entry + imports). */
|
|
37
|
+
inputs: string[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Self-contained document with the bundle inlined. Used only by the MCP
|
|
41
|
+
* resource path (Claude Desktop apps): an MCP-app webview renders the
|
|
42
|
+
* returned HTML with no HTTP origin, so a `./<hash>.js` sibling reference
|
|
43
|
+
* would not resolve. Cache-busting is irrelevant there — the client
|
|
44
|
+
* re-reads the resource on every `resources/read`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function inlineHtml(js: string): string;
|
|
47
|
+
/** Immutable: hash in the URL changes whenever the bundle changes. */
|
|
48
|
+
export declare const TSX_JS_CACHE_CONTROL = "public, max-age=31536000, immutable";
|
|
49
|
+
/** Tiny, code-free shell — always revalidate so a new hash is picked up. */
|
|
50
|
+
export declare const TSX_SHELL_CACHE_CONTROL = "no-cache";
|
|
51
|
+
export interface TsxHttpResponse {
|
|
52
|
+
status: 200 | 404;
|
|
53
|
+
/** Response body. */
|
|
54
|
+
body: string;
|
|
55
|
+
headers: Record<string, string>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Resolve an HTTP request for a compiled `.tsx` view into a response.
|
|
59
|
+
*
|
|
60
|
+
* - `restPath` empty / `index.html` → the HTML shell (revalidated, ETag).
|
|
61
|
+
* - `restPath` === the hashed JS filename → the bundle (immutable).
|
|
62
|
+
* - anything else → 404 (caller may then try its own sibling resolution).
|
|
63
|
+
*
|
|
64
|
+
* Used by every browser-facing serving path (local server, Beam,
|
|
65
|
+
* streamable-http, and — via precompiled files — the Cloudflare
|
|
66
|
+
* [assets] binding) so the cache contract is identical everywhere.
|
|
67
|
+
*/
|
|
68
|
+
export declare function tsxHttpResponse(result: CompiledTsx, restPath: string): TsxHttpResponse;
|
|
69
|
+
/**
|
|
70
|
+
* Compile a TSX file into a hashed JS bundle plus an HTML shell.
|
|
13
71
|
*/
|
|
14
|
-
export declare function compileTsx(filePath: string): Promise<
|
|
72
|
+
export declare function compileTsx(filePath: string): Promise<CompiledTsx>;
|
|
15
73
|
/**
|
|
16
|
-
* Compile with
|
|
74
|
+
* Compile with dependency-graph-aware caching. Re-transpiles when the
|
|
75
|
+
* entry file OR any imported module changes (the previous mtime-only
|
|
76
|
+
* cache silently served a stale bundle after an imported-component edit).
|
|
17
77
|
*/
|
|
18
|
-
export declare function compileTsxCached(filePath: string): Promise<
|
|
78
|
+
export declare function compileTsxCached(filePath: string): Promise<CompiledTsx>;
|
|
19
79
|
/**
|
|
20
80
|
* Synchronous variant for the build command (uses esbuild.buildSync).
|
|
21
81
|
*/
|
|
22
|
-
export declare function compileTsxSync(filePath: string):
|
|
82
|
+
export declare function compileTsxSync(filePath: string): CompiledTsx;
|
|
23
83
|
//# sourceMappingURL=tsx-compiler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsx-compiler.d.ts","sourceRoot":"","sources":["../src/tsx-compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"tsx-compiler.d.ts","sourceRoot":"","sources":["../src/tsx-compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkYH;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,UAAU,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAoPD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAe7C;AAED,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,wCAAwC,CAAC;AAC1E,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,aAAa,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC;IAClB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,CAsBtF;AAoDD;;GAEG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAUvE;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAW7E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAU5D"}
|