Skip to content

refactor: extract NoteCore / NoteToPDF as separate PsychQuant repos (packages 應該要是獨立套件) #78

Description

@kiki830621

Problem

Original text:
「B,那些應該要是套件才對」
— Source: Claude Code session 2026-04-17, idd-implement #77 途中觸發 scope guard

macdoc .gitignore L20-21 註解寫道:

# Local packages & MCP (separate git repos)
packages/

但實際狀態:

Package .gitignore 白名單 獨立 .git Remote repo 正常版控?
srt-to-html-swift ✅ ? ? 是(經 whitelist)
md-to-html-swift ✅ ? ? 是(經 whitelist)
html-to-md-swift ✅ ? ? 是(經 whitelist)
marker-word-converter-swift ✅ ? ? 是(經 whitelist)
common-converter-swift N/A N/A PsychQuant/common-converter-swift 是(remote dep)
word-to-md-swift N/A N/A PsychQuant/word-to-md-swift 是(remote dep)
note-core-swift ❌ ❌ ❌ 否
note-to-pdf-swift ❌ ❌ ❌ 否
note-to-html-swift ❌ ❌ ❌ 否

note-core-swift / note-to-pdf-swift / note-to-html-swift 既不在白名單、又沒獨立 .git、也沒有對應的 PsychQuant/* remote repo — 意味著 #76 (note-to-pdf 發布) 的原始碼只存在開發者的 local filesystem,沒納入任何版本控制。

Type

refactor

Expected

三個 Note-相關 packages 跟 common-converter-swift / word-to-md-swift 同樣處理:獨立成 PsychQuant GitHub repos,用 remoteSourceControl 依賴。

// 目標狀態:Package.swift
.package(url: "https://github.com/PsychQuant/note-core-swift.git", from: "0.1.0"),
.package(url: "https://github.com/PsychQuant/note-to-pdf-swift.git", from: "0.1.0"),
.package(url: "https://github.com/PsychQuant/note-to-html-swift.git", from: "0.1.0"),

Actual

目前三個 packages 都用 local path: 依賴且完全無版本控制:

.package(name: "NoteToHTML", path: "packages/note-to-html-swift"),
.package(name: "NoteToPDF", path: "packages/note-to-pdf-swift"),
// NoteCore 由 NoteToHTML / NoteToPDF 間接依賴

Source files 只在開發者 local(macdoc v0.5.0 binary 能跑,但無法 collaborate / PR / audit)。

Impact

  • 無法 collaborate:第二位開發者從頭 clone macdoc 缺少三個 packages 的 source → 無法 build
  • 無法 PR review:改動 NoteCore 邏輯無 diff 可看
  • 無 audit trail:git log 查不到 packages 歷史
  • Blocks bug: .note → pdf 分頁切錯(筆畫橫跨頁邊界、空白不合理分布) #77:#77 修的 bug 位於 packages/note-core-swift/Sources/NoteCore/NoteParser.swift:154-159,已完成實作 + 單元測試,但無法 commit(被 .gitignore 擋、也沒有 remote repo 可以 push)

Strategy

三個 packages 依相依順序處理:

Phase 1 — NoteCore(基礎,無下游內部依賴)

Phase 2 — NoteToPDF

Phase 3 — NoteToHTML

  • 同 Phase 1 流程

Phase 4 — Verification

Blockers / Dependencies

Notes


Current Status

Phase: closed
Last updated: 2026-04-18 by idd-close

Key Decisions

Scope Changes

  • (none — 按 diagnosis Strategy 6 phases 嚴格執行)

Blocking

Commits

Repos Created

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1 — 本週處理refactorCode refactoring

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions