Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/addon-modernjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@modern-js/plugin": "^3.10.0",
"@rsbuild/core": "^2.2.13",
"@types/node": "^22.12.0",
"storybook": "11.0.0-beta.5",
"storybook": "11.0.0-rc.1",
"storybook-builder-rsbuild": "workspace:*",
"typescript": "^5.9.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/addon-rslib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@rsbuild/core": "^2.2.13",
"@rslib/core": "~1.0.3",
"@types/node": "^22.12.0",
"storybook": "11.0.0-beta.5",
"storybook": "11.0.0-rc.1",
"storybook-builder-rsbuild": "workspace:*",
"typescript": "^5.9.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/addon-rstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@rsbuild/core": "^2.2.13",
"@types/node": "^22.12.0",
"rstack": "0.9.0",
"storybook": "11.0.0-beta.5",
"storybook": "11.0.0-rc.1",
"storybook-addon-rslib": "workspace:*",
"storybook-builder-rsbuild": "workspace:*",
"typescript": "^5.9.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/builder-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@
"devDependencies": {
"@microsoft/api-extractor": "^7.59.4",
"@rsbuild/core": "^2.2.13",
"@storybook/core-webpack": "11.0.0-beta.5",
"@storybook/core-webpack": "11.0.0-rc.1",
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.12.0",
"@types/pretty-hrtime": "^1.0.3",
"prebundle": "^1.6.5",
"pretty-hrtime": "^1.0.3",
"slash": "^5.1.0",
"storybook": "11.0.0-beta.5",
"storybook": "11.0.0-rc.1",
"typescript": "^5.9.3"
},
"peerDependencies": {
"@rsbuild/core": "^2.0.0",
"storybook": "^11.0.0-beta.5"
"storybook": "^11.0.0-rc.1"
},
"peerDependenciesMeta": {
"typescript": {
Expand Down
38 changes: 1 addition & 37 deletions packages/builder-rsbuild/src/preview/iframe-rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import type { RsbuildConfig, Rspack } from '@rsbuild/core'
import { loadConfig, mergeRsbuildConfig } from '@rsbuild/core'
import { pluginTypeCheck } from '@rsbuild/plugin-type-check'
import { createRequire } from 'node:module'
import { dirname, join, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { join, resolve } from 'node:path'
// @ts-expect-error (I removed this on purpose, because it's incorrect)
import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin'
import { pluginHtmlMinifierTerser } from 'rsbuild-plugin-html-minifier-terser'
Expand Down Expand Up @@ -34,27 +33,6 @@ import { getVirtualModules } from './virtual-module-mapping'

const require = createRequire(import.meta.url)

const getAbsolutePath = <T extends string>(input: T): T => {
const storybookPath = fileURLToPath(
import.meta.resolve('storybook/package.json'),
)

// Can't directly use `import.meta.resolve` here because `parentURL` parameter is not standardized yet.
return dirname(
require.resolve(join(input, 'package.json'), {
paths: [dirname(storybookPath)],
}),
) as any as T
}

const maybeGetAbsolutePath = <I extends string>(input: I): I | false => {
try {
return getAbsolutePath(input)
} catch (_e) {
return false
}
}

const builtInResolveExtensions = [
'.mjs',
'.js',
Expand Down Expand Up @@ -92,15 +70,6 @@ const PRODUCTION_MINIFY_OPTIONS: NonNullable<
},
}

const globalPath = maybeGetAbsolutePath('@storybook/global')

// these packages are not pre-bundled because of react dependencies.
// these are not dependencies of the builder anymore, thus resolving them can fail.
// we should remove the aliases in 8.0, I'm not sure why they are here in the first place.
const storybookPaths: Record<string, string> = {
...(globalPath ? { ['@storybook/global']: globalPath } : {}),
}

export type RsbuildBuilderOptions = Options & {
typescriptOptions: TypescriptOptions
}
Expand Down Expand Up @@ -339,11 +308,6 @@ export default async (
progressBar: !quiet,
hmr: shouldDisableHmr ? false : undefined,
},
resolve: {
alias: {
...storybookPaths,
},
},
source: {
define: {
'process.env': `(${JSON.stringify(envs)})`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { global } from '@storybook/global'
import { createBrowserChannel } from 'storybook/internal/channels'
import { STORY_HOT_UPDATED } from 'storybook/internal/core-events'
import { addons, composeConfigs, PreviewWeb } from 'storybook/preview-api'
Expand All @@ -20,7 +19,7 @@ const getProjectAnnotations = () => {
const channel = createBrowserChannel({ page: 'preview' })
addons.setChannel(channel)

if (global.CONFIG_TYPE === 'DEVELOPMENT') {
if (globalThis.CONFIG_TYPE === 'DEVELOPMENT') {
window.__STORYBOOK_SERVER_CHANNEL__ = channel
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('virtual-module-mapping: config entry imports', () => {

expect(entry).toContain("from 'storybook/internal/channels'")
expect(entry).toContain("from 'storybook/internal/core-events'")
expect(entry).toContain("from '@storybook/global'")
expect(entry).toContain("from 'storybook/preview-api'")
expect(entry).not.toContain('@storybook/global')
})
})
6 changes: 3 additions & 3 deletions packages/framework-html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@
"prepare": "pnpm run build"
},
"dependencies": {
"@storybook/html": "^11.0.0-beta.5",
"@storybook/html": "^11.0.0-rc.1",
"storybook-builder-rsbuild": "workspace:*"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.59.4",
"@rsbuild/core": "^2.2.13",
"@types/node": "^22.12.0",
"storybook": "11.0.0-beta.5",
"storybook": "11.0.0-rc.1",
"typescript": "^5.9.3"
},
"peerDependencies": {
"@rsbuild/core": "^2.0.0",
"storybook": "^11.0.0-beta.5"
"storybook": "^11.0.0-rc.1"
},
"engines": {
"node": ">=22.12.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/framework-react-native-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"prepare": "pnpm run build"
},
"dependencies": {
"@storybook/react": "^11.0.0-beta.5",
"@storybook/react": "^11.0.0-rc.1",
"rsbuild-plugin-react-native-web": "workspace:*",
"storybook-builder-rsbuild": "workspace:*",
"storybook-react-rsbuild": "workspace:*"
Expand All @@ -59,7 +59,7 @@
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native-web": "^0.21.4",
"storybook": "11.0.0-beta.5",
"storybook": "11.0.0-rc.1",
"typescript": "^5.9.3"
},
"peerDependencies": {
Expand All @@ -69,7 +69,7 @@
"react-docgen-typescript": "^2.2.2",
"react-dom": "^18.0.0 || ^19.0.0",
"react-native-web": "^0.19.12 || ^0.20.0 || ^0.21.0",
"storybook": "^11.0.0-beta.5",
"storybook": "^11.0.0-rc.1",
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
},
"peerDependenciesMeta": {
Expand Down
6 changes: 3 additions & 3 deletions packages/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"dependencies": {
"@rollup/pluginutils": "^5.4.0",
"@storybook/react": "^11.0.0-beta.5",
"@storybook/react": "^11.0.0-rc.1",
"magic-string": "^1.4.3",
"resolve": "^1.22.13",
"storybook-builder-rsbuild": "workspace:*",
Expand All @@ -68,7 +68,7 @@
"react-docgen": "^8.0.4",
"react-docgen-typescript": "^2.4.0",
"react-dom": "18.3.1",
"storybook": "11.0.0-beta.5",
"storybook": "11.0.0-rc.1",
"typescript": "^5.9.3"
},
"peerDependencies": {
Expand All @@ -77,7 +77,7 @@
"react-docgen": "^8.0.2",
"react-docgen-typescript": "^2.2.2",
"react-dom": "^18.0.0 || ^19.0.0",
"storybook": "^11.0.0-beta.5",
"storybook": "^11.0.0-rc.1",
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
},
"peerDependenciesMeta": {
Expand Down
6 changes: 3 additions & 3 deletions packages/framework-vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"prepare": "pnpm run build"
},
"dependencies": {
"@storybook/vue3": "^11.0.0-beta.5",
"@storybook/vue3": "^11.0.0-rc.1",
"storybook-builder-rsbuild": "workspace:*",
"vue-docgen-api": "^4.79.2",
"vue-docgen-loader": "^2.0.1"
Expand All @@ -53,13 +53,13 @@
"@microsoft/api-extractor": "^7.59.4",
"@rsbuild/core": "^2.2.13",
"@types/node": "^22.12.0",
"storybook": "11.0.0-beta.5",
"storybook": "11.0.0-rc.1",
"typescript": "^5.9.3",
"vue": "^3.5.44"
},
"peerDependencies": {
"@rsbuild/core": "^2.0.0",
"storybook": "^11.0.0-beta.5",
"storybook": "^11.0.0-rc.1",
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0",
"vue": "^3.0.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/framework-web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@
"prepare": "pnpm run build"
},
"dependencies": {
"@storybook/web-components": "^11.0.0-beta.5",
"@storybook/web-components": "^11.0.0-rc.1",
"storybook-builder-rsbuild": "workspace:*"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.59.4",
"@rsbuild/core": "^2.2.13",
"@types/node": "^22.12.0",
"lit": "^3.3.3",
"storybook": "11.0.0-beta.5",
"storybook": "11.0.0-rc.1",
"typescript": "^5.9.3"
},
"peerDependencies": {
"@rsbuild/core": "^2.0.0",
"lit": "^2.0.0 || ^3.0.0",
"storybook": "^11.0.0-beta.5",
"storybook": "^11.0.0-rc.1",
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
},
"engines": {
Expand Down
Loading
Loading