Skip to content

CLI: Support defineMain in main.ts #1170

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

kasperpeulen
Copy link

@kasperpeulen kasperpeulen commented Apr 3, 2025

Description

This PR bumps storybook csf tools, so that defineMain is allowed in main.js/ts.

Manual QA

I build the package locally using the changes from this PR, and I noted a file size increase:

The move to prebundle all our deps in storybook, is kind of working against us in this case.
We kind of expect packages to have storybook as a peer dep, but that is not possible in chromatic cli because of:

  • it would force e2e users to install storybook
  • and it would not allow npx chromatic anymore in some package managers when chromatic is not installed locally

This causes a 3MB increase, as babel gets now both prebundled in storybook and chromatic.
I did find that we do things a bit smarter in storybook 9 which would cause only a 0.5MB increase.
Storybook 9 is not stable yet, so we should bump the dep again in a couple of weeks, to get the bundle size back again.

📦 Published PR as canary version: 11.28.1--canary.1170.14246439837.0

✨ Test out this PR locally via:

npm install [email protected]
# or 
yarn add [email protected]

@kasperpeulen kasperpeulen added the patch Auto: Increment the patch version when merged label Apr 3, 2025
@kasperpeulen kasperpeulen changed the title Update storybook to 8.6 Fix: Support defineMain in main.ts Apr 3, 2025
@kasperpeulen kasperpeulen added bug Classification: Something isn't working CLI labels Apr 3, 2025
@kasperpeulen kasperpeulen changed the title Fix: Support defineMain in main.ts CLI: Support defineMain in main.ts Apr 3, 2025
Copy link
Contributor

github-actions bot commented Apr 3, 2025

📦 Package Size: 9260 KB

@kasperpeulen kasperpeulen added the release Auto: Create a `latest` release when merged label Apr 3, 2025
Copy link

codecov bot commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.24%. Comparing base (b5c5fb0) to head (b78c053).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1170      +/-   ##
==========================================
+ Coverage   70.19%   71.24%   +1.04%     
==========================================
  Files         203      197       -6     
  Lines        7385     7191     -194     
  Branches     1308     1298      -10     
==========================================
- Hits         5184     5123      -61     
+ Misses       2178     2050     -128     
+ Partials       23       18       -5     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kasperpeulen kasperpeulen marked this pull request as draft April 3, 2025 15:00
@kasperpeulen kasperpeulen marked this pull request as ready for review April 3, 2025 15:34
Copy link
Contributor

@justin-thurman justin-thurman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Classification: Something isn't working CLI patch Auto: Increment the patch version when merged release Auto: Create a `latest` release when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants