feat(pipeline): add asset-staging stage and repair #152 merge fallout#155
Merged
Conversation
Land a working `stage-assets` ETL stage that resolves an InDesign source's image bytes and stages them into a generator-ready bundle (ir.json + assets/ + assets.manifest.json), and repair the breakage the #152 conflict-resolution merge left on main. The stage (Extract -> Transform -> Load): - resolveAssets/buildAssetBundle join IR image frames to an href->bytes resolver (pure, source-agnostic); runAssetStage wires in IDML zip extraction and the PDF image cache. Staged filenames come from the generator's own planAssets(), so the bundle feeds straight into generation: flavian-stage-assets brochure.idml --out-dir build/brochure flavian pipeline indesign build/brochure/ir.json --asset-dir build/brochure/assets - Runnable via `pnpm pipeline:stage-assets` and the `flavian-stage-assets` bin. Repairs from the #152 merge: - src/indesign/index.js re-exported four names from ./ingest/index.js that it never exported, so importing the package barrel threw at load. Repointed to ./assets/stage.js, which actually provides them; the orphaned idml-assets.js is now wired into a real stage. - Removed the crashing `flavian pipeline ingest` subcommand (it imported a non-existent runIngest); main exposes ingest via the flavian-ingest bin. - De-duplicated pipeline:ingest (root) and flavian-ingest (package) keys. Adds a barrel-import test that fails on any dangling re-export — the guard that was missing when the bad merge shipped green. Redence proof token (Pipelines / Data-ETL): RDNC-NWYQDP Closes #154 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lands a working
stage-assetsETL stage and repairs the breakage that PR #152's conflict-resolution merge left onmain.The stage (Extract → Transform → Load)
stage-assetsresolves an InDesign source's image bytes and stages them into a generator-ready bundle — the one thing neither the parser, theingeststage, nor the generator did before:ir.json— the intermediate IR the theme generator consumesassets/— image bytes pulled from the source (embedded in the IDML zip, or decoded from the PDF), named to match the generator'splanAssets()outputassets.manifest.json— per-frame provenance + unresolved-asset warningsBecause the staged filenames come from the generator's own
planAssets(), the bundle feeds straight into generation:Pure, source-agnostic transform (
resolveAssets/buildAssetBundle) +runAssetStageorchestration. Runnable viapnpm pipeline:stage-assetsand theflavian-stage-assetsbin. This also makes the previously-orphanedidml-assets.js(merged by #152) functional.Repairs from the #152 merge (tracked in #154)
PR #152 merged after a conflict resolution that left
maindegraded — CI stayed green because nothing exercised the broken paths:src/indesign/index.jsre-exportedresolveAssets, buildIngestBundle, writeIngestBundle, runIngestfrom./ingest/index.js, which exports none of them, so importing the package's./indesignbarrel threw at load. Repointed to./assets/stage.js(which actually provides them).flavian pipeline ingest(it imported a non-existentrunIngest);mainexposes ingest via theflavian-ingestbin, untouched.pipeline:ingest(root) andflavian-ingest(package).Regression guard
Adds
barrel.test.mjs— it imports the package barrel and asserts every advertised export resolves, failing on any dangling re-export. This is the guard that was missing when the bad merge shipped green.Test plan
stage-assets.test.mjs— transform, manifest, end-to-end IDML run aligned withgenerateTheme()(3)barrel.test.mjs— barrel imports cleanly; all exports live (2)assets-idml.test.mjs— embedded-asset extraction (2)@flavian/pipelinesuite green (incl. main's ingest / ingest-content / ingest-detect tests) except two pre-existing CRLF-only snapshot tests (stored LF; green on Ubuntu CI)flavian pipeline ingestnow cleanly reports "Unknown pipeline" instead of crashingpnpm pipeline:stage-assets→ generate → embedded image staged intotheme/assets/Closes #154
Follow-up to #152 (capability issue #117).
🤖 Generated with Claude Code