feat: AST-based Storybook story generation with prop controls, variants, and MDX docs#59
Merged
PAMulligan merged 8 commits intoApr 15, 2026
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…D phase) Replace bash-based generate-stories tests with 22 tests targeting the new Node.js generate-stories.js script using ts-morph AST parsing. Tests cover backward compatibility, argTypes/controls generation, action args, variant stories, default values, MDX documentation, JSON output, and maxVariantsPerProp config. All tests fail as expected since generate-stories.js does not exist yet. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…iants, and MDX docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Addresses code review findings: - Single quotes in JSDoc descriptions are now escaped in generated argTypes - String default values are escaped in generated args - Variant story names from union values are sanitized to valid JS identifiers (handles numeric prefixes like '2xl' and hyphens like 'left-to-right') Co-Authored-By: Claude Opus 4.6 (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
Closes #12
generate-stories.shfrom bash regex to a Node.js script (generate-stories.js) usingts-morphfor TypeScript AST parsing.stories.tsxfiles with typed argTypes/controls (text, number, boolean, select), action args foron*callbacks, variant stories for string literal unions and boolean props, and default args from parameter destructuring.mdxdocumentation files with Meta, Canvas, Controls, ArgTypes blocks and embedded variant canvases--force,--dry-run,--no-mdx,--json,--src-dir,--configgenerateMdxandmaxVariantsPerPropconfig options to pipeline.config.jsonTest plan
pnpm vitest run scripts/__tests__/generate-stories.test.js)./scripts/lint-and-format.sh)generate-stories.sh) forwards to Node.js script correctly🤖 Generated with Claude Code