-
-
Notifications
You must be signed in to change notification settings - Fork 180
Expand file tree
/
Copy pathstorybook.requires.ts
More file actions
90 lines (78 loc) Β· 2.56 KB
/
storybook.requires.ts
File metadata and controls
90 lines (78 loc) Β· 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* do not change this file, it is auto generated by storybook. */
/// <reference types="@storybook/react-native/metro-env" />
import { start, updateView, View, type Features } from '@storybook/react-native';
import "@storybook/addon-ondevice-controls/register";
import "@storybook/addon-ondevice-actions/register";
import "@storybook/addon-ondevice-notes/register";
import "storybook-addon-deep-controls/register";
import "./local-addon-example/register";
const normalizedStories = [
{
titlePrefix: "",
directory: "./components",
files: "**/*.stories.?(ts|tsx|js|jsx)",
importPathMatcher: /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
req: require.context(
'../components',
true,
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/
),
},
{
titlePrefix: "",
directory: "./other_components",
files: "**/*.stories.?(ts|tsx|js|jsx)",
importPathMatcher: /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
req: require.context(
'../other_components',
true,
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/
),
},
{
titlePrefix: "react-native-ui",
directory: "../../packages/react-native-ui",
files: "**/*.stories.?(ts|tsx|js|jsx)",
importPathMatcher: /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
req: require.context(
'../../../packages/react-native-ui',
true,
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/
),
}
];
declare global {
var view: View;
var STORIES: typeof normalizedStories;
var STORYBOOK_WEBSOCKET:
| { host?: string; port?: number; secured?: boolean }
| undefined;
var FEATURES: Features;
}
const annotations = [
require('./preview'),
require("@storybook/react-native/preview"),
require('storybook-addon-deep-controls/preview'),
require('./local-addon-example/preview')
];
globalThis.STORIES = normalizedStories;
globalThis.STORYBOOK_WEBSOCKET = {
host: '192.168.1.172',
port: 7007,
secured: false,
};
module?.hot?.accept?.();
globalThis.FEATURES.ondeviceBackgrounds = true;
const options = {
"playFn": false
}
if (!globalThis.view) {
globalThis.view = start({
annotations,
storyEntries: normalizedStories,
options,
});
} else {
updateView(globalThis.view, annotations, normalizedStories, options);
}
export const view: View = globalThis.view;