@storybook/react-native 7.0.0-alpha.0 → 7.0.0-alpha.2
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/dist/index.d.ts +3 -10
- package/dist/index.js +65 -5468
- package/package.json +5 -3
- package/scripts/__snapshots__/loader.test.js.snap +6 -6
- package/scripts/loader.js +6 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.2",
|
|
4
4
|
"description": "A better way to develop React Native Components for your app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -59,8 +59,9 @@
|
|
|
59
59
|
"@storybook/core-events": "^7",
|
|
60
60
|
"@storybook/csf": "^0.1.1",
|
|
61
61
|
"@storybook/global": "^5.0.0",
|
|
62
|
+
"@storybook/preview-api": "^7",
|
|
62
63
|
"@storybook/preview-web": "^7",
|
|
63
|
-
"@storybook/react-native-theming": "^7.0.0-alpha.
|
|
64
|
+
"@storybook/react-native-theming": "^7.0.0-alpha.2",
|
|
64
65
|
"chokidar": "^3.5.1",
|
|
65
66
|
"commander": "^8.2.0",
|
|
66
67
|
"deepmerge": "^4.3.0",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"util": "^0.12.4"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
75
|
+
"@storybook/types": "^7",
|
|
74
76
|
"@types/jest": "^29.4.3",
|
|
75
77
|
"@types/react": "~18.2.14",
|
|
76
78
|
"babel-jest": "^29.4.3",
|
|
@@ -92,5 +94,5 @@
|
|
|
92
94
|
"publishConfig": {
|
|
93
95
|
"access": "public"
|
|
94
96
|
},
|
|
95
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "284fd8ae2ea94588dfea0f216d34bf263b2c6139"
|
|
96
98
|
}
|
|
@@ -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 { configure, addDecorator, addParameters, addArgsEnhancer
|
|
7
|
+
import { configure, addDecorator, addParameters, addArgsEnhancer } from '@storybook/react-native';
|
|
8
8
|
|
|
9
9
|
global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/file-extensions","files":"FakeStory.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/file-extensions\\\\/FakeStory\\\\.stories\\\\.tsx)$"}]
|
|
10
10
|
|
|
@@ -48,7 +48,7 @@ exports[`loader writeRequires when there is a configuration object writes the st
|
|
|
48
48
|
"
|
|
49
49
|
/* do not change this file, it is auto generated by storybook. */
|
|
50
50
|
|
|
51
|
-
import { configure, addDecorator, addParameters, addArgsEnhancer
|
|
51
|
+
import { configure, addDecorator, addParameters, addArgsEnhancer } from '@storybook/react-native';
|
|
52
52
|
|
|
53
53
|
global.STORIES = [{"titlePrefix":"ComponentsPrefix","files":"**/*.stories.tsx","directory":"./scripts/mocks/configuration-objects/components","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/configuration-objects\\\\/components(?:\\\\/(?!\\\\.)(?:(?:(?!(?:^|\\\\/)\\\\.).)*?)\\\\/|\\\\/|$)(?!\\\\.)(?=.)[^/]*?\\\\.stories\\\\.tsx)$"}]
|
|
54
54
|
|
|
@@ -92,7 +92,7 @@ exports[`loader writeRequires when there is a story glob and exclude paths globs
|
|
|
92
92
|
"
|
|
93
93
|
/* do not change this file, it is auto generated by storybook. */
|
|
94
94
|
|
|
95
|
-
import { configure, addDecorator, addParameters, addArgsEnhancer
|
|
95
|
+
import { configure, addDecorator, addParameters, addArgsEnhancer } from '@storybook/react-native';
|
|
96
96
|
|
|
97
97
|
global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/exclude-config-files","files":"**/*.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/exclude-config-files(?:\\\\/(?!\\\\.)(?:(?:(?!(?:^|\\\\/)\\\\.).)*?)\\\\/|\\\\/|$)(?!\\\\.)(?=.)[^/]*?\\\\.stories\\\\.tsx)$"}]
|
|
98
98
|
|
|
@@ -136,7 +136,7 @@ exports[`loader writeRequires when there is a story glob writes the story import
|
|
|
136
136
|
"
|
|
137
137
|
/* do not change this file, it is auto generated by storybook. */
|
|
138
138
|
|
|
139
|
-
import { configure, addDecorator, addParameters, addArgsEnhancer
|
|
139
|
+
import { configure, addDecorator, addParameters, addArgsEnhancer } from '@storybook/react-native';
|
|
140
140
|
|
|
141
141
|
global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/all-config-files","files":"FakeStory.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/all-config-files\\\\/FakeStory\\\\.stories\\\\.tsx)$"}]
|
|
142
142
|
|
|
@@ -180,7 +180,7 @@ exports[`loader writeRequires when there is no preview does not add preview rela
|
|
|
180
180
|
"
|
|
181
181
|
/* do not change this file, it is auto generated by storybook. */
|
|
182
182
|
|
|
183
|
-
import { configure, addDecorator, addParameters, addArgsEnhancer
|
|
183
|
+
import { configure, addDecorator, addParameters, addArgsEnhancer } from '@storybook/react-native';
|
|
184
184
|
|
|
185
185
|
global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/no-preview","files":"FakeStory.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/no-preview\\\\/FakeStory\\\\.stories\\\\.tsx)$"}]
|
|
186
186
|
|
|
@@ -214,7 +214,7 @@ exports[`loader writeRequires when there is no story glob or addons writes no st
|
|
|
214
214
|
"
|
|
215
215
|
/* do not change this file, it is auto generated by storybook. */
|
|
216
216
|
|
|
217
|
-
import { configure, addDecorator, addParameters, addArgsEnhancer
|
|
217
|
+
import { configure, addDecorator, addParameters, addArgsEnhancer } from '@storybook/react-native';
|
|
218
218
|
|
|
219
219
|
global.STORIES = []
|
|
220
220
|
|
package/scripts/loader.js
CHANGED
|
@@ -112,8 +112,10 @@ function writeRequires({ configPath, absolute = false, unstable_useRequireContex
|
|
|
112
112
|
if (unstable_useRequireContext) {
|
|
113
113
|
const contexts = storiesSpecifiers.map((specifier) => {
|
|
114
114
|
const { path: p, recursive: r, match: m } = toRequireContext(specifier);
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
|
|
116
|
+
const pathToStory = ensureRelativePathHasDot(path.relative(configPath, p));
|
|
117
|
+
|
|
118
|
+
return `require.context('${pathToStory}', ${r}, ${m})`;
|
|
117
119
|
});
|
|
118
120
|
|
|
119
121
|
configure = `
|
|
@@ -187,10 +189,7 @@ function writeRequires({ configPath, absolute = false, unstable_useRequireContex
|
|
|
187
189
|
`;
|
|
188
190
|
}
|
|
189
191
|
|
|
190
|
-
const normalizedStories =
|
|
191
|
-
configDir: configPath,
|
|
192
|
-
workingDir: cwd,
|
|
193
|
-
}).map((specifier) => ({
|
|
192
|
+
const normalizedStories = storiesSpecifiers.map((specifier) => ({
|
|
194
193
|
...specifier,
|
|
195
194
|
importPathMatcher: specifier.importPathMatcher.source,
|
|
196
195
|
}));
|
|
@@ -200,7 +199,7 @@ function writeRequires({ configPath, absolute = false, unstable_useRequireContex
|
|
|
200
199
|
const fileContent = `
|
|
201
200
|
/* do not change this file, it is auto generated by storybook. */
|
|
202
201
|
|
|
203
|
-
import { configure, addDecorator, addParameters, addArgsEnhancer
|
|
202
|
+
import { configure, addDecorator, addParameters, addArgsEnhancer } from '@storybook/react-native';
|
|
204
203
|
|
|
205
204
|
${globalStories}
|
|
206
205
|
|