@fluixi/start 0.1.0-alpha.74 → 0.1.0-alpha.75
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/adapter.cjs +5 -3
- package/dist/adapter.d.ts +9 -9
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +10 -10
- package/dist/adapter.mjs +5 -3
- package/dist/adapters/entry.cjs +1 -1
- package/dist/adapters/entry.js +1 -1
- package/dist/adapters/entry.mjs +1 -1
- package/dist/adapters/platforms.cjs +1 -1
- package/dist/adapters/platforms.d.ts +2 -2
- package/dist/adapters/platforms.js +8 -8
- package/dist/adapters/platforms.mjs +1 -1
- package/dist/{api-RH6E5UTH.mjs → api-HD7KU3BS.mjs} +1 -1
- package/dist/api.cjs +2 -2
- package/dist/api.js +1 -1
- package/dist/api.mjs +2 -2
- package/dist/commands/{api-RH6E5UTH.mjs → api-HD7KU3BS.mjs} +1 -1
- package/dist/commands/{api-4IYNQRKG.mjs → api-PBT4QZ34.mjs} +1 -1
- package/dist/commands/{api-23MJFSYL.mjs → api-PJL37LV3.mjs} +2 -2
- package/dist/commands/build.cjs +13 -6
- package/dist/commands/build.js +6 -6
- package/dist/commands/build.mjs +13 -6
- package/dist/commands/{chunk-OCPCK4ZJ.mjs → chunk-GFQ4MUIC.mjs} +2 -2
- package/dist/commands/{chunk-NS5GR2GX.mjs → chunk-MTM6M3TC.mjs} +1 -1
- package/dist/commands/dev.cjs +11 -4
- package/dist/commands/dev.js +3 -3
- package/dist/commands/dev.mjs +12 -5
- package/dist/commands/index.cjs +14 -7
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.js +1 -1
- package/dist/commands/index.mjs +15 -8
- package/dist/commands/prerender.cjs +2 -0
- package/dist/commands/prerender.d.ts +1 -1
- package/dist/commands/prerender.js +2 -2
- package/dist/commands/prerender.mjs +2 -0
- package/dist/commands/start.cjs +2 -0
- package/dist/commands/start.d.ts +1 -1
- package/dist/commands/start.js +2 -2
- package/dist/commands/start.mjs +2 -0
- package/dist/config.cjs +7 -1
- package/dist/config.d.ts +24 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -6
- package/dist/config.mjs +7 -1
- package/dist/define-config.cjs +32 -0
- package/dist/define-config.d.ts +12 -0
- package/dist/define-config.d.ts.map +1 -0
- package/dist/define-config.js +3 -0
- package/dist/define-config.mjs +7 -0
- package/dist/di.cjs +1 -1
- package/dist/di.d.ts +4 -4
- package/dist/di.d.ts.map +1 -1
- package/dist/di.js +9 -9
- package/dist/di.mjs +1 -1
- package/dist/document.d.ts +1 -1
- package/dist/document.js +1 -1
- package/dist/generated-api.cjs +1 -1
- package/dist/generated-api.js +1 -1
- package/dist/generated-api.mjs +1 -1
- package/dist/generated-server-fns.cjs +1 -1
- package/dist/generated-server-fns.mjs +1 -1
- package/dist/handler-core.cjs +1 -1
- package/dist/handler-core.d.ts +2 -2
- package/dist/handler-core.js +2 -2
- package/dist/handler-core.mjs +1 -1
- package/dist/handler.cjs +1 -0
- package/dist/handler.d.ts +3 -3
- package/dist/handler.js +3 -3
- package/dist/handler.mjs +2 -0
- package/dist/head.cjs +1 -1
- package/dist/head.d.ts +1 -1
- package/dist/head.js +1 -1
- package/dist/head.mjs +1 -1
- package/dist/image-loader.cjs +37 -0
- package/dist/image-loader.d.ts +25 -0
- package/dist/image-loader.d.ts.map +1 -0
- package/dist/image-loader.js +18 -0
- package/dist/image-loader.mjs +12 -0
- package/dist/image.cjs +13 -8
- package/dist/image.d.ts +2 -19
- package/dist/image.d.ts.map +1 -1
- package/dist/image.js +5 -21
- package/dist/image.mjs +14 -8
- package/dist/index.cjs +5 -738
- package/dist/index.d.ts +28 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -17
- package/dist/index.mjs +4 -710
- package/dist/interceptors.cjs +1 -0
- package/dist/interceptors.js +1 -1
- package/dist/interceptors.mjs +2 -0
- package/dist/internal.cjs +9 -4
- package/dist/internal.d.ts +6 -6
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +23 -15
- package/dist/internal.mjs +9 -4
- package/dist/middleware.d.ts +3 -3
- package/dist/middleware.d.ts.map +1 -1
- package/dist/middleware.js +1 -1
- package/dist/preload.cjs +1 -1
- package/dist/preload.js +1 -1
- package/dist/preload.mjs +1 -1
- package/dist/router.cjs +1 -1
- package/dist/router.d.ts +3 -3
- package/dist/router.js +3 -3
- package/dist/router.mjs +1 -1
- package/dist/server-fn-setup.cjs +1 -1
- package/dist/server-fn-setup.d.ts +1 -1
- package/dist/server-fn-setup.js +2 -2
- package/dist/server-fn-setup.mjs +1 -1
- package/dist/server-fn.cjs +1 -1
- package/dist/server-fn.d.ts +2 -2
- package/dist/server-fn.js +2 -2
- package/dist/server-fn.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +1 -1
- package/package.json +25 -7
package/dist/interceptors.cjs
CHANGED
package/dist/interceptors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// HTTP interceptors
|
|
1
|
+
// HTTP interceptors: a request/response/error pipeline around fetch (Angular-style).
|
|
2
2
|
// Register interceptors to attach auth headers, handle 401s, log, or retry. Server-function
|
|
3
3
|
// RPC calls route through this automatically once any interceptor is added; use
|
|
4
4
|
// `fetchWithInterceptors` for your own data fetching too.
|
package/dist/interceptors.mjs
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -110,7 +110,7 @@ function apiRoutesVitePlugin(opts) {
|
|
|
110
110
|
return {
|
|
111
111
|
name: "fluixi-api",
|
|
112
112
|
// Must beat node resolution: '@fluixi/start/api-routes' is a real file in this package,
|
|
113
|
-
// so without `pre` Vite resolves the typed stub and the generated table never loads
|
|
113
|
+
// so without `pre` Vite resolves the typed stub and the generated table never loads ,
|
|
114
114
|
// the app builds and every API route 404s.
|
|
115
115
|
enforce: "pre",
|
|
116
116
|
configResolved(config) {
|
|
@@ -328,7 +328,7 @@ function startTypesPlugin(cfg) {
|
|
|
328
328
|
const blocks = [];
|
|
329
329
|
if (cfg.i18n) blocks.push(...i18nTypeBlock(root, cfg.i18n));
|
|
330
330
|
if (blocks.length === 0) return;
|
|
331
|
-
const content = `// Auto-generated by @fluixi/start
|
|
331
|
+
const content = `// Auto-generated by @fluixi/start, do not edit.
|
|
332
332
|
${blocks.join("\n")}
|
|
333
333
|
`;
|
|
334
334
|
const file = (0, import_node_path2.resolve)(root, "src/fluixi-start-env.d.ts");
|
|
@@ -349,10 +349,15 @@ async function fluixiPlugins(cfg) {
|
|
|
349
349
|
// app has no way to say where an unimported tag comes from.
|
|
350
350
|
//
|
|
351
351
|
// `fluixi()` and not `createVitePlugin()`: the latter is the bare compiler integration,
|
|
352
|
-
// and the reactive graph
|
|
352
|
+
// and the reactive graph: agent, source marks, /__fluixi/graph, is composed on top of
|
|
353
353
|
// it by the former. A start app got no graph at all until this changed.
|
|
354
|
-
|
|
354
|
+
// Everything the app declared for the compiler, with `resolve` still usable on its
|
|
355
|
+
// own because it is the one most apps set. A start app never writes
|
|
356
|
+
// `fluixi()` itself, so without this passthrough the plugin's other options
|
|
357
|
+
// (propsDestructure and the rest) had nowhere to be declared.
|
|
358
|
+
fluixi({ ...cfg.vitePlugin ?? {}, ...cfg.resolve ? { resolve: cfg.resolve } : {} })
|
|
355
359
|
];
|
|
360
|
+
if (cfg.plugins?.length) plugins.push(...cfg.plugins);
|
|
356
361
|
if (cfg.i18n) plugins.push(i18nVitePlugin(cfg.i18n));
|
|
357
362
|
const { apiRoutesVitePlugin: apiRoutesVitePlugin2 } = await Promise.resolve().then(() => (init_api(), api_exports));
|
|
358
363
|
plugins.push(apiRoutesVitePlugin2({ dir: cfg.apiDir }));
|
package/dist/internal.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const SERVER_FNS_VMOD = "virtual:fluixi-server-fns";
|
|
|
5
5
|
export declare const I18N_VMOD = "virtual:fluixi-i18n";
|
|
6
6
|
/**
|
|
7
7
|
* Auto-discover translations. Scans `<dir>/<locale>.json` (e.g. `src/i18n/en.json`, `fr.json`)
|
|
8
|
-
* and provides `virtual:fluixi-i18n` exporting `{ messages, locales, defaultLocale }
|
|
8
|
+
* and provides `virtual:fluixi-i18n` exporting `{ messages, locales, defaultLocale }`, wire it
|
|
9
9
|
* into the built-in i18n in one line:
|
|
10
10
|
*
|
|
11
11
|
* import { createI18n } from '@fluixi/core/i18n';
|
|
@@ -20,12 +20,12 @@ export declare function i18nVitePlugin(opts: {
|
|
|
20
20
|
locales?: string[];
|
|
21
21
|
}): any;
|
|
22
22
|
/**
|
|
23
|
-
* Load env files into `process.env` for SERVER code
|
|
23
|
+
* Load env files into `process.env` for SERVER code, the framework's environment manager.
|
|
24
24
|
*
|
|
25
25
|
* SECURITY MODEL (Vite-aligned): only `VITE_`-prefixed vars are exposed to the client (via
|
|
26
26
|
* `import.meta.env`, inlined into the browser bundle). Everything else is server-only. This
|
|
27
27
|
* loads ALL vars (`.env`, `.env.local`, `.env.[mode]`, `.env.[mode].local`) into `process.env`
|
|
28
|
-
* so loaders + `"use server"` functions can read secrets
|
|
28
|
+
* so loaders + `"use server"` functions can read secrets, WITHOUT ever exposing non-`VITE_`
|
|
29
29
|
* vars to the browser. A real (OS) env var always wins, so deploys/secret managers override files.
|
|
30
30
|
*
|
|
31
31
|
* Result: `process.env.STRIPE_SECRET` works on the server and never ships to the web; only
|
|
@@ -36,14 +36,14 @@ export declare function loadServerEnv(root: string, mode: string): Promise<void>
|
|
|
36
36
|
* Auto-generate ambient TypeScript declarations for @fluixi/start's virtual modules
|
|
37
37
|
* (`virtual:fluixi-server-fns`, `virtual:fluixi-i18n`) into `src/fluixi-start-env.d.ts`, the
|
|
38
38
|
* way the routes plugin writes `fluixi-env.d.ts`. So apps NEVER hand-write these `declare
|
|
39
|
-
* module` blocks
|
|
39
|
+
* module` blocks: the modules AND their types are both generated. Idempotent (only writes on
|
|
40
40
|
* change), runs in dev + build.
|
|
41
41
|
*/
|
|
42
42
|
export declare function startTypesPlugin(cfg: ResolvedConfig): any;
|
|
43
43
|
/**
|
|
44
44
|
* The fluixi build plugins @fluixi/start provides by default: file-based routing
|
|
45
45
|
* (fluixiRoutesPlugin → virtual:fluixi-routes) + the JSX/SSR transform
|
|
46
|
-
* (createVitePlugin). This is what makes start "sit on top of fluixi"
|
|
46
|
+
* (createVitePlugin). This is what makes start "sit on top of fluixi", apps get
|
|
47
47
|
* zero-config routing + SSR. Apps using `fluixi dev|build` should therefore NOT add
|
|
48
48
|
* these to their own vite.config (start owns them); keep vite.config for app-specific
|
|
49
49
|
* bits only (optimizeDeps, ssr.noExternal via config, etc.).
|
|
@@ -52,7 +52,7 @@ export declare function fluixiPlugins(cfg: ResolvedConfig): Promise<any[]>;
|
|
|
52
52
|
export { injectApp, splitTemplate, injectAppAndHead, guardHandler, } from './document.js';
|
|
53
53
|
/**
|
|
54
54
|
* A render fires the route's data fetches eagerly; if the backend is down those
|
|
55
|
-
* promises can reject AFTER we've already responded, with nothing awaiting them
|
|
55
|
+
* promises can reject AFTER we've already responded, with nothing awaiting them ,
|
|
56
56
|
* a floating rejection would kill the dev server. Swallow + log instead.
|
|
57
57
|
*/
|
|
58
58
|
export declare function installCrashGuards(): void;
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,6FAA6F;AAC7F,eAAO,MAAM,eAAe,8BAA8B,CAAC;AAE3D,wGAAwG;AACxG,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,GAAG,CAoCrG;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM7E;AA6DD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,GAAG,CA0BzD;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,6FAA6F;AAC7F,eAAO,MAAM,eAAe,8BAA8B,CAAC;AAE3D,wGAAwG;AACxG,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,GAAG,CAoCrG;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM7E;AA6DD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,GAAG,CA0BzD;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAiCvE;AAED,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,eAAe,CAAC;AAIvB;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CASzC"}
|
package/dist/internal.js
CHANGED
|
@@ -6,7 +6,7 @@ export const SERVER_FNS_VMOD = 'virtual:fluixi-server-fns';
|
|
|
6
6
|
export const I18N_VMOD = 'virtual:fluixi-i18n';
|
|
7
7
|
/**
|
|
8
8
|
* Auto-discover translations. Scans `<dir>/<locale>.json` (e.g. `src/i18n/en.json`, `fr.json`)
|
|
9
|
-
* and provides `virtual:fluixi-i18n` exporting `{ messages, locales, defaultLocale }
|
|
9
|
+
* and provides `virtual:fluixi-i18n` exporting `{ messages, locales, defaultLocale }`, wire it
|
|
10
10
|
* into the built-in i18n in one line:
|
|
11
11
|
*
|
|
12
12
|
* import { createI18n } from '@fluixi/core/i18n';
|
|
@@ -53,12 +53,12 @@ export function i18nVitePlugin(opts) {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* Load env files into `process.env` for SERVER code
|
|
56
|
+
* Load env files into `process.env` for SERVER code, the framework's environment manager.
|
|
57
57
|
*
|
|
58
58
|
* SECURITY MODEL (Vite-aligned): only `VITE_`-prefixed vars are exposed to the client (via
|
|
59
59
|
* `import.meta.env`, inlined into the browser bundle). Everything else is server-only. This
|
|
60
60
|
* loads ALL vars (`.env`, `.env.local`, `.env.[mode]`, `.env.[mode].local`) into `process.env`
|
|
61
|
-
* so loaders + `"use server"` functions can read secrets
|
|
61
|
+
* so loaders + `"use server"` functions can read secrets, WITHOUT ever exposing non-`VITE_`
|
|
62
62
|
* vars to the browser. A real (OS) env var always wins, so deploys/secret managers override files.
|
|
63
63
|
*
|
|
64
64
|
* Result: `process.env.STRIPE_SECRET` works on the server and never ships to the web; only
|
|
@@ -73,12 +73,12 @@ export async function loadServerEnv(root, mode) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
|
-
* Build the `declare module 'virtual:fluixi-i18n'` block
|
|
76
|
+
* Build the `declare module 'virtual:fluixi-i18n'` block, TYPED off the actual JSON files
|
|
77
77
|
* so `createI18n({ messages })` infers translation keys end-to-end from auto-discovery.
|
|
78
78
|
*
|
|
79
79
|
* Instead of typing `messages` as `Record<string, unknown>` (which erases keys), we reference
|
|
80
80
|
* each `<locale>.json` via `(typeof import('./i18n/en.json'))['default']`. TS reads the JSON's
|
|
81
|
-
* real shape, so `t('…')` autocompletes keys discovered from `src/i18n/*.json
|
|
81
|
+
* real shape, so `t('…')` autocompletes keys discovered from `src/i18n/*.json`, no codegen of
|
|
82
82
|
* the key union, the compiler derives it. Falls back to the loose shape when no files exist yet
|
|
83
83
|
* (or a configured locale has no file), keeping the module typed-but-open rather than broken.
|
|
84
84
|
*
|
|
@@ -130,7 +130,7 @@ function i18nTypeBlock(root, i18n) {
|
|
|
130
130
|
* Auto-generate ambient TypeScript declarations for @fluixi/start's virtual modules
|
|
131
131
|
* (`virtual:fluixi-server-fns`, `virtual:fluixi-i18n`) into `src/fluixi-start-env.d.ts`, the
|
|
132
132
|
* way the routes plugin writes `fluixi-env.d.ts`. So apps NEVER hand-write these `declare
|
|
133
|
-
* module` blocks
|
|
133
|
+
* module` blocks: the modules AND their types are both generated. Idempotent (only writes on
|
|
134
134
|
* change), runs in dev + build.
|
|
135
135
|
*/
|
|
136
136
|
export function startTypesPlugin(cfg) {
|
|
@@ -145,21 +145,21 @@ export function startTypesPlugin(cfg) {
|
|
|
145
145
|
// have fixed signatures, so they moved to real package entries
|
|
146
146
|
// (`@fluixi/start/server-fns`, `@fluixi/start/api-routes`) whose types ship with the
|
|
147
147
|
// package. i18n cannot follow: its `messages` type is derived from the app's own JSON
|
|
148
|
-
// (`typeof import('./i18n/en.json')`) and its `locales` is a literal tuple
|
|
148
|
+
// (`typeof import('./i18n/en.json')`) and its `locales` is a literal tuple, that is
|
|
149
149
|
// what makes keys autocomplete, and no static entry can express it.
|
|
150
150
|
const blocks = [];
|
|
151
151
|
if (cfg.i18n)
|
|
152
152
|
blocks.push(...i18nTypeBlock(root, cfg.i18n));
|
|
153
153
|
if (blocks.length === 0)
|
|
154
|
-
return; // no i18n configured
|
|
155
|
-
const content = `// Auto-generated by @fluixi/start
|
|
154
|
+
return; // no i18n configured: nothing left to declare
|
|
155
|
+
const content = `// Auto-generated by @fluixi/start, do not edit.\n${blocks.join('\n')}\n`;
|
|
156
156
|
const file = resolvePath(root, 'src/fluixi-start-env.d.ts');
|
|
157
157
|
try {
|
|
158
158
|
if (!existsSync(file) || readFileSync(file, 'utf8') !== content)
|
|
159
159
|
writeFileSync(file, content);
|
|
160
160
|
}
|
|
161
161
|
catch {
|
|
162
|
-
/* read-only fs (some CI)
|
|
162
|
+
/* read-only fs (some CI), types are a dev convenience, build still works */
|
|
163
163
|
}
|
|
164
164
|
},
|
|
165
165
|
};
|
|
@@ -167,7 +167,7 @@ export function startTypesPlugin(cfg) {
|
|
|
167
167
|
/**
|
|
168
168
|
* The fluixi build plugins @fluixi/start provides by default: file-based routing
|
|
169
169
|
* (fluixiRoutesPlugin → virtual:fluixi-routes) + the JSX/SSR transform
|
|
170
|
-
* (createVitePlugin). This is what makes start "sit on top of fluixi"
|
|
170
|
+
* (createVitePlugin). This is what makes start "sit on top of fluixi", apps get
|
|
171
171
|
* zero-config routing + SSR. Apps using `fluixi dev|build` should therefore NOT add
|
|
172
172
|
* these to their own vite.config (start owns them); keep vite.config for app-specific
|
|
173
173
|
* bits only (optimizeDeps, ssr.noExternal via config, etc.).
|
|
@@ -175,7 +175,7 @@ export function startTypesPlugin(cfg) {
|
|
|
175
175
|
export async function fluixiPlugins(cfg) {
|
|
176
176
|
const { fluixi, fluixiRoutesPlugin } = await import('@fluixi/core/plugins');
|
|
177
177
|
const { serverFunctionsVitePlugin } = await import('@fluixi/compiler/integrations');
|
|
178
|
-
// polyfills:false
|
|
178
|
+
// polyfills:false: the meta-framework is SSR-first; the browser node-polyfill shims
|
|
179
179
|
// break server rendering. Apps that need Buffer/process in the browser opt in later.
|
|
180
180
|
// serverFunctionsVitePlugin applies the "use server" transform (client RPC stub /
|
|
181
181
|
// server registration) per-build via the ssr flag.
|
|
@@ -186,10 +186,18 @@ export async function fluixiPlugins(cfg) {
|
|
|
186
186
|
// app has no way to say where an unimported tag comes from.
|
|
187
187
|
//
|
|
188
188
|
// `fluixi()` and not `createVitePlugin()`: the latter is the bare compiler integration,
|
|
189
|
-
// and the reactive graph
|
|
189
|
+
// and the reactive graph: agent, source marks, /__fluixi/graph, is composed on top of
|
|
190
190
|
// it by the former. A start app got no graph at all until this changed.
|
|
191
|
-
|
|
191
|
+
// Everything the app declared for the compiler, with `resolve` still usable on its
|
|
192
|
+
// own because it is the one most apps set. A start app never writes
|
|
193
|
+
// `fluixi()` itself, so without this passthrough the plugin's other options
|
|
194
|
+
// (propsDestructure and the rest) had nowhere to be declared.
|
|
195
|
+
fluixi({ ...(cfg.vitePlugin ?? {}), ...(cfg.resolve ? { resolve: cfg.resolve } : {}) }),
|
|
192
196
|
];
|
|
197
|
+
// The app's own, after the framework's: a plugin that transforms css or assets runs
|
|
198
|
+
// on what the framework produced rather than racing it.
|
|
199
|
+
if (cfg.plugins?.length)
|
|
200
|
+
plugins.push(...cfg.plugins);
|
|
193
201
|
// Auto-discover translations (src/i18n/<locale>.json → virtual:fluixi-i18n) unless disabled.
|
|
194
202
|
if (cfg.i18n)
|
|
195
203
|
plugins.push(i18nVitePlugin(cfg.i18n));
|
|
@@ -204,7 +212,7 @@ export { injectApp, splitTemplate, injectAppAndHead, guardHandler, } from './doc
|
|
|
204
212
|
let _guardsInstalled = false;
|
|
205
213
|
/**
|
|
206
214
|
* A render fires the route's data fetches eagerly; if the backend is down those
|
|
207
|
-
* promises can reject AFTER we've already responded, with nothing awaiting them
|
|
215
|
+
* promises can reject AFTER we've already responded, with nothing awaiting them ,
|
|
208
216
|
* a floating rejection would kill the dev server. Swallow + log instead.
|
|
209
217
|
*/
|
|
210
218
|
export function installCrashGuards() {
|
package/dist/internal.mjs
CHANGED
|
@@ -159,7 +159,7 @@ function startTypesPlugin(cfg) {
|
|
|
159
159
|
const blocks = [];
|
|
160
160
|
if (cfg.i18n) blocks.push(...i18nTypeBlock(root, cfg.i18n));
|
|
161
161
|
if (blocks.length === 0) return;
|
|
162
|
-
const content = `// Auto-generated by @fluixi/start
|
|
162
|
+
const content = `// Auto-generated by @fluixi/start, do not edit.
|
|
163
163
|
${blocks.join("\n")}
|
|
164
164
|
`;
|
|
165
165
|
const file = resolvePath(root, "src/fluixi-start-env.d.ts");
|
|
@@ -180,12 +180,17 @@ async function fluixiPlugins(cfg) {
|
|
|
180
180
|
// app has no way to say where an unimported tag comes from.
|
|
181
181
|
//
|
|
182
182
|
// `fluixi()` and not `createVitePlugin()`: the latter is the bare compiler integration,
|
|
183
|
-
// and the reactive graph
|
|
183
|
+
// and the reactive graph: agent, source marks, /__fluixi/graph, is composed on top of
|
|
184
184
|
// it by the former. A start app got no graph at all until this changed.
|
|
185
|
-
|
|
185
|
+
// Everything the app declared for the compiler, with `resolve` still usable on its
|
|
186
|
+
// own because it is the one most apps set. A start app never writes
|
|
187
|
+
// `fluixi()` itself, so without this passthrough the plugin's other options
|
|
188
|
+
// (propsDestructure and the rest) had nowhere to be declared.
|
|
189
|
+
fluixi({ ...cfg.vitePlugin ?? {}, ...cfg.resolve ? { resolve: cfg.resolve } : {} })
|
|
186
190
|
];
|
|
191
|
+
if (cfg.plugins?.length) plugins.push(...cfg.plugins);
|
|
187
192
|
if (cfg.i18n) plugins.push(i18nVitePlugin(cfg.i18n));
|
|
188
|
-
const { apiRoutesVitePlugin } = await import("./api-
|
|
193
|
+
const { apiRoutesVitePlugin } = await import("./api-HD7KU3BS.mjs");
|
|
189
194
|
plugins.push(apiRoutesVitePlugin({ dir: cfg.apiDir }));
|
|
190
195
|
plugins.push(startTypesPlugin(cfg));
|
|
191
196
|
return plugins;
|
package/dist/middleware.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Request middleware
|
|
2
|
+
* Request middleware: a chain that runs BEFORE the SSR render, in both `fluixi dev`
|
|
3
3
|
* and `fluixi start`. Each middleware gets `(request, next)`; calling `next()` runs
|
|
4
4
|
* the rest of the chain (ending in the renderer). A middleware may short-circuit
|
|
5
|
-
* (return a Response without calling `next
|
|
5
|
+
* (return a Response without calling `next`: e.g. an auth redirect or a 401), or
|
|
6
6
|
* call `next()` and adjust the result (add headers, rewrite). Runtime-neutral: a
|
|
7
7
|
* middleware sees a Web `Request` and returns a Web `Response`.
|
|
8
8
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import type { FetchHandler } from './handler.js';
|
|
23
23
|
export type MiddlewareNext = () => Promise<Response>;
|
|
24
24
|
export type Middleware = (request: Request, next: MiddlewareNext) => Response | Promise<Response>;
|
|
25
|
-
/** Identity helper for `export default
|
|
25
|
+
/** Identity helper for `export default`: accepts one middleware or an array. */
|
|
26
26
|
export declare function defineMiddleware(mw: Middleware | Middleware[]): Middleware[];
|
|
27
27
|
/**
|
|
28
28
|
* Normalize a loaded `src/middleware.ts` module's default export into a Middleware[].
|
package/dist/middleware.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,CACvB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,cAAc,KACjB,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAElC,
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,CACvB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,cAAc,KACjB,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAElC,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,UAAU,EAAE,CAE5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,EAAE,CAK9D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,UAAU,EAAE,EACzB,IAAI,EAAE,YAAY,GACjB,YAAY,CAed"}
|
package/dist/middleware.js
CHANGED
package/dist/preload.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/start v0.1.0-alpha.
|
|
1
|
+
/*! @fluixi/start v0.1.0-alpha.75 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/preload.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Which built files a URL needs.
|
|
3
3
|
*
|
|
4
4
|
* Keyed by URL pattern, not module id: the server only has a path, and the route table
|
|
5
|
-
* that would map one to the other lives inside the bundle it is serving
|
|
5
|
+
* that would map one to the other lives inside the bundle it is serving ,
|
|
6
6
|
* `@fluixi/core/routes` resolves to a stub outside a build. `fluixi build` does the
|
|
7
7
|
* join, with each route's layouts folded in.
|
|
8
8
|
*
|
package/dist/preload.mjs
CHANGED
package/dist/router.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/start v0.1.0-alpha.
|
|
1
|
+
/*! @fluixi/start v0.1.0-alpha.75 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/router.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@fluixi/start/router
|
|
2
|
+
* `@fluixi/start/router`: the app-facing routing surface, re-exported from
|
|
3
3
|
* `@fluixi/core/router` (the framework-agnostic `@fluixi/router` core + its
|
|
4
4
|
* fluixi adapter). Importing routing from the meta-framework gives apps a single,
|
|
5
|
-
* stable dependency surface
|
|
5
|
+
* stable dependency surface, they don't reach into fluixi internals:
|
|
6
6
|
*
|
|
7
7
|
* import { Router, Outlet, Link, createMemoryHistory } from '@fluixi/start/router';
|
|
8
8
|
*
|
|
9
9
|
* Framework primitives (Suspense, lazy, signals, components) still come from
|
|
10
|
-
* `@fluixi/core
|
|
10
|
+
* `@fluixi/core`: only routing lives here.
|
|
11
11
|
*/
|
|
12
12
|
export * from '@fluixi/core/router';
|
|
13
13
|
//# sourceMappingURL=router.d.ts.map
|
package/dist/router.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@fluixi/start/router
|
|
2
|
+
* `@fluixi/start/router`: the app-facing routing surface, re-exported from
|
|
3
3
|
* `@fluixi/core/router` (the framework-agnostic `@fluixi/router` core + its
|
|
4
4
|
* fluixi adapter). Importing routing from the meta-framework gives apps a single,
|
|
5
|
-
* stable dependency surface
|
|
5
|
+
* stable dependency surface, they don't reach into fluixi internals:
|
|
6
6
|
*
|
|
7
7
|
* import { Router, Outlet, Link, createMemoryHistory } from '@fluixi/start/router';
|
|
8
8
|
*
|
|
9
9
|
* Framework primitives (Suspense, lazy, signals, components) still come from
|
|
10
|
-
* `@fluixi/core
|
|
10
|
+
* `@fluixi/core`: only routing lives here.
|
|
11
11
|
*/
|
|
12
12
|
export * from '@fluixi/core/router';
|
package/dist/router.mjs
CHANGED
package/dist/server-fn-setup.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/start v0.1.0-alpha.
|
|
1
|
+
/*! @fluixi/start v0.1.0-alpha.75 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Server-only bridge: wire `@fluixi/server`'s request context into the server-function
|
|
3
3
|
* dispatcher so `getRequestEvent()` works inside a `"use server"` function. Imported by
|
|
4
|
-
* `virtual:fluixi-server-fns` (server build only)
|
|
4
|
+
* `virtual:fluixi-server-fns` (server build only), never by the client.
|
|
5
5
|
*/
|
|
6
6
|
import { getRequestEvent } from '@fluixi/server';
|
|
7
7
|
export { getRequestEvent };
|
package/dist/server-fn-setup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Server-only bridge: wire `@fluixi/server`'s request context into the server-function
|
|
3
3
|
* dispatcher so `getRequestEvent()` works inside a `"use server"` function. Imported by
|
|
4
|
-
* `virtual:fluixi-server-fns` (server build only)
|
|
4
|
+
* `virtual:fluixi-server-fns` (server build only), never by the client.
|
|
5
5
|
*/
|
|
6
6
|
import { createRequestContext, runWithRequestContext, getRequestEvent } from '@fluixi/server';
|
|
7
7
|
import { setServerFnContextRunner } from './server-fn.js';
|
|
@@ -13,5 +13,5 @@ setServerFnContextRunner((request, run) => {
|
|
|
13
13
|
return { result, responseHeaders };
|
|
14
14
|
});
|
|
15
15
|
// Re-exported so a server function can `import { getRequestEvent } from '@fluixi/start/server-fn-setup'`
|
|
16
|
-
|
|
16
|
+
//: though importing from `@fluixi/server` directly works too.
|
|
17
17
|
export { getRequestEvent };
|
package/dist/server-fn-setup.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/start v0.1.0-alpha.
|
|
1
|
+
/*! @fluixi/start v0.1.0-alpha.75 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/server-fn-setup.ts
|
|
4
4
|
import { createRequestContext, runWithRequestContext, getRequestEvent } from "@fluixi/server";
|
package/dist/server-fn.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/start v0.1.0-alpha.
|
|
1
|
+
/*! @fluixi/start v0.1.0-alpha.75 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/server-fn.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Server-functions runtime
|
|
2
|
+
* Server-functions runtime: the target of the `"use server"` compiler transform.
|
|
3
3
|
* Client-safe (web APIs only, no node imports): on the client the registry/dispatcher
|
|
4
4
|
* are dead code and the stub `fetch()`es the RPC endpoint; on the server the bodies are
|
|
5
5
|
* registered and `handleServerFn` dispatches them.
|
|
@@ -13,7 +13,7 @@ export declare function $$createServerReference(id: string): (...args: any[]) =>
|
|
|
13
13
|
/**
|
|
14
14
|
* Runs a server function inside a request context so `getRequestEvent()` (request,
|
|
15
15
|
* headers, cookies) works inside it. Injected by `@fluixi/start/server-fn-setup` (which
|
|
16
|
-
* bridges `@fluixi/server`'s AsyncLocalStorage) so this module stays client-safe
|
|
16
|
+
* bridges `@fluixi/server`'s AsyncLocalStorage) so this module stays client-safe, no
|
|
17
17
|
* node imports here. `event.responseHeaders` set inside the fn are returned to the host.
|
|
18
18
|
*/
|
|
19
19
|
type ContextRunner = (request: Request, run: () => any) => {
|
package/dist/server-fn.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Server-functions runtime
|
|
2
|
+
* Server-functions runtime: the target of the `"use server"` compiler transform.
|
|
3
3
|
* Client-safe (web APIs only, no node imports): on the client the registry/dispatcher
|
|
4
4
|
* are dead code and the stub `fetch()`es the RPC endpoint; on the server the bodies are
|
|
5
5
|
* registered and `handleServerFn` dispatches them.
|
|
@@ -24,7 +24,7 @@ export function setServerFnContextRunner(runner) {
|
|
|
24
24
|
contextRunner = runner;
|
|
25
25
|
}
|
|
26
26
|
// The fetch the RPC client uses. Pluggable so interceptors (auth headers, 401 handling,
|
|
27
|
-
// retry) apply to server-function calls
|
|
27
|
+
// retry) apply to server-function calls: `addInterceptor` swaps in the intercepted fetch.
|
|
28
28
|
let _fetch = (...a) => fetch(...a);
|
|
29
29
|
export function setServerFnFetch(f) {
|
|
30
30
|
_fetch = f;
|
package/dist/server-fn.mjs
CHANGED