Repository navigation
Core: Allow vite-plus 0.2.x in the optional peer range - #35221
Conversation
Core's only use of vite-plus is the optional `vite-plus/versions` subpath
(toolchain version detection, wrapped in a try/catch that degrades to null).
That export ships identically in 0.2.x — `{ vite, vitest, ... }` string map —
so widen the peer from `^0.1.15` to `^0.1.15 || ^0.2.0`: a superset that keeps
existing 0.1.x consumers working while adding support for the 0.2.x line.
There was a problem hiding this comment.
Pull request overview
This PR widens Storybook core’s optional peer dependency range for vite-plus to include the 0.2.x line, reducing unnecessary peer warnings for consumers that have already upgraded while keeping 0.1.x compatibility.
Changes:
- Expand
vite-pluspeer dependency range incode/corefrom^0.1.15to^0.1.15 || ^0.2.0.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sidnioulz
left a comment
There was a problem hiding this comment.
Thanks @lifeiscontent
Could you please make sure to commit changes to the lockfile (fails CI otherwise) and do a pass of yarn fmt:write on the branch?
Thanks
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Head branch was pushed to by a user without write access
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn ChangesPeer dependency version range update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 72 | 72 | 0 |
| Self size | 21.13 MB | 21.08 MB | 🎉 -53 KB 🎉 |
| Dependency size | 36.42 MB | 36.44 MB | 🚨 +12 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 204 | 204 | 0 |
| Self size | 821 KB | 802 KB | 🎉 -19 KB 🎉 |
| Dependency size | 91.50 MB | 91.45 MB | 🎉 -51 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 197 | 197 | 0 |
| Self size | 32 KB | 32 KB | 🚨 +36 B 🚨 |
| Dependency size | 89.98 MB | 89.94 MB | 🎉 -41 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 73 | 73 | 0 |
| Self size | 1.09 MB | 1.08 MB | 🎉 -10 KB 🎉 |
| Dependency size | 57.55 MB | 57.51 MB | 🎉 -41 KB 🎉 |
| Bundle Size Analyzer | node | node |
What I did
code/core's only use ofvite-plusis the optionalvite-plus/versionssubpath ingetVitePlusVersions()(toolchain version detection), and it's wrapped in atry/catchthat degrades tonullwhen the export is missing.That
./versionsexport ships identically in the0.2.xline —export const versions = { vite, vitest, ... }(verified against0.1.24and0.2.1) — so thetypeof versions.vite === 'string'check holds without any code change.This widens the optional peer from
^0.1.15to^0.1.15 || ^0.2.0: a superset that keeps existing0.1.xconsumers working while letting projects already onvite-plus@0.2.xinstall without a spurious peer warning (or a forcedpeerDependencyRulesoverride).Why
vite-plus@0.2.xreworked how it provides the test runner (it now depends onvitest@4.1.9directly instead of vendoring its own0.1.x-versioned fork), so projects that have upgraded can't satisfy the current^0.1.15range even though the API Storybook relies on is unchanged.Checklist
vite-plus/versions) is the same across0.1.xand0.2.x.peerDependenciesMeta), so non-vite-plus users are unaffected.Summary by CodeRabbit