@storybook/react-native-web-vite 9.2.0-alpha.3 → 10.0.0-beta.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/README.md +3 -1
- package/dist/_node-chunks/chunk-LNZRDY2H.js +17 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -1
- package/dist/node/index.d.ts +31 -5
- package/dist/node/index.js +23 -1
- package/dist/preset.js +58 -1
- package/dist/vite-plugin.js +29 -1
- package/package.json +25 -43
- package/preset.js +1 -1
- package/dist/index.mjs +0 -2
- package/dist/node/index.mjs +0 -3
- package/dist/preset.d.ts +0 -13
- package/dist/vite-plugin.d.ts +0 -5
- package/dist/vite-plugin.mjs +0 -6
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
# Storybook for React Native Web & Vite
|
|
2
2
|
|
|
3
|
-
See [documentation](https://storybook.js.org/docs/get-started/frameworks/react-native-web-vite?renderer=react-native-web) for installation instructions, usage examples, APIs, and more.
|
|
3
|
+
See [documentation](https://storybook.js.org/docs/get-started/frameworks/react-native-web-vite?renderer=react-native-web&ref=readme) for installation instructions, usage examples, APIs, and more.
|
|
4
|
+
|
|
5
|
+
Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=readme).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_t0ohssugfc from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_t0ohssugfc from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_t0ohssugfc from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_t0ohssugfc.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_t0ohssugfc.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_t0ohssugfc.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
__name
|
|
17
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { __definePreview } from "@storybook/react";
|
|
3
|
+
export * from "@storybook/react";
|
|
4
|
+
export {
|
|
5
|
+
__definePreview as definePreview
|
|
6
|
+
};
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import 'storybook/
|
|
3
|
-
import '
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { CompatibleString } from 'storybook/internal/types';
|
|
2
|
+
import { StorybookConfig as StorybookConfig$1, FrameworkOptions as FrameworkOptions$1 } from '@storybook/react-vite';
|
|
3
|
+
import { Options, BabelOptions } from 'vite-plugin-rnw';
|
|
4
|
+
|
|
5
|
+
type FrameworkOptions = FrameworkOptions$1 & {
|
|
6
|
+
/**
|
|
7
|
+
* Many react native libraries aren't transpiled for the web, add them to this list to make sure
|
|
8
|
+
* they get transpiled before attempting to load them on the web. We will automatically add
|
|
9
|
+
* `react-native`, `@react-native`, `expo`, and `@expo` to this list.
|
|
10
|
+
*
|
|
11
|
+
* @example {modulesToTranspile: ['my-library']}
|
|
12
|
+
*/
|
|
13
|
+
modulesToTranspile?: string[];
|
|
14
|
+
pluginReactOptions?: Omit<Options, 'babel'> & {
|
|
15
|
+
babel?: BabelOptions;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated These options will be ignored. Use `pluginReactOptions` now for everything and
|
|
19
|
+
* override includes in order to transpile node_modules pluginBabelOptions will be removed in
|
|
20
|
+
* the next major version. To configure babel, use `pluginReactOptions.babel`.
|
|
21
|
+
*/
|
|
22
|
+
pluginBabelOptions?: Record<string, unknown>;
|
|
23
|
+
};
|
|
24
|
+
type FrameworkName = CompatibleString<'@storybook/react-native-web-vite'>;
|
|
25
|
+
/** The interface for Storybook configuration in `main.ts` files. */
|
|
26
|
+
type StorybookConfig = Omit<StorybookConfig$1, 'framework'> & {
|
|
27
|
+
framework: FrameworkName | {
|
|
28
|
+
name: FrameworkName;
|
|
29
|
+
options: FrameworkOptions;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
6
32
|
|
|
7
33
|
declare function defineMain(config: StorybookConfig): StorybookConfig;
|
|
8
34
|
|
package/dist/node/index.js
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_t0ohssugfc from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_t0ohssugfc from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_t0ohssugfc from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_t0ohssugfc.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_t0ohssugfc.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_t0ohssugfc.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__name
|
|
14
|
+
} from "../_node-chunks/chunk-LNZRDY2H.js";
|
|
15
|
+
|
|
16
|
+
// src/node/index.ts
|
|
17
|
+
function defineMain(config) {
|
|
18
|
+
return config;
|
|
19
|
+
}
|
|
20
|
+
__name(defineMain, "defineMain");
|
|
21
|
+
export {
|
|
22
|
+
defineMain
|
|
23
|
+
};
|
package/dist/preset.js
CHANGED
|
@@ -1 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_t0ohssugfc from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_t0ohssugfc from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_t0ohssugfc from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_t0ohssugfc.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_t0ohssugfc.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_t0ohssugfc.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__name
|
|
14
|
+
} from "./_node-chunks/chunk-LNZRDY2H.js";
|
|
15
|
+
|
|
16
|
+
// src/preset.ts
|
|
17
|
+
import { viteFinal as reactViteFinal } from "@storybook/react-vite/preset";
|
|
18
|
+
import { rnw } from "vite-plugin-rnw";
|
|
19
|
+
import tsconfigPaths from "vite-tsconfig-paths";
|
|
20
|
+
var getExcludeOptions = /* @__PURE__ */ __name((modulesToTranspile) => {
|
|
21
|
+
const defaultModulesToTranspile = ["react-native", "@react-native", "expo", "@expo"];
|
|
22
|
+
const uniqueModulesToTranspile = Array.from(
|
|
23
|
+
/* @__PURE__ */ new Set([...modulesToTranspile, ...defaultModulesToTranspile])
|
|
24
|
+
);
|
|
25
|
+
if (modulesToTranspile.length) {
|
|
26
|
+
return { exclude: new RegExp(`/node_modules/(?!${uniqueModulesToTranspile.join("|")})`) };
|
|
27
|
+
}
|
|
28
|
+
return {};
|
|
29
|
+
}, "getExcludeOptions");
|
|
30
|
+
var viteFinal = /* @__PURE__ */ __name(async (config, options) => {
|
|
31
|
+
const { mergeConfig } = await import("vite");
|
|
32
|
+
const { pluginReactOptions = {}, modulesToTranspile = [] } = await options.presets.apply("frameworkOptions");
|
|
33
|
+
const { plugins = [], ...reactConfigWithoutPlugins } = await reactViteFinal(config, options);
|
|
34
|
+
return mergeConfig(reactConfigWithoutPlugins, {
|
|
35
|
+
plugins: [
|
|
36
|
+
tsconfigPaths(),
|
|
37
|
+
rnw({
|
|
38
|
+
...getExcludeOptions(modulesToTranspile),
|
|
39
|
+
...pluginReactOptions,
|
|
40
|
+
jsxRuntime: pluginReactOptions.jsxRuntime || "automatic",
|
|
41
|
+
babel: {
|
|
42
|
+
babelrc: false,
|
|
43
|
+
configFile: false,
|
|
44
|
+
...pluginReactOptions.babel
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
...plugins
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
}, "viteFinal");
|
|
51
|
+
var core = {
|
|
52
|
+
builder: import.meta.resolve("@storybook/builder-vite"),
|
|
53
|
+
renderer: import.meta.resolve("@storybook/react/preset")
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
core,
|
|
57
|
+
viteFinal
|
|
58
|
+
};
|
package/dist/vite-plugin.js
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_t0ohssugfc from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_t0ohssugfc from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_t0ohssugfc from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_t0ohssugfc.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_t0ohssugfc.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_t0ohssugfc.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__name
|
|
14
|
+
} from "./_node-chunks/chunk-LNZRDY2H.js";
|
|
15
|
+
|
|
16
|
+
// src/vite-plugin.ts
|
|
17
|
+
import { rnw } from "vite-plugin-rnw";
|
|
18
|
+
import tsconfigPaths from "vite-tsconfig-paths";
|
|
19
|
+
var storybookReactNativeWeb = /* @__PURE__ */ __name(() => {
|
|
20
|
+
return [
|
|
21
|
+
tsconfigPaths(),
|
|
22
|
+
rnw({
|
|
23
|
+
jsxRuntime: "automatic"
|
|
24
|
+
})
|
|
25
|
+
];
|
|
26
|
+
}, "storybookReactNativeWeb");
|
|
27
|
+
export {
|
|
28
|
+
storybookReactNativeWeb
|
|
29
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-web-vite",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "10.0.0-beta.1",
|
|
4
|
+
"description": "Storybook for React Native Web and Vite: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"storybook"
|
|
6
|
+
"storybook",
|
|
7
|
+
"react-native",
|
|
8
|
+
"react-native-web",
|
|
9
|
+
"expo",
|
|
10
|
+
"expo-web",
|
|
11
|
+
"vite",
|
|
12
|
+
"component",
|
|
13
|
+
"components"
|
|
7
14
|
],
|
|
8
15
|
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/react-native-web-vite",
|
|
9
16
|
"bugs": {
|
|
@@ -19,33 +26,20 @@
|
|
|
19
26
|
"url": "https://opencollective.com/storybook"
|
|
20
27
|
},
|
|
21
28
|
"license": "MIT",
|
|
29
|
+
"type": "module",
|
|
22
30
|
"exports": {
|
|
23
31
|
".": {
|
|
24
32
|
"types": "./dist/index.d.ts",
|
|
25
|
-
"
|
|
26
|
-
"import": "./dist/index.mjs",
|
|
27
|
-
"require": "./dist/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./preset": {
|
|
30
|
-
"types": "./dist/preset.d.ts",
|
|
31
|
-
"require": "./dist/preset.js"
|
|
32
|
-
},
|
|
33
|
-
"./vite-plugin": {
|
|
34
|
-
"types": "./dist/vite-plugin.d.ts",
|
|
35
|
-
"import": "./dist/vite-plugin.mjs",
|
|
36
|
-
"require": "./dist/vite-plugin.js"
|
|
33
|
+
"default": "./dist/index.js"
|
|
37
34
|
},
|
|
38
35
|
"./node": {
|
|
39
36
|
"types": "./dist/node/index.d.ts",
|
|
40
|
-
"
|
|
41
|
-
"import": "./dist/node/index.mjs",
|
|
42
|
-
"require": "./dist/node/index.js"
|
|
37
|
+
"default": "./dist/node/index.js"
|
|
43
38
|
},
|
|
44
|
-
"./package.json": "./package.json"
|
|
39
|
+
"./package.json": "./package.json",
|
|
40
|
+
"./preset": "./dist/preset.js",
|
|
41
|
+
"./vite-plugin": "./dist/vite-plugin.js"
|
|
45
42
|
},
|
|
46
|
-
"main": "dist/index.js",
|
|
47
|
-
"module": "dist/index.mjs",
|
|
48
|
-
"types": "dist/index.d.ts",
|
|
49
43
|
"files": [
|
|
50
44
|
"dist/**/*",
|
|
51
45
|
"template/cli/**/*",
|
|
@@ -55,13 +49,13 @@
|
|
|
55
49
|
"!src/**/*"
|
|
56
50
|
],
|
|
57
51
|
"scripts": {
|
|
58
|
-
"check": "jiti ../../../scripts/
|
|
59
|
-
"prep": "jiti ../../../scripts/
|
|
52
|
+
"check": "jiti ../../../scripts/check/check-package.ts",
|
|
53
|
+
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
60
54
|
},
|
|
61
55
|
"dependencies": {
|
|
62
|
-
"@storybook/builder-vite": "
|
|
63
|
-
"@storybook/react": "
|
|
64
|
-
"@storybook/react-vite": "
|
|
56
|
+
"@storybook/builder-vite": "10.0.0-beta.1",
|
|
57
|
+
"@storybook/react": "10.0.0-beta.1",
|
|
58
|
+
"@storybook/react-vite": "10.0.0-beta.1",
|
|
65
59
|
"vite-plugin-rnw": "^0.0.6",
|
|
66
60
|
"vite-tsconfig-paths": "^5.1.4"
|
|
67
61
|
},
|
|
@@ -70,27 +64,15 @@
|
|
|
70
64
|
"typescript": "^5.8.3"
|
|
71
65
|
},
|
|
72
66
|
"peerDependencies": {
|
|
73
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
|
74
|
-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
|
67
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
68
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
75
69
|
"react-native": ">=0.74.5",
|
|
76
70
|
"react-native-web": "^0.19.12 || ^0.20.0",
|
|
77
|
-
"storybook": "^
|
|
71
|
+
"storybook": "^10.0.0-beta.1",
|
|
78
72
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
79
73
|
},
|
|
80
|
-
"engines": {
|
|
81
|
-
"node": ">=20.0.0"
|
|
82
|
-
},
|
|
83
74
|
"publishConfig": {
|
|
84
75
|
"access": "public"
|
|
85
76
|
},
|
|
86
|
-
"
|
|
87
|
-
"entries": [
|
|
88
|
-
"./src/index.ts",
|
|
89
|
-
"./src/preset.ts",
|
|
90
|
-
"./src/vite-plugin.ts",
|
|
91
|
-
"./src/node/index.ts"
|
|
92
|
-
],
|
|
93
|
-
"platform": "node"
|
|
94
|
-
},
|
|
95
|
-
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
|
|
77
|
+
"gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae16"
|
|
96
78
|
}
|
package/preset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './dist/preset.js';
|
package/dist/index.mjs
DELETED
package/dist/node/index.mjs
DELETED
package/dist/preset.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { StorybookConfig } from './index.js';
|
|
2
|
-
import 'storybook/internal/types';
|
|
3
|
-
import '@storybook/react-vite';
|
|
4
|
-
import 'vite-plugin-rnw';
|
|
5
|
-
import '@storybook/react';
|
|
6
|
-
|
|
7
|
-
declare const viteFinal: StorybookConfig['viteFinal'];
|
|
8
|
-
declare const core: {
|
|
9
|
-
builder: string;
|
|
10
|
-
renderer: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { core, viteFinal };
|
package/dist/vite-plugin.d.ts
DELETED