@storybook/react-native 10.2.2-next.6 → 10.2.2-next.8
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/metro/withStorybook.js +3 -2
- package/dist/node.js +3 -2
- package/dist/repack/withStorybook.js +3 -2
- package/package.json +6 -8
- package/scripts/common.js +4 -2
- package/scripts/generate.test.js +0 -218
- package/scripts/generate.test.js.snapshot +0 -39
- package/scripts/mocks/all-config-files/FakeComponent.tsx +0 -1
- package/scripts/mocks/all-config-files/FakeStory.stories.tsx +0 -10
- package/scripts/mocks/all-config-files/main.js +0 -9
- package/scripts/mocks/all-config-files/preview.js +0 -24
- package/scripts/mocks/blank-config/main.js +0 -4
- package/scripts/mocks/configuration-objects/components/FakeComponent.tsx +0 -1
- package/scripts/mocks/configuration-objects/components/FakeStory.stories.tsx +0 -9
- package/scripts/mocks/configuration-objects/main.js +0 -15
- package/scripts/mocks/configuration-objects/preview.js +0 -24
- package/scripts/mocks/exclude-config-files/exclude-components/FakeComponent.tsx +0 -1
- package/scripts/mocks/exclude-config-files/exclude-components/FakeStory.stories.tsx +0 -10
- package/scripts/mocks/exclude-config-files/include-components/FakeComponent.tsx +0 -1
- package/scripts/mocks/exclude-config-files/include-components/FakeStory.stories.tsx +0 -10
- package/scripts/mocks/exclude-config-files/main.js +0 -12
- package/scripts/mocks/exclude-config-files/preview.js +0 -24
- package/scripts/mocks/file-extensions/FakeComponent.tsx +0 -1
- package/scripts/mocks/file-extensions/FakeStory.stories.tsx +0 -10
- package/scripts/mocks/file-extensions/main.ts +0 -11
- package/scripts/mocks/file-extensions/preview.tsx +0 -23
- package/scripts/mocks/no-preview/FakeComponent.tsx +0 -1
- package/scripts/mocks/no-preview/FakeStory.stories.tsx +0 -10
- package/scripts/mocks/no-preview/main.js +0 -9
- package/scripts/mocks/preview-files/js/preview.js +0 -24
- package/scripts/mocks/preview-files/jsx/preview.jsx +0 -24
- package/scripts/mocks/preview-files/ts/preview.ts +0 -9
- package/scripts/mocks/preview-files/tsx/preview.tsx +0 -9
- package/scripts/mocks/wrong-extension-preview/FakeComponent.tsx +0 -1
- package/scripts/mocks/wrong-extension-preview/FakeStory.stories.tsx +0 -10
- package/scripts/mocks/wrong-extension-preview/main.js +0 -9
- package/scripts/mocks/wrong-extension-preview/preview.txt +0 -24
|
@@ -72,16 +72,17 @@ var require_common = __commonJS({
|
|
|
72
72
|
}
|
|
73
73
|
function resolveAddonFile(addon, file, extensions = ["js", "mjs", "ts"], configPath) {
|
|
74
74
|
if (!addon || typeof addon !== "string") return null;
|
|
75
|
+
const resolvePaths = { paths: [cwd2] };
|
|
75
76
|
try {
|
|
76
77
|
const basePath = `${addon}/${file}`;
|
|
77
|
-
require.resolve(basePath);
|
|
78
|
+
require.resolve(basePath, resolvePaths);
|
|
78
79
|
return basePath;
|
|
79
80
|
} catch (_error) {
|
|
80
81
|
}
|
|
81
82
|
for (const ext of extensions) {
|
|
82
83
|
try {
|
|
83
84
|
const filePath = `${addon}/${file}.${ext}`;
|
|
84
|
-
require.resolve(filePath);
|
|
85
|
+
require.resolve(filePath, resolvePaths);
|
|
85
86
|
return filePath;
|
|
86
87
|
} catch (_error) {
|
|
87
88
|
}
|
package/dist/node.js
CHANGED
|
@@ -72,16 +72,17 @@ var require_common = __commonJS({
|
|
|
72
72
|
}
|
|
73
73
|
function resolveAddonFile(addon, file, extensions = ["js", "mjs", "ts"], configPath) {
|
|
74
74
|
if (!addon || typeof addon !== "string") return null;
|
|
75
|
+
const resolvePaths = { paths: [cwd2] };
|
|
75
76
|
try {
|
|
76
77
|
const basePath = `${addon}/${file}`;
|
|
77
|
-
require.resolve(basePath);
|
|
78
|
+
require.resolve(basePath, resolvePaths);
|
|
78
79
|
return basePath;
|
|
79
80
|
} catch (_error) {
|
|
80
81
|
}
|
|
81
82
|
for (const ext of extensions) {
|
|
82
83
|
try {
|
|
83
84
|
const filePath = `${addon}/${file}.${ext}`;
|
|
84
|
-
require.resolve(filePath);
|
|
85
|
+
require.resolve(filePath, resolvePaths);
|
|
85
86
|
return filePath;
|
|
86
87
|
} catch (_error) {
|
|
87
88
|
}
|
|
@@ -72,16 +72,17 @@ var require_common = __commonJS({
|
|
|
72
72
|
}
|
|
73
73
|
function resolveAddonFile(addon, file, extensions = ["js", "mjs", "ts"], configPath) {
|
|
74
74
|
if (!addon || typeof addon !== "string") return null;
|
|
75
|
+
const resolvePaths = { paths: [cwd2] };
|
|
75
76
|
try {
|
|
76
77
|
const basePath = `${addon}/${file}`;
|
|
77
|
-
require.resolve(basePath);
|
|
78
|
+
require.resolve(basePath, resolvePaths);
|
|
78
79
|
return basePath;
|
|
79
80
|
} catch (_error) {
|
|
80
81
|
}
|
|
81
82
|
for (const ext of extensions) {
|
|
82
83
|
try {
|
|
83
84
|
const filePath = `${addon}/${file}.${ext}`;
|
|
84
|
-
require.resolve(filePath);
|
|
85
|
+
require.resolve(filePath, resolvePaths);
|
|
85
86
|
return filePath;
|
|
86
87
|
} catch (_error) {
|
|
87
88
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native",
|
|
3
|
-
"version": "10.2.2-next.
|
|
3
|
+
"version": "10.2.2-next.8",
|
|
4
4
|
"description": "A better way to develop React Native Components for your app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@storybook/react": "^10.2.2",
|
|
46
|
-
"@storybook/react-native-theming": "^10.2.2-next.
|
|
47
|
-
"@storybook/react-native-ui": "^10.2.2-next.
|
|
48
|
-
"@storybook/react-native-ui-common": "^10.2.2-next.
|
|
46
|
+
"@storybook/react-native-theming": "^10.2.2-next.8",
|
|
47
|
+
"@storybook/react-native-ui": "^10.2.2-next.8",
|
|
48
|
+
"@storybook/react-native-ui-common": "^10.2.2-next.8",
|
|
49
49
|
"commander": "^14.0.2",
|
|
50
50
|
"dedent": "^1.7.0",
|
|
51
51
|
"deepmerge": "^4.3.1",
|
|
@@ -102,9 +102,7 @@
|
|
|
102
102
|
"gitHead": "4aa2ae40569ea7f61e438ce568a39c580b3097d8",
|
|
103
103
|
"scripts": {
|
|
104
104
|
"dev": "npx --yes tsx buildscripts/gendtsdev.ts && tsup --watch",
|
|
105
|
-
"test": "jest
|
|
106
|
-
"test:ci": "jest
|
|
107
|
-
"test:generate": "node --test scripts/generate.test.js",
|
|
108
|
-
"test:generate:update": "node --test --test-update-snapshots scripts/generate.test.js"
|
|
105
|
+
"test": "jest",
|
|
106
|
+
"test:ci": "jest"
|
|
109
107
|
}
|
|
110
108
|
}
|
package/scripts/common.js
CHANGED
|
@@ -55,10 +55,12 @@ function getPreviewExists({ configPath }) {
|
|
|
55
55
|
function resolveAddonFile(addon, file, extensions = ['js', 'mjs', 'ts'], configPath) {
|
|
56
56
|
if (!addon || typeof addon !== 'string') return null;
|
|
57
57
|
|
|
58
|
+
const resolvePaths = { paths: [cwd] };
|
|
59
|
+
|
|
58
60
|
try {
|
|
59
61
|
const basePath = `${addon}/${file}`;
|
|
60
62
|
|
|
61
|
-
require.resolve(basePath);
|
|
63
|
+
require.resolve(basePath, resolvePaths);
|
|
62
64
|
|
|
63
65
|
return basePath;
|
|
64
66
|
} catch (_error) {}
|
|
@@ -67,7 +69,7 @@ function resolveAddonFile(addon, file, extensions = ['js', 'mjs', 'ts'], configP
|
|
|
67
69
|
try {
|
|
68
70
|
const filePath = `${addon}/${file}.${ext}`;
|
|
69
71
|
|
|
70
|
-
require.resolve(filePath);
|
|
72
|
+
require.resolve(filePath, resolvePaths);
|
|
71
73
|
|
|
72
74
|
return filePath;
|
|
73
75
|
} catch (_error) {}
|
package/scripts/generate.test.js
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
const { describe, it, beforeEach, mock } = require('node:test');
|
|
2
|
-
const assert = require('node:assert');
|
|
3
|
-
const path = require('node:path');
|
|
4
|
-
const { generate } = require('./generate');
|
|
5
|
-
|
|
6
|
-
let pathMock;
|
|
7
|
-
let fileContentMock;
|
|
8
|
-
|
|
9
|
-
global.window = { navigator: {} };
|
|
10
|
-
|
|
11
|
-
const mockFs = {
|
|
12
|
-
writeFileSync: (filePath, fileContent, opts) => {
|
|
13
|
-
pathMock = filePath;
|
|
14
|
-
fileContentMock = fileContent;
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
describe('loader', () => {
|
|
19
|
-
beforeEach(() => {
|
|
20
|
-
pathMock = undefined;
|
|
21
|
-
fileContentMock = undefined;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
describe('writeRequires', () => {
|
|
25
|
-
describe('when there is a story glob', () => {
|
|
26
|
-
it('writes the story imports', async (t) => {
|
|
27
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
28
|
-
await generate({ configPath: 'scripts/mocks/all-config-files' });
|
|
29
|
-
mock.reset();
|
|
30
|
-
|
|
31
|
-
assert.strictEqual(
|
|
32
|
-
pathMock,
|
|
33
|
-
path.resolve(__dirname, 'mocks/all-config-files/storybook.requires.ts')
|
|
34
|
-
);
|
|
35
|
-
t.assert.snapshot(fileContentMock);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
describe('when using js', () => {
|
|
40
|
-
it('writes the story imports without types', async (t) => {
|
|
41
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
42
|
-
await generate({ configPath: 'scripts/mocks/all-config-files', useJs: true });
|
|
43
|
-
mock.reset();
|
|
44
|
-
|
|
45
|
-
assert.strictEqual(
|
|
46
|
-
pathMock,
|
|
47
|
-
path.resolve(__dirname, 'mocks/all-config-files/storybook.requires.js')
|
|
48
|
-
);
|
|
49
|
-
t.assert.snapshot(fileContentMock);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
describe('when there are different file extensions', () => {
|
|
54
|
-
it('writes the story imports', async (t) => {
|
|
55
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
56
|
-
await generate({ configPath: 'scripts/mocks/file-extensions' });
|
|
57
|
-
mock.reset();
|
|
58
|
-
|
|
59
|
-
assert.strictEqual(
|
|
60
|
-
pathMock,
|
|
61
|
-
path.resolve(__dirname, 'mocks/file-extensions/storybook.requires.ts')
|
|
62
|
-
);
|
|
63
|
-
t.assert.snapshot(fileContentMock);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
// TODO can we support exclude globs?
|
|
68
|
-
// describe('when there is a story glob and exclude paths globs', () => {
|
|
69
|
-
// it('writes the story imports', () => {
|
|
70
|
-
// generate({ configPath: 'scripts/mocks/exclude-config-files' });
|
|
71
|
-
// assert.strictEqual(
|
|
72
|
-
// pathMock,
|
|
73
|
-
// path.resolve(__dirname, 'mocks/exclude-config-files/storybook.requires.ts')
|
|
74
|
-
// );
|
|
75
|
-
|
|
76
|
-
// assert.ok(fileContentMock.includes('include-components/FakeStory.stories.tsx'));
|
|
77
|
-
// assert.ok(!fileContentMock.includes('exclude-components/FakeStory.stories.tsx'));
|
|
78
|
-
|
|
79
|
-
// t.assert.snapshot(fileContentMock);
|
|
80
|
-
// });
|
|
81
|
-
// });
|
|
82
|
-
|
|
83
|
-
describe('when there is no story glob or addons', () => {
|
|
84
|
-
it('throws an error', async () => {
|
|
85
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
86
|
-
await assert.rejects(
|
|
87
|
-
async () => await generate({ configPath: 'scripts/mocks/blank-config' }),
|
|
88
|
-
Error
|
|
89
|
-
);
|
|
90
|
-
mock.reset();
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
describe('when there is no preview', () => {
|
|
95
|
-
it('does not add preview related stuff', async (t) => {
|
|
96
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
97
|
-
await generate({ configPath: 'scripts/mocks/no-preview' });
|
|
98
|
-
mock.reset();
|
|
99
|
-
|
|
100
|
-
assert.strictEqual(
|
|
101
|
-
pathMock,
|
|
102
|
-
path.resolve(__dirname, 'mocks/no-preview/storybook.requires.ts')
|
|
103
|
-
);
|
|
104
|
-
t.assert.snapshot(fileContentMock);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// TODO does this still make sense?
|
|
109
|
-
// describe('when the absolute option is true', () => {
|
|
110
|
-
// it('should write absolute paths to the requires file', () => {
|
|
111
|
-
// generate({ configPath: 'scripts/mocks/all-config-files', absolute: true });
|
|
112
|
-
// assert.strictEqual(
|
|
113
|
-
// pathMock,
|
|
114
|
-
// path.resolve(__dirname, 'mocks/all-config-files/storybook.requires.ts')
|
|
115
|
-
// );
|
|
116
|
-
|
|
117
|
-
// // assert.ok(fileContentMock.includes(`FakeStory.stories.tsx`));
|
|
118
|
-
// assert.ok(fileContentMock.includes(path.resolve(__dirname, 'mocks/all-config-files')));
|
|
119
|
-
// });
|
|
120
|
-
// });
|
|
121
|
-
|
|
122
|
-
describe('when there is a configuration object', () => {
|
|
123
|
-
it('writes the story imports', async (t) => {
|
|
124
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
125
|
-
await generate({ configPath: 'scripts/mocks/configuration-objects' });
|
|
126
|
-
mock.reset();
|
|
127
|
-
|
|
128
|
-
assert.strictEqual(
|
|
129
|
-
pathMock,
|
|
130
|
-
path.resolve(__dirname, 'mocks/configuration-objects/storybook.requires.ts')
|
|
131
|
-
);
|
|
132
|
-
t.assert.snapshot(fileContentMock);
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
describe('when host and port are provided', () => {
|
|
137
|
-
it('includes STORYBOOK_WEBSOCKET with host and port', async (t) => {
|
|
138
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
139
|
-
await generate({
|
|
140
|
-
configPath: 'scripts/mocks/all-config-files',
|
|
141
|
-
host: '192.168.1.100',
|
|
142
|
-
port: 8080,
|
|
143
|
-
});
|
|
144
|
-
mock.reset();
|
|
145
|
-
|
|
146
|
-
assert.ok(
|
|
147
|
-
fileContentMock.includes(
|
|
148
|
-
"globalThis.STORYBOOK_WEBSOCKET = { host: '192.168.1.100', port: 8080 };"
|
|
149
|
-
)
|
|
150
|
-
);
|
|
151
|
-
t.assert.snapshot(fileContentMock);
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
describe('when only host is provided', () => {
|
|
156
|
-
it('includes STORYBOOK_WEBSOCKET with host and default port', async (t) => {
|
|
157
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
158
|
-
await generate({
|
|
159
|
-
configPath: 'scripts/mocks/all-config-files',
|
|
160
|
-
host: 'localhost',
|
|
161
|
-
});
|
|
162
|
-
mock.reset();
|
|
163
|
-
|
|
164
|
-
assert.ok(
|
|
165
|
-
fileContentMock.includes(
|
|
166
|
-
"globalThis.STORYBOOK_WEBSOCKET = { host: 'localhost', port: 7007 };"
|
|
167
|
-
)
|
|
168
|
-
);
|
|
169
|
-
t.assert.snapshot(fileContentMock);
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
describe('when host is not provided', () => {
|
|
174
|
-
it('does not include STORYBOOK_WEBSOCKET assignment', async (t) => {
|
|
175
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
176
|
-
await generate({ configPath: 'scripts/mocks/all-config-files' });
|
|
177
|
-
mock.reset();
|
|
178
|
-
|
|
179
|
-
assert.ok(!fileContentMock.includes('globalThis.STORYBOOK_WEBSOCKET ='));
|
|
180
|
-
t.assert.snapshot(fileContentMock);
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
describe('when only port is provided without host', () => {
|
|
185
|
-
it('does not include STORYBOOK_WEBSOCKET assignment', async (t) => {
|
|
186
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
187
|
-
await generate({
|
|
188
|
-
configPath: 'scripts/mocks/all-config-files',
|
|
189
|
-
port: 8080,
|
|
190
|
-
});
|
|
191
|
-
mock.reset();
|
|
192
|
-
|
|
193
|
-
assert.ok(!fileContentMock.includes('globalThis.STORYBOOK_WEBSOCKET ='));
|
|
194
|
-
t.assert.snapshot(fileContentMock);
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
describe('when host and port are provided with useJs', () => {
|
|
199
|
-
it('includes STORYBOOK_WEBSOCKET in JS file', async (t) => {
|
|
200
|
-
mock.method(require('fs'), 'writeFileSync', mockFs.writeFileSync);
|
|
201
|
-
await generate({
|
|
202
|
-
configPath: 'scripts/mocks/all-config-files',
|
|
203
|
-
useJs: true,
|
|
204
|
-
host: '192.168.1.100',
|
|
205
|
-
port: 8080,
|
|
206
|
-
});
|
|
207
|
-
mock.reset();
|
|
208
|
-
|
|
209
|
-
assert.ok(
|
|
210
|
-
fileContentMock.includes(
|
|
211
|
-
"globalThis.STORYBOOK_WEBSOCKET = { host: '192.168.1.100', port: 8080 };"
|
|
212
|
-
)
|
|
213
|
-
);
|
|
214
|
-
t.assert.snapshot(fileContentMock);
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
exports[`loader > writeRequires > when host and port are provided > includes STORYBOOK_WEBSOCKET with host and port 1`] = `
|
|
2
|
-
"/* do not change this file, it is auto generated by storybook. */\\nimport { start, updateView, View } from '@storybook/react-native';\\n\\nimport \\"@storybook/addon-ondevice-notes/register\\";\\nimport \\"@storybook/addon-ondevice-controls/register\\";\\nimport \\"@storybook/addon-ondevice-backgrounds/register\\";\\nimport \\"@storybook/addon-ondevice-actions/register\\";\\n\\nconst normalizedStories = [\\n {\\n titlePrefix: \\"\\",\\n directory: \\"./scripts/mocks/all-config-files\\",\\n files: \\"FakeStory.stories.tsx\\",\\n importPathMatcher: /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/,\\n // @ts-ignore\\n req: require.context(\\n './',\\n false,\\n /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/\\n ),\\n }\\n];\\n\\n\\ndeclare global {\\n var view: View;\\n var STORIES: typeof normalizedStories;\\n var STORYBOOK_WEBSOCKET: { host: string; port: number } | undefined;\\n}\\n\\n\\nconst annotations = [\\n require('./preview'),\\n require(\\"@storybook/react-native/preview\\")\\n];\\n\\nglobalThis.STORIES = normalizedStories;\\nglobalThis.STORYBOOK_WEBSOCKET = { host: '192.168.1.100', port: 8080 };\\n\\n// @ts-ignore\\nmodule?.hot?.accept?.();\\n\\n\\n\\nif (!globalThis.view) {\\n globalThis.view = start({\\n annotations,\\n storyEntries: normalizedStories,\\n\\n });\\n} else {\\n updateView(globalThis.view, annotations, normalizedStories);\\n}\\n\\nexport const view: View = globalThis.view;\\n"
|
|
3
|
-
`;
|
|
4
|
-
|
|
5
|
-
exports[`loader > writeRequires > when host and port are provided with useJs > includes STORYBOOK_WEBSOCKET in JS file 1`] = `
|
|
6
|
-
"/* do not change this file, it is auto generated by storybook. */\\nimport { start, updateView } from '@storybook/react-native';\\n\\nimport \\"@storybook/addon-ondevice-notes/register\\";\\nimport \\"@storybook/addon-ondevice-controls/register\\";\\nimport \\"@storybook/addon-ondevice-backgrounds/register\\";\\nimport \\"@storybook/addon-ondevice-actions/register\\";\\n\\nconst normalizedStories = [\\n {\\n titlePrefix: \\"\\",\\n directory: \\"./scripts/mocks/all-config-files\\",\\n files: \\"FakeStory.stories.tsx\\",\\n importPathMatcher: /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/,\\n \\n req: require.context(\\n './',\\n false,\\n /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/\\n ),\\n }\\n];\\n\\n\\n\\nconst annotations = [\\n require('./preview'),\\n require(\\"@storybook/react-native/preview\\")\\n];\\n\\nglobalThis.STORIES = normalizedStories;\\nglobalThis.STORYBOOK_WEBSOCKET = { host: '192.168.1.100', port: 8080 };\\n\\n\\nmodule?.hot?.accept?.();\\n\\n\\n\\nif (!globalThis.view) {\\n globalThis.view = start({\\n annotations,\\n storyEntries: normalizedStories,\\n\\n });\\n} else {\\n updateView(globalThis.view, annotations, normalizedStories);\\n}\\n\\nexport const view = globalThis.view;\\n"
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
exports[`loader > writeRequires > when host is not provided > does not include STORYBOOK_WEBSOCKET assignment 1`] = `
|
|
10
|
-
"/* do not change this file, it is auto generated by storybook. */\\nimport { start, updateView, View } from '@storybook/react-native';\\n\\nimport \\"@storybook/addon-ondevice-notes/register\\";\\nimport \\"@storybook/addon-ondevice-controls/register\\";\\nimport \\"@storybook/addon-ondevice-backgrounds/register\\";\\nimport \\"@storybook/addon-ondevice-actions/register\\";\\n\\nconst normalizedStories = [\\n {\\n titlePrefix: \\"\\",\\n directory: \\"./scripts/mocks/all-config-files\\",\\n files: \\"FakeStory.stories.tsx\\",\\n importPathMatcher: /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/,\\n // @ts-ignore\\n req: require.context(\\n './',\\n false,\\n /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/\\n ),\\n }\\n];\\n\\n\\ndeclare global {\\n var view: View;\\n var STORIES: typeof normalizedStories;\\n var STORYBOOK_WEBSOCKET: { host: string; port: number } | undefined;\\n}\\n\\n\\nconst annotations = [\\n require('./preview'),\\n require(\\"@storybook/react-native/preview\\")\\n];\\n\\nglobalThis.STORIES = normalizedStories;\\n\\n\\n// @ts-ignore\\nmodule?.hot?.accept?.();\\n\\n\\n\\nif (!globalThis.view) {\\n globalThis.view = start({\\n annotations,\\n storyEntries: normalizedStories,\\n\\n });\\n} else {\\n updateView(globalThis.view, annotations, normalizedStories);\\n}\\n\\nexport const view: View = globalThis.view;\\n"
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
|
-
exports[`loader > writeRequires > when only host is provided > includes STORYBOOK_WEBSOCKET with host and default port 1`] = `
|
|
14
|
-
"/* do not change this file, it is auto generated by storybook. */\\nimport { start, updateView, View } from '@storybook/react-native';\\n\\nimport \\"@storybook/addon-ondevice-notes/register\\";\\nimport \\"@storybook/addon-ondevice-controls/register\\";\\nimport \\"@storybook/addon-ondevice-backgrounds/register\\";\\nimport \\"@storybook/addon-ondevice-actions/register\\";\\n\\nconst normalizedStories = [\\n {\\n titlePrefix: \\"\\",\\n directory: \\"./scripts/mocks/all-config-files\\",\\n files: \\"FakeStory.stories.tsx\\",\\n importPathMatcher: /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/,\\n // @ts-ignore\\n req: require.context(\\n './',\\n false,\\n /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/\\n ),\\n }\\n];\\n\\n\\ndeclare global {\\n var view: View;\\n var STORIES: typeof normalizedStories;\\n var STORYBOOK_WEBSOCKET: { host: string; port: number } | undefined;\\n}\\n\\n\\nconst annotations = [\\n require('./preview'),\\n require(\\"@storybook/react-native/preview\\")\\n];\\n\\nglobalThis.STORIES = normalizedStories;\\nglobalThis.STORYBOOK_WEBSOCKET = { host: 'localhost', port: 7007 };\\n\\n// @ts-ignore\\nmodule?.hot?.accept?.();\\n\\n\\n\\nif (!globalThis.view) {\\n globalThis.view = start({\\n annotations,\\n storyEntries: normalizedStories,\\n\\n });\\n} else {\\n updateView(globalThis.view, annotations, normalizedStories);\\n}\\n\\nexport const view: View = globalThis.view;\\n"
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
exports[`loader > writeRequires > when only port is provided without host > does not include STORYBOOK_WEBSOCKET assignment 1`] = `
|
|
18
|
-
"/* do not change this file, it is auto generated by storybook. */\\nimport { start, updateView, View } from '@storybook/react-native';\\n\\nimport \\"@storybook/addon-ondevice-notes/register\\";\\nimport \\"@storybook/addon-ondevice-controls/register\\";\\nimport \\"@storybook/addon-ondevice-backgrounds/register\\";\\nimport \\"@storybook/addon-ondevice-actions/register\\";\\n\\nconst normalizedStories = [\\n {\\n titlePrefix: \\"\\",\\n directory: \\"./scripts/mocks/all-config-files\\",\\n files: \\"FakeStory.stories.tsx\\",\\n importPathMatcher: /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/,\\n // @ts-ignore\\n req: require.context(\\n './',\\n false,\\n /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/\\n ),\\n }\\n];\\n\\n\\ndeclare global {\\n var view: View;\\n var STORIES: typeof normalizedStories;\\n var STORYBOOK_WEBSOCKET: { host: string; port: number } | undefined;\\n}\\n\\n\\nconst annotations = [\\n require('./preview'),\\n require(\\"@storybook/react-native/preview\\")\\n];\\n\\nglobalThis.STORIES = normalizedStories;\\n\\n\\n// @ts-ignore\\nmodule?.hot?.accept?.();\\n\\n\\n\\nif (!globalThis.view) {\\n globalThis.view = start({\\n annotations,\\n storyEntries: normalizedStories,\\n\\n });\\n} else {\\n updateView(globalThis.view, annotations, normalizedStories);\\n}\\n\\nexport const view: View = globalThis.view;\\n"
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
exports[`loader > writeRequires > when there are different file extensions > writes the story imports 1`] = `
|
|
22
|
-
"/* do not change this file, it is auto generated by storybook. */\\nimport { start, updateView, View } from '@storybook/react-native';\\n\\nimport \\"@storybook/addon-ondevice-notes/register\\";\\nimport \\"@storybook/addon-ondevice-controls/register\\";\\nimport \\"@storybook/addon-ondevice-backgrounds/register\\";\\nimport \\"@storybook/addon-ondevice-actions/register\\";\\n\\nconst normalizedStories = [\\n {\\n titlePrefix: \\"\\",\\n directory: \\"./scripts/mocks/file-extensions\\",\\n files: \\"FakeStory.stories.tsx\\",\\n importPathMatcher: /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/,\\n // @ts-ignore\\n req: require.context(\\n './',\\n false,\\n /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/\\n ),\\n }\\n];\\n\\n\\ndeclare global {\\n var view: View;\\n var STORIES: typeof normalizedStories;\\n var STORYBOOK_WEBSOCKET: { host: string; port: number } | undefined;\\n}\\n\\n\\nconst annotations = [\\n require('./preview'),\\n require(\\"@storybook/react-native/preview\\")\\n];\\n\\nglobalThis.STORIES = normalizedStories;\\n\\n\\n// @ts-ignore\\nmodule?.hot?.accept?.();\\n\\n\\n\\nif (!globalThis.view) {\\n globalThis.view = start({\\n annotations,\\n storyEntries: normalizedStories,\\n\\n });\\n} else {\\n updateView(globalThis.view, annotations, normalizedStories);\\n}\\n\\nexport const view: View = globalThis.view;\\n"
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
exports[`loader > writeRequires > when there is a configuration object > writes the story imports 1`] = `
|
|
26
|
-
"/* do not change this file, it is auto generated by storybook. */\\nimport { start, updateView, View } from '@storybook/react-native';\\n\\nimport \\"@storybook/addon-ondevice-notes/register\\";\\nimport \\"@storybook/addon-ondevice-controls/register\\";\\nimport \\"@storybook/addon-ondevice-backgrounds/register\\";\\nimport \\"@storybook/addon-ondevice-actions/register\\";\\n\\nconst normalizedStories = [\\n {\\n titlePrefix: \\"ComponentsPrefix\\",\\n directory: \\"./scripts/mocks/configuration-objects/components\\",\\n files: \\"**/*.stories.tsx\\",\\n importPathMatcher: /^\\\\.(?:(?:^|\\\\/|(?:(?:(?!(?:^|\\\\/)\\\\.).)*?)\\\\/)(?!\\\\.)(?=.)[^/]*?\\\\.stories\\\\.tsx)$/,\\n // @ts-ignore\\n req: require.context(\\n './components',\\n true,\\n /^\\\\.(?:(?:^|\\\\/|(?:(?:(?!(?:^|\\\\/)\\\\.).)*?)\\\\/)(?!\\\\.)(?=.)[^/]*?\\\\.stories\\\\.tsx)$/\\n ),\\n }\\n];\\n\\n\\ndeclare global {\\n var view: View;\\n var STORIES: typeof normalizedStories;\\n var STORYBOOK_WEBSOCKET: { host: string; port: number } | undefined;\\n}\\n\\n\\nconst annotations = [\\n require('./preview'),\\n require(\\"@storybook/react-native/preview\\")\\n];\\n\\nglobalThis.STORIES = normalizedStories;\\n\\n\\n// @ts-ignore\\nmodule?.hot?.accept?.();\\n\\n\\n\\nif (!globalThis.view) {\\n globalThis.view = start({\\n annotations,\\n storyEntries: normalizedStories,\\n\\n });\\n} else {\\n updateView(globalThis.view, annotations, normalizedStories);\\n}\\n\\nexport const view: View = globalThis.view;\\n"
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
exports[`loader > writeRequires > when there is a story glob > writes the story imports 1`] = `
|
|
30
|
-
"/* do not change this file, it is auto generated by storybook. */\\nimport { start, updateView, View } from '@storybook/react-native';\\n\\nimport \\"@storybook/addon-ondevice-notes/register\\";\\nimport \\"@storybook/addon-ondevice-controls/register\\";\\nimport \\"@storybook/addon-ondevice-backgrounds/register\\";\\nimport \\"@storybook/addon-ondevice-actions/register\\";\\n\\nconst normalizedStories = [\\n {\\n titlePrefix: \\"\\",\\n directory: \\"./scripts/mocks/all-config-files\\",\\n files: \\"FakeStory.stories.tsx\\",\\n importPathMatcher: /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/,\\n // @ts-ignore\\n req: require.context(\\n './',\\n false,\\n /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/\\n ),\\n }\\n];\\n\\n\\ndeclare global {\\n var view: View;\\n var STORIES: typeof normalizedStories;\\n var STORYBOOK_WEBSOCKET: { host: string; port: number } | undefined;\\n}\\n\\n\\nconst annotations = [\\n require('./preview'),\\n require(\\"@storybook/react-native/preview\\")\\n];\\n\\nglobalThis.STORIES = normalizedStories;\\n\\n\\n// @ts-ignore\\nmodule?.hot?.accept?.();\\n\\n\\n\\nif (!globalThis.view) {\\n globalThis.view = start({\\n annotations,\\n storyEntries: normalizedStories,\\n\\n });\\n} else {\\n updateView(globalThis.view, annotations, normalizedStories);\\n}\\n\\nexport const view: View = globalThis.view;\\n"
|
|
31
|
-
`;
|
|
32
|
-
|
|
33
|
-
exports[`loader > writeRequires > when there is no preview > does not add preview related stuff 1`] = `
|
|
34
|
-
"/* do not change this file, it is auto generated by storybook. */\\nimport { start, updateView, View } from '@storybook/react-native';\\n\\nimport \\"@storybook/addon-ondevice-notes/register\\";\\nimport \\"@storybook/addon-ondevice-controls/register\\";\\nimport \\"@storybook/addon-ondevice-backgrounds/register\\";\\nimport \\"@storybook/addon-ondevice-actions/register\\";\\n\\nconst normalizedStories = [\\n {\\n titlePrefix: \\"\\",\\n directory: \\"./scripts/mocks/no-preview\\",\\n files: \\"FakeStory.stories.tsx\\",\\n importPathMatcher: /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/,\\n // @ts-ignore\\n req: require.context(\\n './',\\n false,\\n /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/\\n ),\\n }\\n];\\n\\n\\ndeclare global {\\n var view: View;\\n var STORIES: typeof normalizedStories;\\n var STORYBOOK_WEBSOCKET: { host: string; port: number } | undefined;\\n}\\n\\n\\nconst annotations = [\\n require(\\"@storybook/react-native/preview\\")\\n];\\n\\nglobalThis.STORIES = normalizedStories;\\n\\n\\n// @ts-ignore\\nmodule?.hot?.accept?.();\\n\\n\\n\\nif (!globalThis.view) {\\n globalThis.view = start({\\n annotations,\\n storyEntries: normalizedStories,\\n\\n });\\n} else {\\n updateView(globalThis.view, annotations, normalizedStories);\\n}\\n\\nexport const view: View = globalThis.view;\\n"
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
exports[`loader > writeRequires > when using js > writes the story imports without types 1`] = `
|
|
38
|
-
"/* do not change this file, it is auto generated by storybook. */\\nimport { start, updateView } from '@storybook/react-native';\\n\\nimport \\"@storybook/addon-ondevice-notes/register\\";\\nimport \\"@storybook/addon-ondevice-controls/register\\";\\nimport \\"@storybook/addon-ondevice-backgrounds/register\\";\\nimport \\"@storybook/addon-ondevice-actions/register\\";\\n\\nconst normalizedStories = [\\n {\\n titlePrefix: \\"\\",\\n directory: \\"./scripts/mocks/all-config-files\\",\\n files: \\"FakeStory.stories.tsx\\",\\n importPathMatcher: /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/,\\n \\n req: require.context(\\n './',\\n false,\\n /^\\\\.[\\\\\\\\/](?:FakeStory\\\\.stories\\\\.tsx)$/\\n ),\\n }\\n];\\n\\n\\n\\nconst annotations = [\\n require('./preview'),\\n require(\\"@storybook/react-native/preview\\")\\n];\\n\\nglobalThis.STORIES = normalizedStories;\\n\\n\\n\\nmodule?.hot?.accept?.();\\n\\n\\n\\nif (!globalThis.view) {\\n globalThis.view = start({\\n annotations,\\n storyEntries: normalizedStories,\\n\\n });\\n} else {\\n updateView(globalThis.view, annotations, normalizedStories);\\n}\\n\\nexport const view = globalThis.view;\\n"
|
|
39
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FakeComponent = () => null;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
|
|
4
|
-
|
|
5
|
-
export const decorators = [
|
|
6
|
-
(StoryFn) => (
|
|
7
|
-
<View style={styles.container}>
|
|
8
|
-
<StoryFn />
|
|
9
|
-
</View>
|
|
10
|
-
),
|
|
11
|
-
withBackgrounds,
|
|
12
|
-
];
|
|
13
|
-
export const parameters = {
|
|
14
|
-
my_param: 'anything',
|
|
15
|
-
backgrounds: [
|
|
16
|
-
{ name: 'plain', value: 'white', default: true },
|
|
17
|
-
{ name: 'warm', value: 'hotpink' },
|
|
18
|
-
{ name: 'cool', value: 'deepskyblue' },
|
|
19
|
-
],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const styles = StyleSheet.create({
|
|
23
|
-
container: { padding: 8, flex: 1 },
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FakeComponent = () => null;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
stories: [
|
|
3
|
-
{
|
|
4
|
-
files: '**/*.stories.tsx',
|
|
5
|
-
directory: './components',
|
|
6
|
-
titlePrefix: 'ComponentsPrefix',
|
|
7
|
-
},
|
|
8
|
-
],
|
|
9
|
-
addons: [
|
|
10
|
-
'@storybook/addon-ondevice-notes',
|
|
11
|
-
'@storybook/addon-ondevice-controls',
|
|
12
|
-
'@storybook/addon-ondevice-backgrounds',
|
|
13
|
-
'@storybook/addon-ondevice-actions',
|
|
14
|
-
],
|
|
15
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
|
|
4
|
-
|
|
5
|
-
export const decorators = [
|
|
6
|
-
(StoryFn) => (
|
|
7
|
-
<View style={styles.container}>
|
|
8
|
-
<StoryFn />
|
|
9
|
-
</View>
|
|
10
|
-
),
|
|
11
|
-
withBackgrounds,
|
|
12
|
-
];
|
|
13
|
-
export const parameters = {
|
|
14
|
-
my_param: 'anything',
|
|
15
|
-
backgrounds: [
|
|
16
|
-
{ name: 'plain', value: 'white', default: true },
|
|
17
|
-
{ name: 'warm', value: 'hotpink' },
|
|
18
|
-
{ name: 'cool', value: 'deepskyblue' },
|
|
19
|
-
],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const styles = StyleSheet.create({
|
|
23
|
-
container: { padding: 8, flex: 1 },
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FakeComponentExcluded = () => null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FakeComponent = () => null;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
stories: ['**/*.stories.tsx'],
|
|
3
|
-
reactNativeOptions: {
|
|
4
|
-
excludePaths: '**/exclude-components/**',
|
|
5
|
-
},
|
|
6
|
-
addons: [
|
|
7
|
-
'@storybook/addon-ondevice-notes',
|
|
8
|
-
'@storybook/addon-ondevice-controls',
|
|
9
|
-
'@storybook/addon-ondevice-backgrounds',
|
|
10
|
-
'@storybook/addon-ondevice-actions',
|
|
11
|
-
],
|
|
12
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
|
|
4
|
-
|
|
5
|
-
export const decorators = [
|
|
6
|
-
(StoryFn) => (
|
|
7
|
-
<View style={styles.container}>
|
|
8
|
-
<StoryFn />
|
|
9
|
-
</View>
|
|
10
|
-
),
|
|
11
|
-
withBackgrounds,
|
|
12
|
-
];
|
|
13
|
-
export const parameters = {
|
|
14
|
-
my_param: 'anything',
|
|
15
|
-
backgrounds: [
|
|
16
|
-
{ name: 'plain', value: 'white', default: true },
|
|
17
|
-
{ name: 'warm', value: 'hotpink' },
|
|
18
|
-
{ name: 'cool', value: 'deepskyblue' },
|
|
19
|
-
],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const styles = StyleSheet.create({
|
|
23
|
-
container: { padding: 8, flex: 1 },
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FakeComponent = () => null;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const config = {
|
|
2
|
-
stories: ['./FakeStory.stories.tsx'],
|
|
3
|
-
addons: [
|
|
4
|
-
'@storybook/addon-ondevice-notes',
|
|
5
|
-
'@storybook/addon-ondevice-controls',
|
|
6
|
-
'@storybook/addon-ondevice-backgrounds',
|
|
7
|
-
'@storybook/addon-ondevice-actions',
|
|
8
|
-
],
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default config;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { View, StyleSheet } from 'react-native';
|
|
2
|
-
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
|
|
3
|
-
|
|
4
|
-
export const decorators = [
|
|
5
|
-
(StoryFn) => (
|
|
6
|
-
<View style={styles.container}>
|
|
7
|
-
<StoryFn />
|
|
8
|
-
</View>
|
|
9
|
-
),
|
|
10
|
-
withBackgrounds,
|
|
11
|
-
];
|
|
12
|
-
export const parameters = {
|
|
13
|
-
my_param: 'anything',
|
|
14
|
-
backgrounds: [
|
|
15
|
-
{ name: 'plain', value: 'white', default: true },
|
|
16
|
-
{ name: 'warm', value: 'hotpink' },
|
|
17
|
-
{ name: 'cool', value: 'deepskyblue' },
|
|
18
|
-
],
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const styles = StyleSheet.create({
|
|
22
|
-
container: { padding: 8, flex: 1 },
|
|
23
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FakeComponent = () => null;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
|
|
4
|
-
|
|
5
|
-
export const decorators = [
|
|
6
|
-
(StoryFn) => (
|
|
7
|
-
<View style={styles.container}>
|
|
8
|
-
<StoryFn />
|
|
9
|
-
</View>
|
|
10
|
-
),
|
|
11
|
-
withBackgrounds,
|
|
12
|
-
];
|
|
13
|
-
export const parameters = {
|
|
14
|
-
my_param: 'anything',
|
|
15
|
-
backgrounds: [
|
|
16
|
-
{ name: 'plain', value: 'white', default: true },
|
|
17
|
-
{ name: 'warm', value: 'hotpink' },
|
|
18
|
-
{ name: 'cool', value: 'deepskyblue' },
|
|
19
|
-
],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const styles = StyleSheet.create({
|
|
23
|
-
container: { padding: 8, flex: 1 },
|
|
24
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
|
|
4
|
-
|
|
5
|
-
export const decorators = [
|
|
6
|
-
(StoryFn) => (
|
|
7
|
-
<View style={styles.container}>
|
|
8
|
-
<StoryFn />
|
|
9
|
-
</View>
|
|
10
|
-
),
|
|
11
|
-
withBackgrounds,
|
|
12
|
-
];
|
|
13
|
-
export const parameters = {
|
|
14
|
-
my_param: 'anything',
|
|
15
|
-
backgrounds: [
|
|
16
|
-
{ name: 'plain', value: 'white', default: true },
|
|
17
|
-
{ name: 'warm', value: 'hotpink' },
|
|
18
|
-
{ name: 'cool', value: 'deepskyblue' },
|
|
19
|
-
],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const styles = StyleSheet.create({
|
|
23
|
-
container: { padding: 8, flex: 1 },
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FakeComponent = () => null;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
|
|
4
|
-
|
|
5
|
-
export const decorators = [
|
|
6
|
-
(StoryFn) => (
|
|
7
|
-
<View style={styles.container}>
|
|
8
|
-
<StoryFn />
|
|
9
|
-
</View>
|
|
10
|
-
),
|
|
11
|
-
withBackgrounds,
|
|
12
|
-
];
|
|
13
|
-
export const parameters = {
|
|
14
|
-
my_param: 'anything',
|
|
15
|
-
backgrounds: [
|
|
16
|
-
{ name: 'plain', value: 'white', default: true },
|
|
17
|
-
{ name: 'warm', value: 'hotpink' },
|
|
18
|
-
{ name: 'cool', value: 'deepskyblue' },
|
|
19
|
-
],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const styles = StyleSheet.create({
|
|
23
|
-
container: { padding: 8, flex: 1 },
|
|
24
|
-
});
|