storybook-react-rsbuild 0.0.1-beta.0 → 0.0.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.
@@ -1,116 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/react-docs.ts
31
- var react_docs_exports = {};
32
- __export(react_docs_exports, {
33
- rsbuildFinal: () => rsbuildFinal
34
- });
35
- module.exports = __toCommonJS(react_docs_exports);
36
- var import_docs_tools = require("@storybook/docs-tools");
37
- var import_core = require("@rsbuild/core");
38
-
39
- // src/requirer.ts
40
- function requirer(resolver, path) {
41
- return resolver(path);
42
- }
43
-
44
- // src/react-docs.ts
45
- var rsbuildFinal = async (config, options) => {
46
- if (!(0, import_docs_tools.hasDocsOrControls)(options))
47
- return config;
48
- const typescriptOptions = await options.presets.apply("typescript", {});
49
- const debug = options.loglevel === "debug";
50
- const { reactDocgen, reactDocgenTypescriptOptions } = typescriptOptions || {};
51
- if (typeof reactDocgen !== "string") {
52
- return config;
53
- }
54
- if (reactDocgen !== "react-docgen-typescript") {
55
- return (0, import_core.mergeRsbuildConfig)(config, {
56
- tools: {
57
- rspack: {
58
- module: {
59
- rules: [
60
- {
61
- test: /\.(cjs|mjs|tsx?|jsx?)$/,
62
- enforce: "pre",
63
- loader: requirer(
64
- require.resolve,
65
- "@storybook/preset-react-webpack/dist/loaders/react-docgen-loader"
66
- ),
67
- options: {
68
- debug
69
- },
70
- exclude: /(\.(stories|story)\.(js|jsx|ts|tsx))|(node_modules)/
71
- }
72
- ]
73
- }
74
- }
75
- }
76
- });
77
- }
78
- const { ReactDocgenTypeScriptPlugin } = await import("@storybook/react-docgen-typescript-plugin");
79
- throw new Error(
80
- "Rspack didn't support the hooks `react-docgen-typescript`' required"
81
- );
82
- return (0, import_core.mergeRsbuildConfig)(config, {
83
- tools: {
84
- rspack: {
85
- module: {
86
- rules: [
87
- {
88
- test: /\.(cjs|mjs|jsx?)$/,
89
- enforce: "pre",
90
- loader: requirer(
91
- require.resolve,
92
- "@storybook/preset-react-webpack/dist/loaders/react-docgen-loader"
93
- ),
94
- options: {
95
- debug
96
- },
97
- exclude: /(\.(stories|story)\.(js|jsx|ts|tsx))|(node_modules)/
98
- }
99
- ]
100
- },
101
- plugins: [
102
- ...config.plugins || [],
103
- new ReactDocgenTypeScriptPlugin({
104
- ...reactDocgenTypescriptOptions,
105
- // We *need* this set so that RDT returns default values in the same format as react-docgen
106
- savePropValueAsString: true
107
- })
108
- ]
109
- }
110
- }
111
- });
112
- };
113
- // Annotate the CommonJS export names for ESM import in node:
114
- 0 && (module.exports = {
115
- rsbuildFinal
116
- });
@@ -1,7 +0,0 @@
1
- import {
2
- rsbuildFinal
3
- } from "./chunk-TNRF4JXJ.mjs";
4
- import "./chunk-77YOQVQO.mjs";
5
- export {
6
- rsbuildFinal
7
- };
package/dist/requirer.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/requirer.ts
21
- var requirer_exports = {};
22
- __export(requirer_exports, {
23
- requirer: () => requirer
24
- });
25
- module.exports = __toCommonJS(requirer_exports);
26
- function requirer(resolver, path) {
27
- return resolver(path);
28
- }
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- requirer
32
- });
package/dist/requirer.mjs DELETED
@@ -1,6 +0,0 @@
1
- import {
2
- requirer
3
- } from "./chunk-77YOQVQO.mjs";
4
- export {
5
- requirer
6
- };
package/dist/types.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types.ts
17
- var types_exports = {};
18
- module.exports = __toCommonJS(types_exports);
package/dist/types.mjs DELETED
@@ -1 +0,0 @@
1
- import "./chunk-WBQAMGXK.mjs";