chore(preflight): 路由条数跟上 13 条

This commit is contained in:
qyh15 2026-11-10 11:43:19 +08:00
parent ee43e5df42
commit 3d0a059bbf
1 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@
// 1. profile 里到底有没有把本插件链进去(dependencies + dsh.profile.bundles) // 1. profile 里到底有没有把本插件链进去(dependencies + dsh.profile.bundles)
// 2. 链接指向的目录里,exports 声明的那个文件在不在 // 2. 链接指向的目录里,exports 声明的那个文件在不在
// 3. 那个文件是不是一段能解析的 JS(语法坏了会让整页白屏,且报错很难看懂) // 3. 那个文件是不是一段能解析的 JS(语法坏了会让整页白屏,且报错很难看懂)
// 4. Host 侧装配能不能在内存账本上跑起来(12 条路由 + bootstrap 可用) // 4. Host 侧装配能不能在内存账本上跑起来(13 条路由 + bootstrap 可用)
// //
// 用法:node scripts/workbench-preflight.mjs // 用法:node scripts/workbench-preflight.mjs
// 退出码:0 全通;1 有失败项(打印哪一项失败、为什么)。 // 退出码:0 全通;1 有失败项(打印哪一项失败、为什么)。
@ -84,7 +84,7 @@ check('客户端 bundle 语法可解析(语法错会让整页白屏)', () =>
return `${Math.round(text.length / 1024)} KB` return `${Math.round(text.length / 1024)} KB`
}) })
check('Host 侧装配:内存账本上能起 12 条路由', () => { check('Host 侧装配:内存账本上能起 13 条路由', () => {
const routes = new Map() const routes = new Map()
const fakeCtx = { const fakeCtx = {
get: () => undefined, get: () => undefined,
@ -98,7 +98,7 @@ check('Host 侧装配:内存账本上能起 12 条路由', () => {
const store = new WorkbenchStore({ file: null }) const store = new WorkbenchStore({ file: null })
const host = createWorkbenchHost(fakeCtx, { store, startReconciler: false, load: false }) const host = createWorkbenchHost(fakeCtx, { store, startReconciler: false, load: false })
try { try {
if (routes.size !== 12) throw new Error(`注册了 ${routes.size} 条路由,预期 12 条`) if (routes.size !== 13) throw new Error(`注册了 ${routes.size} 条路由,预期 13 条`)
// bootstrap 要落在具体项目上才有席位;这里现建一个临时项目,不写磁盘。 // bootstrap 要落在具体项目上才有席位;这里现建一个临时项目,不写磁盘。
const project = host.service.registerProject({ hostWorkspaceId: 'preflight' }).project const project = host.service.registerProject({ hostWorkspaceId: 'preflight' }).project
const boot = host.service.bootstrap(project.id) const boot = host.service.bootstrap(project.id)