mirror of
https://github.com/onlyworlds/obsidian-plugin.git
synced 2026-07-22 11:00:31 +00:00
Wake the dormant vault/element-file.ts write path and make YAML frontmatter the note format for new writes, with read-tolerance for legacy span notes. Pure logic (Obsidian-free, unit-tested under `npm test`): - vault/element-transform.ts: frontmatter<->payload, span parse, span->frontmatter, link normalization (single string / multi list, never comma-joined), extension-key passthrough (atlas_/shadow_/x_), body<->description|story mapping, read-before-PATCH diff. - test/element-transform.test.ts + tsconfig.test.json: 16 node:test cases incl. a real span-format Character fixture. Wired to `npm test` (pretest compiles to test-dist/). Wiring: - element-file.ts: readElement preserves extension fields + maps body to story for Narrative (R3/R5); frontmatter-first with legacy span fallback; writeElement round-trips extension keys and respects count-suffixed folders. - DownloadWorldCommand + CreateElementCommand: emit frontmatter via writeElement (no more Handlebars element templates). - NoteLinker: reworked onto metadataCache + SDK FIELD_SCHEMA; writes link IDs into frontmatter (new FieldSelectionModal picks the field). NameChanger syncs frontmatter name. - SaveElementCommand: read-before-PATCH (GET, diff, PATCH only changed fields) (R7). - ExportWorldCommand + CopyWorldCommand: read frontmatter via readElement, span as fallback (mixed worlds upload/copy correctly). - MigrateWorldCommand: "Migrate world notes to frontmatter" — backup-first (abort on failure), idempotent, end report modal (converted/skipped/failed). Deferred (see docs report): PasteWorld still emits span; ValidateWorld is still a span linter (diagnostic only, no writes). docs/SMOKE-CHECKLIST.md is the manual release gate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
38 lines
1.2 KiB
JSON
38 lines
1.2 KiB
JSON
{
|
|
"name": "onlyworlds-obsidian-plugin",
|
|
"version": "2.3.0",
|
|
"description": "Obsidian plugin for the OnlyWorlds worldbuilding framework",
|
|
"main": "main.js",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "node esbuild.config.mjs",
|
|
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
|
|
"version": "node version-bump.mjs && git add manifest.json versions.json",
|
|
"lint": "eslint .",
|
|
"pretest": "tsc -p tsconfig.test.json --skipLibCheck && node -e \"require('fs').writeFileSync('test-dist/package.json','{\\\"type\\\":\\\"commonjs\\\"}')\"",
|
|
"test": "node --test \"test-dist/test/*.test.js\""
|
|
},
|
|
"keywords": [],
|
|
"author": "Titus",
|
|
"license": "MIT",
|
|
"devDependencies": {
|
|
"@eslint/js": "9.30.1",
|
|
"@eslint/json": "0.14.0",
|
|
"@types/node": "^16.11.6",
|
|
"@types/uuid": "^10.0.0",
|
|
"esbuild": "0.25.5",
|
|
"eslint": "^9.30.1",
|
|
"eslint-plugin-obsidianmd": "0.1.9",
|
|
"globals": "14.0.0",
|
|
"jiti": "2.6.1",
|
|
"tslib": "2.4.0",
|
|
"typescript": "^5.8.3",
|
|
"typescript-eslint": "8.35.1"
|
|
},
|
|
"dependencies": {
|
|
"@onlyworlds/sdk": "^2.2.2",
|
|
"handlebars": "^4.7.8",
|
|
"obsidian": "latest",
|
|
"uuid": "^10.0.0"
|
|
}
|
|
}
|