storybook-vue3-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.
- package/LICENSE +1 -1
- package/README.md +1 -3
- package/dist/chunk-3EIOPNXP.mjs +57 -0
- package/dist/chunk-4WQDGMXE.mjs +57 -0
- package/dist/chunk-5UCYT2FA.mjs +66 -0
- package/dist/chunk-5ZQEOG4N.mjs +50 -0
- package/dist/chunk-A5GQNXZ2.mjs +58 -0
- package/dist/chunk-BWOSHFK4.mjs +44 -0
- package/dist/chunk-C26GBKJG.mjs +72 -0
- package/dist/chunk-CDFKRFI5.mjs +52 -0
- package/dist/chunk-CIPUH5EH.mjs +56 -0
- package/dist/chunk-D6UQSHGU.mjs +56 -0
- package/dist/chunk-DOD3HV6P.mjs +71 -0
- package/dist/chunk-I3W2BDYZ.mjs +71 -0
- package/dist/chunk-IDUKMUEB.mjs +52 -0
- package/dist/chunk-IH3TXYTU.mjs +72 -0
- package/dist/chunk-JZRX3EGM.mjs +74 -0
- package/dist/chunk-KLVY43ZM.mjs +44 -0
- package/dist/chunk-LBVFB7EC.mjs +47 -0
- package/dist/chunk-MPIQ664X.mjs +71 -0
- package/dist/chunk-MY2IYEFI.mjs +58 -0
- package/dist/chunk-O6KUUZA6.mjs +53 -0
- package/dist/chunk-PEWUKCXX.mjs +58 -0
- package/dist/chunk-PFDX7D2C.mjs +55 -0
- package/dist/chunk-PHFFO7A6.mjs +71 -0
- package/dist/chunk-PJZVTTEB.mjs +56 -0
- package/dist/chunk-Q2SNQVVN.mjs +57 -0
- package/dist/chunk-R57CWIPS.mjs +51 -0
- package/dist/chunk-RNDU3TK7.mjs +72 -0
- package/dist/chunk-RTN725VB.mjs +52 -0
- package/dist/chunk-SKTSBEAV.mjs +66 -0
- package/dist/chunk-TCBK3RAA.mjs +38 -0
- package/dist/chunk-TFF6KQ6T.mjs +73 -0
- package/dist/chunk-U3HZHJ2X.mjs +72 -0
- package/dist/chunk-U42XVPSO.mjs +53 -0
- package/dist/chunk-U4E5MR76.mjs +44 -0
- package/dist/chunk-UQ3S245P.mjs +56 -0
- package/dist/chunk-V5RZT43H.mjs +72 -0
- package/dist/chunk-VGEIG6F4.mjs +30 -0
- package/dist/chunk-WKGR473C.mjs +67 -0
- package/dist/chunk-X2B4PYBX.mjs +44 -0
- package/dist/chunk-YAXBE2N5.mjs +57 -0
- package/dist/chunk-ZSNEJSBE.mjs +56 -0
- package/dist/chunk-ZXIRSC62.mjs +47 -0
- package/dist/framework-preset-vue3-docs.d.mts +7 -0
- package/dist/framework-preset-vue3-docs.d.ts +7 -0
- package/dist/framework-preset-vue3-docs.js +72 -0
- package/dist/framework-preset-vue3-docs.mjs +6 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +27 -2
- package/dist/preset.d.mts +9 -0
- package/dist/preset.d.ts +10 -2
- package/dist/preset.mjs +11 -8
- package/dist/types.d.mts +26 -0
- package/dist/types.d.ts +26 -0
- package/dist/types.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-T3L66TVZ.mjs +0 -0
- package/dist/chunk-YXYUSZA3.mjs +0 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
3
|
+
}) : x)(function(x) {
|
4
|
+
if (typeof require !== "undefined")
|
5
|
+
return require.apply(this, arguments);
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
7
|
+
});
|
8
|
+
|
9
|
+
// src/framework-preset-vue3-docs.ts
|
10
|
+
import { hasDocsOrControls } from "@storybook/docs-tools";
|
11
|
+
var rsbuildFinal = (config, options) => {
|
12
|
+
if (!hasDocsOrControls(options))
|
13
|
+
return config;
|
14
|
+
console.log("\u{1F468}\u200D\u{1F3A4}111");
|
15
|
+
let vueDocgenOptions = {};
|
16
|
+
options.presetsList?.forEach((preset) => {
|
17
|
+
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
18
|
+
const appendableOptions = preset.options.vueDocgenOptions;
|
19
|
+
vueDocgenOptions = {
|
20
|
+
...vueDocgenOptions,
|
21
|
+
...appendableOptions
|
22
|
+
};
|
23
|
+
}
|
24
|
+
});
|
25
|
+
config.module?.rules?.push({
|
26
|
+
test: /\.vue$/,
|
27
|
+
loader: __require.resolve("vue-docgen-loader", {
|
28
|
+
paths: [__require.resolve("@storybook/preset-vue3-webpack")]
|
29
|
+
}),
|
30
|
+
enforce: "post",
|
31
|
+
options: {
|
32
|
+
docgenOptions: {
|
33
|
+
alias: config.resolve?.alias,
|
34
|
+
...vueDocgenOptions
|
35
|
+
}
|
36
|
+
}
|
37
|
+
});
|
38
|
+
return config;
|
39
|
+
};
|
40
|
+
|
41
|
+
export {
|
42
|
+
__require,
|
43
|
+
rsbuildFinal
|
44
|
+
};
|
@@ -0,0 +1,56 @@
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
3
|
+
}) : x)(function(x) {
|
4
|
+
if (typeof require !== "undefined")
|
5
|
+
return require.apply(this, arguments);
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
7
|
+
});
|
8
|
+
|
9
|
+
// src/framework-preset-vue3-docs.ts
|
10
|
+
import { hasDocsOrControls } from "@storybook/docs-tools";
|
11
|
+
import { mergeRsbuildConfig } from "@rsbuild/core";
|
12
|
+
var rsbuildFinal = (config, options) => {
|
13
|
+
if (!hasDocsOrControls(options))
|
14
|
+
return config;
|
15
|
+
let vueDocgenOptions = {};
|
16
|
+
options.presetsList?.forEach((preset) => {
|
17
|
+
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
18
|
+
const appendableOptions = preset.options.vueDocgenOptions;
|
19
|
+
vueDocgenOptions = {
|
20
|
+
...vueDocgenOptions,
|
21
|
+
...appendableOptions
|
22
|
+
};
|
23
|
+
}
|
24
|
+
});
|
25
|
+
const finalConfig = mergeRsbuildConfig(config, {
|
26
|
+
tools: {
|
27
|
+
rspack: {
|
28
|
+
module: {
|
29
|
+
rules: [
|
30
|
+
{
|
31
|
+
test: /\.vue$/,
|
32
|
+
use: "vue-docgen-loader",
|
33
|
+
loader: __require.resolve("vue-docgen-loader", {
|
34
|
+
// paths: [require.resolve('@storybook/preset-vue3-webpack')],
|
35
|
+
}),
|
36
|
+
enforce: "post",
|
37
|
+
options: {
|
38
|
+
docgenOptions: {
|
39
|
+
// alias: config.resolve?.alias,
|
40
|
+
...vueDocgenOptions
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
]
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
});
|
49
|
+
console.log("\u{1F463}", finalConfig.tools?.rspack);
|
50
|
+
return finalConfig;
|
51
|
+
};
|
52
|
+
|
53
|
+
export {
|
54
|
+
__require,
|
55
|
+
rsbuildFinal
|
56
|
+
};
|
@@ -0,0 +1,72 @@
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
3
|
+
}) : x)(function(x) {
|
4
|
+
if (typeof require !== "undefined")
|
5
|
+
return require.apply(this, arguments);
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
7
|
+
});
|
8
|
+
|
9
|
+
// src/framework-preset-vue3-docs.ts
|
10
|
+
import { hasDocsOrControls } from "@storybook/docs-tools";
|
11
|
+
import { mergeRsbuildConfig } from "@rsbuild/core";
|
12
|
+
var rsbuildFinal = (config, options) => {
|
13
|
+
if (!hasDocsOrControls(options))
|
14
|
+
return config;
|
15
|
+
let vueDocgenOptions = {};
|
16
|
+
options.presetsList?.forEach((preset) => {
|
17
|
+
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
18
|
+
const appendableOptions = preset.options.vueDocgenOptions;
|
19
|
+
vueDocgenOptions = {
|
20
|
+
...vueDocgenOptions,
|
21
|
+
...appendableOptions
|
22
|
+
};
|
23
|
+
}
|
24
|
+
});
|
25
|
+
const finalConfig = mergeRsbuildConfig(config, {
|
26
|
+
tools: {
|
27
|
+
// rspack: {
|
28
|
+
// module: {
|
29
|
+
// rules: [
|
30
|
+
// {
|
31
|
+
// test: /\.vue$/,
|
32
|
+
// // use: 'vue-docgen-loader',
|
33
|
+
// loader: require.resolve('vue-docgen-loader', {
|
34
|
+
// // paths: [require.resolve('@storybook/preset-vue3-webpack')],
|
35
|
+
// }),
|
36
|
+
// enforce: 'post',
|
37
|
+
// options: {
|
38
|
+
// docgenOptions: {
|
39
|
+
// // alias: config.resolve?.alias,
|
40
|
+
// ...vueDocgenOptions,
|
41
|
+
// },
|
42
|
+
// },
|
43
|
+
// },
|
44
|
+
// ],
|
45
|
+
// },
|
46
|
+
// },
|
47
|
+
rspack: (config2, { addRules, appendPlugins, rspack, mergeConfig }) => {
|
48
|
+
addRules({
|
49
|
+
test: /\.vue$/,
|
50
|
+
use: "vue-docgen-loader",
|
51
|
+
// loader: require.resolve('vue-docgen-loader', {
|
52
|
+
// paths: [require.resolve('@storybook/preset-vue3-webpack')],
|
53
|
+
// }),
|
54
|
+
enforce: "post",
|
55
|
+
options: {
|
56
|
+
docgenOptions: {
|
57
|
+
alias: config2.resolve?.alias,
|
58
|
+
...vueDocgenOptions
|
59
|
+
}
|
60
|
+
}
|
61
|
+
});
|
62
|
+
}
|
63
|
+
}
|
64
|
+
});
|
65
|
+
console.log("\u{1F463}", finalConfig.tools?.rspack);
|
66
|
+
return finalConfig;
|
67
|
+
};
|
68
|
+
|
69
|
+
export {
|
70
|
+
__require,
|
71
|
+
rsbuildFinal
|
72
|
+
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
3
|
+
}) : x)(function(x) {
|
4
|
+
if (typeof require !== "undefined")
|
5
|
+
return require.apply(this, arguments);
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
7
|
+
});
|
8
|
+
|
9
|
+
// src/framework-preset-vue3-docs.ts
|
10
|
+
import { hasDocsOrControls } from "@storybook/docs-tools";
|
11
|
+
var rsbuildFinal = (config, options) => {
|
12
|
+
if (!hasDocsOrControls(options))
|
13
|
+
return config;
|
14
|
+
let vueDocgenOptions = {};
|
15
|
+
options.presetsList?.forEach((preset) => {
|
16
|
+
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
17
|
+
const appendableOptions = preset.options.vueDocgenOptions;
|
18
|
+
vueDocgenOptions = {
|
19
|
+
...vueDocgenOptions,
|
20
|
+
...appendableOptions
|
21
|
+
};
|
22
|
+
}
|
23
|
+
});
|
24
|
+
return config;
|
25
|
+
};
|
26
|
+
|
27
|
+
export {
|
28
|
+
__require,
|
29
|
+
rsbuildFinal
|
30
|
+
};
|
@@ -0,0 +1,67 @@
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
3
|
+
}) : x)(function(x) {
|
4
|
+
if (typeof require !== "undefined")
|
5
|
+
return require.apply(this, arguments);
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
7
|
+
});
|
8
|
+
|
9
|
+
// src/framework-preset-vue3-docs.ts
|
10
|
+
import { hasDocsOrControls } from "@storybook/docs-tools";
|
11
|
+
import { mergeRsbuildConfig } from "@rsbuild/core";
|
12
|
+
var rsbuildFinal = (config, options) => {
|
13
|
+
if (!hasDocsOrControls(options))
|
14
|
+
return config;
|
15
|
+
let vueDocgenOptions = {};
|
16
|
+
options.presetsList?.forEach((preset) => {
|
17
|
+
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
18
|
+
const appendableOptions = preset.options.vueDocgenOptions;
|
19
|
+
vueDocgenOptions = {
|
20
|
+
...vueDocgenOptions,
|
21
|
+
...appendableOptions
|
22
|
+
};
|
23
|
+
}
|
24
|
+
});
|
25
|
+
console.log("\u{1F468}\u200D\u{1F3A4}111", vueDocgenOptions, config);
|
26
|
+
return mergeRsbuildConfig(
|
27
|
+
config,
|
28
|
+
{
|
29
|
+
tools: {
|
30
|
+
rspack: (config2, { addRules, appendPlugins, rspack, mergeConfig }) => {
|
31
|
+
addRules({
|
32
|
+
test: /\.vue$/,
|
33
|
+
use: "vue-docgen-loader",
|
34
|
+
// loader: require.resolve('vue-docgen-loader', {
|
35
|
+
// paths: [require.resolve('@storybook/preset-vue3-webpack')],
|
36
|
+
// }),
|
37
|
+
enforce: "post",
|
38
|
+
options: {
|
39
|
+
docgenOptions: {
|
40
|
+
alias: config2.resolve?.alias,
|
41
|
+
...vueDocgenOptions
|
42
|
+
}
|
43
|
+
}
|
44
|
+
});
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
// config.module?.rules?.push({
|
49
|
+
// test: /\.vue$/,
|
50
|
+
// loader: require.resolve('vue-docgen-loader', {
|
51
|
+
// paths: [require.resolve('@storybook/preset-vue3-webpack')],
|
52
|
+
// }),
|
53
|
+
// enforce: 'post',
|
54
|
+
// options: {
|
55
|
+
// docgenOptions: {
|
56
|
+
// alias: config.resolve?.alias,
|
57
|
+
// ...vueDocgenOptions,
|
58
|
+
// },
|
59
|
+
// },
|
60
|
+
// }),
|
61
|
+
);
|
62
|
+
};
|
63
|
+
|
64
|
+
export {
|
65
|
+
__require,
|
66
|
+
rsbuildFinal
|
67
|
+
};
|
@@ -0,0 +1,44 @@
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
3
|
+
}) : x)(function(x) {
|
4
|
+
if (typeof require !== "undefined")
|
5
|
+
return require.apply(this, arguments);
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
7
|
+
});
|
8
|
+
|
9
|
+
// src/framework-preset-vue3-docs.ts
|
10
|
+
import { hasDocsOrControls } from "@storybook/docs-tools";
|
11
|
+
var rsbuildFinal = (config, options) => {
|
12
|
+
if (!hasDocsOrControls(options))
|
13
|
+
return config;
|
14
|
+
let vueDocgenOptions = {};
|
15
|
+
options.presetsList?.forEach((preset) => {
|
16
|
+
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
17
|
+
const appendableOptions = preset.options.vueDocgenOptions;
|
18
|
+
vueDocgenOptions = {
|
19
|
+
...vueDocgenOptions,
|
20
|
+
...appendableOptions
|
21
|
+
};
|
22
|
+
}
|
23
|
+
});
|
24
|
+
console.log("\u{1F468}\u200D\u{1F3A4}111", vueDocgenOptions, config);
|
25
|
+
config.module?.rules?.push({
|
26
|
+
test: /\.vue$/,
|
27
|
+
loader: __require.resolve("vue-docgen-loader", {
|
28
|
+
paths: [__require.resolve("@storybook/preset-vue3-webpack")]
|
29
|
+
}),
|
30
|
+
enforce: "post",
|
31
|
+
options: {
|
32
|
+
docgenOptions: {
|
33
|
+
alias: config.resolve?.alias,
|
34
|
+
...vueDocgenOptions
|
35
|
+
}
|
36
|
+
}
|
37
|
+
});
|
38
|
+
return config;
|
39
|
+
};
|
40
|
+
|
41
|
+
export {
|
42
|
+
__require,
|
43
|
+
rsbuildFinal
|
44
|
+
};
|
@@ -0,0 +1,57 @@
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
3
|
+
}) : x)(function(x) {
|
4
|
+
if (typeof require !== "undefined")
|
5
|
+
return require.apply(this, arguments);
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
7
|
+
});
|
8
|
+
|
9
|
+
// src/framework-preset-vue3-docs.ts
|
10
|
+
import { hasDocsOrControls } from "@storybook/docs-tools";
|
11
|
+
import { mergeRsbuildConfig } from "@rsbuild/core";
|
12
|
+
var rsbuildFinal = (config, options) => {
|
13
|
+
if (!hasDocsOrControls(options))
|
14
|
+
return config;
|
15
|
+
let vueDocgenOptions = {};
|
16
|
+
options.presetsList?.forEach((preset) => {
|
17
|
+
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
18
|
+
const appendableOptions = preset.options.vueDocgenOptions;
|
19
|
+
vueDocgenOptions = {
|
20
|
+
...vueDocgenOptions,
|
21
|
+
...appendableOptions
|
22
|
+
};
|
23
|
+
}
|
24
|
+
});
|
25
|
+
const finalConfig = mergeRsbuildConfig(config, {
|
26
|
+
tools: {
|
27
|
+
rspack: (config2, { mergeConfig }) => {
|
28
|
+
return mergeConfig(config2, {
|
29
|
+
module: {
|
30
|
+
rules: [
|
31
|
+
{
|
32
|
+
test: /\.vue$/,
|
33
|
+
loader: __require.resolve("vue-docgen-loader", {
|
34
|
+
// paths: [require.resolve('@storybook/preset-vue3-webpack')],
|
35
|
+
}),
|
36
|
+
enforce: "post",
|
37
|
+
options: {
|
38
|
+
docgenOptions: {
|
39
|
+
alias: config2.resolve?.alias,
|
40
|
+
...vueDocgenOptions
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
]
|
45
|
+
}
|
46
|
+
});
|
47
|
+
}
|
48
|
+
}
|
49
|
+
});
|
50
|
+
console.log("\u{1F463}", finalConfig.tools?.rspack);
|
51
|
+
return finalConfig;
|
52
|
+
};
|
53
|
+
|
54
|
+
export {
|
55
|
+
__require,
|
56
|
+
rsbuildFinal
|
57
|
+
};
|
@@ -0,0 +1,56 @@
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
3
|
+
}) : x)(function(x) {
|
4
|
+
if (typeof require !== "undefined")
|
5
|
+
return require.apply(this, arguments);
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
7
|
+
});
|
8
|
+
|
9
|
+
// src/framework-preset-vue3-docs.ts
|
10
|
+
import { hasDocsOrControls } from "@storybook/docs-tools";
|
11
|
+
import { mergeRsbuildConfig } from "@rsbuild/core";
|
12
|
+
var rsbuildFinal = (config, options) => {
|
13
|
+
if (!hasDocsOrControls(options))
|
14
|
+
return config;
|
15
|
+
let vueDocgenOptions = {};
|
16
|
+
options.presetsList?.forEach((preset) => {
|
17
|
+
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
18
|
+
const appendableOptions = preset.options.vueDocgenOptions;
|
19
|
+
vueDocgenOptions = {
|
20
|
+
...vueDocgenOptions,
|
21
|
+
...appendableOptions
|
22
|
+
};
|
23
|
+
}
|
24
|
+
});
|
25
|
+
const finalConfig = mergeRsbuildConfig(config, {
|
26
|
+
tools: {
|
27
|
+
rspack: {
|
28
|
+
module: {
|
29
|
+
rules: [
|
30
|
+
{
|
31
|
+
// test: /\.vue$/,
|
32
|
+
use: "vue-docgen-loader",
|
33
|
+
loader: __require.resolve("vue-docgen-loader", {
|
34
|
+
// paths: [require.resolve('@storybook/preset-vue3-webpack')],
|
35
|
+
}),
|
36
|
+
enforce: "post",
|
37
|
+
options: {
|
38
|
+
docgenOptions: {
|
39
|
+
// alias: config.resolve?.alias,
|
40
|
+
...vueDocgenOptions
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
]
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
});
|
49
|
+
console.log("\u{1F463}", finalConfig.tools?.rspack);
|
50
|
+
return finalConfig;
|
51
|
+
};
|
52
|
+
|
53
|
+
export {
|
54
|
+
__require,
|
55
|
+
rsbuildFinal
|
56
|
+
};
|
@@ -0,0 +1,47 @@
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
3
|
+
}) : x)(function(x) {
|
4
|
+
if (typeof require !== "undefined")
|
5
|
+
return require.apply(this, arguments);
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
7
|
+
});
|
8
|
+
|
9
|
+
// src/framework-preset-vue3-docs.ts
|
10
|
+
import { hasDocsOrControls } from "@storybook/docs-tools";
|
11
|
+
import { mergeRsbuildConfig } from "@rsbuild/core";
|
12
|
+
var rsbuildFinal = (config, options) => {
|
13
|
+
if (!hasDocsOrControls(options))
|
14
|
+
return config;
|
15
|
+
let vueDocgenOptions = {};
|
16
|
+
options.presetsList?.forEach((preset) => {
|
17
|
+
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
18
|
+
const appendableOptions = preset.options.vueDocgenOptions;
|
19
|
+
vueDocgenOptions = {
|
20
|
+
...vueDocgenOptions,
|
21
|
+
...appendableOptions
|
22
|
+
};
|
23
|
+
}
|
24
|
+
});
|
25
|
+
console.log("\u{1F468}\u200D\u{1F3A4}111", vueDocgenOptions, config);
|
26
|
+
return mergeRsbuildConfig(
|
27
|
+
config
|
28
|
+
// config.module?.rules?.push({
|
29
|
+
// test: /\.vue$/,
|
30
|
+
// loader: require.resolve('vue-docgen-loader', {
|
31
|
+
// paths: [require.resolve('@storybook/preset-vue3-webpack')],
|
32
|
+
// }),
|
33
|
+
// enforce: 'post',
|
34
|
+
// options: {
|
35
|
+
// docgenOptions: {
|
36
|
+
// alias: config.resolve?.alias,
|
37
|
+
// ...vueDocgenOptions,
|
38
|
+
// },
|
39
|
+
// },
|
40
|
+
// }),
|
41
|
+
);
|
42
|
+
};
|
43
|
+
|
44
|
+
export {
|
45
|
+
__require,
|
46
|
+
rsbuildFinal
|
47
|
+
};
|
@@ -0,0 +1,72 @@
|
|
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/framework-preset-vue3-docs.ts
|
21
|
+
var framework_preset_vue3_docs_exports = {};
|
22
|
+
__export(framework_preset_vue3_docs_exports, {
|
23
|
+
rsbuildFinal: () => rsbuildFinal
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(framework_preset_vue3_docs_exports);
|
26
|
+
var import_docs_tools = require("@storybook/docs-tools");
|
27
|
+
var import_core = require("@rsbuild/core");
|
28
|
+
var rsbuildFinal = (config, options) => {
|
29
|
+
if (!(0, import_docs_tools.hasDocsOrControls)(options))
|
30
|
+
return config;
|
31
|
+
let vueDocgenOptions = {};
|
32
|
+
options.presetsList?.forEach((preset) => {
|
33
|
+
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
34
|
+
const appendableOptions = preset.options.vueDocgenOptions;
|
35
|
+
vueDocgenOptions = {
|
36
|
+
...vueDocgenOptions,
|
37
|
+
...appendableOptions
|
38
|
+
};
|
39
|
+
}
|
40
|
+
});
|
41
|
+
const finalConfig = (0, import_core.mergeRsbuildConfig)(config, {
|
42
|
+
tools: {
|
43
|
+
rspack: (config2, { mergeConfig }) => {
|
44
|
+
return mergeConfig(config2, {
|
45
|
+
module: {
|
46
|
+
rules: [
|
47
|
+
{
|
48
|
+
test: /\.vue$/,
|
49
|
+
loader: require.resolve("vue-docgen-loader", {
|
50
|
+
// paths: [require.resolve('@storybook/preset-vue3-webpack')],
|
51
|
+
}),
|
52
|
+
enforce: "post",
|
53
|
+
options: {
|
54
|
+
docgenOptions: {
|
55
|
+
alias: config2.resolve?.alias,
|
56
|
+
...vueDocgenOptions
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
]
|
61
|
+
}
|
62
|
+
});
|
63
|
+
}
|
64
|
+
}
|
65
|
+
});
|
66
|
+
console.log("\u{1F463}", finalConfig.tools?.rspack);
|
67
|
+
return finalConfig;
|
68
|
+
};
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
70
|
+
0 && (module.exports = {
|
71
|
+
rsbuildFinal
|
72
|
+
});
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
CHANGED
@@ -1,2 +1,27 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import { StorybookConfig as StorybookConfig$1 } from '@storybook/types';
|
2
|
+
import { BuilderOptions, StorybookConfigRsbuild } from 'storybook-builder-rsbuild';
|
3
|
+
|
4
|
+
type FrameworkName = 'storybook-vue3-rsbuild';
|
5
|
+
type BuilderName = 'storybook-builder-rsbuild';
|
6
|
+
type FrameworkOptions = {
|
7
|
+
builder?: BuilderOptions;
|
8
|
+
};
|
9
|
+
type StorybookConfigFramework = {
|
10
|
+
framework: FrameworkName | {
|
11
|
+
name: FrameworkName;
|
12
|
+
options: FrameworkOptions;
|
13
|
+
};
|
14
|
+
core?: StorybookConfig$1['core'] & {
|
15
|
+
builder?: BuilderName | {
|
16
|
+
name: BuilderName;
|
17
|
+
options: BuilderOptions;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
typescript?: StorybookConfig$1['typescript'];
|
21
|
+
};
|
22
|
+
/**
|
23
|
+
* The interface for Storybook configuration in `main.ts` files.
|
24
|
+
*/
|
25
|
+
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigRsbuild | keyof StorybookConfigFramework> & StorybookConfigRsbuild & StorybookConfigFramework;
|
26
|
+
|
27
|
+
export { FrameworkOptions, StorybookConfig };
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { PresetProperty } from '@storybook/types';
|
2
|
+
export { rsbuildFinal } from './framework-preset-vue3-docs.mjs';
|
3
|
+
import './types.mjs';
|
4
|
+
import '@storybook/builder-rsbuild';
|
5
|
+
|
6
|
+
declare const core: PresetProperty<'core'>;
|
7
|
+
declare const typescript: PresetProperty<'typescript'>;
|
8
|
+
|
9
|
+
export { core, typescript };
|
package/dist/preset.d.ts
CHANGED
@@ -1,2 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import { PresetProperty } from '@storybook/types';
|
2
|
+
import { StorybookConfig } from './index.js';
|
3
|
+
import 'storybook-builder-rsbuild';
|
4
|
+
|
5
|
+
declare const rsbuildFinal: StorybookConfig['rsbuildFinal'];
|
6
|
+
|
7
|
+
declare const core: PresetProperty<'core'>;
|
8
|
+
declare const typescript: PresetProperty<'typescript'>;
|
9
|
+
|
10
|
+
export { core, rsbuildFinal, typescript };
|
package/dist/preset.mjs
CHANGED
@@ -1,10 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
return require.apply(this, arguments);
|
6
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
7
|
-
});
|
1
|
+
import {
|
2
|
+
__require,
|
3
|
+
rsbuildFinal
|
4
|
+
} from "./chunk-YAXBE2N5.mjs";
|
8
5
|
|
9
6
|
// src/preset.ts
|
10
7
|
import { dirname, join } from "path";
|
@@ -19,6 +16,12 @@ var core = async (config, options) => {
|
|
19
16
|
renderer: getAbsolutePath("@storybook/vue3")
|
20
17
|
};
|
21
18
|
};
|
19
|
+
var typescript = async (config) => ({
|
20
|
+
...config,
|
21
|
+
skipCompiler: true
|
22
|
+
});
|
22
23
|
export {
|
23
|
-
core
|
24
|
+
core,
|
25
|
+
rsbuildFinal,
|
26
|
+
typescript
|
24
27
|
};
|