-
Notifications
You must be signed in to change notification settings - Fork 13
feat: add mitosis examples to generate storybook files next to showcase examples #5387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
# Conflicts: # showcases/angular-showcase/src/app/components/button/button.component.html # showcases/shared/button.json
# Conflicts: # showcases/patternhub/tsconfig.json
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…-examples-plugins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the showcase architecture to use Mitosis-based examples that can generate both showcase and Storybook files. The key change is moving from JSON-based configuration files to .lite.tsx example files that are compiled to framework-specific code, establishing a single source of truth for component examples across showcases and Storybooks.
Key Changes
- Introduces Mitosis-based showcase architecture with
.lite.tsxexample files for the Button component - Adds path alias configuration (
@components) across all showcase projects for cleaner imports - Removes JSON-based configuration (
showcases/shared/button.json) in favor of TypeScript example files - Creates reusable showcase wrapper components for consistent presentation across platforms
Reviewed changes
Copilot reviewed 95 out of 113 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/components/src/components/button/showcase/button.showcase.lite.tsx |
New main showcase component for Button using Mitosis |
packages/components/src/components/button/examples/*.lite.tsx |
Individual example components for each Button variant/property |
packages/components/src/components/button/examples/button.examples.meta.ts |
Metadata defining all button examples with IDs and grouping |
packages/components/src/shared/showcase/*.lite.tsx |
Reusable wrapper components for showcase presentation |
packages/components/configs/mitosis.showcase.config.cjs |
New Mitosis configuration for compiling showcase files |
showcases/shared/showcase-plugins.tsx |
Plugin system for registering and retrieving showcase components |
showcases/*/tsconfig.json |
Path alias configuration for @components across all showcases |
showcases/*/vite.config.ts |
Vite alias configuration for @components |
storybooks/react-storybook/src/stories/Variant.stories.tsx |
Updated to use actual DBButton component |
showcases/patternhub/scripts/generate-docs-mdx.js |
Removed old code generation logic |
output/*/tsconfig.json |
Excludes showcase/example files from compilation |
__snapshots__/button/showcase/**/*.yaml |
Updated snapshots reflecting reordered examples |
...on/showcase/chromium/DBButton-should-match-screenshot-1/DBButton-should-match-screenshot.png
Show resolved
Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelmkraus these seem to be middle instead of bottom aligned so some elements are now positioned centered instead of block-end. Is this expected and should have happened like this with this PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that change is not intentional.
The centered vs. block-end alignment in the snapshot looks like an unintended side effect, likely coming from a shared wrapper that DBInput also uses. I’ll double-check the affected CSS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found the relevant CSS and reverted it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelmkraus these seem to be middle instead of top aligned so some elements are now positioned centered instead of block-start. Is this expected and should have happened like this with this PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found the relevant CSS and reverted it.
|
@michaelmkraus could you please add a description to this PR ? Why we did this change, on the expected outcome and a summary of the changes as well as what we need to do differently (in our processes) afterwards ? |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Proposed changes
The goal of this PR is to centralize all example definitions in Mitosis and automatically generate showcase outputs for all targets (React, Angular, Vue, Patternhub).
The PR provides
Types of changes
Further comments
🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/feat-examples-plugins