chore(toolchain): upgrade Bun to 1.4.4 and migrate console to TanStack Router

This commit is contained in:
root committed 2026-11-06 00:02:36 +08:00
1 parent b44ebc2ba1
commit 3b9376c75a
134 files changed
+893 -692

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@ import type { Hono } from "hono";
import { serveStatic } from "hono/bun";
/**
* 托管 React Router SPA 构建产物(build/client):存在的文件直接返回,
* 托管 TanStack Router SPA 构建产物(build/client):存在的文件直接返回,
* 其余非 /api 的 GET 回退 index.html 交给前端路由。/api 下的未知路径仍走 JSON 404。
* 注意 hono/deno 的 serveStatic 要求 path 相对 root,写绝对路径会 404。
*/
+6 -6
View File
@@ -31,15 +31,15 @@ export const copyFile: typeof fsp.copyFile = async (a, b, mode) => {
return fsp.copyFile(a, b, mode);
};
export const rm: typeof fsp.rm = async (p, o) => {
export const rm: typeof fsp.rm = (async (p: P, o?: import("node:fs").RmOptions) => {
assertLocalPaths("rm", s(p));
return fsp.rm(p, o);
};
return (fsp.rm as (path: P, options?: import("node:fs").RmOptions) => Promise<void>)(p, o);
}) as typeof fsp.rm;
export const rmdir: typeof fsp.rmdir = async (p, o) => {
export const rmdir: typeof fsp.rmdir = (async (p: P, o?: import("node:fs").RmDirOptions) => {
assertLocalPaths("rmdir", s(p));
return fsp.rmdir(p, o);
};
return (fsp.rmdir as (path: P, options?: import("node:fs").RmDirOptions) => Promise<void>)(p, o);
}) as typeof fsp.rmdir;
export const unlink: typeof fsp.unlink = async (p) => {
assertLocalPaths("unlink", s(p));
+5 -2
View File
@@ -2,11 +2,13 @@ import { defineConfig } from "vitest/config";
// 三组测试,按 groupOrder 依次跑:
// unit —— 纯内存、无 PG,文件并行;
// pg —— 真实 PG、假引擎(每文件独立 schema),文件并行;
// pg —— 真实 PG、假引擎(每文件独立 schema),文件串行;
// serial —— 起真实引擎 / worker / 后台循环 / 子进程的集成与 e2e,文件级串行。并发跑时 worker、轮询、迁移
// 互相抢 CPU 与连接,会把"入库→状态推进"这类时序拉长到超时,串行让每个文件拿到稳定的时序预算。
// 新测试缺省进 pg;起真实 worker / 引擎 / 子进程的加进 SERIAL;确认不碰 PG 的加进 UNIT。
// 并行文件数受开发库连接数约束(max_connections 100,每个 harness 连接池 5–10):MAX_WORKERS 别随手调大。
// OpenWorkflow 0.11 的 CREATE INDEX CONCURRENTLY 使用 1s lock_timeout,即使不同 schema,
// 也会等其它测试的长事务快照;PG 文件串行才能稳定完成迁移。
// unit 文件并行数仍受机器资源约束:MAX_WORKERS 别随手调大。
const UNIT = [
"test/api-registry.test.ts",
"test/organize-in-place-verify.test.ts",
@@ -56,6 +58,7 @@ export default defineConfig({
name: "pg",
include: ["test/**/*.test.ts"],
exclude: [...UNIT, ...SERIAL],
fileParallelism: false,
// 迁移类用例在用例体里建 schema + 迁移,并行时排队等同一把锁,缺省 5s 不够
testTimeout: 60_000,
sequence: { groupOrder: 1 },