Wire the push cycle (SPEC §6) into a runnable command; SAFE BY DEFAULT. - runPush + main(): dry-run by default (plan only, ZERO Docmost writes, no ref advance); --apply is the ONLY path that builds a client and mutates Docmost - orchestration mirrors pull.ts: assertGitAvailable -> ensureRepo -> merge-in-progress guard (§9/§12) -> checkout main -> commit local working tree (Docmost-Sync-Source: local, §7.3) -> base = refs/docmost/last-pushed else docmost -> diffNameStatus(base, main) -> computePushActions -> (apply) -> write-back created pageIds + advance refs; divergent-docmost escalates (exit 1) - npm run push (dry-run) / npm run push -- --apply (writes; needs creds) - fix (review Blocker): pass the WHOLE VaultGit to applyPushActions (bare method refs lost `this` -> --apply crashed on real git); regression test exercises the --apply path against a REAL VaultGit temp repo + fake client (proven to catch it) - symmetric divergent-docmost escalation in both ff branches; dry-run logs the local commit explicitly; SPEC §6 notes the dry-run/local-commit behavior - 737 -> 747 green (x2 stable); build clean; corpus STABLE Deferred (daemon increment): FS-watcher/debounce (§7.1), git-remote push (§7.2), continuous poll loop, pull-side §10 record consumption, fractional-index position.
40 lines
1.1 KiB
JSON
40 lines
1.1 KiB
JSON
{
|
|
"name": "docmost-sync",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"description": "Bidirectional sync daemon between Docmost articles and a local Markdown git vault (git is the state store). See SPEC.md.",
|
|
"license": "MIT",
|
|
"workspaces": [
|
|
"packages/*"
|
|
],
|
|
"engines": {
|
|
"node": ">=20"
|
|
},
|
|
"scripts": {
|
|
"build": "npm run build -w docmost-client && tsc",
|
|
"start": "node build/index.js",
|
|
"dev": "tsx watch src/index.ts",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"coverage": "vitest run --coverage --coverage.provider=v8 --coverage.include='src/**/*.ts' --coverage.include='packages/docmost-client/src/**/*.ts'",
|
|
"roundtrip": "node build/roundtrip.js",
|
|
"pull": "node build/pull.js",
|
|
"push": "node build/push.js"
|
|
},
|
|
"dependencies": {
|
|
"docmost-client": "*",
|
|
"dotenv": "17.4.2",
|
|
"zod": "3.25.76"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "22.19.21",
|
|
"@vitest/coverage-v8": "^3.2.6",
|
|
"axios-mock-adapter": "^2.1.0",
|
|
"fast-check": "^4.8.0",
|
|
"tsx": "4.22.4",
|
|
"typescript": "5.9.3",
|
|
"vitest": "3.2.6"
|
|
}
|
|
}
|