@storybook/react-native 9.1.1-alpha.0 → 9.1.1-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/dist/index.d.ts +1 -1
- package/dist/index.js +15 -16
- package/dist/metro/withStorybook.js +8 -6
- package/dist/metro/withStorybookConfig.js +5 -8
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -123,4 +123,4 @@ interface StorybookConfig {
|
|
|
123
123
|
framework?: '@storybook/react-native';
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
export { InitialSelection, Params, Storage, StorybookConfig, ThemePartial, View, getProjectAnnotations, prepareStories, start, updateView };
|
|
126
|
+
export { type InitialSelection, type Params, type Storage, type StorybookConfig, type ThemePartial, View, getProjectAnnotations, prepareStories, start, updateView };
|
package/dist/index.js
CHANGED
|
@@ -27,8 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
29
|
// src/index.ts
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
32
|
darkTheme: () => import_react_native_theming3.darkTheme,
|
|
33
33
|
getProjectAnnotations: () => getProjectAnnotations,
|
|
34
34
|
prepareStories: () => prepareStories,
|
|
@@ -36,7 +36,7 @@ __export(src_exports, {
|
|
|
36
36
|
theme: () => import_react_native_theming3.theme,
|
|
37
37
|
updateView: () => updateView
|
|
38
38
|
});
|
|
39
|
-
module.exports = __toCommonJS(
|
|
39
|
+
module.exports = __toCommonJS(index_exports);
|
|
40
40
|
var import_react_native_theming3 = require("@storybook/react-native-theming");
|
|
41
41
|
|
|
42
42
|
// src/Start.tsx
|
|
@@ -915,8 +915,7 @@ var View3 = class {
|
|
|
915
915
|
this._asyncStorageStoryId = value;
|
|
916
916
|
}
|
|
917
917
|
const exists = value && this._storyIdExists(value);
|
|
918
|
-
if (!exists)
|
|
919
|
-
console.log("Storybook: could not find persisted story");
|
|
918
|
+
if (!exists) console.log("Storybook: could not find persisted story");
|
|
920
919
|
return { storySpecifier: exists ? value : "*", viewMode: "story" };
|
|
921
920
|
} catch (e) {
|
|
922
921
|
console.warn("storybook-log: error reading from async storage", e);
|
|
@@ -1200,22 +1199,23 @@ function prepareStories({
|
|
|
1200
1199
|
req.keys().forEach((filename) => {
|
|
1201
1200
|
try {
|
|
1202
1201
|
const fileExports = req(filename);
|
|
1203
|
-
if (!fileExports.default)
|
|
1204
|
-
return;
|
|
1202
|
+
if (!fileExports.default) return;
|
|
1205
1203
|
const meta = fileExports.default;
|
|
1206
1204
|
Object.keys(fileExports).forEach((key) => {
|
|
1207
|
-
if (key === "default")
|
|
1208
|
-
|
|
1209
|
-
if (!(0, import_csf2.isExportStory)(key, fileExports.default))
|
|
1210
|
-
return;
|
|
1205
|
+
if (key === "default") return;
|
|
1206
|
+
if (!(0, import_csf2.isExportStory)(key, fileExports.default)) return;
|
|
1211
1207
|
const exportValue = fileExports[key];
|
|
1212
|
-
if (!exportValue)
|
|
1213
|
-
return;
|
|
1208
|
+
if (!exportValue) return;
|
|
1214
1209
|
const title = makeTitle(filename, specifier, meta.title);
|
|
1215
1210
|
if (title) {
|
|
1216
1211
|
const nameFromExport = (0, import_csf2.storyNameFromExport)(key);
|
|
1217
1212
|
const id = (0, import_csf2.toId)(title, nameFromExport);
|
|
1218
|
-
|
|
1213
|
+
let name = nameFromExport;
|
|
1214
|
+
if (typeof exportValue === "function") {
|
|
1215
|
+
name = exportValue?.storyName || nameFromExport;
|
|
1216
|
+
} else {
|
|
1217
|
+
name = exportValue?.name || exportValue?.storyName || nameFromExport;
|
|
1218
|
+
}
|
|
1219
1219
|
index.entries[id] = {
|
|
1220
1220
|
type: "story",
|
|
1221
1221
|
id,
|
|
@@ -1228,8 +1228,7 @@ function prepareStories({
|
|
|
1228
1228
|
const importedStories = req(filename);
|
|
1229
1229
|
const stories = Object.entries(importedStories).reduce(
|
|
1230
1230
|
(carry, [storyKey, story]) => {
|
|
1231
|
-
if (!(0, import_csf2.isExportStory)(storyKey, fileExports.default))
|
|
1232
|
-
return carry;
|
|
1231
|
+
if (!(0, import_csf2.isExportStory)(storyKey, fileExports.default)) return carry;
|
|
1233
1232
|
if (story.play && !options?.playFn) {
|
|
1234
1233
|
carry[storyKey] = { ...story, play: void 0 };
|
|
1235
1234
|
} else {
|
|
@@ -69,8 +69,7 @@ var require_common = __commonJS({
|
|
|
69
69
|
return !!getFilePathExtension({ configPath }, "preview");
|
|
70
70
|
}
|
|
71
71
|
function resolveAddonFile(addon, file, extensions = ["js", "mjs", "ts"], configPath) {
|
|
72
|
-
if (!addon || typeof addon !== "string")
|
|
73
|
-
return null;
|
|
72
|
+
if (!addon || typeof addon !== "string") return null;
|
|
74
73
|
try {
|
|
75
74
|
const basePath = `${addon}/${file}`;
|
|
76
75
|
require.resolve(basePath);
|
|
@@ -97,10 +96,8 @@ var require_common = __commonJS({
|
|
|
97
96
|
return null;
|
|
98
97
|
}
|
|
99
98
|
function getAddonName(addon) {
|
|
100
|
-
if (typeof addon === "string")
|
|
101
|
-
|
|
102
|
-
if (typeof addon === "object" && addon.name && typeof addon.name === "string")
|
|
103
|
-
return addon.name;
|
|
99
|
+
if (typeof addon === "string") return addon;
|
|
100
|
+
if (typeof addon === "object" && addon.name && typeof addon.name === "string") return addon.name;
|
|
104
101
|
console.error("Invalid addon configuration", addon);
|
|
105
102
|
return null;
|
|
106
103
|
}
|
|
@@ -342,6 +339,11 @@ function withStorybook(config, options = {
|
|
|
342
339
|
type: "empty"
|
|
343
340
|
};
|
|
344
341
|
}
|
|
342
|
+
if (moduleName === "tty" || moduleName === "os") {
|
|
343
|
+
return {
|
|
344
|
+
type: "empty"
|
|
345
|
+
};
|
|
346
|
+
}
|
|
345
347
|
if (liteMode && resolveResult?.filePath?.includes?.("@storybook/react-native-ui") && !resolveResult?.filePath?.includes?.("@storybook/react-native-ui-lite") && !resolveResult?.filePath?.includes?.("@storybook/react-native-ui-common")) {
|
|
346
348
|
return {
|
|
347
349
|
type: "empty"
|
|
@@ -31,7 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
|
|
32
32
|
// scripts/common.js
|
|
33
33
|
var require_common = __commonJS({
|
|
34
|
-
"scripts/common.js"(
|
|
34
|
+
"scripts/common.js"(exports2, module2) {
|
|
35
35
|
var { globToRegexp, serverRequire } = require("storybook/internal/common");
|
|
36
36
|
var path2 = require("path");
|
|
37
37
|
var fs = require("fs");
|
|
@@ -74,8 +74,7 @@ var require_common = __commonJS({
|
|
|
74
74
|
return !!getFilePathExtension({ configPath }, "preview");
|
|
75
75
|
}
|
|
76
76
|
function resolveAddonFile(addon, file, extensions = ["js", "mjs", "ts"], configPath) {
|
|
77
|
-
if (!addon || typeof addon !== "string")
|
|
78
|
-
return null;
|
|
77
|
+
if (!addon || typeof addon !== "string") return null;
|
|
79
78
|
try {
|
|
80
79
|
const basePath = `${addon}/${file}`;
|
|
81
80
|
require.resolve(basePath);
|
|
@@ -102,10 +101,8 @@ var require_common = __commonJS({
|
|
|
102
101
|
return null;
|
|
103
102
|
}
|
|
104
103
|
function getAddonName(addon) {
|
|
105
|
-
if (typeof addon === "string")
|
|
106
|
-
|
|
107
|
-
if (typeof addon === "object" && addon.name && typeof addon.name === "string")
|
|
108
|
-
return addon.name;
|
|
104
|
+
if (typeof addon === "string") return addon;
|
|
105
|
+
if (typeof addon === "object" && addon.name && typeof addon.name === "string") return addon.name;
|
|
109
106
|
console.error("Invalid addon configuration", addon);
|
|
110
107
|
return null;
|
|
111
108
|
}
|
|
@@ -124,7 +121,7 @@ var require_common = __commonJS({
|
|
|
124
121
|
|
|
125
122
|
// scripts/generate.js
|
|
126
123
|
var require_generate = __commonJS({
|
|
127
|
-
"scripts/generate.js"(
|
|
124
|
+
"scripts/generate.js"(exports2, module2) {
|
|
128
125
|
var {
|
|
129
126
|
toRequireContext,
|
|
130
127
|
ensureRelativePathHasDot,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native",
|
|
3
|
-
"version": "9.1.1-alpha.
|
|
3
|
+
"version": "9.1.1-alpha.1",
|
|
4
4
|
"description": "A better way to develop React Native Components for your app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@storybook/global": "^5.0.0",
|
|
51
|
-
"@storybook/react": "^9.1.
|
|
52
|
-
"@storybook/react-native-theming": "^9.1.1-alpha.
|
|
53
|
-
"@storybook/react-native-ui": "^9.1.1-alpha.
|
|
54
|
-
"@storybook/react-native-ui-common": "^9.1.1-alpha.
|
|
51
|
+
"@storybook/react": "^9.1.2",
|
|
52
|
+
"@storybook/react-native-theming": "^9.1.1-alpha.1",
|
|
53
|
+
"@storybook/react-native-ui": "^9.1.1-alpha.1",
|
|
54
|
+
"@storybook/react-native-ui-common": "^9.1.1-alpha.1",
|
|
55
55
|
"commander": "^8.2.0",
|
|
56
56
|
"dedent": "^1.5.1",
|
|
57
57
|
"deepmerge": "^4.3.0",
|
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
"babel-jest": "^29.7.0",
|
|
68
68
|
"babel-preset-expo": "^12.0.9",
|
|
69
69
|
"jest": "^29.7.0",
|
|
70
|
-
"jest-expo": "~53.0.
|
|
70
|
+
"jest-expo": "~53.0.9",
|
|
71
71
|
"jotai": "^2.6.2",
|
|
72
72
|
"react": "19.0.0",
|
|
73
|
-
"react-native": "0.79.
|
|
73
|
+
"react-native": "0.79.5",
|
|
74
74
|
"react-test-renderer": "^19.1.0",
|
|
75
|
-
"storybook": "^9.1.
|
|
76
|
-
"tsup": "^
|
|
75
|
+
"storybook": "^9.1.2",
|
|
76
|
+
"tsup": "^8.5.0",
|
|
77
77
|
"typescript": "~5.8.3"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"publishConfig": {
|
|
106
106
|
"access": "public"
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "cc38bfb53177171ffb92d228c0bcde0e4d01d767"
|
|
109
109
|
}
|