@fiyuu/runtime 0.1.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/LICENSE +674 -0
- package/README.md +194 -0
- package/package.json +23 -0
- package/src/bundler.d.ts +9 -0
- package/src/bundler.js +124 -0
- package/src/cli.d.ts +2 -0
- package/src/cli.js +25 -0
- package/src/client-runtime.d.ts +15 -0
- package/src/client-runtime.js +527 -0
- package/src/index.d.ts +4 -0
- package/src/index.js +4 -0
- package/src/inspector.d.ts +38 -0
- package/src/inspector.js +261 -0
- package/src/server-devtools.d.ts +13 -0
- package/src/server-devtools.js +122 -0
- package/src/server-loader.d.ts +26 -0
- package/src/server-loader.js +158 -0
- package/src/server-middleware.d.ts +7 -0
- package/src/server-middleware.js +49 -0
- package/src/server-renderer.d.ts +34 -0
- package/src/server-renderer.js +213 -0
- package/src/server-router.d.ts +14 -0
- package/src/server-router.js +67 -0
- package/src/server-types.d.ts +167 -0
- package/src/server-types.js +5 -0
- package/src/server-utils.d.ts +15 -0
- package/src/server-utils.js +97 -0
- package/src/server-websocket.d.ts +7 -0
- package/src/server-websocket.js +55 -0
- package/src/server.d.ts +68 -0
- package/src/server.js +779 -0
- package/src/service.d.ts +28 -0
- package/src/service.js +71 -0
package/README.md
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Fiyuu
|
|
2
|
+
|
|
3
|
+
Fiyuu is an **AI-native fullstack framework** built on GEA.
|
|
4
|
+
It makes app structure deterministic and exports machine-readable artifacts so both developers and AI tools can work with the same reliable context.
|
|
5
|
+
|
|
6
|
+
## What problem does Fiyuu solve?
|
|
7
|
+
|
|
8
|
+
Routing and rendering are already solved by strong frameworks.
|
|
9
|
+
Fiyuu focuses on a different bottleneck: **AI and humans often misread intent in large, fast-changing codebases**.
|
|
10
|
+
|
|
11
|
+
Fiyuu enforces fixed route contracts (`page.tsx`, `query.ts`, `action.ts`, `schema.ts`, `meta.ts`) and generates `.fiyuu/graph.json` plus AI docs (`PROJECT.md`, `PATHS.md`, `EXECUTION.md`, and more). This reduces guesswork in generation, refactors, and review flows.
|
|
12
|
+
|
|
13
|
+
## Why Fiyuu?
|
|
14
|
+
|
|
15
|
+
- **AI-native project context** — `fiyuu sync` exports graph + AI docs from real app structure
|
|
16
|
+
- **Deterministic fullstack contracts** — fixed file conventions reduce hidden behavior and drift
|
|
17
|
+
- **GEA-first runtime** — app route code stays React-free at the framework layer
|
|
18
|
+
- **Built-in diagnostics** — `fiyuu doctor` validates structure and common anti-patterns
|
|
19
|
+
- **AI assistant bridge** — `fiyuu ai "<prompt>"` prints route-aware context for external LLM workflows
|
|
20
|
+
|
|
21
|
+
## Measurable differentiation
|
|
22
|
+
|
|
23
|
+
Fiyuu tracks performance and DX scorecards by release.
|
|
24
|
+
|
|
25
|
+
| Metric | How to measure | Current (v0.1.x) | Target (v0.2) |
|
|
26
|
+
| --- | --- | --- | --- |
|
|
27
|
+
| Cold build time | `time npm run build` | Baseline pending | >= 20% better on reference app profile |
|
|
28
|
+
| SSR latency (avg/p95) | `npm run benchmark:gea` | Baseline pending | >= 15% lower p95 on reference profile |
|
|
29
|
+
| Client JS bundle size | `npm run benchmark:gea` (bundle output) | Baseline pending | >= 20% smaller on reference profile |
|
|
30
|
+
| AI context readiness time | `time fiyuu sync` | Baseline pending | <= 1s for 100-route reference app |
|
|
31
|
+
|
|
32
|
+
Until public scorecards are published, treat Fiyuu as an early-stage framework.
|
|
33
|
+
|
|
34
|
+
## Performance and benchmark tooling
|
|
35
|
+
|
|
36
|
+
Fiyuu uses Node.js native HTTP server (no Express). Client assets are bundled with esbuild. SSG routes are cached in memory with optional `meta.revalidate` (ISR-style TTL). Query results support TTL caching with in-flight de-duplication. Navigation responses and HTML support ETag/304, and client navigation prefetches links on hover/focus/viewport.
|
|
37
|
+
|
|
38
|
+
For app-layer UI performance, `fiyuu/client` also provides `optimizedImage`, `optimizedVideo`, and responsive helpers (`responsiveStyle`, `mediaUp`, `fluid`, etc.) so teams can ship faster pages without adding heavy UI runtime dependencies.
|
|
39
|
+
|
|
40
|
+
## Built-in Database (FiyuuDB)
|
|
41
|
+
|
|
42
|
+
Fiyuu includes a lightweight, always-in-memory database with SQL-like query support:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// In query.ts or action.ts
|
|
46
|
+
import { db } from "@fiyuu/db";
|
|
47
|
+
|
|
48
|
+
// SQL-like queries
|
|
49
|
+
const users = await db.query("SELECT * FROM users WHERE age > ? AND status = ?", [18, "active"]);
|
|
50
|
+
await db.query("INSERT INTO users (name, email) VALUES (?, ?)", ["Ali", "ali@test.com"]);
|
|
51
|
+
await db.query("UPDATE users SET status = ? WHERE id = ?", ["inactive", "u_123"]);
|
|
52
|
+
|
|
53
|
+
// Table API
|
|
54
|
+
const table = db.table("users");
|
|
55
|
+
const admins = table.find({ role: "admin" });
|
|
56
|
+
const one = table.findOne({ email: "a@b.com" });
|
|
57
|
+
table.insert({ name: "Ahmet", email: "ahmet@test.com" });
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Real-time Channels
|
|
61
|
+
|
|
62
|
+
Fiyuu provides built-in real-time communication via WebSocket and NATS:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
// Server-side (app/services/realtime-sync.ts)
|
|
66
|
+
import { defineService } from "@fiyuu/runtime";
|
|
67
|
+
import { realtime } from "@fiyuu/realtime";
|
|
68
|
+
|
|
69
|
+
export default defineService({
|
|
70
|
+
name: "realtime-sync",
|
|
71
|
+
start({ realtime, db }) {
|
|
72
|
+
const chat = realtime.channel("chat");
|
|
73
|
+
chat.on("message", async (data, socket) => {
|
|
74
|
+
chat.broadcast("new-message", { text: data.text, user: socket.userId });
|
|
75
|
+
await db.query("INSERT INTO messages (text, user) VALUES (?, ?)", [data.text, socket.userId]);
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<!-- Client-side -->
|
|
83
|
+
<script>
|
|
84
|
+
const chat = fiyuu.channel("chat");
|
|
85
|
+
chat.on("new-message", (data) => console.log(data));
|
|
86
|
+
chat.emit("message", { text: "Hello!" });
|
|
87
|
+
</script>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Service-based Lifecycle (Always-Alive App)
|
|
91
|
+
|
|
92
|
+
Unlike Next.js (request-driven), Fiyuu apps stay alive continuously with background services:
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
// app/services/data-sync.ts
|
|
96
|
+
import { defineService } from "@fiyuu/runtime";
|
|
97
|
+
|
|
98
|
+
export default defineService({
|
|
99
|
+
name: "data-sync",
|
|
100
|
+
async start({ db, realtime, config, log }) {
|
|
101
|
+
// Runs on boot, continuously in background
|
|
102
|
+
setInterval(async () => {
|
|
103
|
+
const stats = await db.query("SELECT COUNT(*) as c FROM users WHERE active = 1");
|
|
104
|
+
realtime.channel("stats").emit("update", stats[0]);
|
|
105
|
+
}, 30000);
|
|
106
|
+
},
|
|
107
|
+
async stop({ log }) {
|
|
108
|
+
// Cleanup on shutdown
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Run benchmark:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npm run benchmark:gea
|
|
117
|
+
npm run benchmark:scorecard
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
This reports per-route latency (`avg`, `p50`, `p95`, `min`, `max`) and total client bundle size.
|
|
121
|
+
The scorecard command also records build/sync/doctor outputs into `docs/benchmarks/latest-scorecard.md`.
|
|
122
|
+
|
|
123
|
+
## Current scope (v2 direction)
|
|
124
|
+
|
|
125
|
+
- Primary: **AI-first routing framework** with deterministic contracts
|
|
126
|
+
- Shipping priority: graph tooling, diagnostics, and SSR + cache primitives
|
|
127
|
+
- Secondary: broader adapters, plugin ecosystem depth, CSR/SSG parity
|
|
128
|
+
|
|
129
|
+
## Competitive snapshot
|
|
130
|
+
|
|
131
|
+
Fiyuu is not positioned as a full replacement for Next.js, Nuxt, or Astro today.
|
|
132
|
+
It is positioned as an AI-native framework workflow where deterministic graph context is a first-class feature.
|
|
133
|
+
|
|
134
|
+
- Ecosystem breadth: behind mature frameworks (current reality)
|
|
135
|
+
- AI-readable architecture context: core investment area
|
|
136
|
+
- Public benchmark scorecards: in progress (`docs/benchmark-matrix.md`)
|
|
137
|
+
|
|
138
|
+
## Use cases
|
|
139
|
+
|
|
140
|
+
- **AI-assisted teams** using Copilot, Cursor, or local LLM pipelines
|
|
141
|
+
- **React-free app layer** teams that prefer explicit route contracts
|
|
142
|
+
- **Internal tools and dashboards** where deterministic structure matters more than maximal abstraction
|
|
143
|
+
|
|
144
|
+
## Quick Start
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npm create fiyuu-app@latest my-app
|
|
148
|
+
cd my-app
|
|
149
|
+
npm install
|
|
150
|
+
npm run dev
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Useful commands
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
fiyuu dev
|
|
157
|
+
fiyuu build
|
|
158
|
+
fiyuu start
|
|
159
|
+
fiyuu deploy
|
|
160
|
+
fiyuu cloud help
|
|
161
|
+
fiyuu cloud login <token> --endpoint https://api.fiyuu.work
|
|
162
|
+
fiyuu cloud project create mysite
|
|
163
|
+
fiyuu cloud deploy mysite
|
|
164
|
+
fiyuu sync
|
|
165
|
+
fiyuu doctor
|
|
166
|
+
fiyuu doctor --fix
|
|
167
|
+
fiyuu graph stats
|
|
168
|
+
fiyuu graph export --format markdown --out docs/graph.md
|
|
169
|
+
fiyuu ai "explain route dependencies for /requests"
|
|
170
|
+
fiyuu skill list
|
|
171
|
+
fiyuu skill run seo-baseline
|
|
172
|
+
fiyuu feat list
|
|
173
|
+
fiyuu feat socket on
|
|
174
|
+
fiyuu feat socket off
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Default starter
|
|
178
|
+
|
|
179
|
+
- One-page home layout
|
|
180
|
+
- Optional feature selection during setup (interactive multi-select)
|
|
181
|
+
- Optional light/dark theme toggle with localStorage persistence
|
|
182
|
+
- Built-in `app/not-found.tsx` and `app/error.tsx`
|
|
183
|
+
|
|
184
|
+
## Documentation
|
|
185
|
+
|
|
186
|
+
- English: `docs/en.md`
|
|
187
|
+
- Turkish: `docs/tr.md`
|
|
188
|
+
- Skills (EN): `docs/skills.md`
|
|
189
|
+
- Skills (TR): `docs/skills.tr.md`
|
|
190
|
+
- v2 Product Spec (TR): `docs/v2-product-spec.tr.md`
|
|
191
|
+
- Benchmark Matrix: `docs/benchmark-matrix.md`
|
|
192
|
+
- Benchmarks Folder: `docs/benchmarks/README.md`
|
|
193
|
+
- AI Demo Walkthrough: `docs/ai-demo.md`
|
|
194
|
+
- AI-for-Framework Guide: `docs/ai-for-framework.md`
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fiyuu/runtime",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.js",
|
|
8
|
+
"./cli": "./src/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@geajs/core": "^1.0.12",
|
|
12
|
+
"@fiyuu/core": "0.1.0",
|
|
13
|
+
"@fiyuu/db": "0.3.0",
|
|
14
|
+
"@fiyuu/realtime": "0.3.0",
|
|
15
|
+
"chokidar": "^4.0.3",
|
|
16
|
+
"esbuild": "^0.25.2",
|
|
17
|
+
"ws": "^8.18.1"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": "^19.1.0",
|
|
21
|
+
"react-dom": "^19.1.0"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/src/bundler.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
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[]>;
|
package/src/bundler.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
}
|
package/src/cli.d.ts
ADDED
package/src/cli.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
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;
|