feat(pipeline): add InDesign React component generator#102
Merged
Conversation
Turn the IR + design tokens into importable React artifacts — the final build stage of the InDesign-to-React pipeline (#66, part of #62). - One typed .tsx component per spread; names from page/spread with safe-id fallback - Text frames -> semantic tags (h1-h6/p/figcaption) by paragraph-style role; image frames -> <img> or next/image; token-spaced flow/grid layout - Explicit content prop types with extracted text/src as defaults - Two styling modes: Tailwind classes via the mapper preset, or co-located CSS Modules referencing tokens.css custom properties - Storybook stories per component with extracted content as default args - index.ts barrel + indesign-pipeline-report.md (files, assets, unmapped nodes, a11y TODOs); deterministic output - CLI: --emit-components <dir> with --style and --framework - 11 new tests (128 total): generated TSX type-checks under strict tsc (Tailwind, CSS Modules, Next.js), renders via react-dom/server, plus JSX snapshots Refs #66, #62 Co-Authored-By: Claude Opus 4.8 (1M context) <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
The final build stage of the InDesign-to-React pipeline (#66, part of #62): turn the IR (#63/#64) + design tokens (#65) into a directory of importable, typed React components — the stage that makes the design a finished React package.
New
packages/pipeline/src/react/subsystem plus a--emit-componentsCLI flow.What it generates
Per spread, one
.tsxcomponent:h1–h6/p/figcaption) inferred from the paragraph-style role; image frames become<img>(ornext/imagewhen--framework next); layout is a token-spaced flow, or a grid for multi-column spreads.…Propstype for every extracted content field (heading?,body?,image?,imageAlt?, …), with the extracted text / imagesrcas defaults, so consumers override content while keeping layout..module.cssreferencing thetokens.csscustom properties.*.stories.tsxper component, populated with the extracted content as default args.index.ts, andindesign-pipeline-report.mdlisting produced files, staged assets, unmapped IR nodes, and accessibility TODOs (e.g. images missing alt text).Generated output is deterministic — the same IR produces byte-identical files.
CLI
Acceptance criteria (#66)
tsc --noEmitaccepts (verified via the TS compiler API) and that render without runtime errors (verified viareact-dom/server).module.css(verified with a*.module.cssmodule shim)Testing
pnpm --filter @aurelius/pipeline typecheck/test/build✅ — 128 tests (11 new)eslint .(0 errors) andprettier --check .✅;check-doc-counts✅; lockfile in syncNotes
--emit-componentsresolves tokens internally for class names; run--emit-tokensto also write the token files the components reference.react,react-dom,@types/react,@types/react-dom(all pure JS).Closes #66
Part of #62
🤖 Generated with Claude Code