feat(git-sync): drop legacy docmost:meta back-compat (vaults wipe+rebuild)

Per owner: test data, no migration. parsePageFile no longer reads the old
docmost:meta block — a file without a gitmost_id frontmatter is simply un-tracked
(adopt). Vaults are a cache: rm -rf on the transition, rebuilt native from
Docmost. Simplifies the format work (no fallback). Doc updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
claude code agent 227
2026-06-24 04:28:35 +03:00
parent c4af91391f
commit fd372e7d2d
3 changed files with 19 additions and 46 deletions

View File

@@ -1,6 +1,5 @@
import { describe, it, expect } from "vitest";
import { parsePageFile, serializePageFile } from "../src/lib/page-file";
import { serializeDocmostMarkdownBody } from "../src/lib/index";
describe("page-file thin format", () => {
it("round-trips id frontmatter + clean body", () => {
@@ -20,15 +19,6 @@ describe("page-file thin format", () => {
expect(parsePageFile("---\ngitmost_id: 'xyz'\n---\nbody").id).toBe("xyz");
});
it("MIGRATION: falls back to a legacy docmost:meta block for the id", () => {
const legacy = serializeDocmostMarkdownBody(
{ version: 1, pageId: "legacy-1", title: "T", spaceId: "sp" },
"old body",
);
const { id, body } = parsePageFile(legacy);
expect(id).toBe("legacy-1");
expect(body).toContain("old body");
});
it("ADOPT: a plain hand-written file has no id and keeps its whole body", () => {
const { id, body } = parsePageFile("# Just a note\n\nwritten in Obsidian");