Closes the architecture item from the #119 review: drop the "vendored from docmost-sync" framing and the CJS↔ESM `Function('import()')` bridge so the engine is a normal first-class gitmost package. Part 1 — vendoring markers removed (prose only, zero behavior change): reworded "VENDORED into gitmost" / "vendored from docmost-sync" / "Engine LOGIC is byte-identical" / "it's a port" comments across the engine. Behavior-bearing strings are untouched: BOT_AUTHOR_NAME/EMAIL and the `Docmost-Sync-Source:` provenance trailers (changing them would break git authorship + the loop-guard). Part 2 — the package is now ESM (matching the sibling @docmost/mcp): `type: module`, tsconfig Node16, `.js` extensions on relative imports, and a static `import { marked }` replacing the `new Function('return import(...)')` / `loadMarked` hack — the bridge is GONE from the package. The CommonJS NestJS server loads the now-ESM engine via a new `git-sync.loader.ts` that mirrors the existing `docmost-client.loader.ts` mcp loader exactly (Function-indirected dynamic import + cached promise + retry-on-reject). The 4 server consumers (orchestrator/datasource/vault-registry/git-http-backend) call `await loadGitSync()` for value exports; types stay `import type` (erased). The converter-gate spec — which needs the real converter — loads the package's TS source via a jest moduleNameMapper + isolatedModules (documented in that spec); the other git-sync specs mock the loader. Verified: engine builds pure ESM (no Function/require leftover), vitest 614, editor-ext build, server + client tsc, full server jest 1397/0. Live stand smoke-test: server starts clean on the ESM engine (no ERR_REQUIRE_ESM), a real sync cycle runs through the loader, and the basic e2e suite is 12/12 (clone via git-http-backend, push, pull, delete, 3-way merge — all through the new loader). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
46 lines
1.2 KiB
JSON
46 lines
1.2 KiB
JSON
{
|
|
"name": "@docmost/git-sync",
|
|
"version": "0.1.0",
|
|
"description": "Pure converter + pure sync engine for the Docmost <-> git Markdown sync. See docs/git-sync-plan.md.",
|
|
"private": true,
|
|
"type": "module",
|
|
"main": "./build/index.js",
|
|
"types": "./build/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./build/index.d.ts",
|
|
"default": "./build/index.js"
|
|
}
|
|
},
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"watch": "tsc --watch",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest"
|
|
},
|
|
"license": "MIT",
|
|
"dependencies": {
|
|
"@fellow/prosemirror-recreate-transform": "^1.2.3",
|
|
"@tiptap/core": "3.20.4",
|
|
"@tiptap/extension-highlight": "3.20.4",
|
|
"@tiptap/extension-image": "3.20.4",
|
|
"@tiptap/extension-subscript": "3.20.4",
|
|
"@tiptap/extension-superscript": "3.20.4",
|
|
"@tiptap/extension-task-item": "3.20.4",
|
|
"@tiptap/extension-task-list": "3.20.4",
|
|
"@tiptap/html": "3.20.4",
|
|
"@tiptap/pm": "3.20.4",
|
|
"@tiptap/starter-kit": "3.20.4",
|
|
"jsdom": "25.0.0",
|
|
"marked": "17.0.5",
|
|
"zod": "4.3.6"
|
|
},
|
|
"devDependencies": {
|
|
"@types/jsdom": "^21.1.7",
|
|
"@types/node": "^20.0.0",
|
|
"fast-check": "^4.8.0",
|
|
"typescript": "^5.0.0",
|
|
"vitest": "4.1.6"
|
|
}
|
|
}
|