Skip to content

Update storybook, vite, and vitest and change to pnpm instead of yarn (BL-16115)#424

Open
StephenMcConnel wants to merge 3 commits into
masterfrom
BL-16273-ConvertFromVoltaToVitePlus-2
Open

Update storybook, vite, and vitest and change to pnpm instead of yarn (BL-16115)#424
StephenMcConnel wants to merge 3 commits into
masterfrom
BL-16273-ConvertFromVoltaToVitePlus-2

Conversation

@StephenMcConnel
Copy link
Copy Markdown
Contributor

@StephenMcConnel StephenMcConnel commented May 13, 2026

Updates were inspired by BL-16273, but vite+ didn't seem to work with storybook. One of the current storybook
addons is not working with vite 8.0.


This change is Reviewable

Summary by CodeRabbit

  • Chores

    • Migrated package manager from Yarn to pnpm and pinned package manager/tooling versions
    • Updated Storybook for React-Vite integration and adjusted Storybook addons and startup script
    • Added workspace configuration and tightened package build rules
    • Updated TypeScript/bundler resolution and added Less module support
  • Documentation

    • Updated development and testing instructions to use pnpm commands
    • Added debugging guide for local development workflows

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@StephenMcConnel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 31 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 67c93271-acb0-4831-b24d-4f2333333e2c

📥 Commits

Reviewing files that changed from the base of the PR and between cabeb7f and 9733fdc.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (8)
  • .storybook/main.ts
  • README-advanced.md
  • README.md
  • package.json
  • pnpm-workspace.yaml
  • src/globals.d.ts
  • src/stories/tsconfig.json
  • tsconfig.json
📝 Walkthrough

Walkthrough

This PR migrates the repo from Yarn to pnpm (adds pnpm packageManager and Volta update), updates package scripts and dependency pins, adopts Storybook’s Vite variant in config and stories, adjusts TypeScript moduleResolution to "bundler", adds story-local tsconfig and less typings, and updates developer docs to use pnpm.

Changes

Tooling and Storybook Modernization

Layer / File(s) Summary
Package manager configuration and dependencies
package.json, pnpm-workspace.yaml
Adds packageManager: "pnpm@11.1.2", replaces Yarn/Volta entry with pnpm, updates scripts to use pnpm, and pins/updates many dependencies and devDependencies (including Storybook and build tooling).
Storybook core configuration updates
.storybook/main.ts, .storybook/preview.ts
Changes local Vite config import to ../vite.config.ts, narrows addons to @storybook/addon-links and @storybook/addon-docs, updates viteFinal server proxy return shape, and switches preview typing to Preview from @storybook/react-vite.
Story file import consolidation for Storybook Vite
src/stories/BloomPlayerTester.ts, src/stories/books.stories.tsx, src/stories/controlBarInteraction.stories.tsx, src/stories/multiBook.stories.tsx, src/stories/navigation.stories.tsx, src/stories/playerInteraction.stories.tsx
Replaces @storybook/react imports with @storybook/react-vite in story typing imports and consolidates test helper imports to storybook/test where used.
Development and setup documentation
README.md, README-advanced.md
Replaces yarn instructions with pnpm equivalents for install, build, storybook/dev/test commands; adds advanced debugging/linking guide using pnpm link/pnpm unlink.
TypeScript and globals
tsconfig.json, src/stories/tsconfig.json, src/globals.d.ts
Changes compilerOptions.moduleResolution to bundler, adds src/stories/tsconfig.json (extends root, bundler resolution, noEmit), and adds declare module "*.less";.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: upgrading Storybook, Vite, and Vitest, plus converting from Yarn to pnpm.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.storybook/main.ts:
- Line 15: The Storybook config's addons array currently includes
"@storybook/addon-links" and "@storybook/addon-docs" but is missing controls, so
stories using argTypes with control:"boolean" won't render controls; update the
addons array in .storybook/main.ts (the addons variable/array) to include
"@storybook/addon-controls" or replace the current addons with
"@storybook/addon-essentials" to restore controls and related features, then
reinstall or run Storybook to verify that navigation.stories.tsx and
multiBook.stories.tsx now show the control UI.

