Feature/upgrade packages#544
Conversation
There was a problem hiding this comment.
Pull request overview
Upgrades the Vite/Storybook toolchain and adjusts config/mocks to accommodate breaking changes from the upgrades.
Changes:
- Upgraded Vite and related tooling (incl.
@vitejs/plugin-react) and bumped Storybook packages. - Updated Vite build config to use
rolldownOptionsand removed a Vite alias override for@viaa/avo2-types. - Updated component mock data to avoid Storybook
addon-actionsusage.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
vite.config.mts |
Switches build bundler options key and removes a package alias workaround. |
src/components/Header/Header.mock.tsx |
Removes Storybook actions import and changes the onClickTitle mock handler. |
src/components/CTA/CTA.mock.ts |
Removes Storybook actions usage from CTA mock link handler. |
package.json |
Bumps Vite + Storybook-related devDependencies and removes storybook-addon-jsx. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ...MOCK_HEADER_PROPS, | ||
| category: AvoContentTypeEnglish.COLLECTION, | ||
| onClickTitle: action('Title clicked'), | ||
| onClickTitle: () => { action: 'Title clicked' }, |
There was a problem hiding this comment.
onClickTitle: () => { action: 'Title clicked' } is a no-op labeled statement (it doesn’t invoke Storybook actions and is confusing/likely to be flagged by linters). Replace with a proper noop (() => {} / () => undefined) or use the Storybook-recommended mock function (e.g. fn() from @storybook/test) if you still want click logging in stories.
| onClickTitle: () => { action: 'Title clicked' }, | |
| onClickTitle: () => undefined, |
| "@storybook/react-vite": "10.0.8", | ||
| "@storybook/addon-docs": "10.3.4", | ||
| "@storybook/react": "10.3.4", | ||
| "@storybook/react-vite": "10.3.4", |
There was a problem hiding this comment.
Storybook 10.x packages declare a peer dependency on the storybook package. Since storybook isn’t listed in devDependencies, installs rely on peer auto-install behavior and can float to a different patch version (e.g. lockfile resolving 10.3.5 while other Storybook packages are 10.3.4). Add storybook explicitly (and pin it to the same version) to make installs reproducible across package managers/CI.
| "@storybook/react-vite": "10.3.4", | |
| "@storybook/react-vite": "10.3.4", | |
| "storybook": "10.3.4", |
upgrade vite + resolve issues