Skip to content

chore: upgrade storybook to latest version (#733)#734

Merged
NoopDog merged 2 commits intomainfrom
fran/733-upgrade-sb
Dec 12, 2025
Merged

chore: upgrade storybook to latest version (#733)#734
NoopDog merged 2 commits intomainfrom
fran/733-upgrade-sb

Conversation

@frano-m
Copy link
Contributor

@frano-m frano-m commented Dec 12, 2025

Closes #733.

This pull request migrates the Storybook configuration and related dependencies from the Webpack-based @storybook/nextjs setup to the new Vite-based @storybook/nextjs-vite system. It updates all relevant Storybook packages, adjusts imports throughout the codebase, and simplifies the Storybook config file. These changes modernize the project's Storybook integration, improve performance, and ensure compatibility with the latest Storybook ecosystem.

Storybook migration and configuration updates:

  • Migrated the main Storybook configuration in .storybook/main.ts to use @storybook/nextjs-vite and Vite builder, replacing the previous Webpack-based setup and removing custom aliasing and docgen options.
  • Updated all Storybook-related dependencies in package.json to their Vite-compatible versions, including switching from @storybook/nextjs and related packages to @storybook/nextjs-vite. [1] [2]

Codebase-wide import adjustments:

  • Updated all Storybook story files to import Meta and StoryObj from @storybook/nextjs-vite instead of @storybook/react, ensuring compatibility with the new Storybook setup. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

Test utility import updates:

  • Changed all imports of fn and action utility functions in stories and args files to use the new storybook/test and storybook/actions packages, replacing the previous @storybook/test and @storybook/addon-actions imports. [1] [2] [3] [4] [5] [6]

Miscellaneous import fixes:

  • Corrected the import path for LOREM_IPSUM in FilterTag story args to use a relative path, ensuring it resolves correctly after the migration.

Copy link
Contributor

Copilot AI left a comment

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 migrates the Storybook configuration from version 8.6.4 with Webpack-based @storybook/nextjs to version 10.1.7 with Vite-based @storybook/nextjs-vite. The migration simplifies the build setup, improves performance, and modernizes the project's Storybook integration.

Key changes include:

  • Upgrading all Storybook packages from v8.6.4 to v10.1.7 and switching to Vite-based packages
  • Updating ~70 story files to import types from @storybook/nextjs-vite instead of @storybook/react
  • Changing test utility imports from @storybook/test and @storybook/addon-actions to the new storybook/test and storybook/actions paths
  • Simplifying the Storybook main configuration by removing custom webpack aliasing
  • Changing TypeScript's moduleResolution from "node" to "bundler" to better support Vite

Reviewed changes

Copilot reviewed 81 out of 84 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.storybook/main.ts Completely rewritten to use Vite-based configuration with defineMain, removing webpack-specific customizations
package.json Updated all Storybook dependencies to v10.1.7, consolidated multiple addon packages into the main Vite package
tsconfig.json Changed moduleResolution from "node" to "bundler" for better Vite compatibility
jest.config.js Removed moduleNameMapper for @storybook/addon-actions as the mock is no longer needed
src/mocks/@storybook/addon-actions.ts Removed mock file as part of migration to new import paths
Story files (70+ files) Updated all Meta and StoryObj imports from @storybook/react to @storybook/nextjs-vite
Args files (7 files) Updated fn import from @storybook/test to storybook/test
Test files Updated waitFor import in test file from @storybook/test to storybook/test
Storybook utility files Updated Preview and type imports in decorators, parameters, and controls files
Data Dictionary filters story Updated action import from @storybook/addon-actions to storybook/actions
src/utils/mdx/staticGeneration/staticProps.ts Changed SerializeOptions type import to use Parameters utility type
src/hooks/authentication/session/useSessionIdleTimer.ts Consolidated type import with named import using inline type keyword
Column filter tag story Added explicit Column type import and cast for BIONETWORK constant
FilterTag args Fixed LOREM_IPSUM import to use correct relative path

Copy link
Collaborator

@NoopDog NoopDog left a comment

Choose a reason for hiding this comment

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

Amaze @frano-m thanks...

@NoopDog NoopDog merged commit b419e22 into main Dec 12, 2025
2 checks passed
@frano-m frano-m deleted the fran/733-upgrade-sb branch December 15, 2025 00:50
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.

Upgrade storybook to latest version

3 participants