Skip to content

Commit 16ade01

Browse files
authored
chore: update vite (#1078)
1 parent aa2e596 commit 16ade01

6 files changed

Lines changed: 475 additions & 792 deletions

File tree

.changeset/upgrade-vite-8.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": patch
3+
---
4+
5+
Upgrade to Vite 8 (Rolldown-powered), @vitejs/plugin-react v6, and Vitest 4.1. Remove unused storybook-addon-turbo-build. Migrate vitest config from deprecated esbuild option to oxc.

.storybook/main.js

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,9 @@ const config = {
1414
options: {},
1515
},
1616

17-
features: {
18-
postcss: false,
19-
emotionAlias: false,
20-
buildStoriesJson: true,
21-
interactionsDebugger: true,
22-
argTypeTargetsV7: false,
23-
modernInlineRender: true,
24-
},
25-
2617
stories: ['../src/**/*.docs.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
2718

2819
addons: [
29-
'@storybook/addon-links',
30-
{
31-
name: 'storybook-addon-turbo-build',
32-
options: {
33-
esbuildMinifyOptions: {
34-
target: 'es2021',
35-
},
36-
},
37-
},
3820
{
3921
name: '@storybook/addon-docs',
4022
options: {
@@ -48,18 +30,25 @@ const config = {
4830
],
4931

5032
viteFinal(config) {
51-
const REACT_PLUGIN_NAMES = ['vite:react-babel', 'vite:react-refresh'];
33+
const isReactPlugin = (/** @type {string} */ name) =>
34+
name.startsWith('vite:react') || name.startsWith('@vitejs/plugin-react');
5235
const existingPlugins = (config.plugins ?? [])
5336
.flat()
5437
.filter(
5538
(p) =>
5639
p &&
5740
typeof p === 'object' &&
58-
!REACT_PLUGIN_NAMES.includes(/** @type {any} */ (p).name),
41+
!isReactPlugin(/** @type {any} */ (p).name ?? ''),
5942
);
6043

6144
config.plugins = [...existingPlugins, react({ jsxRuntime: 'automatic' })];
6245

46+
config.build ??= {};
47+
config.build.rolldownOptions ??= {};
48+
config.build.rolldownOptions.experimental = {
49+
strictExecutionOrder: true,
50+
};
51+
6352
config.define = {
6453
...config.define,
6554
__UIKIT_VERSION__: JSON.stringify(pkg.version),

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
"@size-limit/webpack-why": "^8.2.4",
110110
"@statoscope/cli": "^5.20.1",
111111
"@storybook/addon-docs": "^10.2.3",
112-
"@storybook/addon-links": "^10.2.3",
113112
"@storybook/react-vite": "^10.2.3",
114113
"@tenphi/eslint-plugin-tasty": "^0.3.1",
115114
"@testing-library/dom": "^10.4.1",
@@ -127,8 +126,8 @@
127126
"@typescript-eslint/eslint-plugin": "^8.31.0",
128127
"@typescript-eslint/parser": "^8.31.0",
129128
"@uiw/react-codemirror": "^4.25.4",
130-
"@vitejs/plugin-react": "^4.3.2",
131-
"@vitest/coverage-v8": "^4.0.18",
129+
"@vitejs/plugin-react": "^6.0.0",
130+
"@vitest/coverage-v8": "^4.1.0",
132131
"best-effort-json-parser": "^1.2.1",
133132
"bytes": "^3.1.2",
134133
"chromatic": "^13.1.4",
@@ -157,12 +156,11 @@
157156
"serve-handler": "^6.1.6",
158157
"size-limit": "^8.2.6",
159158
"storybook": "^10.2.3",
160-
"storybook-addon-turbo-build": "^2.0.1",
161159
"tsdown": "^0.20.3",
162160
"typescript": "^5.6.3",
163161
"typescript-eslint": "^8.31.0",
164-
"vite": "^7.1.3",
165-
"vitest": "^4.0.18"
162+
"vite": "^8.0.0",
163+
"vitest": "^4.1.0"
166164
},
167165
"browserslist": [
168166
"last 2 Chrome versions",

0 commit comments

Comments
 (0)