Skip to content

release: 2.2.0-beta.6 — 共享 metadata 向上解析 + $1/$2 测试#6

Merged
SongshGeo merged 4 commits into
mainfrom
dev
Jun 6, 2026
Merged

release: 2.2.0-beta.6 — 共享 metadata 向上解析 + $1/$2 测试#6
SongshGeo merged 4 commits into
mainfrom
dev

Conversation

@SongshGeo

Copy link
Copy Markdown

将 dev 上自 2.2.0-beta.4 以来的改动合入 main。

包含

  • feat: 共享 metadata.json 向上解析到项目根01d11c3
    • 新增「项目根」= 同 project 所有 draft 文件夹的最低公共祖先(LCA)。
    • metadata.json / JSON 数据文件从 draft 文件夹向上找到项目根为止(含 source/),支持每个 draft 放在各自子目录、共享根目录一份 metadata 的结构。
    • 修复嵌套结构下「metadata file not found」报错。
    • 新增纯函数 util src/model/project-resources.ts + 17 个单测。
  • test: 覆盖 Save-as-Note $1/$2 文件名占位符c86b940
  • release: bump 2.2.0-beta.5 / 2.2.0-beta.6

验证

  • npm run test:unit:53 passed
  • npm run build:svelte-check 0 errors,构建成功

🤖 Generated with Claude Code

SongshGeo and others added 4 commits June 6, 2026 14:40
Prepares the multi-draft quick-compile feature for release. Tag
2.2.0-beta.5 should be pushed after this merges to main to trigger
release.yml (manifest version must match the tag).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract the output-path placeholder substitution into an obsidian-free
write-to-note-utils module (matching the existing *-utils test pattern)
and add unit tests for draftOutputName and applyTargetPlaceholders:
$2 → draft name (draftTitle, falling back to the index basename),
$1 → project title, global replacement, and distinct names across the
drafts of a project.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Shared resource files (metadata.json for Add Zenodo Frontmatter, JSON
data for Replace JSON Placeholders) were only looked up in the index
note's own folder. Drafts whose index lives in a per-draft subfolder
could not see a metadata.json placed at the project root, causing
"metadata file not found" errors when compiling such drafts.

Introduce a project root = lowest common ancestor of a project's draft
folders, and search for shared resources from the draft's folder up to
that root (inclusive), checking both <dir>/<file> and <dir>/source/<file>.
The search is bounded at the project root, so it never picks up an
unrelated file higher in the vault. Single-draft and same-folder
projects are unaffected (root == index folder => one level only).

Supports project layouts like:
  project/
    metadata.json
    draft A/A index.md
    draft B/B index.md

- New obsidian-free, unit-tested util src/model/project-resources.ts
  (projectRootPath, projectResourceCandidatePaths, LCA helpers).
- Thread projectRoot through CompileContext and compile() options; pass
  it from CompileView (single + Compile All) and both compile commands.
- The metadata editor now loads/saves the shared file at the project root.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Ships shared-metadata resolution up to the project root.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SongshGeo SongshGeo merged commit d3930f7 into main Jun 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant