Skip to content

Commit b263845

Browse files
authored
feat: update for storybook 9 (#13)
* feat: update for storybook 9 * 3.0.0-0 * update * update * update * 3.0.1-0
1 parent 2087909 commit b263845

File tree

5 files changed

+18
-25
lines changed

5 files changed

+18
-25
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-template-storybook",
3-
"version": "2.0.4",
3+
"version": "3.0.1-0",
44
"description": "React Native template for a quick start with storybook.",
55
"scripts": {
66
"test": "exit 0"

template/_storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @type{import("@storybook/react-webpack5").StorybookConfig} */
22
module.exports = {
33
stories: ['../components/**/*.stories.?(ts|tsx|js|jsx)'],
4-
addons: ['@storybook/addon-essentials'],
4+
addons: ['@storybook/addon-docs'],
55
framework: {
66
name: '@storybook/react-native-web-vite',
77
options: {},

template/components/Button/Button.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// stories/MyButton.stories.tsx
22
import type {Meta, StoryObj} from '@storybook/react';
3-
import {fn} from '@storybook/test';
3+
import {fn} from 'storybook/test';
44
import {MyButton} from './Button';
55

66
const meta = {

template/metro.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
2-
const path = require("path");
32
const withStorybook = require('@storybook/react-native/metro/withStorybook');
43

54
const defaultConfig = getDefaultConfig(__dirname);
@@ -17,5 +16,4 @@ const finalConfig = mergeConfig(defaultConfig, config);
1716
module.exports = withStorybook(finalConfig, {
1817
enabled: process.env.STORYBOOK_ENABLED === 'true',
1918
onDisabledRemoveStorybook: true,
20-
configPath: path.resolve(__dirname, './.rnstorybook'),
2119
});

template/package.json

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"storybook": "cross-env STORYBOOK_ENABLED='true' react-native start",
1212
"storybook:ios": "cross-env STORYBOOK_ENABLED='true' react-native run-ios",
1313
"storybook:android": "cross-env STORYBOOK_ENABLED='true' react-native run-android",
14-
"storybook-generate": "sb-rn-get-stories --config-path .rnstorybook",
14+
"storybook-generate": "sb-rn-get-stories",
1515
"storybook:web": "storybook dev -p 6006",
1616
"build-storybook": "storybook build"
1717
},
@@ -31,6 +31,7 @@
3131
"devDependencies": {
3232
"@babel/core": "^7.25.2",
3333
"@babel/preset-env": "^7.25.3",
34+
"@babel/preset-react": "^7.27.1",
3435
"@babel/runtime": "^7.25.0",
3536
"@react-native-community/cli": "18.0.0",
3637
"@react-native-community/cli-platform-android": "18.0.0",
@@ -39,15 +40,15 @@
3940
"@react-native/eslint-config": "0.79.2",
4041
"@react-native/metro-config": "0.79.2",
4142
"@react-native/typescript-config": "0.79.2",
42-
"@storybook/addon-essentials": "^8.6.12",
43-
"@storybook/addon-ondevice-actions": "^8.6.2",
44-
"@storybook/addon-ondevice-backgrounds": "^8.6.2",
45-
"@storybook/addon-ondevice-controls": "^8.6.2",
46-
"@storybook/addon-ondevice-notes": "^8.6.2",
47-
"@storybook/react": "^8.6.12",
48-
"@storybook/react-native": "^8.6.2",
49-
"@storybook/react-native-web-vite": "^8.6.12",
50-
"@storybook/test": "^8.6.12",
43+
"@chromatic-com/storybook": "4.0.0-next.7",
44+
"@storybook/addon-docs": "9.0.0-rc.4",
45+
"@storybook/addon-ondevice-actions": "9.0.0-rc.4",
46+
"@storybook/addon-ondevice-backgrounds": "9.0.0-rc.4",
47+
"@storybook/addon-ondevice-controls": "9.0.0-rc.4",
48+
"@storybook/addon-ondevice-notes": "9.0.0-rc.4",
49+
"@storybook/react": "9.0.0-rc.4",
50+
"@storybook/react-native": "9.0.0-rc.4",
51+
"@storybook/react-native-web-vite": "9.0.0-rc.4",
5152
"@types/jest": "^29.5.13",
5253
"@types/react": "^19.0.0",
5354
"@types/react-test-renderer": "^19.0.0",
@@ -58,7 +59,7 @@
5859
"jest": "^29.6.3",
5960
"react-test-renderer": "19.0.0",
6061
"prettier": "2.8.8",
61-
"storybook": "^8.6.12",
62+
"storybook": "9.0.0-rc.4",
6263
"typescript": "^5.8.3",
6364
"vite": "^6.3.4"
6465
},
@@ -69,20 +70,14 @@
6970
"node": ">=18"
7071
},
7172
"resolutions": {
72-
"react-docgen-typescript": "2.2.2",
73-
"react": "19.0.0",
74-
"react-native-web": "^0.20.0"
73+
"react-docgen-typescript": "2.2.2"
7574
},
7675
"overrides": {
77-
"react-docgen-typescript": "2.2.2",
78-
"react": "19.0.0",
79-
"react-native-web": "^0.20.0"
76+
"react-docgen-typescript": "2.2.2"
8077
},
8178
"pnpm": {
8279
"overrides": {
83-
"react-docgen-typescript": "2.2.2",
84-
"react": "19.0.0",
85-
"react-native-web": "^0.20.0"
80+
"react-docgen-typescript": "2.2.2"
8681
}
8782
}
8883
}

0 commit comments

Comments
 (0)