@storybook/react-native 7.6.11 → 7.6.12

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.6.11",
3
+ "version": "7.6.12",
4
4
  "description": "A better way to develop React Native Components for your app",
5
5
  "keywords": [
6
6
  "react",
@@ -63,7 +63,7 @@
63
63
  "@storybook/preview-api": "^7.6.10",
64
64
  "@storybook/preview-web": "^7.6.10",
65
65
  "@storybook/react": "^7.6.10",
66
- "@storybook/react-native-theming": "^7.6.11",
66
+ "@storybook/react-native-theming": "^7.6.12",
67
67
  "chokidar": "^3.5.1",
68
68
  "commander": "^8.2.0",
69
69
  "dedent": "^1.5.1",
@@ -97,5 +97,5 @@
97
97
  "publishConfig": {
98
98
  "access": "public"
99
99
  },
100
- "gitHead": "5aed8e2d2ddc4fe76dd5f883aeb35e3fb48cae87"
100
+ "gitHead": "8edec3c994c1a8d890b66ca3a6be0678b9daa49e"
101
101
  }
package/readme.md CHANGED
@@ -79,7 +79,7 @@ Then set `transformer.unstable_allowRequireContext` to true and add the generate
79
79
 
80
80
  ```js
81
81
  // metro.config.js
82
-
82
+ const path = require('path');
83
83
  const { getDefaultConfig } = require('expo/metro-config');
84
84
 
85
85
  const { generate } = require('@storybook/react-native/scripts/generate');
@@ -88,16 +88,18 @@ generate({
88
88
  configPath: path.resolve(__dirname, './.storybook'),
89
89
  });
90
90
 
91
- const defaultConfig = getDefaultConfig(__dirname);
91
+ /** @type {import('expo/metro-config').MetroConfig} */
92
+ const config = getDefaultConfig(__dirname);
92
93
 
93
- defaultConfig.transformer.unstable_allowRequireContext = true;
94
+ config.transformer.unstable_allowRequireContext = true;
94
95
 
95
- module.exports = defaultConfig;
96
+ module.exports = config;
96
97
  ```
97
98
 
98
99
  **React native**
99
100
 
100
101
  ```js
102
+ const path = require('path');
101
103
  const { generate } = require('@storybook/react-native/scripts/generate');
102
104
 
103
105
  generate({
@@ -29,14 +29,13 @@ function generate({ configPath, absolute = false, useJs = false }) {
29
29
  workingDir: cwd,
30
30
  });
31
31
 
32
- // TODO refactor contexts and normalized stories to be one thing
33
32
  const normalizedStories = storiesSpecifiers.map((specifier) => {
34
33
  // TODO why????
35
34
  const reg = globToRegexp(`./${specifier.files}`);
36
35
 
37
36
  const { path: p, recursive: r, match: m } = toRequireContext(specifier);
38
37
 
39
- const pathToStory = ensureRelativePathHasDot(path.relative(configPath, p));
38
+ const pathToStory = ensureRelativePathHasDot(path.posix.relative(configPath, p));
40
39
  return `{
41
40
  titlePrefix: "${specifier.titlePrefix}",
42
41
  directory: "${specifier.directory}",