Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: align resolve.extensions with webpack builder #80

Merged
merged 1 commit into from
Sep 3, 2024
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/builder-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"add": "^2.0.6",
"pretty-hrtime": "^1.0.3",
"slash": "^5.0.0",
"storybook": "8.2.8",
"storybook": "8.3.0-beta.2",
"typescript": "^5.3.2"
},
"peerDependencies": {
Expand Down
12 changes: 11 additions & 1 deletion packages/builder-rsbuild/src/preview/iframe-rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ export default async (

config.resolve ??= {}
config.resolve.symlinks = !isPreservingSymlinks()
config.resolve.extensions = [
Copy link
Member

Choose a reason for hiding this comment

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

How about change the default value in Rsbuild?

Copy link
Member Author

@fi3ework fi3ework Sep 3, 2024

Choose a reason for hiding this comment

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

I've considered this option. And I think Storybook has some exclusive convention and may affect the whole Storybook ecosystem. It's better to perfect consistency with Storybook's config to avoid other breaks in the future. Rsbuild's default value could handle most practices, but Storybook is a bit special. :P

'.mjs',
'.js',
'.jsx',
'.ts',
'.tsx',
'.json',
'.cjs',
]

config.watchOptions = {
ignored: /node_modules/,
Expand Down Expand Up @@ -356,7 +365,8 @@ export default async (
inject: false,
template,
templateParameters: {
version: packageJson.version,
version:
packageJson?.version ?? '0.0.0-storybook-rsbuild-unknown-version',
globals: {
CONFIG_TYPE: configType,
LOGLEVEL: logLevel,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
},
"devDependencies": {
"@rsbuild/core": "1.0.1-beta.14",
"@storybook/types": "8.2.8",
"@storybook/types": "8.3.0-beta.2",
"@types/resolve": "^1.20.6",
"add": "^2.0.6",
"storybook": "8.2.8",
"storybook": "8.3.0-beta.2",
"typescript": "^5.3.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue3-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"@rsbuild/core": "1.0.1-beta.14",
"@types/node": "^18.0.0",
"storybook": "8.2.8",
"storybook": "8.3.0-beta.2",
"typescript": "^5.3.2"
},
"peerDependencies": {
Expand Down
1,252 changes: 544 additions & 708 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions sandboxes/react-16/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"@chromatic-com/storybook": "^1.4.0",
"@rsbuild/core": "1.0.1-beta.14",
"@rsbuild/plugin-react": "1.0.1-beta.14",
"@storybook/addon-essentials": "8.2.8",
"@storybook/addon-interactions": "8.2.8",
"@storybook/addon-links": "8.2.8",
"@storybook/addon-onboarding": "8.2.8",
"@storybook/blocks": "8.2.8",
"@storybook/react": "8.2.8",
"@storybook/test": "8.2.8",
"@storybook/addon-essentials": "8.3.0-beta.2",
"@storybook/addon-interactions": "8.3.0-beta.2",
"@storybook/addon-links": "8.3.0-beta.2",
"@storybook/addon-onboarding": "8.3.0-beta.2",
"@storybook/blocks": "8.3.0-beta.2",
"@storybook/react": "8.3.0-beta.2",
"@storybook/test": "8.3.0-beta.2",
"@types/react": "^16",
"@types/react-dom": "^16",
"storybook": "8.2.8",
"storybook": "8.3.0-beta.2",
"storybook-react-rsbuild": "workspace:*",
"typescript": "^5.3.2"
},
Expand Down
16 changes: 8 additions & 8 deletions sandboxes/react-18/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"@chromatic-com/storybook": "^1.4.0",
"@rsbuild/core": "1.0.1-beta.14",
"@rsbuild/plugin-react": "1.0.1-beta.14",
"@storybook/addon-essentials": "8.2.8",
"@storybook/addon-interactions": "8.2.8",
"@storybook/addon-links": "8.2.8",
"@storybook/addon-onboarding": "8.2.8",
"@storybook/blocks": "8.2.8",
"@storybook/react": "8.2.8",
"@storybook/test": "8.2.8",
"@storybook/addon-essentials": "8.3.0-beta.2",
"@storybook/addon-interactions": "8.3.0-beta.2",
"@storybook/addon-links": "8.3.0-beta.2",
"@storybook/addon-onboarding": "8.3.0-beta.2",
"@storybook/blocks": "8.3.0-beta.2",
"@storybook/react": "8.3.0-beta.2",
"@storybook/test": "8.3.0-beta.2",
"@types/react": "^18",
"@types/react-dom": "^18",
"storybook": "8.2.8",
"storybook": "8.3.0-beta.2",
"storybook-react-rsbuild": "workspace:*",
"typescript": "^5.3.2"
}
Expand Down
2 changes: 1 addition & 1 deletion sandboxes/react-18/src/stories/Page.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const LoggedOut: Story = {}

// More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing
export const LoggedIn: Story = {
play: async ({ canvasElement }) => {
play: async ({ canvasElement }: any) => {
const canvas = within(canvasElement)
const loginButton = canvas.getByRole('button', { name: /Log in/i })
await expect(loginButton).toBeInTheDocument()
Expand Down
16 changes: 8 additions & 8 deletions sandboxes/vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"@chromatic-com/storybook": "^1.4.0",
"@rsbuild/core": "1.0.1-beta.14",
"@rsbuild/plugin-vue": "1.0.1-beta.14",
"@storybook/addon-essentials": "8.2.8",
"@storybook/addon-interactions": "8.2.8",
"@storybook/addon-links": "8.2.8",
"@storybook/addon-onboarding": "8.2.8",
"@storybook/blocks": "8.2.8",
"@storybook/test": "8.2.8",
"@storybook/vue3": "8.2.8",
"storybook": "8.2.8",
"@storybook/addon-essentials": "8.3.0-beta.2",
"@storybook/addon-interactions": "8.3.0-beta.2",
"@storybook/addon-links": "8.3.0-beta.2",
"@storybook/addon-onboarding": "8.3.0-beta.2",
"@storybook/blocks": "8.3.0-beta.2",
"@storybook/test": "8.3.0-beta.2",
"@storybook/vue3": "8.3.0-beta.2",
"storybook": "8.3.0-beta.2",
"storybook-vue3-rsbuild": "workspace:*",
"typescript": "^5.3.2"
}
Expand Down