@storybook/react-native 8.0.0-alpha.2 → 8.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react-native",
3
- "version": "8.0.0-alpha.2",
3
+ "version": "8.0.0-alpha.4",
4
4
  "description": "A better way to develop React Native Components for your app",
5
5
  "keywords": [
6
6
  "react",
@@ -32,7 +32,7 @@
32
32
  "template/**/*"
33
33
  ],
34
34
  "scripts": {
35
- "dev": "ts-node ./buildscripts/gentsdev.ts && tsup --watch",
35
+ "dev": "npx tsx buildscripts/gendtsdev.ts && tsup --watch",
36
36
  "prepare": "rm -rf dist/ && tsup",
37
37
  "test": "jest",
38
38
  "test:ci": "jest"
@@ -52,17 +52,18 @@
52
52
  "preset": "react-native"
53
53
  },
54
54
  "dependencies": {
55
- "@storybook/channels": "8.0.0-rc.1",
56
- "@storybook/client-logger": "8.0.0-rc.1",
57
- "@storybook/core-common": "8.0.0-rc.1",
58
- "@storybook/core-events": "8.0.0-rc.1",
55
+ "@storybook/channels": "^8",
56
+ "@storybook/client-logger": "^8",
57
+ "@storybook/core-common": "^8",
58
+ "@storybook/core-events": "^8",
59
59
  "@storybook/csf": "^0.1.1",
60
- "@storybook/docs-tools": "8.0.0-rc.1",
60
+ "@storybook/docs-tools": "^8",
61
61
  "@storybook/global": "^5.0.0",
62
- "@storybook/manager-api": "8.0.0-rc.1",
63
- "@storybook/preview-api": "8.0.0-rc.1",
64
- "@storybook/react": "8.0.0-rc.1",
65
- "@storybook/react-native-theming": "^8.0.0-alpha.2",
62
+ "@storybook/manager-api": "^8",
63
+ "@storybook/preview-api": "^8",
64
+ "@storybook/react": "^8",
65
+ "@storybook/react-native-theming": "^8.0.0-alpha.4",
66
+ "@storybook/react-native-ui": "^8.0.0-alpha.4",
66
67
  "chokidar": "^3.5.1",
67
68
  "commander": "^8.2.0",
68
69
  "dedent": "^1.5.1",
@@ -74,20 +75,21 @@
74
75
  "util": "^0.12.4"
75
76
  },
76
77
  "devDependencies": {
77
- "@storybook/types": "8.0.0-rc.1",
78
+ "@storybook/types": "^8",
78
79
  "@types/jest": "^29.4.3",
79
80
  "@types/react": "~18.2.14",
80
81
  "babel-jest": "^29.4.3",
81
82
  "jest": "^29.7.0",
82
83
  "jotai": "^2.6.2",
83
84
  "react-test-renderer": "18.2.0",
84
- "ts-node": "^10.9.1",
85
85
  "tsup": "^7.2.0",
86
86
  "typescript": "^5.3.3"
87
87
  },
88
88
  "peerDependencies": {
89
+ "@gorhom/bottom-sheet": ">=4",
89
90
  "react": "*",
90
91
  "react-native": ">=0.57.0",
92
+ "react-native-gesture-handler": ">=2",
91
93
  "react-native-safe-area-context": "*"
92
94
  },
93
95
  "engines": {
@@ -96,5 +98,5 @@
96
98
  "publishConfig": {
97
99
  "access": "public"
98
100
  },
99
- "gitHead": "6f189532af5cbfbdd4bc968faab66721407c84ca"
101
+ "gitHead": "01c91fd5e53822bcbc1350a154d609c7c0092e69"
100
102
  }
@@ -4,7 +4,7 @@ exports[`loader writeRequires when there are different file extensions writes th
4
4
  "
5
5
  /* do not change this file, it is auto generated by storybook. */
6
6
 
7
- import { start, prepareStories, getProjectAnnotations } from '@storybook/react-native';
7
+ import { start, prepareStories, getProjectAnnotations, updateView } from '@storybook/react-native';
8
8
 
9
9
  import "@storybook/addon-ondevice-notes/register";
10
10
  import "@storybook/addon-ondevice-controls/register";
@@ -40,15 +40,7 @@ import "@storybook/addon-ondevice-actions/register";
40
40
  storyEntries: normalizedStories
41
41
  });
42
42
  } else {
43
- const { importMap } = prepareStories({ storyEntries: normalizedStories });
44
-
45
- global.view._preview.onStoriesChanged({
46
- importFn: async (importPath: string) => importMap[importPath],
47
- });
48
-
49
- global.view._preview.onGetProjectAnnotationsChanged({
50
- getProjectAnnotations: getProjectAnnotations(global.view, annotations),
51
- });
43
+ updateView(global.view, annotations, normalizedStories);
52
44
  }
53
45
 
54
46
  export const view = global.view;
@@ -59,7 +51,7 @@ exports[`loader writeRequires when there is a configuration object writes the st
59
51
  "
60
52
  /* do not change this file, it is auto generated by storybook. */
61
53
 
62
- import { start, prepareStories, getProjectAnnotations } from '@storybook/react-native';
54
+ import { start, prepareStories, getProjectAnnotations, updateView } from '@storybook/react-native';
63
55
 
64
56
  import "@storybook/addon-ondevice-notes/register";
65
57
  import "@storybook/addon-ondevice-controls/register";
@@ -95,15 +87,7 @@ import "@storybook/addon-ondevice-actions/register";
95
87
  storyEntries: normalizedStories
96
88
  });
