fluxion-ts 0.0.4
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/.oxlintrc.json +64 -0
- package/.prettierrc +6 -0
- package/AGENTS.md +3 -0
- package/Dockerfile +13 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/document/index.html +16 -0
- package/document/src/main.tsx +8 -0
- package/document/src/styles.css +321 -0
- package/document/src/view/App.tsx +304 -0
- package/document/src/view/CodeBlock.tsx +11 -0
- package/document/src/view/Section.tsx +18 -0
- package/document/vite.config.ts +23 -0
- package/draft/vibe.md +50 -0
- package/package.json +66 -0
- package/rollup.config.mjs +102 -0
- package/scripts/build-image.ts +13 -0
- package/scripts/bump-version.ts +12 -0
- package/scripts/configs.ts +79 -0
- package/scripts/lines.ts +54 -0
- package/scripts/publish.ts +6 -0
- package/src/common/consts.ts +30 -0
- package/src/common/dtm.ts +10 -0
- package/src/common/logger.ts +145 -0
- package/src/core/meta-api.ts +48 -0
- package/src/core/server.ts +447 -0
- package/src/core/types.d.ts +6 -0
- package/src/core/utils/headers.ts +34 -0
- package/src/core/utils/request.ts +145 -0
- package/src/core/utils/send-json.ts +21 -0
- package/src/index.ts +11 -0
- package/src/workers/file-runtime.ts +1071 -0
- package/src/workers/handler-worker-pool.ts +754 -0
- package/src/workers/handler-worker.ts +1029 -0
- package/src/workers/options.ts +77 -0
- package/src/workers/protocol.d.ts +186 -0
- package/tests/core/dynamic-directory.test.ts +48 -0
- package/tests/core/file-runtime.test.ts +347 -0
- package/tests/core/server-options.test.ts +204 -0
- package/tests/e2e/fluxion-server.e2e-spec.ts +225 -0
- package/tests/helpers/test-utils.ts +81 -0
- package/tsconfig.json +22 -0
- package/vitest.config.ts +24 -0
package/.oxlintrc.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"oxlint:recommended",
|
|
4
|
+
"oxlint-plugin-prettier/recommended",
|
|
5
|
+
"oxlint-plugin-typescript/recommended"
|
|
6
|
+
],
|
|
7
|
+
"ignorePatterns": [
|
|
8
|
+
"draft/",
|
|
9
|
+
"dist/",
|
|
10
|
+
"node_modules/",
|
|
11
|
+
"coverage/",
|
|
12
|
+
"**/tests/**/*.ts",
|
|
13
|
+
"**/tests/**/*.tsx",
|
|
14
|
+
"build/",
|
|
15
|
+
"example/",
|
|
16
|
+
"scripts/"
|
|
17
|
+
],
|
|
18
|
+
"plugins": [
|
|
19
|
+
"typescript"
|
|
20
|
+
],
|
|
21
|
+
"rules": {
|
|
22
|
+
"no-explicit-any": "off",
|
|
23
|
+
"no-inferrable-types": "off",
|
|
24
|
+
"prefer-for-of": "off",
|
|
25
|
+
"unified-signatures": "off",
|
|
26
|
+
"no-unused-vars": [
|
|
27
|
+
"warn",
|
|
28
|
+
{
|
|
29
|
+
"argsIgnorePattern": "^_",
|
|
30
|
+
"varsIgnorePattern": "^_",
|
|
31
|
+
"caughtErrorsIgnorePattern": "^_"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"@typescript-eslint/no-extraneous-class": "off",
|
|
35
|
+
"@typescript-eslint/class-literal-property-style": [
|
|
36
|
+
"error",
|
|
37
|
+
"fields"
|
|
38
|
+
],
|
|
39
|
+
"no-debugger": "error",
|
|
40
|
+
"no-console": "warn",
|
|
41
|
+
"no-var": "error",
|
|
42
|
+
"prefer-const": "error",
|
|
43
|
+
"eqeqeq": [
|
|
44
|
+
"error",
|
|
45
|
+
"always"
|
|
46
|
+
],
|
|
47
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
48
|
+
"error",
|
|
49
|
+
{
|
|
50
|
+
"prefer": "type-imports"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"@typescript-eslint/array-type": [
|
|
54
|
+
"error",
|
|
55
|
+
{
|
|
56
|
+
"default": "array-simple"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"@typescript-eslint/consistent-type-definitions": [
|
|
60
|
+
"error",
|
|
61
|
+
"interface"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
package/.prettierrc
ADDED
package/AGENTS.md
ADDED
package/Dockerfile
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
FROM node:24
|
|
2
|
+
WORKDIR /app
|
|
3
|
+
COPY package.json pnpm-lock.yaml ./
|
|
4
|
+
RUN npm install -g pnpm && pnpm install --frozen-lockfile
|
|
5
|
+
RUN pnpm install
|
|
6
|
+
COPY ./dist /app/
|
|
7
|
+
WORKDIR /app
|
|
8
|
+
|
|
9
|
+
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
|
10
|
+
|
|
11
|
+
ENV NODE_ENV=production
|
|
12
|
+
EXPOSE 3000
|
|
13
|
+
CMD ["pnpm", "start"]
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 kasukabe tsumugi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Fluxion
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/fluxion)
|
|
4
|
+
[](https://www.npmjs.com/package/fluxion)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://baendlorel.github.io/fluxion/">
|
|
9
|
+
<img src="https://raw.githubusercontent.com/baendlorel/fluxion/refs/heads/main/assets/fluxion.svg" width="240px" alt="fluxion logo" />
|
|
10
|
+
</a>
|
|
11
|
+
</p>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Fluxion 使用文档</title>
|
|
7
|
+
<meta
|
|
8
|
+
name="description"
|
|
9
|
+
content="Fluxion 中文使用文档:请求判定规则、动态加载机制、元接口与上传部署。"
|
|
10
|
+
/>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="app"></div>
|
|
14
|
+
<script type="module" src="./src/main.tsx"></script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--bg: #f7f6f1;
|
|
5
|
+
--bg-soft: #ece9df;
|
|
6
|
+
--surface: #fffefb;
|
|
7
|
+
--text: #173046;
|
|
8
|
+
--text-soft: #4c6477;
|
|
9
|
+
--line: #d5d9de;
|
|
10
|
+
--brand: #0f8b8d;
|
|
11
|
+
--brand-strong: #0b6f72;
|
|
12
|
+
--warm: #e8a43c;
|
|
13
|
+
--warning: #c94e2f;
|
|
14
|
+
--shadow: 0 22px 44px rgba(23, 48, 70, 0.12);
|
|
15
|
+
--radius: 18px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
* {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
html,
|
|
23
|
+
body {
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
body {
|
|
29
|
+
min-height: 100vh;
|
|
30
|
+
font-family: 'Manrope', sans-serif;
|
|
31
|
+
color: var(--text);
|
|
32
|
+
background:
|
|
33
|
+
radial-gradient(circle at 10% 8%, rgba(15, 139, 141, 0.12), transparent 34%),
|
|
34
|
+
radial-gradient(circle at 90% 0%, rgba(232, 164, 60, 0.16), transparent 36%),
|
|
35
|
+
var(--bg);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
a {
|
|
39
|
+
color: inherit;
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.doc-page {
|
|
44
|
+
width: min(1060px, calc(100% - 2rem));
|
|
45
|
+
margin: 1.4rem auto 2.6rem;
|
|
46
|
+
position: relative;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.bg-glow {
|
|
50
|
+
position: fixed;
|
|
51
|
+
width: 300px;
|
|
52
|
+
height: 300px;
|
|
53
|
+
border-radius: 999px;
|
|
54
|
+
filter: blur(80px);
|
|
55
|
+
opacity: 0.28;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
z-index: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.bg-glow-left {
|
|
61
|
+
top: -80px;
|
|
62
|
+
left: -120px;
|
|
63
|
+
background: #3ca2a4;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.bg-glow-right {
|
|
67
|
+
top: -120px;
|
|
68
|
+
right: -80px;
|
|
69
|
+
background: #f2bb5a;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.hero,
|
|
73
|
+
.toc,
|
|
74
|
+
.content,
|
|
75
|
+
.footer {
|
|
76
|
+
position: relative;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.hero {
|
|
81
|
+
background: linear-gradient(135deg, #fdfcf8 0%, #f4f1e7 100%);
|
|
82
|
+
border: 1px solid var(--line);
|
|
83
|
+
border-radius: 28px;
|
|
84
|
+
padding: 2.4rem;
|
|
85
|
+
box-shadow: var(--shadow);
|
|
86
|
+
animation: lift-in 420ms ease;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.eyebrow {
|
|
90
|
+
margin: 0;
|
|
91
|
+
font-size: 0.82rem;
|
|
92
|
+
font-weight: 700;
|
|
93
|
+
letter-spacing: 0.1em;
|
|
94
|
+
text-transform: uppercase;
|
|
95
|
+
color: var(--brand);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.hero-title {
|
|
99
|
+
margin: 0.55rem 0 0;
|
|
100
|
+
font-size: clamp(1.8rem, 3vw, 2.85rem);
|
|
101
|
+
line-height: 1.12;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.hero-copy {
|
|
105
|
+
margin: 1rem 0 0;
|
|
106
|
+
color: var(--text-soft);
|
|
107
|
+
max-width: 68ch;
|
|
108
|
+
line-height: 1.62;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.inline-code {
|
|
112
|
+
display: inline-block;
|
|
113
|
+
padding: 0.04rem 0.34rem;
|
|
114
|
+
border-radius: 0.36rem;
|
|
115
|
+
border: 1px solid #d8dee4;
|
|
116
|
+
background: #f5f7fa;
|
|
117
|
+
font-family: 'IBM Plex Mono', monospace;
|
|
118
|
+
font-size: 0.84em;
|
|
119
|
+
color: #294357;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.hero-actions {
|
|
123
|
+
margin-top: 1.45rem;
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-wrap: wrap;
|
|
126
|
+
gap: 0.7rem;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.button {
|
|
130
|
+
display: inline-flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
padding: 0.67rem 1.1rem;
|
|
134
|
+
border-radius: 999px;
|
|
135
|
+
font-weight: 700;
|
|
136
|
+
font-size: 0.92rem;
|
|
137
|
+
transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.button:hover {
|
|
141
|
+
transform: translateY(-1px);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.button-primary {
|
|
145
|
+
background: var(--brand);
|
|
146
|
+
color: #ffffff;
|
|
147
|
+
box-shadow: 0 10px 18px rgba(15, 139, 141, 0.24);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.button-primary:hover {
|
|
151
|
+
background: var(--brand-strong);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.button-ghost {
|
|
155
|
+
background: #ffffff;
|
|
156
|
+
border: 1px solid var(--line);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.toc {
|
|
160
|
+
margin-top: 1rem;
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-wrap: wrap;
|
|
163
|
+
gap: 0.5rem;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.toc a {
|
|
167
|
+
padding: 0.48rem 0.82rem;
|
|
168
|
+
border-radius: 999px;
|
|
169
|
+
border: 1px solid #d8dee4;
|
|
170
|
+
background: rgba(255, 255, 255, 0.72);
|
|
171
|
+
font-size: 0.85rem;
|
|
172
|
+
font-weight: 600;
|
|
173
|
+
color: #284358;
|
|
174
|
+
backdrop-filter: blur(3px);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.toc a:hover {
|
|
178
|
+
border-color: var(--brand);
|
|
179
|
+
color: var(--brand-strong);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.content {
|
|
183
|
+
margin-top: 1.15rem;
|
|
184
|
+
display: grid;
|
|
185
|
+
gap: 0.9rem;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.doc-section {
|
|
189
|
+
background: var(--surface);
|
|
190
|
+
border: 1px solid var(--line);
|
|
191
|
+
border-radius: var(--radius);
|
|
192
|
+
padding: 1.35rem;
|
|
193
|
+
box-shadow: 0 8px 20px rgba(15, 28, 42, 0.06);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.section-header {
|
|
197
|
+
margin-bottom: 0.85rem;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.section-title {
|
|
201
|
+
margin: 0;
|
|
202
|
+
font-size: 1.3rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.section-lead {
|
|
206
|
+
margin: 0.48rem 0 0;
|
|
207
|
+
line-height: 1.58;
|
|
208
|
+
color: var(--text-soft);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.panel {
|
|
212
|
+
border: 1px solid #dfe4e8;
|
|
213
|
+
background: #ffffff;
|
|
214
|
+
border-radius: 14px;
|
|
215
|
+
padding: 1rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.panel-title {
|
|
219
|
+
margin: 0;
|
|
220
|
+
font-size: 1rem;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.panel-note {
|
|
224
|
+
margin: 0.52rem 0 0;
|
|
225
|
+
color: var(--text-soft);
|
|
226
|
+
line-height: 1.55;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.panel-note-list {
|
|
230
|
+
margin-top: 0.74rem;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.panel-positive {
|
|
234
|
+
background: linear-gradient(180deg, #f5fcf8 0%, #fdfefe 100%);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.panel-warning {
|
|
238
|
+
background: linear-gradient(180deg, #fff8f2 0%, #fffdfc 100%);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.grid-two {
|
|
242
|
+
display: grid;
|
|
243
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
244
|
+
gap: 0.8rem;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.check-list,
|
|
248
|
+
.warning-list,
|
|
249
|
+
.ordered-list {
|
|
250
|
+
margin: 0;
|
|
251
|
+
padding-left: 1.1rem;
|
|
252
|
+
line-height: 1.58;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.warning-list li {
|
|
256
|
+
color: #93472f;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.timeline {
|
|
260
|
+
display: grid;
|
|
261
|
+
gap: 0.52rem;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.timeline-item {
|
|
265
|
+
margin: 0;
|
|
266
|
+
line-height: 1.62;
|
|
267
|
+
color: var(--text-soft);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.timeline-key {
|
|
271
|
+
display: inline-block;
|
|
272
|
+
min-width: 114px;
|
|
273
|
+
font-weight: 700;
|
|
274
|
+
color: var(--text);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.code-block {
|
|
278
|
+
margin: 0.95rem 0 0;
|
|
279
|
+
padding: 0.95rem;
|
|
280
|
+
border-radius: 12px;
|
|
281
|
+
border: 1px solid #2d445b;
|
|
282
|
+
background: #102336;
|
|
283
|
+
color: #d8edf4;
|
|
284
|
+
font-family: 'IBM Plex Mono', monospace;
|
|
285
|
+
font-size: 0.84rem;
|
|
286
|
+
line-height: 1.6;
|
|
287
|
+
overflow-x: auto;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.footer {
|
|
291
|
+
margin-top: 1rem;
|
|
292
|
+
text-align: center;
|
|
293
|
+
color: #5b6f80;
|
|
294
|
+
font-size: 0.86rem;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
@keyframes lift-in {
|
|
298
|
+
from {
|
|
299
|
+
opacity: 0;
|
|
300
|
+
transform: translateY(12px);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
to {
|
|
304
|
+
opacity: 1;
|
|
305
|
+
transform: translateY(0);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
@media (max-width: 920px) {
|
|
310
|
+
.grid-two {
|
|
311
|
+
grid-template-columns: 1fr;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.hero {
|
|
315
|
+
padding: 1.5rem;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.doc-section {
|
|
319
|
+
padding: 1rem;
|
|
320
|
+
}
|
|
321
|
+
}
|