@fiyuu/runtime 0.4.2 → 0.4.3
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 +674 -0
- package/dist/bundler.d.ts +10 -0
- package/dist/bundler.d.ts.map +1 -0
- package/dist/bundler.js +125 -0
- package/dist/bundler.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +26 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-runtime.d.ts +16 -0
- package/dist/client-runtime.d.ts.map +1 -0
- package/dist/client-runtime.js +528 -0
- package/dist/client-runtime.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/inspector.d.ts +39 -0
- package/dist/inspector.d.ts.map +1 -0
- package/dist/inspector.js +262 -0
- package/dist/inspector.js.map +1 -0
- package/dist/server-devtools.d.ts +14 -0
- package/dist/server-devtools.d.ts.map +1 -0
- package/dist/server-devtools.js +123 -0
- package/dist/server-devtools.js.map +1 -0
- package/dist/server-loader.d.ts +27 -0
- package/dist/server-loader.d.ts.map +1 -0
- package/dist/server-loader.js +159 -0
- package/dist/server-loader.js.map +1 -0
- package/dist/server-middleware.d.ts +8 -0
- package/dist/server-middleware.d.ts.map +1 -0
- package/dist/server-middleware.js +50 -0
- package/dist/server-middleware.js.map +1 -0
- package/dist/server-renderer.d.ts +42 -0
- package/dist/server-renderer.d.ts.map +1 -0
- package/dist/server-renderer.js +255 -0
- package/dist/server-renderer.js.map +1 -0
- package/dist/server-router.d.ts +15 -0
- package/dist/server-router.d.ts.map +1 -0
- package/dist/server-router.js +68 -0
- package/dist/server-router.js.map +1 -0
- package/dist/server-types.d.ts +168 -0
- package/dist/server-types.d.ts.map +1 -0
- package/dist/server-types.js +6 -0
- package/dist/server-types.js.map +1 -0
- package/dist/server-utils.d.ts +17 -0
- package/dist/server-utils.d.ts.map +1 -0
- package/dist/server-utils.js +103 -0
- package/dist/server-utils.js.map +1 -0
- package/dist/server-websocket.d.ts +8 -0
- package/dist/server-websocket.d.ts.map +1 -0
- package/dist/server-websocket.js +56 -0
- package/dist/server-websocket.js.map +1 -0
- package/dist/server.d.ts +69 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +846 -0
- package/dist/server.js.map +1 -0
- package/dist/service.d.ts +29 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +72 -0
- package/dist/service.js.map +1 -0
- package/package.json +11 -18
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FeatureRecord, RenderMode } from "@fiyuu/core";
|
|
2
|
+
export interface ClientAsset {
|
|
3
|
+
route: string;
|
|
4
|
+
feature: string;
|
|
5
|
+
render: RenderMode;
|
|
6
|
+
bundleFile: string;
|
|
7
|
+
publicPath: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function bundleClient(features: FeatureRecord[], outputDirectory: string): Promise<ClientAsset[]>;
|
|
10
|
+
//# sourceMappingURL=bundler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../../packages/runtime/src/bundler.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAID,wBAAsB,YAAY,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAgE7G"}
|
package/dist/bundler.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { promises as fs, existsSync } from "node:fs";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { build } from "esbuild";
|
|
5
|
+
const buildCache = new Map();
|
|
6
|
+
export async function bundleClient(features, outputDirectory) {
|
|
7
|
+
await fs.mkdir(outputDirectory, { recursive: true });
|
|
8
|
+
const pageFeatures = features.filter((feature) => feature.files["page.tsx"] && feature.render === "csr");
|
|
9
|
+
const assets = await Promise.all(pageFeatures.map(async (feature) => {
|
|
10
|
+
const safeFeatureName = feature.feature.length > 0 ? feature.feature.replaceAll("/", "_") : "home";
|
|
11
|
+
const pageFile = feature.files["page.tsx"];
|
|
12
|
+
const layoutFiles = resolveLayoutFiles(feature, pageFile);
|
|
13
|
+
const signature = await createBuildSignature([pageFile, ...layoutFiles]);
|
|
14
|
+
const signatureHash = createHash("sha1").update(signature).digest("hex").slice(0, 10);
|
|
15
|
+
const bundleName = `${safeFeatureName}.${signatureHash}.js`;
|
|
16
|
+
const bundleFile = path.join(outputDirectory, bundleName);
|
|
17
|
+
const cacheKey = feature.route;
|
|
18
|
+
const publicPath = `/__fiyuu/client/${bundleName}`;
|
|
19
|
+
const cached = buildCache.get(cacheKey);
|
|
20
|
+
if (cached && cached.signature === signature && existsSync(cached.asset.bundleFile)) {
|
|
21
|
+
return {
|
|
22
|
+
...cached.asset,
|
|
23
|
+
render: feature.render,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
await build({
|
|
27
|
+
stdin: {
|
|
28
|
+
contents: createClientEntry(pageFile, layoutFiles),
|
|
29
|
+
resolveDir: path.dirname(pageFile),
|
|
30
|
+
sourcefile: `${feature.feature}-client.tsx`,
|
|
31
|
+
loader: "tsx",
|
|
32
|
+
},
|
|
33
|
+
bundle: true,
|
|
34
|
+
format: "esm",
|
|
35
|
+
jsx: "automatic",
|
|
36
|
+
jsxImportSource: "@geajs/core",
|
|
37
|
+
minify: true,
|
|
38
|
+
outfile: bundleFile,
|
|
39
|
+
platform: "browser",
|
|
40
|
+
sourcemap: false,
|
|
41
|
+
target: ["es2022"],
|
|
42
|
+
});
|
|
43
|
+
const asset = {
|
|
44
|
+
route: feature.route,
|
|
45
|
+
feature: feature.feature,
|
|
46
|
+
render: feature.render,
|
|
47
|
+
bundleFile,
|
|
48
|
+
publicPath,
|
|
49
|
+
};
|
|
50
|
+
if (cached && cached.asset.bundleFile !== asset.bundleFile && existsSync(cached.asset.bundleFile)) {
|
|
51
|
+
try {
|
|
52
|
+
await fs.unlink(cached.asset.bundleFile);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// ignore stale artifact cleanup failures
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
buildCache.set(cacheKey, { signature, asset });
|
|
59
|
+
return asset;
|
|
60
|
+
}));
|
|
61
|
+
return assets;
|
|
62
|
+
}
|
|
63
|
+
async function createBuildSignature(filePaths) {
|
|
64
|
+
const signatures = await Promise.all(filePaths.map(async (filePath) => {
|
|
65
|
+
const stats = await fs.stat(filePath);
|
|
66
|
+
return `${filePath}:${stats.size}:${Math.floor(stats.mtimeMs)}`;
|
|
67
|
+
}));
|
|
68
|
+
return signatures.join("|");
|
|
69
|
+
}
|
|
70
|
+
function createClientEntry(pageFile, layoutFiles) {
|
|
71
|
+
const layoutImports = layoutFiles
|
|
72
|
+
.map((layoutFile, index) => `import * as LayoutModule${index} from ${JSON.stringify(layoutFile)};`)
|
|
73
|
+
.join("\n");
|
|
74
|
+
const layoutWrappers = layoutFiles
|
|
75
|
+
.map((_, index) => `const Layout${index} = LayoutModule${index}.default; if (Layout${index}) { const wrapped = new Layout${index}({ route, children: String(component) }); component = wrapped; }`)
|
|
76
|
+
.reverse()
|
|
77
|
+
.join("\n ");
|
|
78
|
+
return `
|
|
79
|
+
import { Component } from "@geajs/core";
|
|
80
|
+
import Page from ${JSON.stringify(pageFile)};
|
|
81
|
+
${layoutImports}
|
|
82
|
+
|
|
83
|
+
const data = window.__FIYUU_DATA__ ?? null;
|
|
84
|
+
const route = window.__FIYUU_ROUTE__ ?? "/";
|
|
85
|
+
const intent = window.__FIYUU_INTENT__ ?? "";
|
|
86
|
+
const render = window.__FIYUU_RENDER__ ?? "csr";
|
|
87
|
+
const rootElement = document.getElementById("app");
|
|
88
|
+
const pageProps = { data, route, intent, render };
|
|
89
|
+
if (!(Page && Page.prototype instanceof Component)) {
|
|
90
|
+
throw new Error("Fiyuu Gea mode expects page default export to extend @geajs/core Component.");
|
|
91
|
+
}
|
|
92
|
+
let component = new Page(pageProps);
|
|
93
|
+
${layoutWrappers}
|
|
94
|
+
|
|
95
|
+
if (rootElement) {
|
|
96
|
+
rootElement.innerHTML = "";
|
|
97
|
+
component.render(rootElement);
|
|
98
|
+
|
|
99
|
+
// Re-execute any <script> tags injected by the component.
|
|
100
|
+
// innerHTML assignment does not execute scripts — this is a browser security rule.
|
|
101
|
+
// We collect all script tags and recreate them so they run normally.
|
|
102
|
+
const injectedScripts = rootElement.querySelectorAll("script");
|
|
103
|
+
for (const oldScript of injectedScripts) {
|
|
104
|
+
const newScript = document.createElement("script");
|
|
105
|
+
for (const attr of oldScript.attributes) {
|
|
106
|
+
newScript.setAttribute(attr.name, attr.value);
|
|
107
|
+
}
|
|
108
|
+
newScript.textContent = oldScript.textContent;
|
|
109
|
+
oldScript.parentNode?.replaceChild(newScript, oldScript);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
}
|
|
114
|
+
function resolveLayoutFiles(feature, pageFile) {
|
|
115
|
+
const featureParts = feature.feature ? feature.feature.split("/") : [];
|
|
116
|
+
const featureDirectory = path.dirname(pageFile);
|
|
117
|
+
const appDirectory = featureParts.length > 0
|
|
118
|
+
? path.resolve(featureDirectory, ...Array(featureParts.length).fill(".."))
|
|
119
|
+
: featureDirectory;
|
|
120
|
+
const directories = [appDirectory, ...featureParts.map((_, index) => path.join(appDirectory, ...featureParts.slice(0, index + 1)))];
|
|
121
|
+
return directories
|
|
122
|
+
.map((directory) => path.join(directory, "layout.tsx"))
|
|
123
|
+
.filter((layoutPath) => existsSync(layoutPath));
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=bundler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../../../packages/runtime/src/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAWhC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAqD,CAAC;AAEhF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAyB,EAAE,eAAuB;IACnF,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAErD,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC;IACzG,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAC9B,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACjC,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACnG,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAE,CAAC;QAC5C,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC1D,MAAM,SAAS,GAAG,MAAM,oBAAoB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IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;SACtD,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;AACpD,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../packages/runtime/src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { scanApp } from "@fiyuu/core";
|
|
5
|
+
import { bundleClient } from "./bundler.js";
|
|
6
|
+
async function main() {
|
|
7
|
+
const [, , command, rootDirectory] = process.argv;
|
|
8
|
+
if (command !== "bundle" || !rootDirectory) {
|
|
9
|
+
throw new Error("Usage: runtime bundle <rootDirectory>");
|
|
10
|
+
}
|
|
11
|
+
const appDirectory = resolveAppDirectory(rootDirectory);
|
|
12
|
+
const features = await scanApp(appDirectory);
|
|
13
|
+
const outputDirectory = path.join(rootDirectory, ".fiyuu", "client");
|
|
14
|
+
await bundleClient(features, outputDirectory);
|
|
15
|
+
console.log(`Bundled client assets to ${outputDirectory}`);
|
|
16
|
+
}
|
|
17
|
+
function resolveAppDirectory(rootDirectory) {
|
|
18
|
+
const rootAppDirectory = path.join(rootDirectory, "app");
|
|
19
|
+
const exampleAppDirectory = path.join(rootDirectory, "examples", "basic-app", "app");
|
|
20
|
+
return existsSync(rootAppDirectory) ? rootAppDirectory : exampleAppDirectory;
|
|
21
|
+
}
|
|
22
|
+
main().catch((error) => {
|
|
23
|
+
console.error(error instanceof Error ? error.message : "Unknown bundle error");
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
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,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC;IAC/E,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fiyuu Client Runtime
|
|
3
|
+
*
|
|
4
|
+
* A small script injected into every page that provides:
|
|
5
|
+
* - fiyuu.theme — dark/light mode management
|
|
6
|
+
* - fiyuu.state — simple reactive state with DOM binding
|
|
7
|
+
* - fiyuu.bind — shorthand for updating element text / html
|
|
8
|
+
* - fiyuu.router — client-side navigation without page reload
|
|
9
|
+
* - fiyuu.partial — replace a DOM element with a fetched route's content
|
|
10
|
+
* - fiyuu.onError — global client-side error handler
|
|
11
|
+
* - fiyuu.ws — WebSocket connection helper
|
|
12
|
+
*
|
|
13
|
+
* Everything is accessible via window.fiyuu in page scripts.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildClientRuntime(websocketPath: string): string;
|
|
16
|
+
//# sourceMappingURL=client-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-runtime.d.ts","sourceRoot":"","sources":["../../../../packages/runtime/src/client-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAggBhE"}
|