Skip to content

Commit db3a58f

Browse files
authored
chore: bump Storybook Rsbuild to v3 (#369)
1 parent 34f0d04 commit db3a58f

File tree

7 files changed

+78
-67
lines changed

7 files changed

+78
-67
lines changed

pnpm-lock.yaml

Lines changed: 48 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rslib/module-federation/mf-react-component/.storybook/main.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import { createRequire } from 'node:module';
2-
import { dirname, join } from 'node:path';
1+
import { resolve } from 'node:path';
2+
import { fileURLToPath } from 'node:url';
33
import type { StorybookConfig } from 'storybook-react-rsbuild';
44

5-
const require = createRequire(import.meta.url);
6-
75
/**
86
* This function is used to resolve the absolute path of a package.
97
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
108
*/
11-
function getAbsolutePath(value: string): any {
12-
return dirname(require.resolve(join(value, 'package.json')));
13-
}
9+
const getAbsolutePath = (value: string): any => {
10+
return resolve(
11+
fileURLToPath(new URL(import.meta.resolve(`${value}/package.json`, import.meta.url))),
12+
'..',
13+
);
14+
};
1415

1516
const config: StorybookConfig = {
1617
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'],

rslib/module-federation/mf-react-component/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"react": "^19.2.0",
3030
"react-dom": "^19.2.0",
3131
"storybook": "^10.0.8",
32-
"storybook-addon-rslib": "^2.1.6",
33-
"storybook-react-rsbuild": "^2.1.6"
32+
"storybook-addon-rslib": "^3.0.0",
33+
"storybook-react-rsbuild": "^3.0.0"
3434
},
3535
"peerDependencies": {
3636
"react": "*"

rslib/react-storybook/.storybook/main.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import { createRequire } from 'node:module';
2-
import { dirname, join } from 'node:path';
1+
import { resolve } from 'node:path';
2+
import { fileURLToPath } from 'node:url';
33
import type { StorybookConfig } from 'storybook-react-rsbuild';
44

5-
const require = createRequire(import.meta.url);
6-
75
/**
86
* This function is used to resolve the absolute path of a package.
97
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
108
*/
11-
function getAbsolutePath(value: string): any {
12-
return dirname(require.resolve(join(value, 'package.json')));
13-
}
9+
const getAbsolutePath = (value: string): any => {
10+
return resolve(
11+
fileURLToPath(new URL(import.meta.resolve(`${value}/package.json`, import.meta.url))),
12+
'..',
13+
);
14+
};
1415

1516
const config: StorybookConfig = {
1617
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'],

rslib/react-storybook/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"react": "^19.2.0",
3030
"react-dom": "^19.2.0",
3131
"storybook": "^10.0.8",
32-
"storybook-addon-rslib": "^2.1.6",
33-
"storybook-react-rsbuild": "^2.1.6",
32+
"storybook-addon-rslib": "^3.0.0",
33+
"storybook-react-rsbuild": "^3.0.0",
3434
"typescript": "^5.9.3"
3535
},
3636
"peerDependencies": {

rslib/vue-storybook/.storybook/main.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import { createRequire } from 'node:module';
2-
import { dirname, join } from 'node:path';
1+
import { resolve } from 'node:path';
2+
import { fileURLToPath } from 'node:url';
33
import type { StorybookConfig } from 'storybook-vue3-rsbuild';
44

5-
const require = createRequire(import.meta.url);
6-
75
/**
86
* This function is used to resolve the absolute path of a package.
97
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
108
*/
11-
function getAbsolutePath(value) {
12-
return dirname(require.resolve(join(value, 'package.json')));
13-
}
9+
const getAbsolutePath = (value: string): any => {
10+
return resolve(
11+
fileURLToPath(new URL(import.meta.resolve(`${value}/package.json`, import.meta.url))),
12+
'..',
13+
);
14+
};
1415

1516
const config: StorybookConfig = {
1617
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'],

rslib/vue-storybook/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"@storybook/vue3": "^10.0.8",
2727
"rsbuild-plugin-unplugin-vue": "^0.1.0",
2828
"storybook": "^10.0.8",
29-
"storybook-addon-rslib": "^2.1.6",
30-
"storybook-vue3-rsbuild": "^2.1.6",
29+
"storybook-addon-rslib": "^3.0.0",
30+
"storybook-vue3-rsbuild": "^3.0.0",
3131
"typescript": "^5.9.3",
3232
"vue": "^3.5.21",
3333
"vue-tsc": "^3.1.5"

0 commit comments

Comments
 (0)