Skip to content

Commit 4507b5a

Browse files
authored
feat(storybook): add support for storybook 10 (#33277)
## Current Behavior We support Storybook 8 and 9 ## Expected Behavior Add support for Storybook 10, bringing Storybook support to 8, 9 and 10 ## Related Issue(s) Fixes #33141
1 parent d7c8f6e commit 4507b5a

File tree

55 files changed

+3071
-1156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3071
-1156
lines changed

e2e/storybook/src/storybook-nested.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ describe('Storybook generators and executors for standalone workspaces - using R
4646
'tsconfig.storybook.json'
4747
);
4848
});
49-
50-
it('should edit root tsconfig.json', () => {
51-
const tsconfig = readJson(`tsconfig.json`);
52-
expect(tsconfig['ts-node']?.compilerOptions?.module).toEqual('commonjs');
53-
});
5449
});
5550

5651
describe('serve storybook', () => {

graph/client/.storybook/main.js

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

graph/client/.storybook/preview-head.html

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

graph/client/.storybook/preview.js

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

graph/client/.storybook/tailwind-imports.css

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

graph/client/project.json

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -87,31 +87,6 @@
8787
}
8888
},
8989
"defaultConfiguration": "dev"
90-
},
91-
"storybook": {
92-
"executor": "@nx/storybook:storybook",
93-
"options": {
94-
"port": 4400,
95-
"configDir": "graph/client/.storybook"
96-
},
97-
"configurations": {
98-
"ci": {
99-
"quiet": true
100-
}
101-
}
102-
},
103-
"build-storybook": {
104-
"executor": "@nx/storybook:build",
105-
"outputs": ["{options.outputDir}"],
106-
"options": {
107-
"configDir": "graph/client/.storybook",
108-
"outputDir": "dist/storybook/graph-client"
109-
},
110-
"configurations": {
111-
"ci": {
112-
"quiet": true
113-
}
114-
}
11590
}
11691
},
11792
"tags": []

graph/client/tsconfig.storybook.json

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

graph/migrate/.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const config: StorybookConfig = {
1515
const {
1616
nxViteTsPaths,
1717
// nx-ignore-next-line
18-
} = require('@nx/vite/plugins/nx-tsconfig-paths.plugin');
18+
} = await import('@nx/vite/plugins/nx-tsconfig-paths.plugin');
1919
return mergeConfig(config, { plugins: [nxViteTsPaths()] });
2020
},
2121
typescript: {

graph/migrate/tsconfig.storybook.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"emitDecoratorMetadata": true,
5-
"outDir": ""
5+
"outDir": "",
6+
"moduleResolution": "node16"
67
},
78
"exclude": [
89
"src/**/*.spec.ts",
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/* eslint-disable @nx/enforce-module-boundaries */
2-
import type { StorybookConfig } from '@storybook/react-vite';
32
import { mergeConfig } from 'vite';
43

5-
const config: StorybookConfig = {
4+
export default {
65
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
76
addons: ['@storybook/addon-docs'],
87

@@ -14,16 +13,13 @@ const config: StorybookConfig = {
1413
reactDocgen: 'react-docgen-typescript',
1514
},
1615
docs: {},
17-
1816
viteFinal: async (config) => {
1917
const {
2018
nxViteTsPaths,
2119
// nx-ignore-next-line
22-
} = require('@nx/vite/plugins/nx-tsconfig-paths.plugin');
20+
} = await import('@nx/vite/plugins/nx-tsconfig-paths.plugin');
2321
return mergeConfig(config, {
2422
plugins: [nxViteTsPaths()],
2523
});
2624
},
2725
};
28-
29-
export default config;

0 commit comments

Comments
 (0)