Skip to content
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

refactor: add initial support for Component Story Format (CSF) #39

Merged
merged 7 commits into from
Sep 1, 2023

Conversation

itsjavi
Copy link
Owner

@itsjavi itsjavi commented Sep 1, 2023

Note: Studying the possibility of using ComponentDriven/csf, published under @storybook/csf, but it might go in another PR (if really needed).

  • Refactor vite-plugin story collector to be compatible with CSF
  • Add a nested dir in the examples to see how they appear in the sidebar and the urls
    • Remove dummy examples/react/stories/nested-dir (or add actual examples)
    • Add more meaningful examples
  • Refactor Sidebar, offloading logic into separate functions.
  • Cleanup old StoryMeta types, and unused code.
  • Story CSF support (scope of this PR):
    • title
    • name
    • component
    • args
    • parameters (not working very well, e.g. the state of the toolbar icons is not updated)
    • decorators
    • render custom render function. all decorators processing and component rendering is delegated here.
    • loaders: Nice to have
    • argTypes : I don't see a use case until we add a "Controls" panel for the args
    • globals : It seems that currently we've been using "parameters" as a combination of CSF parameters and globals. It would be nice to support this and disambiguate it from params.

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Patch coverage: 1.21% and project coverage change: -1.37% ⚠️

Comparison is base (034b01e) 4.92% compared to head (4d4422d) 3.55%.

Additional details and impacted files
@@           Coverage Diff            @@
##            main     #39      +/-   ##
========================================
- Coverage   4.92%   3.55%   -1.37%     
========================================
  Files         36      39       +3     
  Lines       2273    2614     +341     
  Branches      65      63       -2     
========================================
- Hits         112      93      -19     
- Misses      2126    2483     +357     
- Partials      35      38       +3     
Files Changed Coverage Δ
...ages/examples/react/src/components/LinkableBtn.tsx 0.00% <0.00%> (ø)
packages/storylite/src/app/renderApp.tsx 0.00% <0.00%> (ø)
packages/storylite/src/app/routes.ts 0.00% <0.00%> (ø)
packages/storylite/src/app/stores/global.ts 0.00% <0.00%> (ø)
packages/storylite/src/components/Story.tsx 0.00% <0.00%> (ø)
...s/storylite/src/components/canvas/CanvasIframe.tsx 0.00% <0.00%> (ø)
...orylite/src/components/canvas/CanvasIframeBody.tsx 0.00% <0.00%> (ø)
...kages/storylite/src/components/sidebar/Sidebar.tsx 0.00% <0.00%> (ø)
.../storylite/src/components/sidebar/SidebarTitle.tsx 0.00% <0.00%> (ø)
.../storylite/src/components/toolbar/ToolbarAddon.tsx 0.00% <0.00%> (ø)
... and 17 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@itsjavi itsjavi merged commit 4dcb361 into main Sep 1, 2023
1 of 3 checks passed
@itsjavi itsjavi deleted the sb-csf3-interop branch September 1, 2023 11:12
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.

1 participant