Skip to content

Commit e8b494e

Browse files
authored
Merge pull request #2 from noclocks/feature/upgrade-storybook-7-to-8
2 parents 72e0052 + 39bfd9d commit e8b494e

20 files changed

+1224
-1754
lines changed

.env.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BROWSER='chrome-beta'

.storybook/main.js

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

.storybook/main.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import {StorybookConfig} from '@storybook/react-vite';
2+
3+
const config: StorybookConfig = {
4+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
addons: [
6+
'@storybook/addon-links',
7+
'@storybook/addon-essentials',
8+
'@storybook/addon-onboarding',
9+
'@storybook/addon-interactions',
10+
],
11+
framework: {
12+
name: '@storybook/react-vite',
13+
options: {},
14+
},
15+
// async viteFinal(config) {
16+
// // Add configuration here
17+
// return config;
18+
// },
19+
core: {
20+
disableTelemetry: true,
21+
},
22+
docs: {
23+
autodocs: 'tag',
24+
defaultName: 'Documentation',
25+
},
26+
typescript: {
27+
reactDocgen: 'react-docgen',
28+
// reactDocgenTypescriptOptions: {
29+
// compilerOptions: {
30+
// allowSyntheticDefaultImports: false,
31+
// esModuleInterop: false,
32+
// },
33+
// },
34+
},
35+
};
36+
export default config;

.storybook/preview.js

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

.storybook/preview.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import {Preview} from '@storybook/react';
2+
3+
const preview: Preview = {
4+
parameters: {
5+
// NOTE: From migration to Storybook 8 (from 7)
6+
// In Storybook you can write so-called play functions, which are used to render your stories interactively. │
7+
// │ Mocking action args in play functions was done implicitly by analyzing the argTypesRegex. │
8+
// │ │
9+
// │ Since Storybook 8, implicit action args mocking isn't supported anymore. │
10+
// │ │
11+
// │ Use the following command to check for mocked action usages in your play functions: │
12+
// │ npx storybook migrate find-implicit-spies --glob="**/*.stories.@(js|jsx|ts|tsx)" │
13+
// │ │
14+
// │ And follow the documentation to migrate your play functions: │
15+
// │ https://storybook.js.org/docs/8.0/essentials/actions#via-storybooktest-fn-spy-function
16+
// actions: { argTypesRegex: "^on[A-Z].*" },
17+
controls: {
18+
matchers: {
19+
// color: /(background|color)$/i,
20+
date: /Date$/i,
21+
},
22+
},
23+
},
24+
};
25+
26+
export default preview;

package.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
"version": "1.0.0",
44
"description": "",
55
"main": "index.js",
6+
"type": "module",
67
"directories": {
78
"doc": "docs",
89
"test": "tests"
910
},
1011
"scripts": {
1112
"preinstall": "pnpm dlx only-allow pnpm",
1213
"test": "echo \"Error: no test specified\" && exit 1",
13-
"storybook": "storybook dev -p 6006",
14+
"storybook-docs": "storybook dev --docs",
15+
"storybook": "BROWSER=process.env.BROWSER storybook dev -p 6006 --disable-telemetry",
1416
"build-storybook": "storybook build"
1517
},
1618
"author": "Jimmy Briggs <[email protected]> (https://github.com/jimbrig)",
@@ -19,17 +21,19 @@
1921
],
2022
"license": "Unlicense",
2123
"devDependencies": {
22-
"@storybook/addon-essentials": "^7.6.17",
23-
"@storybook/addon-interactions": "^7.6.17",
24-
"@storybook/addon-links": "^7.6.17",
25-
"@storybook/addon-onboarding": "^1.0.11",
26-
"@storybook/blocks": "^7.6.17",
27-
"@storybook/react": "^7.6.17",
28-
"@storybook/react-vite": "^7.6.17",
29-
"@storybook/test": "^7.6.17",
24+
"@storybook/addon-essentials": "^8.0.4",
25+
"@storybook/addon-interactions": "^8.0.4",
26+
"@storybook/addon-links": "^8.0.4",
27+
"@storybook/addon-onboarding": "^8.0.4",
28+
"@storybook/blocks": "^8.0.4",
29+
"@storybook/react": "^8.0.4",
30+
"@storybook/react-vite": "^8.0.4",
31+
"@storybook/test": "^8.0.4",
32+
"cross-env": "^7.0.3",
33+
"prettier": "^3.2.5",
3034
"prop-types": "^15.8.1",
3135
"react": "^18.2.0",
3236
"react-dom": "^18.2.0",
33-
"storybook": "^7.6.17"
37+
"storybook": "^8.0.4"
3438
}
3539
}

0 commit comments

Comments
 (0)