@storybook/react-native 7.0.0-alpha.0 → 7.0.0-alpha.1

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": "7.0.0-alpha.0",
3
+ "version": "7.0.0-alpha.1",
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.0",
64
+ "@storybook/react-native-theming": "^7.0.0-alpha.1",
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": "a16d060c6d1e49a7d68ba8e698d7128ee18a94b7"
97
+ "gitHead": "6e257261ea4c4f47adfbef7e1afc4fe3fe4e12bf"
96
98
  }
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
- // TODO remove this dot 👇 and find actual solution
116
- return `require.context('.${p}', ${r}, ${m})`;
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 = normalizeStories(main.stories, {
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, clearDecorators } from '@storybook/react-native';
202
+ import { configure, addDecorator, addParameters, addArgsEnhancer } from '@storybook/react-native';
204
203
 
205
204
  ${globalStories}
206
205