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

Use --stats-json flag for SB 8.0.0+ #1049

Merged

Conversation

jmhobbs
Copy link
Contributor

@jmhobbs jmhobbs commented Sep 13, 2024

At 8.0.0, --webpack-stats-json was renamed to --stats-json

Prefer that option for projects using 8.0.0 or greater.

New version of #1035, which had a bug when storybook.version was missing on the Context object.

📦 Published PR as canary version: 11.10.3--canary.1049.10997678109.0

✨ Test out this PR locally via:

npm install chromatic@11.10.3--canary.1049.10997678109.0
# or 
yarn add chromatic@11.10.3--canary.1049.10997678109.0

@jmhobbs jmhobbs added release Auto: Create a `latest` release when merged patch Auto: Increment the patch version when merged labels Sep 13, 2024
@jmhobbs jmhobbs requested review from maxcorbin and a team September 13, 2024 17:39
@jmhobbs jmhobbs self-assigned this Sep 13, 2024
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 520c9601 100.00% (target: 80.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (520c960) Report Missing Report Missing Report Missing
Head commit (c5edc35) 8324 4495 54.00%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1049) 13 13 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@jmhobbs jmhobbs added the DO NOT MERGE Block: Prevent merging this PR label Sep 13, 2024
Copy link
Contributor

@codykaup codykaup left a comment

Choose a reason for hiding this comment

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

That's rather unfortunate. This fix makes sense though!

@jmhobbs jmhobbs removed the DO NOT MERGE Block: Prevent merging this PR label Sep 23, 2024
@jmhobbs jmhobbs added this pull request to the merge queue Sep 23, 2024
Merged via the queue into main with commit a4e9b28 Sep 23, 2024
27 of 29 checks passed
@jmhobbs jmhobbs deleted the jmhobbs/cap-2186-gha-doesnt-recognize-the-flag-stats-json branch September 23, 2024 15:43
@ghengeveld
Copy link
Member

🚀 PR was released in v11.10.3 🚀

@ghengeveld ghengeveld added the released Verdict: This issue/pull request has been released label Sep 23, 2024
@Densitibo
Copy link

This PR introduced Turbosnap to stop working; I was getting the following error message:

Error: ✖ Failed to publish your built Storybook
✖ TurboSnap disabled due to missing stats file
Did not find preview-stats.json in your built Storybook.
Make sure you pass --stats-json when building your Storybook.
    at U3i (/home/runner/work/_actions/chromaui/action/latest/action/register.js:1460:1196)
    at yse.task (/home/runner/work/_actions/chromaui/action/latest/action/register.js:286:6159)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: non-zero exit code

Consider updating the error message here:

Make sure you pass --stats-json when building your Storybook.

to

Make sure you pass --webpack-stats-json when building your Storybook.

Passing pass --stats-json did not fix the build. However, if I use --webpack-stats-json, it works well.

@jmhobbs
Copy link
Contributor Author

jmhobbs commented Sep 24, 2024

@Densitibo, sorry for the broken build! What version of Storybook are you running? I'm curious if we have an edge case somewhere that it would go down the wrong path and use the new flag when it is not actually supported.

@Densitibo
Copy link

I'm running Storybook 8.0.8 for react-webpack5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Auto: Increment the patch version when merged release Auto: Create a `latest` release when merged released Verdict: This issue/pull request has been released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants