Addon Vitest: Fix postinstall file types #28978
Merged
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.
Closes N/A
NOTE: the problem below is actually fixed by #28980. But this PR is still valid. CJS should not require ESM.
What I did
Fix CJS requiring ESM. Not sure whether this will solve the problem.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Postinstall the canary (?)
🦋 Canary release
This pull request has been released as version
0.0.0-pr-28978-sha-d1099143
. Try it out in a new sandbox by runningnpx [email protected] sandbox
or in an existing project withnpx [email protected] upgrade
.More information
0.0.0-pr-28978-sha-d1099143
shilman/fix-vitest-postinstall
d1099143
1724761618
)To request a new release of this pull request, mention the
@storybookjs/core
team.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=28978
Greptile Summary
This pull request addresses an issue with the postinstall script for the @storybook/experimental-addon-vitest addon by updating file extensions to resolve CommonJS importing ESM problems.
code/addons/vitest/postinstall.cjs
to require 'dist/postinstall.cjs' instead of '.js'code/addons/vitest/preset.cjs
to directly export contents from 'dist/preset.cjs'