In `@package.json`:
- Line 65: Update the `@testing-library/dom` dependency in package.json by
replacing the hard-coded old version string ("@testing-library/dom": "^7.21.4")
with the current latest stable version: fetch the exact version via your package
registry (e.g., run npm view `@testing-library/dom` version or check the npmjs.org
page), update the package.json entry accordingly, run your package manager to
regenerate the lockfile (npm install / pnpm install / yarn install), and run the
test suite to ensure compatibility (fix any TypeScript or API changes in tests
referencing `@testing-library/dom`).
- Line 7: Update the packageManager entry in package.json: replace the current
value "pnpm@10.26.0" with the newer stable release (e.g. "pnpm@11.1.0") in the
packageManager field so project tooling uses the updated pnpm; after changing
packageManager run your workspace bootstrap (pnpm install / pnpm -w install) to
refresh lockfiles and ensure compatibility with the new pnpm version.
- Line 52: The package.json upgrade to "jquery": "^4.0.0" may break the
unmaintained plugin jquery.nicescroll (v3.7.6); verify compatibility by testing
UI scroll behavior and automated browser tests that exercise
$(".selector").niceScroll() usage and any nicescroll config in your codebase,
and check the jquery.nicescroll repo/issues for jQuery4 notes; if incompatible,
either pin jquery in package.json back to a compatible 3.x range or replace
jquery.nicescroll with a maintained alternative (e.g.,
OverlayScrollbars/PerfectScrollbar), updating imports and all init calls
(niceScroll() usages) accordingly and adding regression tests to prevent future
breakage.

