Make @docmost/git-sync natively consumable by the CommonJS server (and jest):
build to CommonJS (tsconfig module CommonJS, drop type:module, strip .js from
relative imports), and lazy-load the only ESM-only dep (marked) via the dynamic
Function('import()') trick (mirrors docmost-client.loader.ts) with a require()
fallback so vitest's evaluator works too. git-sync tests stay green (314 pass,
3 expected fail).
Add the §13.1 idempotency gate (apps/server .../git-sync-converter-gate.spec.ts):
13 editor-ext docs (paragraphs/headings, marks, links, bullet/ordered/task lists,
blockquote, callouts, code block, hr, table, nested mix) round-trip
content(editor-ext) -> convertProseMirrorToMarkdown -> markdownToProseMirror ->
TiptapTransformer.toYdoc/fromYdoc(tiptapExtensions) -> canonicalize and assert
docsCanonicallyEqual. All green => the vendored converter's docmost-schema is
schema-compatible with editor-ext (no node/mark/attr loss), which the plan §13.1
requires before Phase B. The one intrinsic markdown-image lossiness (width/height
/align can't ride plain ) is isolated in a KNOWN DIVERGENCE block, not
hidden. Server tsc clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
27 lines
2.2 KiB
JavaScript
27 lines
2.2 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.docsCanonicallyEqual = exports.canonicalizeContent = exports.markdownToProseMirror = exports.convertProseMirrorToMarkdown = exports.serializeDocmostMarkdownBody = exports.parseDocmostMarkdown = exports.serializeDocmostMarkdown = void 0;
|
|
/**
|
|
* Public surface of the vendored pure converter (the `lib/` half of the
|
|
* docmost-sync `docmost-client` package). This barrel re-exports only the
|
|
* PURE, IO-free pieces the sync engine needs: the self-contained markdown
|
|
* (de)serializers, the lossless ProseMirror <-> Markdown converter, the
|
|
* markdown -> ProseMirror import path, and semantic canonicalization for the
|
|
* round-trip idempotency check (SPEC §11).
|
|
*
|
|
* The REST client, websocket/collab write-path, auth-utils and page-lock from
|
|
* the upstream package are deliberately NOT vendored (the gitmost server writes
|
|
* natively — plan §2.2/§2.3).
|
|
*/
|
|
var markdown_document_1 = require("./markdown-document");
|
|
Object.defineProperty(exports, "serializeDocmostMarkdown", { enumerable: true, get: function () { return markdown_document_1.serializeDocmostMarkdown; } });
|
|
Object.defineProperty(exports, "parseDocmostMarkdown", { enumerable: true, get: function () { return markdown_document_1.parseDocmostMarkdown; } });
|
|
Object.defineProperty(exports, "serializeDocmostMarkdownBody", { enumerable: true, get: function () { return markdown_document_1.serializeDocmostMarkdownBody; } });
|
|
var markdown_converter_1 = require("./markdown-converter");
|
|
Object.defineProperty(exports, "convertProseMirrorToMarkdown", { enumerable: true, get: function () { return markdown_converter_1.convertProseMirrorToMarkdown; } });
|
|
var markdown_to_prosemirror_1 = require("./markdown-to-prosemirror");
|
|
Object.defineProperty(exports, "markdownToProseMirror", { enumerable: true, get: function () { return markdown_to_prosemirror_1.markdownToProseMirror; } });
|
|
var canonicalize_1 = require("./canonicalize");
|
|
Object.defineProperty(exports, "canonicalizeContent", { enumerable: true, get: function () { return canonicalize_1.canonicalizeContent; } });
|
|
Object.defineProperty(exports, "docsCanonicallyEqual", { enumerable: true, get: function () { return canonicalize_1.docsCanonicallyEqual; } });
|