Skip to content

Core: Allow vite-plus 0.2.x in the optional peer range - #35221

Merged
Sidnioulz merged 2 commits into
storybookjs:nextfrom
lifeiscontent:lifeiscontent/vite-plus-0.2-peer
Jul 2, 2026
Merged

Sidnioulz merged 2 commits into
storybookjs:nextfrom
lifeiscontent:lifeiscontent/vite-plus-0.2-peer

Conversation

@lifeiscontent

@lifeiscontent lifeiscontent commented Jun 18, 2026 •

Copy link
Copy Markdown
Member

What I did

code/core's only use of vite-plus is the optional vite-plus/versions subpath in getVitePlusVersions() (toolchain version detection), and it's wrapped in a try/catch that degrades to null when the export is missing.

That ./versions export ships identically in the 0.2.x line — export const versions = { vite, vitest, ... } (verified against 0.1.24 and 0.2.1) — so the typeof versions.vite === 'string' check holds without any code change.

This widens the optional peer from ^0.1.15 to ^0.1.15 || ^0.2.0: a superset that keeps existing 0.1.x consumers working while letting projects already on vite-plus@0.2.x install without a spurious peer warning (or a forced peerDependencyRules override).

Why

vite-plus@0.2.x reworked how it provides the test runner (it now depends on vitest@4.1.9 directly instead of vendoring its own 0.1.x-versioned fork), so projects that have upgraded can't satisfy the current ^0.1.15 range even though the API Storybook relies on is unchanged.

Checklist

  • No source change beyond the peer range — the consumed surface (vite-plus/versions) is the same across 0.1.x and 0.2.x.
  • It's an optional peer (peerDependenciesMeta), so non-vite-plus users are unaffected.

Summary by CodeRabbit

  • Chores
    • Extended dependency version compatibility to support a broader range of releases, improving compatibility with both current and newer versions while maintaining backward support.

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.
Copilot AI review requested due to automatic review settings June 18, 2026 17:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-plus peer dependency range in code/core from ^0.1.15 to ^0.1.15 || ^0.2.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sidnioulz Sidnioulz self-assigned this Jun 18, 2026
@Sidnioulz Sidnioulz added dependencies ci:normal Run our default set of CI jobs (choose this for most PRs). qa:skip Pull Requests that do not need any QA. (e.g. documentation) labels Jun 18, 2026
@Sidnioulz
Sidnioulz enabled auto-merge June 18, 2026 17:30

@Sidnioulz Sidnioulz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>
auto-merge was automatically disabled June 23, 2026 07:18

Head branch was pushed to by a user without write access

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d0e309cc-095a-4e60-bad9-5988a7394e31

📥 Commits

Reviewing files that changed from the base of the PR and between d2400da and 2770541.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • code/core/package.json

📝 Walkthrough

Walkthrough

In code/core/package.json, the peerDependencies entry for vite-plus is updated from ^0.1.15 to ^0.1.15 || ^0.2.0, adding support for the 0.2.x release line alongside the existing 0.1.x range.

Changes

Peer dependency version range update

Layer / File(s) Summary
vite-plus peer dependency range broadened
code/core/package.json
peerDependencies.vite-plus is changed from ^0.1.15 to ^0.1.15 || ^0.2.0.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@storybook-app-bot

Copy link
Copy Markdown
Contributor

Package Benchmarks

Commit: 2770541, ran on 23 June 2026 at 07:38:31 UTC

The following packages have significant changes to their size or dependencies:

storybook

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

This was referenced Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal Run our default set of CI jobs (choose this for most PRs). dependencies qa:skip Pull Requests that do not need any QA. (e.g. documentation)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants