Skip to content

Commit 35dec78

Browse files
committed
chore: migrate storybook
1 parent 602d5fa commit 35dec78

25 files changed

+4353
-508
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,6 @@ $RECYCLE.BIN/
253253
.pnpm-store
254254
.nx/cache
255255
.nx/workspace-data
256+
257+
258+
storybook-static

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache
5+
/.nx/workspace-data

.storybook/main.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

.storybook/manager.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

.storybook/preview.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

nx.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
},
1414
"lint": {
1515
"cache": true,
16-
"inputs": [
17-
"default",
18-
"{workspaceRoot}/eslint.config.js"
19-
]
16+
"inputs": ["default", "{workspaceRoot}/eslint.config.js"]
2017
},
2118
"e2e": {
2219
"cache": true
@@ -25,5 +22,16 @@
2522
"cache": true,
2623
"inputs": ["default", "^default"]
2724
}
28-
}
25+
},
26+
"plugins": [
27+
{
28+
"plugin": "@nx/storybook/plugin",
29+
"options": {
30+
"serveStorybookTargetName": "storybook",
31+
"buildStorybookTargetName": "build-storybook",
32+
"testStorybookTargetName": "test-storybook",
33+
"staticStorybookTargetName": "static-storybook"
34+
}
35+
}
36+
]
2937
}

package.json

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"lint": "pnpm exec nx run-many --target=lint --parallel",
77
"test": "pnpm exec nx run-many --target=test --parallel --output-style=stream --skip-nx-cache",
88
"test:watch": "pnpm exec nx run-many --target=test --watch --parallel --output-style=stream",
9-
"prepublish": "pnpm exec nx run-many --target=prepare --parallel",
109
"version": "changeset version",
1110
"tag": "changeset tag"
1211
},
@@ -15,11 +14,28 @@
1514
"packageManager": "[email protected]",
1615
"devDependencies": {
1716
"@changesets/cli": "^2.27.9",
17+
"@chromatic-com/storybook": "^3",
1818
"@eslint/js": "^9.14.0",
1919
"@nx/eslint": "^20.0.12",
20-
"@nx/eslint-plugin": "20.0.12",
21-
"@nx/js": "^20.0.12",
20+
"@nx/eslint-plugin": "20.2.1",
21+
"@nx/js": "20.2.1",
22+
"@nx/storybook": "^20.2.1",
2223
"@nx/vite": "^20.0.12",
24+
"@nx/web": "20.2.1",
25+
"@storybook/addon-actions": "^8.4.7",
26+
"@storybook/addon-docs": "^8.4.7",
27+
"@storybook/addon-essentials": "^8.4.6",
28+
"@storybook/addon-interactions": "^8.4.6",
29+
"@storybook/core-server": "^8.4.6",
30+
"@storybook/manager-api": "^8.4.7",
31+
"@storybook/react": "^8.4.6",
32+
"@storybook/react-vite": "^8.4.6",
33+
"@storybook/test": "^8.4.7",
34+
"@storybook/test-runner": "^0.20.1",
35+
"@storybook/theming": "^8.4.7",
36+
"@swc-node/register": "~1.10.9",
37+
"@swc/core": "~1.10.1",
38+
"@swc/helpers": "~0.5.11",
2339
"@types/node": "^22.9.0",
2440
"@vitest/coverage-v8": "^2.1.4",
2541
"@vitest/ui": "^2.1.4",
@@ -29,10 +45,12 @@
2945
"globals": "^15.12.0",
3046
"nx": "^20.0.12",
3147
"prettier": "^3.3.3",
48+
"storybook": "^8.4.6",
49+
"ts-node": "10.9.2",
3250
"tslib": "^2.8.1",
3351
"tsx": "^4.19.2",
3452
"typescript": "^5.6.3",
35-
"typescript-eslint": "^8.13.0",
53+
"typescript-eslint": "^8.18.0",
3654
"vite": "^5.4.10",
3755
"vite-plugin-dts": "^4.3.0",
3856
"vitest": "^2.1.4"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import type { StorybookConfig } from '@storybook/react-vite';
2+
3+
const config: StorybookConfig = {
4+
stories: ['../stories/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
5+
6+
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions', '@chromatic-com/storybook'],
7+
8+
framework: {
9+
name: '@storybook/react-vite',
10+
options: {
11+
builder: {
12+
viteConfigPath: 'vite.config.ts',
13+
},
14+
},
15+
},
16+
17+
docs: {},
18+
19+
typescript: {
20+
reactDocgen: 'react-docgen-typescript',
21+
},
22+
};
23+
24+
export default config;
25+
26+
// To customize your Vite configuration you can use the viteFinal field.
27+
// Check https://storybook.js.org/docs/react/builders/vite#configuration
28+
// and https://nx.dev/recipes/storybook/custom-builder-configs
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { addons } from '@storybook/manager-api';
2+
import theme from './theme';
3+
4+
addons.setConfig({
5+
theme: theme,
6+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const tags = ["autodocs"];

0 commit comments

Comments
 (0)