gemi 0.107.0 → 0.109.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/ai/index.js +2 -2
- package/dist/ai/index.js.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bin/gemi.js +242 -33
- package/dist/bin/gemi.js.map +9 -7
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-9jz4rggd.js → chunk-1es50p4k.js} +2 -2
- package/dist/{chunk-9jz4rggd.js.map → chunk-1es50p4k.js.map} +1 -1
- package/dist/{chunk-2gmgd05c.js → chunk-367kyrdx.js} +2 -2
- package/dist/{chunk-2gmgd05c.js.map → chunk-367kyrdx.js.map} +1 -1
- package/dist/{chunk-h7pafjej.js → chunk-3x86bhfn.js} +3 -3
- package/dist/{chunk-h7pafjej.js.map → chunk-3x86bhfn.js.map} +1 -1
- package/dist/{chunk-kda25fn4.js → chunk-52vsdnny.js} +1 -1
- package/dist/{chunk-m31pfz1s.js → chunk-5d6eaxab.js} +2 -2
- package/dist/{chunk-m31pfz1s.js.map → chunk-5d6eaxab.js.map} +1 -1
- package/dist/{chunk-njkk498k.js → chunk-6zekebzt.js} +2 -2
- package/dist/{chunk-njkk498k.js.map → chunk-6zekebzt.js.map} +1 -1
- package/dist/{chunk-00y49jcf.js → chunk-7mc5e61r.js} +2 -2
- package/dist/{chunk-00y49jcf.js.map → chunk-7mc5e61r.js.map} +1 -1
- package/dist/{chunk-47rgq59q.js → chunk-7ssjzp87.js} +2 -2
- package/dist/{chunk-47rgq59q.js.map → chunk-7ssjzp87.js.map} +1 -1
- package/dist/{chunk-5wt25tyd.js → chunk-9m18pknp.js} +2 -2
- package/dist/{chunk-5wt25tyd.js.map → chunk-9m18pknp.js.map} +1 -1
- package/dist/{chunk-vj2t77x1.js → chunk-9qw9fa6z.js} +2 -2
- package/dist/{chunk-vj2t77x1.js.map → chunk-9qw9fa6z.js.map} +1 -1
- package/dist/{chunk-v52dyw0q.js → chunk-c8dhvdrs.js} +2 -2
- package/dist/{chunk-v52dyw0q.js.map → chunk-c8dhvdrs.js.map} +1 -1
- package/dist/{chunk-kstvyvr0.js → chunk-d2tngs73.js} +2 -2
- package/dist/{chunk-kstvyvr0.js.map → chunk-d2tngs73.js.map} +1 -1
- package/dist/{chunk-q7y9v2v5.js → chunk-d5sbnzng.js} +13 -13
- package/dist/{chunk-q7y9v2v5.js.map → chunk-d5sbnzng.js.map} +5 -4
- package/dist/{chunk-1npdp1w2.js → chunk-dpy08xw4.js} +2 -2
- package/dist/{chunk-1npdp1w2.js.map → chunk-dpy08xw4.js.map} +1 -1
- package/dist/{chunk-h3t4n0bn.js → chunk-ehasw3qm.js} +2 -2
- package/dist/{chunk-h3t4n0bn.js.map → chunk-ehasw3qm.js.map} +1 -1
- package/dist/{chunk-331s9wqr.js → chunk-eyg88bgv.js} +2 -2
- package/dist/{chunk-331s9wqr.js.map → chunk-eyg88bgv.js.map} +1 -1
- package/dist/{chunk-fq3sb3xt.js → chunk-f7jhkg8x.js} +3 -3
- package/dist/{chunk-fq3sb3xt.js.map → chunk-f7jhkg8x.js.map} +1 -1
- package/dist/chunk-fe1pcnw6.js +6 -0
- package/dist/chunk-fe1pcnw6.js.map +11 -0
- package/dist/chunk-fj6yftm7.js +58 -0
- package/dist/{chunk-6zqqec7r.js.map → chunk-fj6yftm7.js.map} +3 -3
- package/dist/{chunk-vbm1ng3f.js → chunk-g5a3ptsa.js} +2 -2
- package/dist/{chunk-vbm1ng3f.js.map → chunk-g5a3ptsa.js.map} +1 -1
- package/dist/{chunk-2q7m8a16.js → chunk-g74qwhvf.js} +2 -2
- package/dist/{chunk-2q7m8a16.js.map → chunk-g74qwhvf.js.map} +1 -1
- package/dist/{chunk-eytdyahy.js → chunk-g7fr2cy2.js} +2 -2
- package/dist/{chunk-eytdyahy.js.map → chunk-g7fr2cy2.js.map} +1 -1
- package/dist/{chunk-yebaheh7.js → chunk-ga533cpz.js} +2 -2
- package/dist/{chunk-yebaheh7.js.map → chunk-ga533cpz.js.map} +1 -1
- package/dist/{chunk-q2fyp44f.js → chunk-gdsby5jh.js} +2 -2
- package/dist/{chunk-q2fyp44f.js.map → chunk-gdsby5jh.js.map} +1 -1
- package/dist/{chunk-sbyqs03h.js → chunk-grs8dnkd.js} +2 -2
- package/dist/{chunk-sbyqs03h.js.map → chunk-grs8dnkd.js.map} +1 -1
- package/dist/{chunk-k17prwhx.js → chunk-h15eae7g.js} +2 -2
- package/dist/{chunk-k17prwhx.js.map → chunk-h15eae7g.js.map} +1 -1
- package/dist/{chunk-9mqqr05d.js → chunk-h6g9g8qc.js} +3 -3
- package/dist/{chunk-9mqqr05d.js.map → chunk-h6g9g8qc.js.map} +1 -1
- package/dist/{chunk-82hpq0bq.js → chunk-hf32yq23.js} +2 -2
- package/dist/{chunk-82hpq0bq.js.map → chunk-hf32yq23.js.map} +1 -1
- package/dist/{chunk-xpyhmg45.js → chunk-hgz8sx40.js} +2 -2
- package/dist/{chunk-3s3awh38.js.map → chunk-hgz8sx40.js.map} +1 -1
- package/dist/{chunk-8pynv9rw.js → chunk-jc4j61xb.js} +2 -2
- package/dist/{chunk-8pynv9rw.js.map → chunk-jc4j61xb.js.map} +1 -1
- package/dist/{chunk-h4x7cba0.js → chunk-jgtean4t.js} +2 -2
- package/dist/{chunk-h4x7cba0.js.map → chunk-jgtean4t.js.map} +1 -1
- package/dist/{chunk-6rz8kyqb.js → chunk-jm4jn28j.js} +2 -2
- package/dist/{chunk-6rz8kyqb.js.map → chunk-jm4jn28j.js.map} +1 -1
- package/dist/{chunk-jnw73s8c.js → chunk-k1ezptt8.js} +2 -2
- package/dist/{chunk-jnw73s8c.js.map → chunk-k1ezptt8.js.map} +1 -1
- package/dist/{chunk-xg9vye7c.js → chunk-m9609t1y.js} +1 -1
- package/dist/{chunk-mhq2bd9c.js → chunk-mp5krm14.js} +3 -3
- package/dist/{chunk-mhq2bd9c.js.map → chunk-mp5krm14.js.map} +1 -1
- package/dist/{chunk-k9qmr2wa.js → chunk-ngw4xzrt.js} +3 -3
- package/dist/{chunk-k9qmr2wa.js.map → chunk-ngw4xzrt.js.map} +1 -1
- package/dist/{chunk-ydkjf626.js → chunk-nxxx0m1a.js} +2 -2
- package/dist/{chunk-ydkjf626.js.map → chunk-nxxx0m1a.js.map} +1 -1
- package/dist/{chunk-rn2kgbg4.js → chunk-pa3khk46.js} +2 -2
- package/dist/{chunk-rn2kgbg4.js.map → chunk-pa3khk46.js.map} +1 -1
- package/dist/{chunk-wsftnxzs.js → chunk-q8k7f11z.js} +2 -2
- package/dist/{chunk-wsftnxzs.js.map → chunk-q8k7f11z.js.map} +1 -1
- package/dist/{chunk-rjernda5.js → chunk-qnq110tw.js} +2 -2
- package/dist/{chunk-rjernda5.js.map → chunk-qnq110tw.js.map} +1 -1
- package/dist/{chunk-ftgd68se.js → chunk-qyyxzy04.js} +2 -2
- package/dist/{chunk-ftgd68se.js.map → chunk-qyyxzy04.js.map} +1 -1
- package/dist/{chunk-pj2e1p07.js → chunk-qz9aaw5x.js} +2 -2
- package/dist/{chunk-pj2e1p07.js.map → chunk-qz9aaw5x.js.map} +1 -1
- package/dist/{chunk-2xqrh6d0.js → chunk-r9gzbjc5.js} +1 -1
- package/dist/{chunk-wedwkqe7.js → chunk-rgfzqwpg.js} +3 -3
- package/dist/{chunk-wedwkqe7.js.map → chunk-rgfzqwpg.js.map} +1 -1
- package/dist/{chunk-hdhahvd4.js → chunk-rjcsdazt.js} +2 -2
- package/dist/{chunk-hdhahvd4.js.map → chunk-rjcsdazt.js.map} +1 -1
- package/dist/chunk-s5aa4hty.js +17 -0
- package/dist/{chunk-5mj7a141.js.map → chunk-s5aa4hty.js.map} +9 -7
- package/dist/{chunk-rh9j8cwv.js → chunk-sp2v357a.js} +3 -3
- package/dist/{chunk-rh9j8cwv.js.map → chunk-sp2v357a.js.map} +1 -1
- package/dist/{chunk-cfsscms3.js → chunk-t0bp8nrc.js} +4 -4
- package/dist/{chunk-cfsscms3.js.map → chunk-t0bp8nrc.js.map} +1 -1
- package/dist/{chunk-kqff894s.js → chunk-t3qw9syt.js} +2 -2
- package/dist/{chunk-kqff894s.js.map → chunk-t3qw9syt.js.map} +1 -1
- package/dist/{chunk-zrdbytx4.js → chunk-t85rca2p.js} +2 -2
- package/dist/{chunk-zrdbytx4.js.map → chunk-t85rca2p.js.map} +1 -1
- package/dist/{chunk-tyhrrnp5.js → chunk-tr9mxdth.js} +3 -3
- package/dist/{chunk-tyhrrnp5.js.map → chunk-tr9mxdth.js.map} +1 -1
- package/dist/{chunk-6wrhc9bq.js → chunk-vee4j6ft.js} +2 -2
- package/dist/{chunk-6wrhc9bq.js.map → chunk-vee4j6ft.js.map} +1 -1
- package/dist/{chunk-kqz8jp6v.js → chunk-vna85rdq.js} +2 -2
- package/dist/{chunk-kqz8jp6v.js.map → chunk-vna85rdq.js.map} +1 -1
- package/dist/{chunk-4rr9wmh8.js → chunk-vsnmdtrs.js} +2 -2
- package/dist/{chunk-4rr9wmh8.js.map → chunk-vsnmdtrs.js.map} +1 -1
- package/dist/{chunk-anp4kv3w.js → chunk-vwkdfngg.js} +1 -1
- package/dist/chunk-w3j53r0a.js +24 -0
- package/dist/chunk-w3j53r0a.js.map +19 -0
- package/dist/{chunk-gqpge54c.js → chunk-wdpdqjr1.js} +2 -2
- package/dist/{chunk-gqpge54c.js.map → chunk-wdpdqjr1.js.map} +1 -1
- package/dist/{chunk-wzqkdmjd.js → chunk-whe0x70j.js} +2 -2
- package/dist/{chunk-wzqkdmjd.js.map → chunk-whe0x70j.js.map} +1 -1
- package/dist/{chunk-1rs13253.js → chunk-wqsdjweb.js} +3 -3
- package/dist/{chunk-1rs13253.js.map → chunk-wqsdjweb.js.map} +1 -1
- package/dist/{chunk-3s3awh38.js → chunk-wvwee7dn.js} +2 -2
- package/dist/{chunk-xpyhmg45.js.map → chunk-wvwee7dn.js.map} +1 -1
- package/dist/{chunk-ffagkj3x.js → chunk-y66ntxbg.js} +2 -2
- package/dist/{chunk-ffagkj3x.js.map → chunk-y66ntxbg.js.map} +1 -1
- package/dist/chunk-z9x8x3wq.js +5 -0
- package/dist/{chunk-mrvcaakf.js.map → chunk-z9x8x3wq.js.map} +1 -1
- package/dist/{chunk-we2sj339.js → chunk-zh1t33nq.js} +2 -2
- package/dist/{chunk-we2sj339.js.map → chunk-zh1t33nq.js.map} +1 -1
- package/dist/{chunk-661wezaf.js → chunk-zhm3qvrc.js} +2 -2
- package/dist/{chunk-661wezaf.js.map → chunk-zhm3qvrc.js.map} +1 -1
- package/dist/{chunk-kh273hj0.js → chunk-zys7kecf.js} +2 -2
- package/dist/{chunk-kh273hj0.js.map → chunk-zys7kecf.js.map} +1 -1
- package/dist/{chunk-fwympxqk.js → chunk-zz7h6tdr.js} +2 -2
- package/dist/{chunk-fwympxqk.js.map → chunk-zz7h6tdr.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-Cqfwr6dk.js → ThemeProvider-BgLyzzOL.js} +8 -2
- package/dist/chunks/ThemeProvider-BgLyzzOL.js.map +1 -0
- package/dist/client/ClientRouter.d.ts +2 -0
- package/dist/client/ClientRouter.d.ts.map +1 -1
- package/dist/client/ClientRouterContext.d.ts.map +1 -1
- package/dist/client/ServerDataProvider.d.ts +2 -0
- package/dist/client/ServerDataProvider.d.ts.map +1 -1
- package/dist/client/createRoot.d.ts.map +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +76 -6
- package/dist/client/index.js.map +1 -1
- package/dist/client/islands.d.ts +84 -0
- package/dist/client/islands.d.ts.map +1 -0
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/ViewRouter.d.ts +38 -0
- package/dist/http/ViewRouter.d.ts.map +1 -1
- package/dist/http/index.d.ts +1 -1
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/server/devFetch.d.ts.map +1 -1
- package/dist/server/httpProd.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/modulePreloads.d.ts +17 -0
- package/dist/server/modulePreloads.d.ts.map +1 -1
- package/dist/server/staticFile.d.ts +20 -1
- package/dist/server/staticFile.d.ts.map +1 -1
- package/dist/server/styles.d.ts +3 -1
- package/dist/server/styles.d.ts.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +3 -3
- package/dist/services/index.js.map +2 -2
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts +27 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/services/router/createComponentTree.d.ts.map +1 -1
- package/dist/services/router/createFlatViewRoutes.d.ts +13 -1
- package/dist/services/router/createFlatViewRoutes.d.ts.map +1 -1
- package/dist/services/router/staticDocument.d.ts +44 -0
- package/dist/services/router/staticDocument.d.ts.map +1 -0
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/vite/index.mjs +72 -3
- package/dist/vitest/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5mj7a141.js +0 -17
- package/dist/chunk-6tyf0h6k.js +0 -24
- package/dist/chunk-6tyf0h6k.js.map +0 -18
- package/dist/chunk-6zqqec7r.js +0 -58
- package/dist/chunk-mrvcaakf.js +0 -5
- package/dist/chunk-z38355mx.js +0 -6
- package/dist/chunk-z38355mx.js.map +0 -11
- package/dist/chunks/ThemeProvider-Cqfwr6dk.js.map +0 -1
- /package/dist/{chunk-kda25fn4.js.map → chunk-52vsdnny.js.map} +0 -0
- /package/dist/{chunk-xg9vye7c.js.map → chunk-m9609t1y.js.map} +0 -0
- /package/dist/{chunk-2xqrh6d0.js.map → chunk-r9gzbjc5.js.map} +0 -0
- /package/dist/{chunk-anp4kv3w.js.map → chunk-vwkdfngg.js.map} +0 -0
|
@@ -3,6 +3,7 @@ import { type CarriedContext } from "../../http/requestContext";
|
|
|
3
3
|
import { type FlatViewRoutes } from "./createFlatViewRoutes";
|
|
4
4
|
import { type ViewRouteConfig } from "./config";
|
|
5
5
|
import type { ComponentTree } from "../../client/types";
|
|
6
|
+
import { type IslandResolver } from "./staticDocument";
|
|
6
7
|
/**
|
|
7
8
|
* `/assets` is where the client build output is served from, ahead of the
|
|
8
9
|
* router — a route mounted there could never be reached in production, and in
|
|
@@ -30,6 +31,12 @@ export declare class ViewRouteDispatcher {
|
|
|
30
31
|
clientRouteManifest: Record<string, string[]>;
|
|
31
32
|
componentTree: ComponentTree;
|
|
32
33
|
flatComponentTree: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Route patterns declared `.static()`. Shipped to the browser so a
|
|
36
|
+
* client-side navigation to one becomes a full page load: the page has no
|
|
37
|
+
* client router to render it into.
|
|
38
|
+
*/
|
|
39
|
+
staticRoutes: string[];
|
|
33
40
|
root: any;
|
|
34
41
|
/**
|
|
35
42
|
* The shell-content hint (#294): React defers any boundary over
|
|
@@ -78,9 +85,26 @@ export declare class ViewRouteDispatcher {
|
|
|
78
85
|
private completeStream;
|
|
79
86
|
/** See `preloadCache`. */
|
|
80
87
|
private modulePreloadLinks;
|
|
88
|
+
/**
|
|
89
|
+
* A `.static()` view's document: the same tree a hydrated view renders, but
|
|
90
|
+
* settled before the first byte and sent with no client runtime — no entry
|
|
91
|
+
* module, `modulepreload`s, `__GEMI_DATA__`, theme script, query or
|
|
92
|
+
* dictionary payloads, or React's streaming scripts. Islands that rendered
|
|
93
|
+
* add their loader (`injectIslands`).
|
|
94
|
+
*/
|
|
95
|
+
private renderStatic;
|
|
81
96
|
private render;
|
|
82
97
|
handleViewRequest(req: Request, carried?: CarriedContext | null): Promise<Response | ((params: {
|
|
83
|
-
|
|
98
|
+
/**
|
|
99
|
+
* `static` is set for a static view, which has no client to load CSS
|
|
100
|
+
* later: the styles must cover the views' whole import graph. `layout`
|
|
101
|
+
* is its own document layout, whose CSS then replaces the app's
|
|
102
|
+
* stylesheet.
|
|
103
|
+
*/
|
|
104
|
+
getStyles: (p: string[], options?: {
|
|
105
|
+
static?: boolean;
|
|
106
|
+
layout?: string;
|
|
107
|
+
}) => Promise<any[]>;
|
|
84
108
|
viewImportMap: any;
|
|
85
109
|
bootstrapModules?: string[];
|
|
86
110
|
loaders: string;
|
|
@@ -119,6 +143,8 @@ export declare class ViewRouteDispatcher {
|
|
|
119
143
|
* each one is inlined into — so the client needs the base to fetch one.
|
|
120
144
|
*/
|
|
121
145
|
assetBase?: string;
|
|
146
|
+
/** Where island client modules are served from; see `injectIslands`. */
|
|
147
|
+
resolveIsland?: IslandResolver;
|
|
122
148
|
}) => Promise<Response>)>;
|
|
123
149
|
}
|
|
124
150
|
//# sourceMappingURL=ViewRouteDispatcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewRouteDispatcher.d.ts","sourceRoot":"","sources":["../../../services/router/ViewRouteDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,KAAK,cAAc,EAAmC,MAAM,2BAA2B,CAAC;AAEj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AAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC;QACpD;;;WAGG;QACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QACjD;;;;WAIG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,wEAAwE;QACxE,aAAa,CAAC,EAAE,cAAc,CAAC;KAChC;CA80BJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponentTree.d.ts","sourceRoot":"","sources":["../../../services/router/createComponentTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"createComponentTree.d.ts","sourceRoot":"","sources":["../../../services/router/createComponentTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAuBxD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAoCrE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpRequest } from "../../http";
|
|
2
|
-
import type { ViewRoutes } from "../../http/ViewRouter";
|
|
2
|
+
import type { StaticViewOptions, ViewRoutes } from "../../http/ViewRouter";
|
|
3
3
|
export type ViewRouteExec = (req: HttpRequest<any, any>) => any;
|
|
4
4
|
/**
|
|
5
5
|
* One entry per segment of a route, parallel to `exec` — `segments[i]` is what
|
|
@@ -27,6 +27,12 @@ export type FlatViewRoutes = Record<string, {
|
|
|
27
27
|
* itself is built once at boot and cannot vary by user.
|
|
28
28
|
*/
|
|
29
29
|
features: string[];
|
|
30
|
+
/**
|
|
31
|
+
* Set when the route's view was declared `.static()`: the document is sent
|
|
32
|
+
* settled and without the client runtime. Only a leaf view can be static;
|
|
33
|
+
* the layouts above it render into the same static document.
|
|
34
|
+
*/
|
|
35
|
+
static?: StaticViewOptions;
|
|
30
36
|
}>;
|
|
31
37
|
export declare function createFlatViewRoutes(routes: ViewRoutes): {
|
|
32
38
|
[k: string]: {
|
|
@@ -41,6 +47,12 @@ export declare function createFlatViewRoutes(routes: ViewRoutes): {
|
|
|
41
47
|
* itself is built once at boot and cannot vary by user.
|
|
42
48
|
*/
|
|
43
49
|
features: string[];
|
|
50
|
+
/**
|
|
51
|
+
* Set when the route's view was declared `.static()`: the document is sent
|
|
52
|
+
* settled and without the client runtime. Only a leaf view can be static;
|
|
53
|
+
* the layouts above it render into the same static document.
|
|
54
|
+
*/
|
|
55
|
+
static?: StaticViewOptions;
|
|
44
56
|
};
|
|
45
57
|
};
|
|
46
58
|
//# sourceMappingURL=createFlatViewRoutes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFlatViewRoutes.d.ts","sourceRoot":"","sources":["../../../services/router/createFlatViewRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"createFlatViewRoutes.d.ts","sourceRoot":"","sources":["../../../services/router/createFlatViewRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,GAAG,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CACjC,MAAM,EACN;IACE,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,UAAU,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CACF,CAAC;AAmCF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU;;cArD7C,aAAa,EAAE;oBACT,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;kBAClB,MAAM;kBACN,gBAAgB,EAAE;QAC5B;;;;;WAKG;kBACO,MAAM,EAAE;QAClB;;;;WAIG;iBACM,iBAAiB;;EAiH7B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { StaticRenderCollector } from "../../client/islands";
|
|
2
|
+
/**
|
|
3
|
+
* Where an island's client module is served from: `src` is imported by the
|
|
4
|
+
* loader, `preload` is every chunk that import pulls in (itself first).
|
|
5
|
+
*/
|
|
6
|
+
export type IslandAsset = {
|
|
7
|
+
src: string;
|
|
8
|
+
preload: string[];
|
|
9
|
+
};
|
|
10
|
+
/** Maps an island module's build key (`app/views/site/menu.island.ts`) to its asset. */
|
|
11
|
+
export type IslandResolver = (moduleKey: string) => IslandAsset | undefined;
|
|
12
|
+
/** The id of the JSON block the loader reads its island table from. */
|
|
13
|
+
export declare const ISLAND_DATA_ID = "gemi-islands";
|
|
14
|
+
/**
|
|
15
|
+
* The island loader, inlined into a static document that uses islands.
|
|
16
|
+
*
|
|
17
|
+
* Kept byte-for-byte constant — the per-page island table travels in a
|
|
18
|
+
* separate `<script type="application/json">`, which a Content Security Policy
|
|
19
|
+
* does not treat as script — so a strict policy can allow it by hash:
|
|
20
|
+
* `script-src 'sha256-…'` with `ISLAND_LOADER_CSP_HASH`. Island modules are
|
|
21
|
+
* then plain `import()`s of same-origin (or asset-base) files.
|
|
22
|
+
*
|
|
23
|
+
* Per marker: parse `data-props`, import the module on the island's schedule,
|
|
24
|
+
* call its default export once. A failure is logged and leaves the
|
|
25
|
+
* server-rendered markup in place.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ISLAND_LOADER_SOURCE: string;
|
|
28
|
+
/**
|
|
29
|
+
* `'sha256-…'` for the production island loader, ready to put in a
|
|
30
|
+
* `script-src` directive. The dev loader also installs the React Refresh
|
|
31
|
+
* preamble first, so it does not match; a dev policy needs `'unsafe-inline'`
|
|
32
|
+
* as Vite itself does.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ISLAND_LOADER_CSP_HASH: string;
|
|
35
|
+
/**
|
|
36
|
+
* Adds the island loader to a settled static document — only when the render
|
|
37
|
+
* recorded an island, so a page without one keeps no script at all.
|
|
38
|
+
*
|
|
39
|
+
* Eager islands get `modulepreload`s in the head for their whole static import
|
|
40
|
+
* closure; lazy ones are fetched when their schedule fires, so nothing about
|
|
41
|
+
* them is announced up front.
|
|
42
|
+
*/
|
|
43
|
+
export declare function injectIslands(html: string, collector: StaticRenderCollector, resolveIsland: IslandResolver | undefined, dev: boolean): string;
|
|
44
|
+
//# sourceMappingURL=staticDocument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staticDocument.d.ts","sourceRoot":"","sources":["../../../services/router/staticDocument.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAE7D,wFAAwF;AACxF,MAAM,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,WAAW,GAAG,SAAS,CAAC;AAE5E,uEAAuE;AACvE,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,QAMkH,CAAC;AAEpJ;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,QAEb,CAAC;AAwBvB;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,qBAAqB,EAChC,aAAa,EAAE,cAAc,GAAG,SAAS,EACzC,GAAG,EAAE,OAAO,GACX,MAAM,CAiCR"}
|
package/dist/support/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{hc as Y}from"../chunk-9hbwvcxn.js";import{
|
|
2
|
+
import{hc as Y}from"../chunk-9hbwvcxn.js";import{ag as M}from"../chunk-9m18pknp.js";import{ah as P,ch as R}from"../chunk-h6g9g8qc.js";import"../chunk-367kyrdx.js";import{lh as Q,mh as U,nh as V,oh as W}from"../chunk-vna85rdq.js";import"../chunk-wvwee7dn.js";class S{static token;async boot(){}static inject(){if(!this.token)throw Error(`Service [${this.name}] does not declare a \`static token\`, so the container has no key to resolve it by.`);try{return R(this)}catch(x){throw Error(`Could not inject [${this.name}]. Services are constructed when the kernel boots, so `+"inject() only works from code that runs after that \u2014 a constructor default or a method "+`body, never module top level. Check that [${this.name}] is listed in \`services\` on your Kernel.`,{cause:x})}}static with(x){let f=new this;for(let[C,g]of Object.entries(x))if(g!==void 0)f[C]=g;return f}}import{readdir as z}from"fs/promises";import{join as B,parse as j}from"path";var H=[".ts",".tsx",".js",".mjs",".jsx"];function J(x={}){let f={};for(let[C,g]of Object.entries(x))f[C]=q(g);return new P(f)}async function L(x,f=new P){let C=[];try{C=await z(x)}catch(D){return f}let g=C.filter((D)=>{let{ext:v,name:F}=j(D);return H.includes(v)&&!F.startsWith(".")}).sort();for(let D of g){let{name:v}=j(D),F=await import(B(x,D));f.set(v,q(F))}return f}function q(x){if(x&&typeof x==="object"&&"default"in x)return x.default;return x}export{M as withDefaults,Q as sourceFiles,W as projectRoot,L as loadConfigFrom,V as discoverClasses,J as createConfigRepository,Y as ServiceProvider,S as Service,P as Repository,U as DiscoveryError};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=654759EB0C4D295264756E2164756E21
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import { readdir } from \"node:fs/promises\";\nimport { join, parse } from \"node:path\";\n\nimport { Repository } from \"./Repository\";\n\nconst CONFIG_EXTENSIONS = [\".ts\", \".tsx\", \".js\", \".mjs\", \".jsx\"];\n\n// Builds a Repository from an already-imported map of config modules. The map\n// key becomes the top-level config key, so `{ mail: mailModule }` is readable\n// as `config.get(\"mail.driver\")`. Each entry may be either the module namespace\n// (its `default` export is unwrapped) or the config object itself.\nexport function createConfigRepository(\n modules: Record<string, any> = {},\n): Repository {\n const items: Record<string, any> = {};\n\n for (const [key, mod] of Object.entries(modules)) {\n items[key] = unwrap(mod);\n }\n\n return new Repository(items);\n}\n\n// Reads every config module in an app's `app/config` directory into a\n// Repository. The file's basename is the top-level key: `app/config/mail.ts`\n// populates `mail.*`. A missing directory yields an empty Repository so apps\n// that declare no config still boot.\nexport async function loadConfigFrom(\n directory: string,\n repository = new Repository(),\n): Promise<Repository> {\n let entries: string[] = [];\n\n try {\n entries = await readdir(directory);\n } catch (err) {\n return repository;\n }\n\n const files = entries\n .filter((entry) => {\n const { ext, name } = parse(entry);\n return CONFIG_EXTENSIONS.includes(ext) && !name.startsWith(\".\");\n })\n .sort();\n\n for (const file of files) {\n const { name } = parse(file);\n const mod = await import(join(directory, file));\n repository.set(name, unwrap(mod));\n }\n\n return repository;\n}\n\nfunction unwrap(mod: any) {\n if (mod && typeof mod === \"object\" && \"default\" in mod) {\n return mod.default;\n }\n return mod;\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"m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AI,QAEb,OAAO",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "654759EB0C4D295264756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/dist/testing/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as QueryManagerProvider, D as I18nProvider, F as createMemoryHistory, I as toVariantKey, J as Subject, L as applyParams, N as ProgressManager, O as ServerDataContext, P as Action, i as RouteTransitionProvider, o as ClientRouterContext, r as m, t as ThemeProvider, z as QueryManagerContext } from "../chunks/ThemeProvider-
|
|
1
|
+
import { B as QueryManagerProvider, D as I18nProvider, F as createMemoryHistory, I as toVariantKey, J as Subject, L as applyParams, N as ProgressManager, O as ServerDataContext, P as Action, i as RouteTransitionProvider, o as ClientRouterContext, r as m, t as ThemeProvider, z as QueryManagerContext } from "../chunks/ThemeProvider-BgLyzzOL.js";
|
|
2
2
|
import { r as RouteStateProvider } from "../chunks/useParams-BN3XXfmG.js";
|
|
3
3
|
import { Suspense, useContext, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
package/dist/vite/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as parseAstAsync$1 } from "./node-BgyIm-M7.mjs";
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
2
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
3
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
4
4
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
5
5
|
//#region config/load.ts
|
|
6
6
|
var CONFIG_FILES = [
|
|
@@ -1448,6 +1448,74 @@ function documentBase(base) {
|
|
|
1448
1448
|
return base.startsWith("/") || /^[a-z][a-z\d+.-]*:\/\//i.test(base) ? normalizeAssetBase(base) : "/";
|
|
1449
1449
|
}
|
|
1450
1450
|
//#endregion
|
|
1451
|
+
//#region vite/islandPlugin.ts
|
|
1452
|
+
/**
|
|
1453
|
+
* `() => import("./x.island")` — the loader `island()` takes. The specifier
|
|
1454
|
+
* must name a `*.island` module; the extension is optional, as in any import.
|
|
1455
|
+
*/
|
|
1456
|
+
var ISLAND_LOADER = /\(\s*\)\s*=>\s*import\(\s*(["'])([^"'\n]+?\.island(?:\.[cm]?[jt]sx?)?)\1\s*\)/g;
|
|
1457
|
+
/**
|
|
1458
|
+
* Symlinks resolved, so the key is the same path the manifest is keyed on
|
|
1459
|
+
* however the project directory was reached (`/var` vs `/private/var` on
|
|
1460
|
+
* macOS, a linked workspace).
|
|
1461
|
+
*/
|
|
1462
|
+
function realPath(path) {
|
|
1463
|
+
try {
|
|
1464
|
+
return realpathSync(path);
|
|
1465
|
+
} catch {
|
|
1466
|
+
return path;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
/**
|
|
1470
|
+
* Tells the server which built file an island's loader imports.
|
|
1471
|
+
*
|
|
1472
|
+
* `island("nav-menu", NavMenuView, () => import("./navMenu.island"))` is
|
|
1473
|
+
* rewritten so the loader carries the module's build key — its path from the
|
|
1474
|
+
* project root, the key the client manifest uses:
|
|
1475
|
+
*
|
|
1476
|
+
* ```js
|
|
1477
|
+
* Object.assign(() => import("./navMenu.island"), { gemiIsland: "app/views/site/navMenu.island.ts" })
|
|
1478
|
+
* ```
|
|
1479
|
+
*
|
|
1480
|
+
* The server renders, never calls the loader, and maps the key to a URL. In
|
|
1481
|
+
* the SSR graph the import itself is replaced too, so an island's browser code
|
|
1482
|
+
* is not bundled into the server build.
|
|
1483
|
+
*/
|
|
1484
|
+
function gemiIslandPlugin() {
|
|
1485
|
+
let root = process.cwd();
|
|
1486
|
+
return {
|
|
1487
|
+
name: "gemi-plugin-islands",
|
|
1488
|
+
enforce: "pre",
|
|
1489
|
+
configResolved(config) {
|
|
1490
|
+
root = realPath(config.root);
|
|
1491
|
+
},
|
|
1492
|
+
async transform(code, id, options) {
|
|
1493
|
+
if (id.includes("/node_modules/") || id.startsWith("\0")) return null;
|
|
1494
|
+
if (!/\.[cm]?[jt]sx?$/.test(id.split("?")[0])) return null;
|
|
1495
|
+
if (!code.includes(".island")) return null;
|
|
1496
|
+
const ssr = Boolean(options?.ssr) || this.environment?.config?.consumer === "server";
|
|
1497
|
+
const s = new MagicString(code);
|
|
1498
|
+
let changed = false;
|
|
1499
|
+
for (const match of code.matchAll(ISLAND_LOADER)) {
|
|
1500
|
+
const [whole, quote, specifier] = match;
|
|
1501
|
+
const resolved = await this.resolve(specifier, id);
|
|
1502
|
+
if (!resolved || resolved.external) continue;
|
|
1503
|
+
const file = realPath(resolved.id.split("?")[0]);
|
|
1504
|
+
const key = relative(root, file).split(sep).join("/");
|
|
1505
|
+
if (key.startsWith("..")) continue;
|
|
1506
|
+
const loader = ssr ? `() => Promise.reject(new Error("Island modules load in the browser."))` : `() => import(${quote}${specifier}${quote})`;
|
|
1507
|
+
s.overwrite(match.index, match.index + whole.length, `Object.assign(${loader}, { gemiIsland: ${JSON.stringify(key)} })`);
|
|
1508
|
+
changed = true;
|
|
1509
|
+
}
|
|
1510
|
+
if (!changed) return null;
|
|
1511
|
+
return {
|
|
1512
|
+
code: s.toString(),
|
|
1513
|
+
map: s.generateMap({ hires: true })
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
};
|
|
1517
|
+
}
|
|
1518
|
+
//#endregion
|
|
1451
1519
|
//#region vite/index.ts
|
|
1452
1520
|
var gemi = async () => {
|
|
1453
1521
|
const userConfig = await loadGemiConfig(process.cwd());
|
|
@@ -1465,7 +1533,7 @@ var gemi = async () => {
|
|
|
1465
1533
|
ssrEmitAssets: true,
|
|
1466
1534
|
sourcemap: true,
|
|
1467
1535
|
rollupOptions: {
|
|
1468
|
-
input: Array.from(JSON.parse(process.env.GEMI_INPUT ?? "[]")),
|
|
1536
|
+
input: Array.from(JSON.parse(process.env.GEMI_INPUT ?? "[]")).filter((entry) => !(env.isSsrBuild && /\.island\.[cm]?[jt]sx?$/.test(entry))),
|
|
1469
1537
|
preserveEntrySignatures: "strict",
|
|
1470
1538
|
...env.isSsrBuild ? { external: isGemiExternal } : {}
|
|
1471
1539
|
}
|
|
@@ -1479,6 +1547,7 @@ var gemi = async () => {
|
|
|
1479
1547
|
config: () => userViteConfig
|
|
1480
1548
|
},
|
|
1481
1549
|
gemiAssetBasePlugin(resolveAssetBase(userConfig.assetBase)),
|
|
1550
|
+
gemiIslandPlugin(),
|
|
1482
1551
|
{
|
|
1483
1552
|
name: "gemi-plugin-hot-reload",
|
|
1484
1553
|
handleHotUpdate({ server, modules }) {
|
package/dist/vitest/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{da as k,ea as z}from"../chunk-
|
|
2
|
+
import{da as k,ea as z}from"../chunk-wqsdjweb.js";import"../chunk-eyg88bgv.js";import"../chunk-c8dhvdrs.js";import"../chunk-wvwee7dn.js";function K(){return{name:"gemi-custom-request",enforce:"pre",async transform(D,G){let j=G.split("?",1)[0];if(j.includes("/node_modules/")||!k.test(j))return null;return{code:await z(D),map:null}}}}export{K as gemiRequestPlugin};
|
|
3
3
|
|
|
4
4
|
//# debugId=1C43D425FE3D486E64756E2164756E21
|