97
89
  } else {
98
- const { importMap } = prepareStories({ storyEntries: normalizedStories });
99
-
100
- global.view._preview.onStoriesChanged({
101
- importFn: async (importPath: string) => importMap[importPath],
102
- });
103
-
104
- global.view._preview.onGetProjectAnnotationsChanged({
105
- getProjectAnnotations: getProjectAnnotations(global.view, annotations),
106
- });
90
+ updateView(global.view, annotations, normalizedStories);
107
91
  }
108
92
 
109
93
  export const view = global.view;
@@ -114,7 +98,7 @@ exports[`loader writeRequires when there is a story glob writes the story import
114
98
  "
115
99
  /* do not change this file, it is auto generated by storybook. */
116
100
 
117
- import { start, prepareStories, getProjectAnnotations } from '@storybook/react-native';
101
+ import { start, prepareStories, getProjectAnnotations, updateView } from '@storybook/react-native';
118
102
 
119
103
  import "@storybook/addon-ondevice-notes/register";
120
104
  import "@storybook/addon-ondevice-controls/register";
@@ -150,15 +134,7 @@ import "@storybook/addon-ondevice-actions/register";
150
134
  storyEntries: normalizedStories
151
135
  });
152
136
  } else {
153
- const { importMap } = prepareStories({ storyEntries: normalizedStories });
154
-
155
- global.view._preview.onStoriesChanged({
156
- importFn: async (importPath: string) => importMap[importPath],
157
- });
158
-
159
- global.view._preview.onGetProjectAnnotationsChanged({
160
- getProjectAnnotations: getProjectAnnotations(global.view, annotations),
161
- });
137
+ updateView(global.view, annotations, normalizedStories);
162
138
  }
163
139
 
164
140
  export const view = global.view;
@@ -169,7 +145,7 @@ exports[`loader writeRequires when there is no preview does not add preview rela
169
145
  "
170
146
  /* do not change this file, it is auto generated by storybook. */
171
147
 
172
- import { start, prepareStories, getProjectAnnotations } from '@storybook/react-native';
148
+ import { start, prepareStories, getProjectAnnotations, updateView } from '@storybook/react-native';
173
149
 
174
150
  import "@storybook/addon-ondevice-notes/register";
175
151
  import "@storybook/addon-ondevice-controls/register";
@@ -205,15 +181,7 @@ import "@storybook/addon-ondevice-actions/register";
205
181
  storyEntries: normalizedStories
206
182
  });
207
183
  } else {
208
- const { importMap } = prepareStories({ storyEntries: normalizedStories });
209
-
210
- global.view._preview.onStoriesChanged({
211
- importFn: async (importPath: string) => importMap[importPath],
212
- });
213
-
214
- global.view._preview.onGetProjectAnnotationsChanged({
215
- getProjectAnnotations: getProjectAnnotations(global.view, annotations),
216
- });
184
+ updateView(global.view, annotations, normalizedStories);
217
185
  }
218
186
 
219
187
  export const view = global.view;
@@ -68,9 +68,9 @@ function generate({ configPath, absolute = false, useJs = false }) {
68
68
 
69
69
  const fileContent = `
70
70
  /* do not change this file, it is auto generated by storybook. */
71
-
72
- import { start, prepareStories, getProjectAnnotations } from '@storybook/react-native';
73
-
71
+
72
+ import { start, updateView } from '@storybook/react-native';
73
+
74
74
  ${registerAddons}
75
75
 
76
76
  const normalizedStories = [${normalizedStories.join(',')}];
@@ -80,7 +80,7 @@ function generate({ configPath, absolute = false, useJs = false }) {
80
80
  const annotations = ${annotations};
81
81
 
82
82
  global.STORIES = normalizedStories;
83
-
83
+
84
84
  // @ts-ignore
85
85
  module?.hot?.accept?.();
86
86
 
@@ -90,15 +90,7 @@ function generate({ configPath, absolute = false, useJs = false }) {
90
90
  storyEntries: normalizedStories
91
91
  });
92
92
  } else {
93
- const { importMap } = prepareStories({ storyEntries: normalizedStories });
94
-
95
- global.view._preview.onStoriesChanged({
96
- importFn: async (importPath: string) => importMap[importPath],
97
- });
98
-
99
- global.view._preview.onGetProjectAnnotationsChanged({
100
- getProjectAnnotations: getProjectAnnotations(global.view, annotations),
101
- });
93
+ updateView(global.view, annotations, normalizedStories);
102
94
  }
103
95
 
104
96
  export const view = global.view;