feat: consolidate local-first mnote web runtime

This commit is contained in:
lix-2026
2026-05-28 22:01:44 +08:00
parent 7354807ee9
commit 39b9a0183a
154 changed files with 13591 additions and 12728 deletions
@@ -101,8 +101,6 @@ async function main() {
MNOTE_WEB_PUBLIC_BIND: `127.0.0.1:${port}`,
MNOTE_WEB_ENABLE_LEGACY_NEXT_COMPAT: "0",
MNOTE_LOCAL_WORKSPACE_BASE_DIR: dataRoot,
CONVEX_SELF_HOSTED_URL: "http://127.0.0.1:9",
NEXT_PUBLIC_CONVEX_URL: "http://127.0.0.1:9",
},
stdio: ["ignore", "pipe", "pipe"],
});
@@ -124,6 +122,8 @@ async function main() {
const firstAggregate = await loadAggregate(baseUrl, actorId, documentId, rootUri);
assert.equal(firstAggregate.head.title, "README");
assert.equal(firstAggregate.body.projectionSource, "local_markdown.content", "local-first Page Aggregate 应声明 local markdown projection source");
assert(firstAggregate.body.blockDocument, "local-first Page Aggregate 应输出 blockDocumentruntime 不应只依赖 legacy content");
const titlePayload = await requestJson(baseUrl, actorId, "/api/documents/title", {
method: "POST",
@@ -178,6 +178,8 @@ async function main() {
const finalAggregate = await loadAggregate(baseUrl, actorId, documentId, rootUri);
assert.equal(finalAggregate.head.title, "P3 标题", "frontmatter title 应优先于正文 H1");
assert.equal(finalAggregate.body.projectionSource, "local_markdown.content", "保存后 Page Aggregate source 不应退回 legacy documents.content");
assert(finalAggregate.body.blockDocument, "保存后 Page Aggregate 应保留 blockDocument");
assert.equal(finalAggregate.layout.pageOptions.wideLayout, true);
assert.equal(finalAggregate.layout.pageOptions.showToc, true);
assert.equal(finalAggregate.layout.pageOptions.showHeadingNumbers, true);