@maiyunnet/kebab 9.29.6 → 10.0.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.
Files changed (52) hide show
  1. package/abox/proxy.js +24 -2
  2. package/abox/response.js +36 -17
  3. package/abox/session-login.js +1 -13
  4. package/doc/kebab-rag.md +1522 -1034
  5. package/index.d.ts +12 -1
  6. package/index.js +1 -1
  7. package/lib/ai.d.ts +4 -0
  8. package/lib/ai.js +32 -16
  9. package/lib/cookie.d.ts +2 -0
  10. package/lib/cookie.js +47 -45
  11. package/lib/core.d.ts +26 -0
  12. package/lib/core.js +36 -13
  13. package/lib/cron.js +1 -8
  14. package/lib/crypto.js +20 -6
  15. package/lib/db/conn.js +1 -0
  16. package/lib/fs.js +78 -31
  17. package/lib/kv.d.ts +182 -79
  18. package/lib/kv.js +518 -214
  19. package/lib/s3.d.ts +2 -0
  20. package/lib/s3.js +14 -27
  21. package/lib/session.d.ts +7 -0
  22. package/lib/session.js +23 -2
  23. package/lib/socket.d.ts +4 -1
  24. package/lib/socket.js +1 -0
  25. package/lib/sql.d.ts +0 -5
  26. package/lib/sql.js +48 -12
  27. package/lib/text.d.ts +10 -5
  28. package/lib/text.js +22 -12
  29. package/lib/turnstile.d.ts +6 -0
  30. package/lib/turnstile.js +16 -9
  31. package/lib/undici.d.ts +7 -1
  32. package/lib/undici.js +72 -36
  33. package/lib/ws.d.ts +1 -1
  34. package/lib/ws.js +85 -128
  35. package/lib/zip.js +46 -45
  36. package/package.json +2 -2
  37. package/sys/child.js +178 -146
  38. package/sys/cmd.js +196 -197
  39. package/sys/ctr.d.ts +14 -14
  40. package/sys/ctr.js +145 -59
  41. package/sys/master.js +111 -80
  42. package/sys/mod.d.ts +8 -2
  43. package/sys/mod.js +23 -11
  44. package/sys/monitor/files.d.ts +2 -1
  45. package/sys/monitor/files.js +77 -21
  46. package/sys/monitor/watchdog.d.ts +7 -0
  47. package/sys/monitor/watchdog.js +311 -203
  48. package/sys/monitor.d.ts +59 -54
  49. package/sys/monitor.js +742 -681
  50. package/sys/route.d.ts +4 -4
  51. package/sys/route.js +93 -52
  52. package/www/example/ctr/test.js +8 -8
package/sys/cmd.js CHANGED
@@ -3,16 +3,18 @@
3
3
  * Date: 2020-3-7 23:51:15
4
4
  * Last: 2020-3-7 23:51:18, 2022-07-22 14:14:09, 2022-9-27 14:52:19, 2023-5-23 21:42:46, 2024-7-2 15:12:28, 2026-2-23 13:08:11
5
5
  */
6
+ // --- 系统 ---
6
7
  import * as http from 'http';
7
8
  import * as childProcess from 'child_process';
9
+ import * as crypto from 'node:crypto';
8
10
  import { fileURLToPath } from 'url';
11
+ // --- 库和定义 ---
12
+ import * as kebab from '#kebab/index.js';
9
13
  import * as lFs from '#kebab/lib/fs.js';
10
14
  import * as lText from '#kebab/lib/text.js';
11
15
  import * as lTime from '#kebab/lib/time.js';
12
16
  import * as lCore from '#kebab/lib/core.js';
13
17
  import * as rpc from '#kebab/lib/core/rpc.js';
14
- import * as crypto from 'node:crypto';
15
- import * as kebab from '#kebab/index.js';
16
18
  // --- 检查语言包:node ./source/main locale -l ./source/www/example/data/locale/sc -d ./source/www/example ---
