@storybook/react-native-web-vite 9.2.0-alpha.3 → 10.0.0-beta.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/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_26qqtucyrc4 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_26qqtucyrc4 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_26qqtucyrc4 from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_26qqtucyrc4.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_26qqtucyrc4.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_26qqtucyrc4.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
@@ -32,4 +32,4 @@ type StorybookConfig = Omit<StorybookConfig$1, 'framework'> & {
32
32
  };
33
33
  };
34
34
 
35
- export { FrameworkOptions, StorybookConfig };
35
+ export type { FrameworkOptions, StorybookConfig };
package/dist/index.js CHANGED
@@ -1 +1,6 @@
1
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default"));var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var index_exports={};__export(index_exports,{definePreview:()=>import_react.__definePreview});module.exports=__toCommonJS(index_exports);var import_react=require("@storybook/react");__reExport(index_exports,require("@storybook/react"),module.exports);0&&(module.exports={definePreview,...require("@storybook/react")});
1
+ // src/index.ts
2
+ import { __definePreview } from "@storybook/react";
3
+ export * from "@storybook/react";
4
+ export {
5
+ __definePreview as definePreview
6
+ };
@@ -1,8 +1,34 @@
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';
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
 
@@ -1 +1,23 @@
1
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var node_exports={};__export(node_exports,{defineMain:()=>defineMain});module.exports=__toCommonJS(node_exports);function defineMain(config){return config}0&&(module.exports={defineMain});
1
+ import CJS_COMPAT_NODE_URL_26qqtucyrc4 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_26qqtucyrc4 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_26qqtucyrc4 from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_26qqtucyrc4.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_26qqtucyrc4.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_26qqtucyrc4.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-J2DWSUSB.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
- "use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{core:()=>core,viteFinal:()=>viteFinal});module.exports=__toCommonJS(preset_exports);var import_preset=require("@storybook/react-vite/preset"),import_vite_plugin_rnw=require("vite-plugin-rnw"),import_vite_tsconfig_paths=__toESM(require("vite-tsconfig-paths")),getExcludeOptions=modulesToTranspile=>{let defaultModulesToTranspile=["react-native","@react-native","expo","@expo"],uniqueModulesToTranspile=Array.from(new Set([...modulesToTranspile,...defaultModulesToTranspile]));return modulesToTranspile.length?{exclude:new RegExp(`/node_modules/(?!${uniqueModulesToTranspile.join("|")})`)}:{}},viteFinal=async(config,options)=>{let{mergeConfig}=await import("vite"),{pluginReactOptions={},modulesToTranspile=[]}=await options.presets.apply("frameworkOptions"),{plugins=[],...reactConfigWithoutPlugins}=await(0,import_preset.viteFinal)(config,options);return mergeConfig(reactConfigWithoutPlugins,{plugins:[(0,import_vite_tsconfig_paths.default)(),(0,import_vite_plugin_rnw.rnw)({...getExcludeOptions(modulesToTranspile),...pluginReactOptions,jsxRuntime:pluginReactOptions.jsxRuntime||"automatic",babel:{babelrc:!1,configFile:!1,...pluginReactOptions.babel}}),...plugins]})},core={builder:"@storybook/builder-vite",renderer:"@storybook/react"};0&&(module.exports={core,viteFinal});
1
+ import CJS_COMPAT_NODE_URL_26qqtucyrc4 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_26qqtucyrc4 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_26qqtucyrc4 from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_26qqtucyrc4.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_26qqtucyrc4.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_26qqtucyrc4.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-J2DWSUSB.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
+ };
@@ -1 +1,29 @@
1
- "use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var vite_plugin_exports={};__export(vite_plugin_exports,{storybookReactNativeWeb:()=>storybookReactNativeWeb});module.exports=__toCommonJS(vite_plugin_exports);var import_vite_plugin_rnw=require("vite-plugin-rnw"),import_vite_tsconfig_paths=__toESM(require("vite-tsconfig-paths")),storybookReactNativeWeb=()=>[(0,import_vite_tsconfig_paths.default)(),(0,import_vite_plugin_rnw.rnw)({jsxRuntime:"automatic"})];0&&(module.exports={storybookReactNativeWeb});
1
+ import CJS_COMPAT_NODE_URL_26qqtucyrc4 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_26qqtucyrc4 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_26qqtucyrc4 from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_26qqtucyrc4.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_26qqtucyrc4.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_26qqtucyrc4.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-J2DWSUSB.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": "9.2.0-alpha.3",
4
- "description": "Develop react-native components an isolated web environment with hot reloading.",
3
+ "version": "10.0.0-beta.0",
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
- "node": "./dist/index.js",
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
- "node": "./dist/node/index.js",
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/prepare/check.ts",
59
- "prep": "jiti ../../../scripts/prepare/bundle.ts"
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": "9.2.0-alpha.3",
63
- "@storybook/react": "9.2.0-alpha.3",
64
- "@storybook/react-vite": "9.2.0-alpha.3",
56
+ "@storybook/builder-vite": "10.0.0-beta.0",
57
+ "@storybook/react": "10.0.0-beta.0",
58
+ "@storybook/react-vite": "10.0.0-beta.0",
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-beta",
74
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
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": "^9.2.0-alpha.3",
71
+ "storybook": "^10.0.0-beta.0",
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
- "bundler": {
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
- module.exports = require('./dist/preset');
1
+ export * from './dist/preset.js';
package/dist/index.mjs DELETED
@@ -1,2 +0,0 @@
1
- export * from '@storybook/react';
2
- export { __definePreview as definePreview } from '@storybook/react';
@@ -1,3 +0,0 @@
1
- function defineMain(config){return config}
2
-
3
- export { defineMain };
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 };
@@ -1,5 +0,0 @@
1
- import * as vite from 'vite';
2
-
3
- declare const storybookReactNativeWeb: () => (vite.Plugin<any> | vite.Plugin<any>[])[];
4
-
5
- export { storybookReactNativeWeb };
@@ -1,6 +0,0 @@
1
- import { rnw } from 'vite-plugin-rnw';
2
- import tsconfigPaths from 'vite-tsconfig-paths';
3
-
4
- var storybookReactNativeWeb=()=>[tsconfigPaths(),rnw({jsxRuntime:"automatic"})];
5
-
6
- export { storybookReactNativeWeb };