feat(anatomy): curation pipeline — changeset schema, applier with before/after records, cleaned single asset, draft seed, changelog + review report generators; seed layout legacy-import/curation/draft
This commit is contained in:
1 parent
3dbbfdf1df
commit
6870d87910
58 files changed
+18167
-267
No files matched your search
@@ -2,9 +2,14 @@ import { readFile } from 'node:fs/promises'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { join } from 'node:path'
|
||||
import {
|
||||
buildEquineDraft,
|
||||
EQUINE_SOURCE_PATHS,
|
||||
HEAD_VIEW_ID,
|
||||
importEquineLegacy,
|
||||
parseViewBox,
|
||||
readEquineCuration,
|
||||
readEquineSources,
|
||||
type DraftResult,
|
||||
type EquineLegacyInput,
|
||||
type ImportResult,
|
||||
} from '../src'
|
||||
@@ -34,3 +39,19 @@ export async function legacyAnnoIds(path: string): Promise<string[]> {
|
||||
const ids = [...text.matchAll(/data-anno-id="([^"]+)"/g)].map((m) => m[1]!)
|
||||
return [...new Set(ids)]
|
||||
}
|
||||
|
||||
/** Legacy import + committed curation files → the working draft. */
|
||||
export async function runDraft(): Promise<{
|
||||
result: ImportResult
|
||||
draft: DraftResult
|
||||
}> {
|
||||
const input = await loadInput()
|
||||
const result = importEquineLegacy(input)
|
||||
const draft = buildEquineDraft({
|
||||
importResult: result,
|
||||
legacyMainSvgBytes: input.mainSvg.bytes,
|
||||
headViewBox: parseViewBox(result.viewBoxes[HEAD_VIEW_ID] ?? null),
|
||||
...(await readEquineCuration(REPO_ROOT)),
|
||||
})
|
||||
return { result, draft }
|
||||
}
|
||||
Reference in new issue
Block a user