@storybook/react-native-web-vite 10.1.0-alpha.1 → 10.1.0-alpha.11
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 +2 -4
- package/dist/node/index.d.ts +2 -4
- package/dist/node/index.js +6 -10
- package/dist/preset.js +14 -25
- package/dist/vite-plugin.js +12 -17
- package/package.json +7 -7
- package/dist/_node-chunks/chunk-QAC77B3E.js +0 -17
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CompatibleString } from 'storybook/internal/types';
|
|
2
2
|
import { FrameworkOptions as FrameworkOptions$1, StorybookConfig as StorybookConfig$1 } from '@storybook/react-vite';
|
|
3
|
-
import {
|
|
3
|
+
import { RnwOptions } from 'vite-plugin-rnw';
|
|
4
4
|
export * from '@storybook/react';
|
|
5
5
|
export { __definePreview as definePreview } from '@storybook/react';
|
|
6
6
|
|
|
@@ -13,9 +13,7 @@ type FrameworkOptions = FrameworkOptions$1 & {
|
|
|
13
13
|
* @example {modulesToTranspile: ['my-library']}
|
|
14
14
|
*/
|
|
15
15
|
modulesToTranspile?: string[];
|
|
16
|
-
pluginReactOptions?:
|
|
17
|
-
babel?: BabelOptions;
|
|
18
|
-
};
|
|
16
|
+
pluginReactOptions?: RnwOptions;
|
|
19
17
|
/**
|
|
20
18
|
* @deprecated These options will be ignored. Use `pluginReactOptions` now for everything and
|
|
21
19
|
* override includes in order to transpile node_modules pluginBabelOptions will be removed in
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CompatibleString } from 'storybook/internal/types';
|
|
2
2
|
import { StorybookConfig as StorybookConfig$1, FrameworkOptions as FrameworkOptions$1 } from '@storybook/react-vite';
|
|
3
|
-
import {
|
|
3
|
+
import { RnwOptions } from 'vite-plugin-rnw';
|
|
4
4
|
|
|
5
5
|
type FrameworkOptions = FrameworkOptions$1 & {
|
|
6
6
|
/**
|
|
@@ -11,9 +11,7 @@ type FrameworkOptions = FrameworkOptions$1 & {
|
|
|
11
11
|
* @example {modulesToTranspile: ['my-library']}
|
|
12
12
|
*/
|
|
13
13
|
modulesToTranspile?: string[];
|
|
14
|
-
pluginReactOptions?:
|
|
15
|
-
babel?: BabelOptions;
|
|
16
|
-
};
|
|
14
|
+
pluginReactOptions?: RnwOptions;
|
|
17
15
|
/**
|
|
18
16
|
* @deprecated These options will be ignored. Use `pluginReactOptions` now for everything and
|
|
19
17
|
* override includes in order to transpile node_modules pluginBabelOptions will be removed in
|
package/dist/node/index.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_x316jkrqlys from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_x316jkrqlys from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_x316jkrqlys from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_x316jkrqlys.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_x316jkrqlys.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_x316jkrqlys.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "../_node-chunks/chunk-QAC77B3E.js";
|
|
15
12
|
|
|
16
13
|
// src/node/index.ts
|
|
17
14
|
function defineMain(config) {
|
|
18
15
|
return config;
|
|
19
16
|
}
|
|
20
|
-
__name(defineMain, "defineMain");
|
|
21
17
|
export {
|
|
22
18
|
defineMain
|
|
23
19
|
};
|
package/dist/preset.js
CHANGED
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_x316jkrqlys from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_x316jkrqlys from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_x316jkrqlys from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_x316jkrqlys.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_x316jkrqlys.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_x316jkrqlys.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "./_node-chunks/chunk-QAC77B3E.js";
|
|
15
12
|
|
|
16
13
|
// src/preset.ts
|
|
17
14
|
import { viteFinal as reactViteFinal } from "@storybook/react-vite/preset";
|
|
18
15
|
import { rnw } from "vite-plugin-rnw";
|
|
19
16
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
20
|
-
var getExcludeOptions =
|
|
21
|
-
|
|
22
|
-
const uniqueModulesToTranspile = Array.from(
|
|
17
|
+
var getExcludeOptions = (modulesToTranspile) => {
|
|
18
|
+
let defaultModulesToTranspile = ["react-native", "@react-native", "expo", "@expo"], uniqueModulesToTranspile = Array.from(
|
|
23
19
|
/* @__PURE__ */ new Set([...modulesToTranspile, ...defaultModulesToTranspile])
|
|
24
20
|
);
|
|
25
|
-
|
|
26
|
-
|
|
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);
|
|
21
|
+
return modulesToTranspile.length ? { exclude: new RegExp(`/node_modules/(?!${uniqueModulesToTranspile.join("|")})`) } : {};
|
|
22
|
+
}, viteFinal = async (config, options) => {
|
|
23
|
+
let { mergeConfig } = await import("vite"), { pluginReactOptions = {}, modulesToTranspile = [] } = await options.presets.apply("frameworkOptions"), { plugins = [], ...reactConfigWithoutPlugins } = await reactViteFinal(config, options);
|
|
34
24
|
return mergeConfig(reactConfigWithoutPlugins, {
|
|
35
25
|
plugins: [
|
|
36
26
|
tsconfigPaths(),
|
|
@@ -39,16 +29,15 @@ var viteFinal = /* @__PURE__ */ __name(async (config, options) => {
|
|
|
39
29
|
...pluginReactOptions,
|
|
40
30
|
jsxRuntime: pluginReactOptions.jsxRuntime || "automatic",
|
|
41
31
|
babel: {
|
|
42
|
-
babelrc:
|
|
43
|
-
configFile:
|
|
32
|
+
babelrc: !1,
|
|
33
|
+
configFile: !1,
|
|
44
34
|
...pluginReactOptions.babel
|
|
45
35
|
}
|
|
46
36
|
}),
|
|
47
37
|
...plugins
|
|
48
38
|
]
|
|
49
39
|
});
|
|
50
|
-
},
|
|
51
|
-
var core = {
|
|
40
|
+
}, core = {
|
|
52
41
|
builder: import.meta.resolve("@storybook/builder-vite"),
|
|
53
42
|
renderer: import.meta.resolve("@storybook/react/preset")
|
|
54
43
|
};
|
package/dist/vite-plugin.js
CHANGED
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_x316jkrqlys from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_x316jkrqlys from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_x316jkrqlys from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_x316jkrqlys.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_x316jkrqlys.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_x316jkrqlys.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "./_node-chunks/chunk-QAC77B3E.js";
|
|
15
12
|
|
|
16
13
|
// src/vite-plugin.ts
|
|
17
14
|
import { rnw } from "vite-plugin-rnw";
|
|
18
15
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
19
|
-
var storybookReactNativeWeb =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
];
|
|
26
|
-
}, "storybookReactNativeWeb");
|
|
16
|
+
var storybookReactNativeWeb = () => [
|
|
17
|
+
tsconfigPaths(),
|
|
18
|
+
rnw({
|
|
19
|
+
jsxRuntime: "automatic"
|
|
20
|
+
})
|
|
21
|
+
];
|
|
27
22
|
export {
|
|
28
23
|
storybookReactNativeWeb
|
|
29
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-web-vite",
|
|
3
|
-
"version": "10.1.0-alpha.
|
|
3
|
+
"version": "10.1.0-alpha.11",
|
|
4
4
|
"description": "Storybook for React Native Web and Vite: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@storybook/builder-vite": "10.1.0-alpha.
|
|
57
|
-
"@storybook/react": "10.1.0-alpha.
|
|
58
|
-
"@storybook/react-vite": "10.1.0-alpha.
|
|
59
|
-
"vite-plugin-rnw": "^0.0.
|
|
56
|
+
"@storybook/builder-vite": "10.1.0-alpha.11",
|
|
57
|
+
"@storybook/react": "10.1.0-alpha.11",
|
|
58
|
+
"@storybook/react-vite": "10.1.0-alpha.11",
|
|
59
|
+
"vite-plugin-rnw": "^0.0.10",
|
|
60
60
|
"vite-tsconfig-paths": "^5.1.4"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
69
69
|
"react-native": ">=0.74.5",
|
|
70
70
|
"react-native-web": "^0.19.12 || ^0.20.0 || ^0.21.0",
|
|
71
|
-
"storybook": "^10.1.0-alpha.
|
|
71
|
+
"storybook": "^10.1.0-alpha.11",
|
|
72
72
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae1l"
|
|
78
78
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_fngx3vlky4 from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_fngx3vlky4 from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_fngx3vlky4 from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_fngx3vlky4.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_fngx3vlky4.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_fngx3vlky4.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
|
-
};
|