@storybook/react-native 8.3.9 → 8.3.10-alpha.0
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/metro/withStorybook.js +27 -1
- package/package.json +4 -4
- package/readme.md +8 -3
package/metro/withStorybook.js
CHANGED
|
@@ -5,9 +5,35 @@ const { WebSocketServer } = require('ws');
|
|
|
5
5
|
|
|
6
6
|
module.exports = (
|
|
7
7
|
config,
|
|
8
|
-
{ configPath, enabled = true, websockets, useJs = false
|
|
8
|
+
{ configPath, enabled = true, websockets, useJs = false, onDisabledRemoveStorybook = false } = {
|
|
9
|
+
enabled: true,
|
|
10
|
+
useJs: false,
|
|
11
|
+
onDisabledRemoveStorybook: false,
|
|
12
|
+
}
|
|
9
13
|
) => {
|
|
10
14
|
if (!enabled) {
|
|
15
|
+
if (onDisabledRemoveStorybook) {
|
|
16
|
+
return {
|
|
17
|
+
...config,
|
|
18
|
+
resolver: {
|
|
19
|
+
...config.resolver,
|
|
20
|
+
resolveRequest: (context, moduleName, platform) => {
|
|
21
|
+
const resolveFunction = config?.resolver?.resolveRequest
|
|
22
|
+
? config?.resolver?.resolveRequest
|
|
23
|
+
: context.resolveRequest;
|
|
24
|
+
|
|
25
|
+
if (moduleName.startsWith('storybook') || moduleName.startsWith('@storybook')) {
|
|
26
|
+
return {
|
|
27
|
+
type: 'empty',
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return resolveFunction(context, moduleName, platform);
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
11
37
|
return config;
|
|
12
38
|
}
|
|
13
39
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.10-alpha.0",
|
|
4
4
|
"description": "A better way to develop React Native Components for your app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@storybook/csf": "^0.1.1",
|
|
44
44
|
"@storybook/global": "^5.0.0",
|
|
45
45
|
"@storybook/react": "^8.3.5",
|
|
46
|
-
"@storybook/react-native-theming": "^8.3.
|
|
47
|
-
"@storybook/react-native-ui": "^8.3.
|
|
46
|
+
"@storybook/react-native-theming": "^8.3.10-alpha.0",
|
|
47
|
+
"@storybook/react-native-ui": "^8.3.10-alpha.0",
|
|
48
48
|
"chokidar": "^3.5.1",
|
|
49
49
|
"commander": "^8.2.0",
|
|
50
50
|
"dedent": "^1.5.1",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "7abe94ef9ccc96fb583d8653a193ae0f3ca7c8a0"
|
|
86
86
|
}
|
package/readme.md
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
# Storybook for React Native
|
|
2
2
|
|
|
3
3
|
> [!IMPORTANT]
|
|
4
|
-
> This readme is
|
|
4
|
+
> This readme is for v8, for v7 docs see the [v7.6 docs](https://github.com/storybookjs/react-native/tree/v7.6.20-stable).
|
|
5
5
|
|
|
6
6
|
With Storybook for React Native you can design and develop individual React Native components without running your app.
|
|
7
7
|
|
|
8
|
-
This readme is for the 8.3.1 version, you can find the 7.6 docs [here](https://github.com/storybookjs/react-native/tree/v7.6.20-stable).
|
|
9
|
-
|
|
10
8
|
If you are migrating from 7.6 to 8.3 you can find the migration guide [here](https://github.com/storybookjs/react-native/blob/next/MIGRATION.md#from-version-76x-to-83x)
|
|
11
9
|
|
|
12
10
|
For more information about storybook visit: [storybook.js.org](https://storybook.js.org)
|
|
@@ -330,6 +328,13 @@ module.exports = withStorybook(defaultConfig, {
|
|
|
330
328
|
});
|
|
331
329
|
```
|
|
332
330
|
|
|
331
|
+
#### onDisabledRemoveStorybook
|
|
332
|
+
|
|
333
|
+
Type: `boolean`, default: `false`
|
|
334
|
+
|
|
335
|
+
If onDisabledRemoveStorybook `true` and `enabled` is `false`, the storybook package will be removed from the build.
|
|
336
|
+
This is useful if you want to remove storybook from your production build.
|
|
337
|
+
|
|
333
338
|
#### useJs
|
|
334
339
|
|
|
335
340
|
Type: `boolean`, default: `false`
|