In `@README-advanced.md`:
- Line 75: Replace the typo "Andy changes" with "Any changes" in the sentence
describing node_modules linking in README-advanced.md (the line that begins
"This adjusts node_modules to use a link to the live output in the bloom-player
output folder."); update that phrase to read "Any changes made to the
bloom-player code can be tested..." to correct the documentation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a0831121-d7f5-4148-a6fc-b93c7a389e61

📥 Commits

Reviewing files that changed from the base of the PR and between b29e21e and 769f830.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (12)
  • .storybook/main.ts
  • .storybook/preview.ts
  • README-advanced.md
  • README.md
  • package.json
  • pnpm-workspace.yaml
  • src/stories/BloomPlayerTester.ts
  • src/stories/books.stories.tsx
  • src/stories/controlBarInteraction.stories.tsx
  • src/stories/multiBook.stories.tsx
  • src/stories/navigation.stories.tsx
  • src/stories/playerInteraction.stories.tsx

Comment thread .storybook/main.ts
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
addons: ["@storybook/addon-links", "@storybook/addon-docs"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if stories use features from removed addons

echo "=== Checking for addon-essentials features usage ==="

# Check for argTypes (controls addon)
echo -e "\n--- Stories using argTypes/controls ---"
rg -n "argTypes:" --type=ts --type=tsx -g "*.stories.*" -C2

# Check for actions usage
echo -e "\n--- Stories using actions ---"
rg -n "action\(|actions\." --type=ts --type=tsx -g "*.stories.*" -C2

# Check for viewport configuration
echo -e "\n--- Stories using viewport ---"
rg -n "viewport:" --type=ts --type=tsx -g "*.stories.*" -C2

# Check for parameters that might use removed addons
echo -e "\n--- Stories with parameters ---"
rg -n "parameters:" --type=ts --type=tsx -g "*.stories.*" -A5 | head -50

Repository: BloomBooks/bloom-player

Length of output: 387


🏁 Script executed:

# Find all story files in the repository
find . -name "*.stories.*" -type f 2>/dev/null | head -20

# Also check the repository structure
git ls-files | grep -i "stories" | head -20

Repository: BloomBooks/bloom-player

Length of output: 518


🏁 Script executed:

# Re-run the addon feature checks with corrected patterns (no conflicting flags)

# Check for argTypes (controls addon)
echo "=== Checking for argTypes/controls usage ==="
rg -n "argTypes:" -A2 2>/dev/null

# Check for actions usage  
echo -e "\n=== Checking for actions usage ==="
rg -n "action\(" 2>/dev/null

# Check for viewport configuration
echo -e "\n=== Checking for viewport usage ==="
rg -n "viewport:" 2>/dev/null

# Check for other addon-essentials features
echo -e "\n=== Checking for addon-essentials features (backgrounds, measure, outline) ==="
rg -n "backgrounds:|measure:|outline:" 2>/dev/null

# Check if there are any .stories files at all
echo -e "\n=== Total story files found ==="
find . -name "*.stories.*" -type f 2>/dev/null | wc -l

Repository: BloomBooks/bloom-player

Length of output: 50381


🏁 Script executed:

# Check the git history to see the actual change
git log --oneline .storybook/main.ts | head -5

# Show the actual diff of the change
git log -p .storybook/main.ts | head -100

Repository: BloomBooks/bloom-player

Length of output: 128


🏁 Script executed:

# Also verify if any stories use other removed addon features
echo "=== Checking for viewport usage ==="
rg "viewport:" src/stories/ 2>/dev/null

echo -e "\n=== Checking for backgrounds usage ==="
rg "backgrounds:" src/stories/ 2>/dev/null

echo -e "\n=== Checking for addon-actions usage ==="
rg "@storybook/addon-actions|useArgs|argTypes.*action" src/stories/ 2>/dev/null

Repository: BloomBooks/bloom-player

Length of output: 185


🏁 Script executed:

cat -n .storybook/main.ts

Repository: BloomBooks/bloom-player

Length of output: 5154


🏁 Script executed:

# Also check if there's a package.json to see what addons are installed
cat package.json | grep -A 20 '"dependencies"' | head -30

Repository: BloomBooks/bloom-player

Length of output: 787


Stories that use argTypes controls will not render control UI.

Stories at src/stories/navigation.stories.tsx and src/stories/multiBook.stories.tsx define argTypes with control: "boolean", which requires @storybook/addon-controls. This addon was bundled in @storybook/addon-essentials but is not present in the new configuration. @storybook/addon-links and @storybook/addon-docs do not include controls functionality.

Add @storybook/addon-controls to the addons array or reinstall @storybook/addon-essentials if other features (actions, viewport, backgrounds, measure, outline) are also needed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.storybook/main.ts at line 15, The Storybook config's addons array currently
includes "@storybook/addon-links" and "@storybook/addon-docs" but is missing
controls, so stories using argTypes with control:"boolean" won't render
controls; update the addons array in .storybook/main.ts (the addons
variable/array) to include "@storybook/addon-controls" or replace the current
addons with "@storybook/addon-essentials" to restore controls and related
features, then reinstall or run Storybook to verify that navigation.stories.tsx
and multiBook.stories.tsx now show the control UI.

Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread package.json Outdated
"@storybook/addon-docs": "10.3.6",
"@storybook/addon-links": "10.3.6",
"@storybook/react-vite": "10.3.6",
"@testing-library/dom": "^7.21.4",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Consider upgrading @testing-library/dom to a more recent version.

Version ^7.21.4 of @testing-library/dom is from around 2020. More recent versions (13.x-14.x series as of early 2025) include bug fixes, performance improvements, and better TypeScript support.

What is the latest stable version of `@testing-library/dom` in May 2026?
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 65, Update the `@testing-library/dom` dependency in
package.json by replacing the hard-coded old version string
("@testing-library/dom": "^7.21.4") with the current latest stable version:
fetch the exact version via your package registry (e.g., run npm view
`@testing-library/dom` version or check the npmjs.org page), update the
package.json entry accordingly, run your package manager to regenerate the
lockfile (npm install / pnpm install / yarn install), and run the test suite to
ensure compatibility (fix any TypeScript or API changes in tests referencing
`@testing-library/dom`).

Comment thread README-advanced.md Outdated
@StephenMcConnel StephenMcConnel force-pushed the BL-16273-ConvertFromVoltaToVitePlus-2 branch from 769f830 to cabeb7f Compare May 18, 2026 16:09
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

♻️ Duplicate comments (1)
.storybook/main.ts (1)

15-15: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Stories that use argTypes controls will not render control UI.

Stories at src/stories/navigation.stories.tsx and src/stories/multiBook.stories.tsx define argTypes with control: "boolean", which requires @storybook/addon-controls. This addon was bundled in @storybook/addon-essentials but is not present in the new configuration. @storybook/addon-links and @storybook/addon-docs do not include controls functionality.

Add @storybook/addon-controls to the addons array or reinstall @storybook/addon-essentials if other features (actions, viewport, backgrounds, measure, outline) are also needed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.storybook/main.ts at line 15, The Storybook config's addons array (the
addons entry in .storybook/main.ts) is missing `@storybook/addon-controls` so
argTypes with control: "boolean" won't render; update the addons array (the
addons variable) to include "`@storybook/addon-controls`" or alternatively replace
the current addons list with "`@storybook/addon-essentials`" if you want controls
plus actions/viewport/backgrounds/etc., ensuring the addons array contains the
controls or essentials package.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 46-58: The dependency list pins an old vulnerable axios ("axios":
"0.18.1") and conflicts with the workspace savePrefix policy; update the axios
entry in package.json to at least "0.31.1" (preferably "1.16.1") to remove the
HIGH severity vulnerability, run lockfile update (pnpm install) and test; also
decide whether you want exact pins or caret ranges—if you want workspace
behavior, align package.json version strings to use the savePrefix policy (e.g.,
"^" ranges) or update pnpm-workspace.yaml to document intentional exact pins so
versions are consistent.

