Skip to content

feat(pipeline): add asset-staging stage and repair #152 merge fallout#155

Merged
PAMulligan merged 1 commit into
mainfrom
feat/asset-staging-stage
Jun 24, 2026
Merged

feat(pipeline): add asset-staging stage and repair #152 merge fallout#155
PAMulligan merged 1 commit into
mainfrom
feat/asset-staging-stage

Conversation

@PAMulligan

Copy link
Copy Markdown
Collaborator

Summary

Lands a working stage-assets ETL stage and repairs the breakage that PR #152's conflict-resolution merge left on main.

The stage (Extract → Transform → Load)

stage-assets resolves an InDesign source's image bytes and stages them into a generator-ready bundle — the one thing neither the parser, the ingest stage, nor the generator did before:

  • ir.json — the intermediate IR the theme generator consumes
  • assets/ — image bytes pulled from the source (embedded in the IDML zip, or decoded from the PDF), named to match the generator's planAssets() output
  • assets.manifest.json — per-frame provenance + unresolved-asset warnings

Because the staged filenames come from the generator's own planAssets(), 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

Pure, source-agnostic transform (resolveAssets / buildAssetBundle) + runAssetStage orchestration. Runnable via pnpm pipeline:stage-assets and the flavian-stage-assets bin. This also makes the previously-orphaned idml-assets.js (merged by #152) functional.

Repairs from the #152 merge (tracked in #154)

PR #152 merged after a conflict resolution that left main degraded — CI stayed green because nothing exercised the broken paths:

  • Dangling barrel exportsrc/indesign/index.js re-exported resolveAssets, buildIngestBundle, writeIngestBundle, runIngest from ./ingest/index.js, which exports none of them, so importing the package's ./indesign barrel threw at load. Repointed to ./assets/stage.js (which actually provides them).
  • Crashing subcommand — removed flavian pipeline ingest (it imported a non-existent runIngest); main exposes ingest via the flavian-ingest bin, untouched.
  • Duplicate keys — de-duped pipeline:ingest (root) and flavian-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 with generateTheme() (3)
  • barrel.test.mjs — barrel imports cleanly; all exports live (2)
  • assets-idml.test.mjs — embedded-asset extraction (2)
  • Full @flavian/pipeline suite green (incl. main's ingest / ingest-content / ingest-detect tests) except two pre-existing CRLF-only snapshot tests (stored LF; green on Ubuntu CI)
  • InDesign smoke + fixtures (CI steps)
  • flavian pipeline ingest now cleanly reports "Unknown pipeline" instead of crashing
  • E2E: pnpm pipeline:stage-assets → generate → embedded image staged into theme/assets/
  • commitlint passes

Closes #154
Follow-up to #152 (capability issue #117).

🤖 Generated with Claude Code

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>
@PAMulligan PAMulligan self-assigned this Jun 24, 2026
@PAMulligan PAMulligan merged commit 26c6c72 into main Jun 24, 2026
20 checks passed
@PAMulligan PAMulligan deleted the feat/asset-staging-stage branch June 24, 2026 22:08
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.

Repair #152 merge fallout: dangling barrel export, duplicate package.json keys, crashing flavian pipeline ingest

1 participant