收口 Rust Web 入口与 AI 写入链
- 将 3000 主入口继续收口到 mnote-web,补齐 /favicon.ico、/api/auth、session alias、AI run 等 Rust Web 路由边界。 - 更新登录页与 Convex Auth 代理,支持测试账号快速登录写入真实 Convex Auth cookie。 - 推进页面设置、Wolai 对齐、Phase 7 AI kernel/CLI-first 设计文档与相关 smoke 脚本。 - 更新 leptos-tiptap 生成资产、mnote-cli/bridge-runtime、前端依赖和 dev/prod 启动脚本。
This commit is contained in:
+29
-12
@@ -7,6 +7,7 @@ const {
|
||||
ensurePortFree,
|
||||
isPortFree,
|
||||
resolveRuntimePlan,
|
||||
shouldStartCelery,
|
||||
} = require("./desktop-hot.js");
|
||||
|
||||
function findFreePort() {
|
||||
@@ -114,15 +115,34 @@ test("ensurePortFree 在非 Windows 平台能释放后端监听进程", async (t
|
||||
await waitForExit(child);
|
||||
});
|
||||
|
||||
test("默认热启动计划使用 mnote-web 作为 3000 owner,Next 仅作为 legacy upstream", () => {
|
||||
test("默认热启动计划只使用 mnote-web 作为 3000 owner,不启动 Next legacy upstream", () => {
|
||||
const plan = resolveRuntimePlan({
|
||||
FRONTEND_PORT: "3000",
|
||||
NEXT_LEGACY_PORT: "3100",
|
||||
});
|
||||
|
||||
assert.equal(plan.skipGateway, false);
|
||||
assert.equal(plan.skipNextLegacy, true);
|
||||
assert.equal(plan.publicPort, 3000);
|
||||
assert.equal(plan.legacyPort, 3100);
|
||||
assert.equal(plan.frontendTaskName, null);
|
||||
assert.equal(plan.mnoteWebCommand, "cargo run -p mnote-web --bin mnote-web");
|
||||
assert.deepEqual(plan.mnoteWebEnv, {
|
||||
MNOTE_WEB_BIND: "127.0.0.1:3000",
|
||||
MNOTE_WEB_PUBLIC_BIND: "127.0.0.1:3000",
|
||||
MNOTE_WEB_ENABLE_LEGACY_NEXT_COMPAT: "0",
|
||||
});
|
||||
});
|
||||
|
||||
test("显式开启 legacy compat 时才启动 Next legacy upstream", () => {
|
||||
const plan = resolveRuntimePlan({
|
||||
FRONTEND_PORT: "3000",
|
||||
NEXT_LEGACY_PORT: "3100",
|
||||
MNOTE_WEB_ENABLE_LEGACY_NEXT_COMPAT: "1",
|
||||
});
|
||||
|
||||
assert.equal(plan.skipGateway, false);
|
||||
assert.equal(plan.skipNextLegacy, false);
|
||||
assert.equal(plan.frontendTaskName, "next-legacy");
|
||||
assert.equal(plan.frontendCommand, "pnpm dev -p 3100");
|
||||
assert.equal(plan.mnoteWebCommand, "cargo run -p mnote-web --bin mnote-web");
|
||||
@@ -134,17 +154,6 @@ test("默认热启动计划使用 mnote-web 作为 3000 owner,Next 仅作为 l
|
||||
});
|
||||
});
|
||||
|
||||
test("默认任务数组顺序变化时后端命令不应覆盖 mnote-web gateway", () => {
|
||||
const plan = resolveRuntimePlan({
|
||||
FRONTEND_PORT: "3000",
|
||||
NEXT_LEGACY_PORT: "3100",
|
||||
BACKEND_CMD: "/custom/backend",
|
||||
});
|
||||
|
||||
assert.equal(plan.mnoteWebCommand, "cargo run -p mnote-web --bin mnote-web");
|
||||
assert.equal(plan.frontendCommand, "pnpm dev -p 3100");
|
||||
});
|
||||
|
||||
test("MNOTE_WEB_SKIP_GATEWAY 可临时恢复旧 Next 3000 入口", () => {
|
||||
const plan = resolveRuntimePlan({
|
||||
FRONTEND_PORT: "3000",
|
||||
@@ -176,3 +185,11 @@ test("SKIP_NEXT_LEGACY 保持 Rust gateway 为 3000 owner,但不启动 Next le
|
||||
MNOTE_WEB_ENABLE_LEGACY_NEXT_COMPAT: "0",
|
||||
});
|
||||
});
|
||||
|
||||
test("默认跳过 Celery,只有显式开启时才启动", () => {
|
||||
assert.equal(shouldStartCelery({}), false);
|
||||
assert.equal(shouldStartCelery({ ENABLE_CELERY: "1" }), true);
|
||||
assert.equal(shouldStartCelery({ ENABLE_CELERY: "true" }), true);
|
||||
assert.equal(shouldStartCelery({ CELERY_CMD: "custom-celery" }), true);
|
||||
assert.equal(shouldStartCelery({ ENABLE_CELERY: "1", SKIP_CELERY: "1" }), false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user