File tree Expand file tree Collapse file tree 6 files changed +77
-5
lines changed Expand file tree Collapse file tree 6 files changed +77
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish Storybook
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ jobs :
7
+ test :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - name : Enable Corepack
11
+ run : corepack enable
12
+ shell : bash
13
+
14
+ - name : Checkout repository
15
+ uses : actions/checkout@v4
16
+ with :
17
+ fetch-depth : 0
18
+
19
+ - name : Setup Node.js
20
+ uses : actions/setup-node@v4
21
+ with :
22
+ node-version-file : .nvmrc
23
+ cache : yarn
24
+ cache-dependency-path : yarn.lock
25
+
26
+ - name : Install dependencies
27
+ run : yarn install
28
+
29
+ - name : Build Storybook
30
+ run : yarn build-storybook
31
+
32
+ - name : Deploy to GitHub Pages
33
+ uses : peaceiris/actions-gh-pages@v3
34
+ with :
35
+ github_token : ${{ secrets.GITHUB_TOKEN }}
36
+ publish_dir : ./storybook-static
Original file line number Diff line number Diff line change 1
1
node_modules
2
2
.idea
3
3
.yarn
4
- dist
4
+ dist
5
+ storybook-static
Original file line number Diff line number Diff line change 1
1
import { join , dirname } from 'path' ;
2
2
3
3
import type { StorybookConfig } from '@storybook/react-vite' ;
4
+ import { withoutVitePlugins } from '@storybook/builder-vite' ;
4
5
5
6
/**
6
7
* This function is used to resolve the absolute path of a package.
@@ -9,6 +10,7 @@ import type { StorybookConfig } from '@storybook/react-vite';
9
10
function getAbsolutePath ( value : string ) : any {
10
11
return dirname ( require . resolve ( join ( value , 'package.json' ) ) ) ;
11
12
}
13
+
12
14
const config : StorybookConfig = {
13
15
stories : [ '../src/**/*.mdx' , '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)' ] ,
14
16
addons : [
@@ -21,5 +23,10 @@ const config: StorybookConfig = {
21
23
name : getAbsolutePath ( '@storybook/react-vite' ) ,
22
24
options : { } ,
23
25
} ,
26
+ async viteFinal ( config ) {
27
+ config . plugins = await withoutVitePlugins ( config . plugins , [ 'vite:dts' ] ) ;
28
+
29
+ return config ;
30
+ } ,
24
31
} ;
25
32
export default config ;
Original file line number Diff line number Diff line change @@ -65,15 +65,17 @@ To run all tests:
65
65
yarn test
66
66
````
67
67
68
- # # Running Storybook Locally
69
- To explore components and their behavior in isolation:
68
+ # # Running Storybook
69
+ To explore components and their behavior in isolation: https://mongodb-js.github.io/diagramming
70
+
71
+ Changes to the Storybook will be uploaded to the link above on push to ` main`
72
+
73
+ To run locally at http://localhost:6006 on your own branch:
70
74
71
75
` ` ` bash
72
76
yarn install
73
77
yarn storybook
74
78
` ` `
75
-
76
- Storybook will run locally at http://localhost:6006.
77
79
78
80
# ## Resources
79
81
- [NPM Package](https://www.npmjs.com/package/@mongodb-js/diagramming)
Original file line number Diff line number Diff line change 57
57
"@storybook/addon-essentials" : " ^8.6.0" ,
58
58
"@storybook/addon-interactions" : " ^8.6.0" ,
59
59
"@storybook/addon-themes" : " ^8.6.12" ,
60
+ "@storybook/builder-vite" : " ^9.0.0" ,
60
61
"@storybook/react" : " ^8.6.0" ,
61
62
"@storybook/react-vite" : " ^8.6.0" ,
62
63
"@storybook/test" : " ^8.6.0" ,
Original file line number Diff line number Diff line change @@ -1261,6 +1261,7 @@ __metadata:
1261
1261
" @storybook/addon-essentials " : " npm:^8.6.0"
1262
1262
" @storybook/addon-interactions " : " npm:^8.6.0"
1263
1263
" @storybook/addon-themes " : " npm:^8.6.12"
1264
+ " @storybook/builder-vite " : " npm:^9.0.0"
1264
1265
" @storybook/react " : " npm:^8.6.0"
1265
1266
" @storybook/react-vite " : " npm:^8.6.0"
1266
1267
" @storybook/test " : " npm:^8.6.0"
@@ -1807,6 +1808,19 @@ __metadata:
1807
1808
languageName : node
1808
1809
linkType : hard
1809
1810
1811
+ " @storybook/builder-vite@npm:^9.0.0 " :
1812
+ version : 9.0.0
1813
+ resolution : " @storybook/builder-vite@npm:9.0.0"
1814
+ dependencies :
1815
+ " @storybook/csf-plugin " : " npm:9.0.0"
1816
+ ts-dedent : " npm:^2.0.0"
1817
+ peerDependencies :
1818
+ storybook : ^9.0.0
1819
+ vite : ^5.0.0 || ^6.0.0
1820
+ checksum : 10c0/15cf155b5dc8b05abac7376e7c233e4c12c24bdf22f492c4072888081db49577633504501bb3ac0c7cebcdca642169a3bbc57154b77506ecdc946cd911ad82fa
1821
+ languageName : node
1822
+ linkType : hard
1823
+
1810
1824
" @storybook/components@npm:8.6.0 " :
1811
1825
version : 8.6.0
1812
1826
resolution : " @storybook/components@npm:8.6.0"
@@ -1851,6 +1865,17 @@ __metadata:
1851
1865
languageName : node
1852
1866
linkType : hard
1853
1867
1868
+ " @storybook/csf-plugin@npm:9.0.0 " :
1869
+ version : 9.0.0
1870
+ resolution : " @storybook/csf-plugin@npm:9.0.0"
1871
+ dependencies :
1872
+ unplugin : " npm:^1.3.1"
1873
+ peerDependencies :
1874
+ storybook : ^9.0.0
1875
+ checksum : 10c0/601f7e8425952e8fe28093ee17af8803f34b3378e4b54e565c0cc41d98e9df2ef93cdcd4dcc36fa87d264ac38c9ac5d7bd1abd79e8895261e22cfa556fcbbd63
1876
+ languageName : node
1877
+ linkType : hard
1878
+
1854
1879
" @storybook/csf@npm:^0.1.11 " :
1855
1880
version : 0.1.13
1856
1881
resolution : " @storybook/csf@npm:0.1.13"
You can’t perform that action at this time.
0 commit comments