17
19
  /** --- 解析命令 --- */
18
20
  const cmds = process.argv.slice(2);
@@ -35,6 +37,197 @@ async function initDir(paths) {
35
37
  }
36
38
  return true;
37
39
  }
40
+ /**
41
+ * --- 构建命令:使用 esbuild 打包 *.page.tsx 为浏览器水合 bundle,并生成 Tailwind CSS ---
42
+ * 用法:node ./source/main build [-d www/myapp/stc]
43
+ */
44
+ async function runBuild() {
45
+ // --- 解析 -d / --dir 目标目录参数 ---
46
+ let targetDir = '';
47
+ for (let i = 1; i < cmds.length; ++i) {
48
+ if ((cmds[i] === '-d' || cmds[i] === '--dir') && cmds[i + 1]) {
49
+ targetDir = cmds[i + 1];
50
+ ++i;
51
+ }
52
+ }
53
+ // --- 扫描收集所有 *.page.tsx 入口 ---
54
+ const entryPoints = [];
55
+ const scanDir = async (dir) => {
56
+ const items = await lFs.readDir(dir);
57
+ for (const item of items) {
58
+ if (item.name === '.' || item.name === '..') {
59
+ continue;
60
+ }
61
+ if (item.isDirectory()) {
62
+ await scanDir(`${dir}/${item.name}`);
63
+ }
64
+ else if (item.name.endsWith('.page.tsx')) {
65
+ entryPoints.push(`${dir}/${item.name}`);
66
+ }
67
+ }
68
+ };
69
+ if (targetDir) {
70
+ const absTarget = targetDir.startsWith('/') || /^[A-Za-z]:/.test(targetDir)
71
+ ? targetDir
72
+ : kebab.ROOT_CWD + targetDir.replace(/^\//, '');
73
+ if (!await lFs.isDir(absTarget)) {
74
+ lCore.display('KEBAB', 'BUILD', '[DIR NOT FOUND]', absTarget);
75
+ return;
76
+ }
77
+ await scanDir(absTarget);
78
+ }
79
+ else {
80
+ const findStcDirs = async (dir) => {
81
+ const items = await lFs.readDir(dir);
82
+ for (const item of items) {
83
+ if (item.name === '.' || item.name === '..' || !item.isDirectory()) {
84
+ continue;
85
+ }
86
+ const sub = `${dir}/${item.name}`;
87
+ if (item.name === 'stc') {
88
+ await scanDir(sub);
89
+ }
90
+ else {
91
+ await findStcDirs(sub);
92
+ }
93
+ }
94
+ };
95
+ await findStcDirs(kebab.WWW_CWD.replace(/\/$/, ''));
96
+ }
97
+ if (entryPoints.length === 0) {
98
+ lCore.display('KEBAB', 'BUILD', 'No .tsx files found.');
99
+ return;
100
+ }
101
+ lCore.display('KEBAB', 'BUILD', `Found ${entryPoints.length} file(s).`);
102
+ // --- 按所属 stc/ 目录分组,同站点页面共享 chunk ---
103
+ const byStc = new Map();
104
+ for (const entry of entryPoints) {
105
+ const parts = entry.split('/');
106
+ const idx = parts.lastIndexOf('stc');
107
+ const stcRoot = idx >= 0 ? parts.slice(0, idx + 1).join('/') : parts.slice(0, -1).join('/');
108
+ const list = byStc.get(stcRoot);
109
+ if (list) {
110
+ list.push(entry);
111
+ }
112
+ else {
113
+ byStc.set(stcRoot, [entry]);
114
+ }
115
+ }
116
+ const esbuild = await import('esbuild');
117
+ for (const [stcRoot, entries] of byStc) {
118
+ await buildStcGroup(esbuild, stcRoot, entries);
119
+ }
120
+ lCore.display('DONE');
121
+ }
122
+ /**
123
+ * --- 构建单个 stc/ 站点下的全部页面 JS bundle 与 Tailwind CSS ---
124
+ * @param esbuild esbuild 模块实例
125
+ * @param stcRoot 站点 stc 根目录
126
+ * @param entries 该站点下的 *.page.tsx 入口列表
127
+ */
128
+ async function buildStcGroup(esbuild, stcRoot, entries) {
129
+ // --- 生成临时水合入口文件(splitting 模式不支持 stdin 多入口) ---
130
+ const tempFiles = [];
131
+ for (const entry of entries) {
132
+ const basename = entry.split('/').pop().replace(/\.tsx$/, '');
133
+ const entryDir = entry.substring(0, entry.lastIndexOf('/'));
134
+ const hydrateCode = [
135
+ `import { hydrateRoot } from 'react-dom/client';`,
136
+ `import { createElement } from 'react';`,
137
+ `import { BrowserRouter } from 'react-router-dom';`,
138
+ `import App from './${basename}.tsx';`,
139
+ `const el = document.getElementById('__kebab_props__');`,
140
+ `if (el) {`,
141
+ ` const p = JSON.parse(el.textContent ?? '{}');`,
142
+ ` if (typeof p._routerBase === 'string') {`,
143
+ ` hydrateRoot(document, createElement(BrowserRouter, { basename: p._routerBase }, createElement(App, p)));`,
144
+ ` } else {`,
145
+ ` hydrateRoot(document, createElement(App, p));`,
146
+ ` }`,
147
+ `}`,
148
+ ].join('\n');
149
+ const tempFile = `${entryDir}/${basename}.hydrate.tsx`;
150
+ await lFs.putContent(tempFile, hydrateCode);
151
+ tempFiles.push(tempFile);
152
+ const rel = entry.replace(kebab.ROOT_CWD, '');
153
+ lCore.display('KEBAB', 'BUILD', rel, '→', rel.replace(/\.tsx$/, '.bundle.js'));
154
+ }
155
+ // --- 清理旧 chunk,避免 hash 变化后废弃文件堆积 ---
156
+ try {
157
+ const staleChunks = await lFs.readDir(stcRoot);
158
+ for (const item of staleChunks) {
159
+ if (!item.isDirectory() && /^chunk-[A-Z0-9]+\.js$/.test(item.name)) {
160
+ await lFs.unlink(`${stcRoot}/${item.name}`);
161
+ }
162
+ }
163
+ }
164
+ catch {
165
+ // --- 目录不可读时跳过 ---
166
+ }
167
+ // --- 执行 esbuild 打包并重命名为 *.bundle.js ---
168
+ try {
169
+ await esbuild.build({
170
+ 'entryPoints': tempFiles,
171
+ 'bundle': true,
172
+ 'splitting': true,
173
+ 'format': 'esm',
174
+ 'jsx': 'automatic',
175
+ 'jsxImportSource': 'react',
176
+ 'platform': 'browser',
177
+ 'target': 'es2022',
178
+ 'minify': true,
179
+ 'outbase': stcRoot,
180
+ 'outdir': stcRoot,
181
+ 'entryNames': '[dir]/[name]',
182
+ 'chunkNames': 'chunk-[hash]',
183
+ });
184
+ for (const tempFile of tempFiles) {
185
+ const hydrateJs = tempFile.replace(/\.tsx$/, '.js');
186
+ const bundleJs = hydrateJs.replace(/\.hydrate\.js$/, '.bundle.js');
187
+ await lFs.rename(hydrateJs, bundleJs);
188
+ lCore.display('KEBAB', 'BUILD', 'JS', bundleJs.replace(kebab.ROOT_CWD, ''));
189
+ }
190
+ }
191
+ catch (e) {
192
+ lCore.display('KEBAB', 'BUILD', 'JS FAILED', stcRoot.replace(kebab.ROOT_CWD, ''), e.message ?? '');
193
+ }
194
+ finally {
195
+ for (const tempFile of tempFiles) {
196
+ await lFs.unlink(tempFile);
197
+ }
198
+ }
199
+ // --- 为每个入口单独构建 Tailwind CSS ---
200
+ const twJsUser = kebab.ROOT_CWD + 'node_modules/@tailwindcss/cli/dist/index.mjs';
201
+ const twJsSelf = fileURLToPath(new URL('../node_modules/@tailwindcss/cli/dist/index.mjs', import.meta.url));
202
+ const twJs = await lFs.isFile(twJsUser) ? twJsUser : twJsSelf;
203
+ for (const entry of entries) {
204
+ const cssOut = entry.replace(/\.tsx$/, '.css');
205
+ const tmpCss = entry + '.__tw__.css';
206
+ await lFs.putContent(tmpCss, '@import "tailwindcss";\n@source "./**/*.tsx";\n');
207
+ try {
208
+ await new Promise((resolve, reject) => {
209
+ const proc = childProcess.spawn(process.execPath, [twJs, '-i', tmpCss, '-o', cssOut, '--minify'], { 'shell': false });
210
+ const errLines = [];
211
+ proc.stderr.on('data', (d) => errLines.push(d.toString()));
212
+ proc.on('close', (code) => {
213
+ if (code === 0) {
214
+ resolve();
215
+ }
216
+ else {
217
+ reject(new Error(errLines.join('').trim() || `tailwindcss exit ${code ?? 'null'}`));
218
+ }
219
+ });
220
+ });
221
+ lCore.display('KEBAB', 'BUILD', 'CSS', cssOut.replace(kebab.ROOT_CWD, ''));
222
+ }
223
+ catch (e) {
224
+ lCore.display('KEBAB', 'BUILD', 'CSS SKIP (tailwindcss not installed?)', e.message ?? '');
225
+ }
226
+ finally {
227
+ await lFs.unlink(tmpCss);
228
+ }
229
+ }
230
+ }
38
231
  /** --- cmd 解析 --- */
39
232
  async function run() {
40
233
  if (cmds[0] === 'init' || cmds[0] === 'update') {
@@ -360,201 +553,7 @@ async function run() {
360
553
  process.exit();
361
554
  }
362
555
  if (cmds[0] === 'build') {
363
- // --- 构建命令:使用 esbuild 打包 *.page.tsx 文件为自包含 bundle ---
364
- // --- 约定:文件名以 .page.tsx 结尾的为页面入口,会被打包;其余 .tsx 均视为组件,不参与打包 ---
365
- // --- 与 Next.js 的 page.tsx 约定同理,开发者可自由组织目录结构,框架靠文件名区分入口与组件 ---
366
- // --- 推荐目录结构:stc/view/home.page.tsx(入口)+ stc/view/components/header.tsx(组件)---
367
- // --- 用法:node ./source/main build [-d www/myapp/stc] ---
368
- let targetDir = '';
369
- for (let i = 1; i < cmds.length; i++) {
370
- if ((cmds[i] === '-d' || cmds[i] === '--dir') && cmds[i + 1]) {
371
- targetDir = cmds[i + 1];
372
- i++;
373
- }
374
- }
375
- /** --- 递归扫描目录,收集所有 *.page.tsx 文件作为打包入口 --- */
376
- const entryPoints = [];
377
- const scanDir = async (dir) => {
378
- const items = await lFs.readDir(dir);
379
- for (const item of items) {
380
- if (item.name === '.' || item.name === '..') {
381
- continue;
382
- }
383
- if (item.isDirectory()) {
384
- await scanDir(`${dir}/${item.name}`);
385
- }
386
- else if (item.name.endsWith('.page.tsx')) {
387
- entryPoints.push(`${dir}/${item.name}`);
388
- }
389
- }
390
- };
391
- if (targetDir) {
392
- // --- 指定了目录:递归扫描该目录下所有 *.page.tsx ---
393
- const absTarget = targetDir.startsWith('/') || /^[A-Za-z]:/.test(targetDir)
394
- ? targetDir
395
- : kebab.ROOT_CWD + targetDir.replace(/^\//, '');
396
- if (await lFs.isDir(absTarget)) {
397
- await scanDir(absTarget);
398
- }
399
- else {
400
- lCore.display('KEBAB', 'BUILD', '[DIR NOT FOUND]', absTarget);
401
- process.exit();
402
- return;
403
- }
404
- }
405
- else {
406
- // --- 未指定目录:递归在 www/ 下找所有 stc/ 目录并扫描(支持任意深度,如 www/*/stc、www/*/*/stc)---
407
- const findStcDirs = async (dir) => {
408
- const items = await lFs.readDir(dir);
409
- for (const item of items) {
410
- if (item.name === '.' || item.name === '..' || !item.isDirectory()) {
411
- continue;
412
- }
413
- const sub = `${dir}/${item.name}`;
414
- if (item.name === 'stc') {
415
- await scanDir(sub);
416
- }
417
- else {
418
- await findStcDirs(sub);
419
- }
420
- }
421
- };
422
- // --- kebab.WWW_CWD 末尾含 /,去掉再传入保持路径格式统一 ---
423
- await findStcDirs(kebab.WWW_CWD.replace(/\/$/, ''));
424
- }
425
- if (entryPoints.length === 0) {
426
- lCore.display('KEBAB', 'BUILD', 'No .tsx files found.');
427
- process.exit();
428
- return;
429
- }
430
- lCore.display('KEBAB', 'BUILD', `Found ${entryPoints.length} file(s).`);
431
- const esbuild = await import('esbuild');
432
- // --- 按 stc/ 根目录分组:同一站点内所有页面合并为一次 esbuild 构建 ---
433
- // --- 不同站点(不同 stc/)相互隔离,同站点内跨子目录页面共享 chunk ---
434
- // --- splitting: true 自动将任意共享 import(React/Header/utils 等)提取为独立 chunk ---
435
- /**
436
- * --- 查找路径中最后一段名为 stc 的祖先目录 ---
437
- */
438
- const getStcRoot = (filePath) => {
439
- const parts = filePath.split('/');
440
- const idx = parts.lastIndexOf('stc');
441
- return idx >= 0 ? parts.slice(0, idx + 1).join('/') : parts.slice(0, -1).join('/');
442
- };
443
- const byStc = new Map();
444
- for (const entry of entryPoints) {
445
- const stcRoot = getStcRoot(entry);
446
- if (!byStc.has(stcRoot)) {
447
- byStc.set(stcRoot, []);
448
- }
449
- byStc.get(stcRoot).push(entry);
450
- }
451
- for (const [stcRoot, entries] of byStc) {
452
- // --- 为每个页面写入水合入口临时文件(实际文件,splitting 不支持 stdin 多入口)---
453
- const tempFiles = [];
454
- for (const entry of entries) {
455
- const basename = entry.split('/').pop().replace(/\.tsx$/, '');
456
- const entryDir = entry.substring(0, entry.lastIndexOf('/'));
457
- const hydrateCode = [
458
- `import{hydrateRoot}from'react-dom/client';`,
459
- `import{createElement}from'react';`,
460
- `import{BrowserRouter}from'react-router-dom';`,
461
- `import App from'./${basename}.tsx';`,
462
- `const el=document.getElementById('__kebab_props__');`,
463
- `if(el){`,
464
- `const p=JSON.parse(el.textContent??'{}');`,
465
- `if(typeof p._routerBase==='string'){`,
466
- `hydrateRoot(document,createElement(BrowserRouter,{basename:p._routerBase},createElement(App,p)));`,
467
- `}else{`,
468
- `hydrateRoot(document,createElement(App,p));`,
469
- `}`,
470
- `}`,
471
- ].join('');
472
- const tempFile = `${entryDir}/${basename}.hydrate.tsx`;
473
- await lFs.putContent(tempFile, hydrateCode);
474
- tempFiles.push(tempFile);
475
- lCore.display('KEBAB', 'BUILD', entry.replace(kebab.ROOT_CWD, ''), '→', entry.replace(kebab.ROOT_CWD, '').replace(/\.tsx$/, '.bundle.js'));
476
- }
477
- // --- JS 构建:整站一次构建,splitting 按实际共享情况自动提取 chunk ---
478
- // --- outbase = outdir = stcRoot,入口保留子目录结构,chunk 落在 stcRoot 根 ---
479
- // --- 构建前清除旧 chunk,避免 hash 变化后废弃文件堆积 ---
480
- try {
481
- const staleChunks = await lFs.readDir(stcRoot);
482
- for (const item of staleChunks) {
483
- if (!item.isDirectory() && /^chunk-[A-Z0-9]+\.js$/.test(item.name)) {
484
- await lFs.unlink(`${stcRoot}/${item.name}`);
485
- }
486
- }
487
- }
488
- catch {
489
- // --- 目录不可读时跳过 ---
490
- }
491
- try {
492
- await esbuild.build({
493
- 'entryPoints': tempFiles,
494
- 'bundle': true,
495
- 'splitting': true,
496
- 'format': 'esm',
497
- 'jsx': 'automatic',
498
- 'jsxImportSource': 'react',
499
- 'platform': 'browser',
500
- 'target': 'es2022',
501
- 'minify': true,
502
- 'outbase': stcRoot,
503
- 'outdir': stcRoot,
504
- 'entryNames': '[dir]/[name]',
505
- 'chunkNames': 'chunk-[hash]',
506
- });
507
- // --- 将 *.hydrate.js 重命名为 *.bundle.js ---
508
- for (const tempFile of tempFiles) {
509
- const hydrateJs = tempFile.replace(/\.tsx$/, '.js');
510
- const bundleJs = hydrateJs.replace(/\.hydrate\.js$/, '.bundle.js');
511
- await lFs.rename(hydrateJs, bundleJs);
512
- lCore.display('KEBAB', 'BUILD', 'JS', bundleJs.replace(kebab.ROOT_CWD, ''));
513
- }
514
- }
515
- catch (e) {
516
- lCore.display('KEBAB', 'BUILD', 'JS FAILED', stcRoot.replace(kebab.ROOT_CWD, ''), e.message ?? '');
517
- }
518
- finally {
519
- // --- 清理临时水合入口文件 ---
520
- for (const tempFile of tempFiles) {
521
- await lFs.unlink(tempFile);
522
- }
523
- }
524
- // --- CSS:每个入口单独构建 Tailwind ---
525
- for (const entry of entries) {
526
- const cssOut = entry.replace(/\.tsx$/, '.css');
527
- const tmpCss = entry + '.__tw__.css';
528
- await lFs.putContent(tmpCss, `@import "tailwindcss";\n@source "./**/*.tsx";\n`);
529
- try {
530
- // --- 优先从用户项目根目录查找,找不到则 fallback 到 kebab 包自身目录(用于 kebab 开发模式)---
531
- const twJsUser = kebab.ROOT_CWD + 'node_modules/@tailwindcss/cli/dist/index.mjs';
532
- const twJsSelf = fileURLToPath(new URL('../node_modules/@tailwindcss/cli/dist/index.mjs', import.meta.url));
533
- const twJs = await lFs.isFile(twJsUser) ? twJsUser : twJsSelf;
534
- await new Promise((resolve, reject) => {
535
- const proc = childProcess.spawn(process.execPath, [twJs, '-i', tmpCss, '-o', cssOut, '--minify'], { 'shell': false });
536
- const errLines = [];
537
- proc.stderr.on('data', (d) => errLines.push(d.toString()));
538
- proc.on('close', (code) => {
539
- if (code === 0) {
540
- resolve();
541
- }
542
- else {
543
- reject(new Error(errLines.join('').trim() || `tailwindcss exit ${code ?? 'null'}`));
544
- }
545
- });
546
- });
547
- lCore.display('KEBAB', 'BUILD', 'CSS', cssOut.replace(kebab.ROOT_CWD, ''));
548
- }
549
- catch (e) {
550
- lCore.display('KEBAB', 'BUILD', 'CSS SKIP (tailwindcss not installed?)', e.message ?? '');
551
- }
552
- finally {
553
- await lFs.unlink(tmpCss);
554
- }
555
- }
556
- }
557
- lCore.display('DONE');
556
+ await runBuild();
558
557
  process.exit();
559
558
  }
560
559
  // --- 读取配置文件 ---
package/sys/ctr.d.ts CHANGED
@@ -33,8 +33,8 @@ export interface IValibotOptions<TIssue extends v.BaseIssue<unknown>> {
33
33
  }
34
34
  /** --- XSRF 校验失败的问题描述 --- */
35
35
  export interface IValibotXsrfIssue extends v.BaseIssue<unknown> {
36
- readonly kind: 'validation';
37
- readonly type: 'xsrf';
36
+ readonly 'kind': 'validation';
37
+ readonly 'type': 'xsrf';
38
38
  }
39
39
  /** --- 带 XSRF 检测的 Valibot 同步校验选项 --- */
40
40
  export interface IValibotXOptions<TIssue extends v.BaseIssue<unknown>> {
@@ -49,17 +49,17 @@ export interface IValibotXOptions<TIssue extends v.BaseIssue<unknown>> {
49
49
  }
50
50
  /** --- Valibot 校验结果:仅成功分支提供 schema 推导后的 output --- */
51
51
  export type TValibotResult<TSchema extends v.GenericSchema, TIssue extends v.BaseIssue<unknown> = v.InferIssue<TSchema>> = {
52
- readonly typed: true;
53
- readonly success: true;
54
- readonly output: v.InferOutput<TSchema>;
55
- readonly issues: undefined;
56
- readonly response: undefined;
52
+ readonly 'typed': true;
53
+ readonly 'success': true;
54
+ readonly 'output': v.InferOutput<TSchema>;
55
+ readonly 'issues': undefined;
56
+ readonly 'response': undefined;
57
57
  } | {
58
- readonly typed: boolean;
59
- readonly success: false;
60
- readonly output: undefined;
61
- readonly issues: [TIssue, ...TIssue[]];
62
- readonly response: kebab.Json[];
58
+ readonly 'typed': boolean;
59
+ readonly 'success': false;
60
+ readonly 'output': undefined;
61
+ readonly 'issues': [TIssue, ...TIssue[]];
62
+ readonly 'response': kebab.Json[];
63
63
  };
64
64
  /** --- React SSR 页面选项 --- */
65
65
  export interface IReactPageOptions {
@@ -227,7 +227,7 @@ export declare class Ctr {
227
227
  * @param path
228
228
  * @param data
229
229
  */
230
- protected _loadView(path: string, data?: kebab.Json): Promise<string>;
230
+ protected _loadView(viewPath: string, data?: kebab.Json): Promise<string>;
231
231
  /**
232
232
  * --- 加载 React 全页面进行 SSR 渲染,组件需渲染完整 HTML 文档(含 html/head/body),无需 EJS ---
233
233
  * --- 框架自动注入 props:_urlBase/_urlFull/_urlStc/_staticVer/_staticPath/_staticPathFull ---
@@ -338,7 +338,7 @@ export declare class Ctr {
338
338
  * --- 获取 data JSON 数据 ---
339
339
  * @param path 文件路径(不含扩展名)
340
340
  */
341
- protected _loadData<T>(path: string): Promise<T | false | null>;
341
+ protected _loadData<T>(dataPath: string): Promise<T | false | null>;
342
342
  /**
343
343
  * --- 跳转,支持相对本项目根路径的路径或绝对路径 ---
344
344
  * @param location 相对或绝对网址