@fluixi/start 0.1.0-alpha.73 → 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 +750 -0
- 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 +719 -0
- package/dist/adapters/entry.cjs +122 -0
- package/dist/adapters/entry.js +1 -1
- package/dist/adapters/entry.mjs +95 -0
- package/dist/adapters/platforms.cjs +311 -0
- package/dist/adapters/platforms.d.ts +2 -2
- package/dist/adapters/platforms.js +8 -8
- package/dist/adapters/platforms.mjs +284 -0
- package/dist/api-HD7KU3BS.mjs +114 -0
- package/dist/api.cjs +145 -0
- package/dist/api.js +1 -1
- package/dist/api.mjs +116 -0
- package/dist/commands/api-HD7KU3BS.mjs +114 -0
- package/dist/commands/api-PBT4QZ34.mjs +16 -0
- package/dist/commands/api-PJL37LV3.mjs +17 -0
- package/dist/commands/build.cjs +877 -0
- package/dist/commands/build.js +6 -6
- package/dist/commands/build.mjs +717 -0
- package/dist/commands/chunk-GFQ4MUIC.mjs +117 -0
- package/dist/commands/chunk-MTM6M3TC.mjs +115 -0
- package/dist/commands/dev.cjs +670 -0
- package/dist/commands/dev.js +3 -3
- package/dist/commands/dev.mjs +512 -0
- package/dist/commands/index.cjs +1145 -0
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.js +1 -1
- package/dist/commands/index.mjs +982 -0
- package/dist/commands/prerender.cjs +404 -0
- package/dist/commands/prerender.d.ts +1 -1
- package/dist/commands/prerender.js +2 -2
- package/dist/commands/prerender.mjs +377 -0
- package/dist/commands/start.cjs +463 -0
- package/dist/commands/start.d.ts +1 -1
- package/dist/commands/start.js +2 -2
- package/dist/commands/start.mjs +428 -0
- package/dist/config.cjs +150 -0
- 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 +114 -0
- 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 +200 -0
- 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 +169 -0
- package/dist/document.cjs +115 -0
- package/dist/document.d.ts +1 -1
- package/dist/document.js +1 -1
- package/dist/document.mjs +86 -0
- package/dist/generated-api.cjs +43 -0
- package/dist/generated-api.js +1 -1
- package/dist/generated-api.mjs +18 -0
- package/dist/generated-server-fns.cjs +43 -0
- package/dist/generated-server-fns.mjs +18 -0
- package/dist/handler-core.cjs +211 -0
- package/dist/handler-core.d.ts +2 -2
- package/dist/handler-core.js +2 -2
- package/dist/handler-core.mjs +185 -0
- package/dist/handler.cjs +182 -0
- package/dist/handler.d.ts +3 -3
- package/dist/handler.js +3 -3
- package/dist/handler.mjs +152 -0
- package/dist/head.cjs +25 -0
- package/dist/head.d.ts +1 -1
- package/dist/head.js +1 -1
- package/dist/head.mjs +4 -0
- 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 +151 -0
- 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 +126 -0
- package/dist/index.cjs +303 -0
- 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 +262 -0
- package/dist/interceptors.cjs +72 -0
- package/dist/interceptors.js +1 -1
- package/dist/interceptors.mjs +44 -0
- package/dist/internal.cjs +393 -0
- 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 +223 -0
- package/dist/middleware.cjs +58 -0
- package/dist/middleware.d.ts +3 -3
- package/dist/middleware.d.ts.map +1 -1
- package/dist/middleware.js +1 -1
- package/dist/middleware.mjs +31 -0
- package/dist/preload.cjs +42 -0
- package/dist/preload.js +1 -1
- package/dist/preload.mjs +18 -0
- package/dist/router.cjs +25 -0
- package/dist/router.d.ts +3 -3
- package/dist/router.js +3 -3
- package/dist/router.mjs +4 -0
- package/dist/server-fn-setup.cjs +46 -0
- package/dist/server-fn-setup.d.ts +1 -1
- package/dist/server-fn-setup.js +2 -2
- package/dist/server-fn-setup.mjs +22 -0
- package/dist/server-fn.cjs +109 -0
- package/dist/server-fn.d.ts +2 -2
- package/dist/server-fn.js +2 -2
- package/dist/server-fn.mjs +79 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/ui.cjs +123 -0
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +93 -0
- package/package.json +63 -25
package/dist/adapter.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare function createProdHandler(config?: FluixiConfig): Promise<FetchH
|
|
|
10
10
|
/**
|
|
11
11
|
* The shell the server renders into.
|
|
12
12
|
*
|
|
13
|
-
* `dist/client/index.html` is it, until the app prerenders
|
|
13
|
+
* `dist/client/index.html` is it, until the app prerenders `/`, then that path holds a
|
|
14
14
|
* rendered page and the build stashes the shell in `dist/server/template.html` first.
|
|
15
15
|
* Rendering into the page instead puts the home page's markup and head around every
|
|
16
16
|
* SSR response, and leaves hydration two mount elements to choose between.
|
|
@@ -35,7 +35,7 @@ export interface AdapterBuildContext {
|
|
|
35
35
|
hasServer: boolean;
|
|
36
36
|
/**
|
|
37
37
|
* Bundle a generated entry into one self-contained file. Adapters emit a small
|
|
38
|
-
* platform entry
|
|
38
|
+
* platform entry: the worker's `fetch` export, the function's handler, and this
|
|
39
39
|
* pulls the server bundle and the template into it, because none of these
|
|
40
40
|
* platforms can resolve a module or read a file at runtime.
|
|
41
41
|
*/
|
|
@@ -45,7 +45,7 @@ export interface AdapterBuildContext {
|
|
|
45
45
|
* A deploy target.
|
|
46
46
|
*
|
|
47
47
|
* The runtime-neutral fetch handler is the portable core; an adapter packages it for a
|
|
48
|
-
* platform
|
|
48
|
+
* platform: how the server is bundled (`bundle`), how it is served in development or
|
|
49
49
|
* on a long-running host (`serve`), and what a deploy actually needs on disk
|
|
50
50
|
* (`build`): a worker entry, a function manifest, a routing config.
|
|
51
51
|
*/
|
|
@@ -55,10 +55,10 @@ export interface Adapter {
|
|
|
55
55
|
* How `fluixi build` bundles the framework into the server output. The choice is a
|
|
56
56
|
* property of the deploy target, not of the app:
|
|
57
57
|
*
|
|
58
|
-
* - `'external'
|
|
58
|
+
* - `'external'`: `@fluixi/*` stays as bare imports, resolved from `node_modules` at
|
|
59
59
|
* runtime. Smaller output, faster build; requires the dependencies to be installed
|
|
60
60
|
* next to it. Right for a long-running Node/Bun/Deno process.
|
|
61
|
-
* - `'inline'
|
|
61
|
+
* - `'inline'`: everything is bundled into one self-contained file that resolves
|
|
62
62
|
* nothing at runtime. Right for edge/serverless, where there is no `node_modules`.
|
|
63
63
|
*
|
|
64
64
|
* Unset leaves Vite's own heuristic alone (installed deps external, linked ones bundled).
|
|
@@ -73,10 +73,10 @@ export interface Adapter {
|
|
|
73
73
|
*/
|
|
74
74
|
build?(ctx: AdapterBuildContext): Promise<void> | void;
|
|
75
75
|
}
|
|
76
|
-
/** Reference filesystem adapter
|
|
76
|
+
/** Reference filesystem adapter: Node `http` + static files from dist/client. */
|
|
77
77
|
export declare const nodeAdapter: Adapter;
|
|
78
78
|
export { cloudflareAdapter, netlifyAdapter, vercelAdapter } from './adapters/platforms.js';
|
|
79
|
-
/** Reference edge/web adapter
|
|
79
|
+
/** Reference edge/web adapter: export `{ fetch }`; the platform serves assets. */
|
|
80
80
|
export declare const webAdapter: Adapter;
|
|
81
81
|
/**
|
|
82
82
|
* The Vite `ssr` options for a build, given the configured adapter's `bundle` mode.
|
|
@@ -91,9 +91,9 @@ export declare const webAdapter: Adapter;
|
|
|
91
91
|
* only honours an *exact* id in `ssr.external`. A bare package name falls through to a
|
|
92
92
|
* resolvability probe that does not externalize deep imports here, and the result is the
|
|
93
93
|
* worst of both worlds: `@fluixi/core` an import, `@fluixi/core/router` copied into
|
|
94
|
-
* the bundle
|
|
94
|
+
* the bundle: two routers, two sets of module state, in one server.
|
|
95
95
|
*
|
|
96
|
-
* `ssrNoExternal` always wins
|
|
96
|
+
* `ssrNoExternal` always wins: it is the app saying "this one must be bundled".
|
|
97
97
|
*/
|
|
98
98
|
export declare function ssrBuildOptions(cfg: ResolvedConfig): {
|
|
99
99
|
noExternal?: string[] | true;
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAI7E;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,GAAE,YAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAiBxF;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGxF;AAoBD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,GAAG,EAAE,cAAc,CAAC;IACpB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,cAAc,CAAC;IACpB,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,SAAS,EAAE,OAAO,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AA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC/B,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IACpE;;;OAGG;IACH,KAAK,CAAC,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACxD;AAED,iFAAiF;AACjF,eAAO,MAAM,WAAW,EAAE,OAWzB,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE3F,kFAAkF;AAClF,eAAO,MAAM,UAAU,EAAE,OAQxB,CAAC;AAUF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG;IACpD,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAoBA"}
|
package/dist/adapter.js
CHANGED
|
@@ -18,7 +18,7 @@ export async function createProdHandler(config = {}) {
|
|
|
18
18
|
const clientDir = resolve(cfg.root, 'dist/client');
|
|
19
19
|
const template = await readTemplate(clientDir, resolve(cfg.root, 'dist/server'));
|
|
20
20
|
const serverEntry = resolve(cfg.root, 'dist/server', 'entry-server.js');
|
|
21
|
-
// SPA apps may ship no server entry (or one only for server functions)
|
|
21
|
+
// SPA apps may ship no server entry (or one only for server functions), import if present.
|
|
22
22
|
const mod = existsSync(serverEntry)
|
|
23
23
|
? await import(/* @vite-ignore */ pathToFileURL(serverEntry).href)
|
|
24
24
|
: {};
|
|
@@ -32,7 +32,7 @@ export async function createProdHandler(config = {}) {
|
|
|
32
32
|
/**
|
|
33
33
|
* The shell the server renders into.
|
|
34
34
|
*
|
|
35
|
-
* `dist/client/index.html` is it, until the app prerenders
|
|
35
|
+
* `dist/client/index.html` is it, until the app prerenders `/`, then that path holds a
|
|
36
36
|
* rendered page and the build stashes the shell in `dist/server/template.html` first.
|
|
37
37
|
* Rendering into the page instead puts the home page's markup and head around every
|
|
38
38
|
* SSR response, and leaves hydration two mount elements to choose between.
|
|
@@ -59,7 +59,7 @@ async function loadPreloader(cfg) {
|
|
|
59
59
|
return undefined;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
/** Reference filesystem adapter
|
|
62
|
+
/** Reference filesystem adapter: Node `http` + static files from dist/client. */
|
|
63
63
|
export const nodeAdapter = {
|
|
64
64
|
name: 'node',
|
|
65
65
|
// A Node server runs from the app directory, so node_modules is right there: keep the
|
|
@@ -73,7 +73,7 @@ export const nodeAdapter = {
|
|
|
73
73
|
},
|
|
74
74
|
};
|
|
75
75
|
export { cloudflareAdapter, netlifyAdapter, vercelAdapter } from './adapters/platforms.js';
|
|
76
|
-
/** Reference edge/web adapter
|
|
76
|
+
/** Reference edge/web adapter: export `{ fetch }`; the platform serves assets. */
|
|
77
77
|
export const webAdapter = {
|
|
78
78
|
name: 'web',
|
|
79
79
|
// An edge/serverless runtime uploads a file, not an install: nothing may be left to
|
|
@@ -87,7 +87,7 @@ export const webAdapter = {
|
|
|
87
87
|
* Subpaths that only look like package entries: a Vite plugin replaces them with the
|
|
88
88
|
* app's generated route/server-fn/API tables, and the real file in the package is a stub
|
|
89
89
|
* that throws. Externalizing one would ship the stub. The plugins run with
|
|
90
|
-
* `enforce: 'pre'` so they win anyway
|
|
90
|
+
* `enforce: 'pre'` so they win anyway: this list is the second lock on that door.
|
|
91
91
|
*/
|
|
92
92
|
const GENERATED_SUBPATHS = new Set(['./routes', './server-fns', './api-routes']);
|
|
93
93
|
/**
|
|
@@ -103,9 +103,9 @@ const GENERATED_SUBPATHS = new Set(['./routes', './server-fns', './api-routes'])
|
|
|
103
103
|
* only honours an *exact* id in `ssr.external`. A bare package name falls through to a
|
|
104
104
|
* resolvability probe that does not externalize deep imports here, and the result is the
|
|
105
105
|
* worst of both worlds: `@fluixi/core` an import, `@fluixi/core/router` copied into
|
|
106
|
-
* the bundle
|
|
106
|
+
* the bundle: two routers, two sets of module state, in one server.
|
|
107
107
|
*
|
|
108
|
-
* `ssrNoExternal` always wins
|
|
108
|
+
* `ssrNoExternal` always wins: it is the app saying "this one must be bundled".
|
|
109
109
|
*/
|
|
110
110
|
export function ssrBuildOptions(cfg) {
|
|
111
111
|
const noExternal = cfg.ssrNoExternal.length ? cfg.ssrNoExternal : undefined;
|
|
@@ -121,7 +121,7 @@ export function ssrBuildOptions(cfg) {
|
|
|
121
121
|
// Silently building an inlined bundle here would look identical to a working one
|
|
122
122
|
// until someone measures it, so say why nothing was externalized.
|
|
123
123
|
console.warn(` fluixi: adapter "${cfg.adapter?.name}" builds an externalized server, but no ` +
|
|
124
|
-
`fluixi or @fluixi/* dependency was found in ${join(cfg.root, 'package.json')}
|
|
124
|
+
`fluixi or @fluixi/* dependency was found in ${join(cfg.root, 'package.json')}, bundling everything.`);
|
|
125
125
|
}
|
|
126
126
|
return { noExternal, external: external.length ? external : undefined };
|
|
127
127
|
}
|
|
@@ -136,7 +136,7 @@ function frameworkDeps(root) {
|
|
|
136
136
|
return Object.keys(declared).filter((id) => id === '@fluixi/core' || id.startsWith('@fluixi/'));
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
|
-
* `['@fluixi/core', '@fluixi/core/router', …]
|
|
139
|
+
* `['@fluixi/core', '@fluixi/core/router', …]`: the package plus every static subpath it
|
|
140
140
|
* exports. Wildcard entries (`./lib/*`) cannot be enumerated and are left to Vite; an
|
|
141
141
|
* app importing through one gets it bundled, which is the safe direction.
|
|
142
142
|
*/
|
|
@@ -164,7 +164,7 @@ function resolvePackage(root, name) {
|
|
|
164
164
|
return readPackage(createRequire(join(root, 'index.js')).resolve(`${name}/package.json`));
|
|
165
165
|
}
|
|
166
166
|
catch {
|
|
167
|
-
/* not exported
|
|
167
|
+
/* not exported: fall through */
|
|
168
168
|
}
|
|
169
169
|
for (let dir = root;; dir = dirname(dir)) {
|
|
170
170
|
const pkg = readPackage(join(dir, 'node_modules', name, 'package.json'));
|