Skip to content

Commit

Permalink
feat!: bump rsbuild to 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Jun 25, 2024
1 parent 0bcb0a6 commit 95933a7
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 110 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ The repository contains the Storybook Rsbuild builder and framework integrations
| ------------------------------------------------------- | ---------------------------------------------------- |
| [storybook-builder-rsbuild](./packages/builder-rsbuild) | Rsbuild powered builder for Storybook |
| [storybook-react-rsbuild](./packages/react-rsbuild) | React integration for Storybook with Rsbuild builder |
| [storybook-vue3-rsbuild](./packages/vue3-rsbuild) | Vue3 integration for Storybook with Rsbuild builder |
| [storybook-vue3-rsbuild](./packages/vue3-rsbuild) | Vue 3 integration for Storybook with Rsbuild builder |

## Usage

> [!NOTE]
> Requirements: `@rsbuild/core >= 0.6.15` and `storybook >= 8.0` (checkout Storybook's [release note](https://storybook.js.org/blog/storybook-8/) for migration)
> Requirements: `@rsbuild/core >= 0.7.0` and `storybook >= 8.0` (checkout Storybook's [release note](https://storybook.js.org/blog/storybook-8/) for migration)
In Storybook v8, you don't need to manually install storybook-builder-rsbuild, it has been depended by the framework, such as `storybook-react-rsbuild` and `storybook-vue3-rsbuild`.

Expand Down Expand Up @@ -41,7 +41,7 @@ In Storybook v8, you don't need to manually install storybook-builder-rsbuild, i

You're all set now. You could also checkout the example in [sandboxes/react-rsbuild](./sandboxes/react-rsbuild).

### Use with Vue3
### Use with Vue 3

1. Install Vue3 framework integration
```bash
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 @@ -60,7 +60,7 @@
"prep": "node --loader ../../scripts/node_modules/esbuild-register/loader.js -r ../../scripts/node_modules/esbuild-register/register.js ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@rsbuild/plugin-type-check": "0.6.15",
"@rsbuild/plugin-type-check": "0.7.9",
"@storybook/addon-docs": "^8.0.10",
"@storybook/channels": "^8.0.10",
"@storybook/client-logger": "^8.0.10",
Expand Down Expand Up @@ -90,7 +90,7 @@
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@rsbuild/core": "0.6.15",
"@rsbuild/core": "0.7.9",
"@types/express": "^4.17.21",
"@types/fs-extra": "^11.0.4",
"@types/node": "^18.0.0",
Expand All @@ -101,7 +101,7 @@
"typescript": "^5.3.2"
},
"peerDependencies": {
"@rsbuild/core": ">= 0.6.15"
"@rsbuild/core": ">= 0.7.0"
},
"peerDependenciesMeta": {
"typescript": {
Expand Down
5 changes: 3 additions & 2 deletions packages/builder-rsbuild/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as rsbuildReal from '@rsbuild/core'
import type { createDevServer } from '@rsbuild/core/dist/internal'
import type { Options } from '@storybook/types'
import { dirname, join, parse } from 'path'
import express from 'express'
Expand All @@ -15,7 +14,9 @@ import prettyTime from 'pretty-hrtime'
export * from './types'
export * from './preview/virtual-module-mapping'

type RsbuildDevServer = Awaited<ReturnType<typeof createDevServer>>
type RsbuildDevServer = Awaited<
ReturnType<rsbuildReal.RsbuildInstance['createDevServer']>
>
type StatsOrMultiStats = Parameters<rsbuildReal.OnAfterBuildFn>[0]['stats']
export type Stats = NonNullable<
Exclude<StatsOrMultiStats, { stats: unknown[] }>
Expand Down
3 changes: 2 additions & 1 deletion packages/react-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"prep": "node --loader ../../scripts/node_modules/esbuild-register/loader.js -r ../../scripts/node_modules/esbuild-register/register.js ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@rsbuild/core": "0.6.15",
"@storybook/docs-tools": "^8.0.10",
"@storybook/node-logger": "^8.0.10",
"@storybook/react": "^8.0.10",
Expand All @@ -67,12 +66,14 @@
"tsconfig-paths": "^4.2.0"
},
"devDependencies": {
"@rsbuild/core": "0.7.9",
"@storybook/types": "^8.0.10",
"@types/resolve": "^1.20.6",
"add": "^2.0.6",
"typescript": "^5.3.2"
},
"peerDependencies": {
"@rsbuild/core": ">= 0.7.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
"typescript": ">= 4.2.x"
Expand Down
5 changes: 4 additions & 1 deletion packages/vue3-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,20 @@
"prep": "node --loader ../../scripts/node_modules/esbuild-register/loader.js -r ../../scripts/node_modules/esbuild-register/register.js ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@rsbuild/core": "0.6.15",
"@storybook/docs-tools": "^8.0.10",
"@storybook/types": "^8.0.10",
"@storybook/vue3": "^8.0.10",
"storybook-builder-rsbuild": "workspace:*",
"vue-docgen-loader": "^1.5.1"
},
"devDependencies": {
"@rsbuild/core": "0.7.9",
"@types/node": "^18.0.0",
"typescript": "^5.3.2"
},
"peerDependencies": {
"@rsbuild/core": ">= 0.7.0"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
Expand Down
Loading

0 comments on commit 95933a7

Please sign in to comment.