In `@pnpm-workspace.yaml`:
- Line 9: The repo has an inconsistency between pnpm's savePrefix setting and
the pinned versions in package.json: adjust the pnpm-workspace.yaml savePrefix
(the savePrefix key) to match your desired policy or update package.json to
match it; either remove or set savePrefix to "" to enforce exact pins across new
installs, or change the pinned dependencies in package.json back to caret ranges
(^) so they align with savePrefix: "^". Ensure the change is applied to the
savePrefix entry in pnpm-workspace.yaml and/or the dependency version strings in
package.json so both files follow the same pinning strategy.
- Line 6: The YAML line defining allowBuilds has inconsistent spacing inside the
braces; update the allowBuilds mapping so it follows standard YAML style (no
extra spaces inside braces) by normalizing the inline mapping for allowBuilds
(the keys esbuild and swiper) to the conventional formatting.

In `@README-advanced.md`:
- Around line 67-83: Update the pnpm link/unlink instructions to use the modern
path-based workflow: remove the standalone "pnpm link" step in bloom-player's
folder (or replace with guidance to use "pnpm link --global" only if
intentionally relying on a global store), and instruct the consumer in the other
project's development folder to run "pnpm link <path-to-bloom-player>" (relative
or absolute path) to create the link; for unlinking show both "pnpm unlink
bloom-player" (by package name) and the alternative "pnpm unlink
<path-to-bloom-player>" when path form was used, and add a brief pointer to the
pnpm link documentation URL for reference.

---

Duplicate comments:
In @.storybook/main.ts:
- Line 15: The Storybook config's addons array (the addons entry in
.storybook/main.ts) is missing `@storybook/addon-controls` so argTypes with
control: "boolean" won't render; update the addons array (the addons variable)
to include "`@storybook/addon-controls`" or alternatively replace the current
addons list with "`@storybook/addon-essentials`" if you want controls plus
actions/viewport/backgrounds/etc., ensuring the addons array contains the
controls or essentials package.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b7d00ad6-51e5-487f-bf7a-3a17ff7e0b4c

📥 Commits

Reviewing files that changed from the base of the PR and between 769f830 and cabeb7f.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (8)
  • .storybook/main.ts
  • README-advanced.md
  • README.md
  • package.json
  • pnpm-workspace.yaml
  • src/globals.d.ts
  • src/stories/tsconfig.json
  • tsconfig.json

Comment thread package.json
Comment thread pnpm-workspace.yaml Outdated
Comment thread pnpm-workspace.yaml Outdated
Comment thread README-advanced.md Outdated
@StephenMcConnel StephenMcConnel force-pushed the BL-16273-ConvertFromVoltaToVitePlus-2 branch from cabeb7f to 9733fdc Compare May 18, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant