storybook-vue3-rsbuild 2.1.6 → 3.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/dist/_node-chunks/chunk-R7WAQDKE.js +21 -0
- package/dist/index.d.ts +3 -28
- package/dist/index.js +1 -23
- package/dist/node/index.d.ts +3 -8
- package/dist/node/index.js +14 -26
- package/dist/preset.js +54 -87
- package/package.json +15 -25
- package/preset.js +1 -1
- package/dist/index.mjs +0 -1
- package/dist/node/index.mjs +0 -6
- package/dist/preset.d.ts +0 -11
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_48dbf71c7755f051 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_48dbf71c7755f051 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_48dbf71c7755f051 from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_48dbf71c7755f051.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_48dbf71c7755f051.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_48dbf71c7755f051.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
var __require = /* @__PURE__ */ ((x) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(x, {
|
|
13
|
+
get: (a, b) => (typeof require < "u" ? require : a)[b]
|
|
14
|
+
}) : x)(function(x) {
|
|
15
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
16
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
__require
|
|
21
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type FrameworkName = 'storybook-vue3-rsbuild';
|
|
6
|
-
type BuilderName = 'storybook-builder-rsbuild';
|
|
7
|
-
type FrameworkOptions = {
|
|
8
|
-
builder?: BuilderOptions;
|
|
9
|
-
};
|
|
10
|
-
type StorybookConfigFramework = {
|
|
11
|
-
framework: FrameworkName | {
|
|
12
|
-
name: FrameworkName;
|
|
13
|
-
options: FrameworkOptions;
|
|
14
|
-
};
|
|
15
|
-
core?: StorybookConfig$1['core'] & {
|
|
16
|
-
builder?: BuilderName | {
|
|
17
|
-
name: BuilderName;
|
|
18
|
-
options: BuilderOptions;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
typescript?: Partial<TypescriptOptions & TypescriptOptions$1>;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* The interface for Storybook configuration in `main.ts` files.
|
|
25
|
-
*/
|
|
26
|
-
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigRsbuild | keyof StorybookConfigFramework> & StorybookConfigRsbuild & StorybookConfigFramework;
|
|
27
|
-
|
|
28
|
-
export { FrameworkOptions, StorybookConfig };
|
|
1
|
+
// auto generated file from file:///Users/bytedance/Projects/storybook-rsbuild/scripts/build/utils/generate-type-mappers.ts, do not edit
|
|
2
|
+
export * from '../src/index.ts';
|
|
3
|
+
export type * from '../src/index.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
|
|
17
1
|
// src/index.ts
|
|
18
|
-
|
|
19
|
-
module.exports = __toCommonJS(src_exports);
|
|
20
|
-
__reExport(src_exports, require("@storybook/vue3"), module.exports);
|
|
21
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
-
0 && (module.exports = {
|
|
23
|
-
...require("@storybook/vue3")
|
|
24
|
-
});
|
|
2
|
+
export * from "@storybook/vue3";
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import 'storybook/internal/types';
|
|
5
|
-
|
|
6
|
-
declare function defineMain(config: StorybookConfig): StorybookConfig;
|
|
7
|
-
|
|
8
|
-
export { defineMain };
|
|
1
|
+
// auto generated file from file:///Users/bytedance/Projects/storybook-rsbuild/scripts/build/utils/generate-type-mappers.ts, do not edit
|
|
2
|
+
export * from '../../src/node/index.ts';
|
|
3
|
+
export type * from '../../src/node/index.ts';
|
package/dist/node/index.js
CHANGED
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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);
|
|
1
|
+
import CJS_COMPAT_NODE_URL_48dbf71c7755f051 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_48dbf71c7755f051 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_48dbf71c7755f051 from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_48dbf71c7755f051.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_48dbf71c7755f051.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_48dbf71c7755f051.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import "../_node-chunks/chunk-R7WAQDKE.js";
|
|
19
13
|
|
|
20
14
|
// src/node/index.ts
|
|
21
|
-
var node_exports = {};
|
|
22
|
-
__export(node_exports, {
|
|
23
|
-
defineMain: () => defineMain
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(node_exports);
|
|
26
15
|
function defineMain(config) {
|
|
27
16
|
return config;
|
|
28
17
|
}
|
|
29
|
-
|
|
30
|
-
0 && (module.exports = {
|
|
18
|
+
export {
|
|
31
19
|
defineMain
|
|
32
|
-
}
|
|
20
|
+
};
|
package/dist/preset.js
CHANGED
|
@@ -1,119 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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);
|
|
1
|
+
import CJS_COMPAT_NODE_URL_48dbf71c7755f051 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_48dbf71c7755f051 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_48dbf71c7755f051 from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_48dbf71c7755f051.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_48dbf71c7755f051.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_48dbf71c7755f051.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__require
|
|
14
|
+
} from "./_node-chunks/chunk-R7WAQDKE.js";
|
|
29
15
|
|
|
30
16
|
// src/preset.ts
|
|
31
|
-
|
|
32
|
-
__export(preset_exports, {
|
|
33
|
-
core: () => core,
|
|
34
|
-
rsbuildFinal: () => rsbuildFinal,
|
|
35
|
-
typescript: () => typescript
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(preset_exports);
|
|
38
|
-
var import_node_path = require("path");
|
|
17
|
+
import { dirname, join } from "node:path";
|
|
39
18
|
|
|
40
19
|
// src/framework-preset-vue3.ts
|
|
41
|
-
|
|
20
|
+
import { mergeRsbuildConfig } from "@rsbuild/core";
|
|
42
21
|
var rsbuildFinalDoc = (config, options) => {
|
|
43
22
|
let vueDocgenOptions = {};
|
|
44
|
-
for (
|
|
23
|
+
for (let preset of options.presetsList || [])
|
|
45
24
|
if (preset.name.includes("addon-docs") && preset.options.vueDocgenOptions) {
|
|
46
|
-
|
|
25
|
+
let appendableOptions = preset.options.vueDocgenOptions;
|
|
47
26
|
vueDocgenOptions = {
|
|
48
27
|
...vueDocgenOptions,
|
|
49
28
|
...appendableOptions
|
|
50
29
|
};
|
|
51
30
|
}
|
|
52
|
-
}
|
|
53
31
|
return {
|
|
54
32
|
tools: {
|
|
55
|
-
rspack: (config2, { mergeConfig }) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
...vueDocgenOptions
|
|
69
|
-
}
|
|
33
|
+
rspack: (config2, { mergeConfig }) => mergeConfig(config2, {
|
|
34
|
+
module: {
|
|
35
|
+
rules: [
|
|
36
|
+
{
|
|
37
|
+
test: /\.vue$/,
|
|
38
|
+
loader: __require.resolve("vue-docgen-loader", {
|
|
39
|
+
// paths: [require.resolve('@storybook/preset-vue3-webpack')],
|
|
40
|
+
}),
|
|
41
|
+
enforce: "post",
|
|
42
|
+
options: {
|
|
43
|
+
docgenOptions: {
|
|
44
|
+
alias: config2.resolve?.alias,
|
|
45
|
+
...vueDocgenOptions
|
|
70
46
|
}
|
|
71
47
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
})
|
|
76
52
|
}
|
|
77
53
|
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
// Port https://github.com/storybookjs/storybook/blob/4224713c21c1f1ada8aca68db1b855dfad7f6975/code/presets/vue3-webpack/src/framework-preset-vue3.ts#L59.
|
|
85
|
-
vue$: require.resolve("vue/dist/vue.esm-bundler.js")
|
|
86
|
-
}
|
|
54
|
+
}, rsbuildFinalBase = (config, options) => ({
|
|
55
|
+
resolve: {
|
|
56
|
+
alias: {
|
|
57
|
+
// https://github.com/fengyuanchen/vue-feather/issues/8
|
|
58
|
+
// Port https://github.com/storybookjs/storybook/blob/4224713c21c1f1ada8aca68db1b855dfad7f6975/code/presets/vue3-webpack/src/framework-preset-vue3.ts#L59.
|
|
59
|
+
vue$: __require.resolve("vue/dist/vue.esm-bundler.js")
|
|
87
60
|
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
rsbuildFinalDoc(config, options)
|
|
95
|
-
);
|
|
96
|
-
};
|
|
61
|
+
}
|
|
62
|
+
}), rsbuildFinal = (config, options) => mergeRsbuildConfig(
|
|
63
|
+
config,
|
|
64
|
+
rsbuildFinalBase(config, options),
|
|
65
|
+
rsbuildFinalDoc(config, options)
|
|
66
|
+
);
|
|
97
67
|
|
|
98
68
|
// src/preset.ts
|
|
99
|
-
var getAbsolutePath = (input) =>
|
|
100
|
-
|
|
101
|
-
const framework = await options.presets.apply("framework");
|
|
69
|
+
var getAbsolutePath = (input) => dirname(__require.resolve(join(input, "package.json"))), core = async (config, options) => {
|
|
70
|
+
let framework = await options.presets.apply("framework");
|
|
102
71
|
return {
|
|
103
72
|
builder: {
|
|
104
73
|
name: getAbsolutePath("storybook-builder-rsbuild"),
|
|
105
|
-
options: typeof framework
|
|
74
|
+
options: typeof framework == "string" ? {} : framework.options.builder || {}
|
|
106
75
|
},
|
|
107
76
|
renderer: getAbsolutePath("@storybook/vue3")
|
|
108
77
|
};
|
|
109
|
-
}
|
|
110
|
-
var typescript = async (config) => ({
|
|
78
|
+
}, typescript = async (config) => ({
|
|
111
79
|
...config,
|
|
112
|
-
skipCompiler:
|
|
80
|
+
skipCompiler: !0
|
|
113
81
|
});
|
|
114
|
-
|
|
115
|
-
0 && (module.exports = {
|
|
82
|
+
export {
|
|
116
83
|
core,
|
|
117
84
|
rsbuildFinal,
|
|
118
85
|
typescript
|
|
119
|
-
}
|
|
86
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook-vue3-rsbuild",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.1",
|
|
4
4
|
"description": "Storybook for Vue3 and Rsbuild: Develop React Component in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -18,30 +18,20 @@
|
|
|
18
18
|
"directory": "packages/framework-vue3"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
|
+
"type": "module",
|
|
21
22
|
"exports": {
|
|
22
23
|
".": {
|
|
23
24
|
"types": "./dist/index.d.ts",
|
|
24
|
-
"
|
|
25
|
-
"require": "./dist/index.js",
|
|
26
|
-
"import": "./dist/index.mjs"
|
|
27
|
-
},
|
|
28
|
-
"./preset": {
|
|
29
|
-
"types": "./dist/preset.d.ts",
|
|
30
|
-
"require": "./dist/preset.js"
|
|
31
|
-
},
|
|
32
|
-
"./react-docs": {
|
|
33
|
-
"types": "./dist/react-docs.d.ts",
|
|
34
|
-
"require": "./dist/react-docs.js"
|
|
25
|
+
"default": "./dist/index.js"
|
|
35
26
|
},
|
|
36
27
|
"./node": {
|
|
37
28
|
"types": "./dist/node/index.d.ts",
|
|
38
|
-
"
|
|
39
|
-
"import": "./dist/node/index.mjs",
|
|
40
|
-
"require": "./dist/node/index.js"
|
|
29
|
+
"default": "./dist/node/index.js"
|
|
41
30
|
},
|
|
42
|
-
"./package.json": "./package.json"
|
|
31
|
+
"./package.json": "./package.json",
|
|
32
|
+
"./preset": "./dist/preset.js"
|
|
43
33
|
},
|
|
44
|
-
"main": "dist/index.
|
|
34
|
+
"main": "dist/index.mjs",
|
|
45
35
|
"module": "dist/index.mjs",
|
|
46
36
|
"types": "dist/index.d.ts",
|
|
47
37
|
"files": [
|
|
@@ -52,20 +42,20 @@
|
|
|
52
42
|
"!src/**/*"
|
|
53
43
|
],
|
|
54
44
|
"dependencies": {
|
|
55
|
-
"@storybook/vue3": "^
|
|
45
|
+
"@storybook/vue3": "^10.0.0",
|
|
56
46
|
"vue-docgen-loader": "^2.0.1",
|
|
57
|
-
"storybook-builder-rsbuild": "
|
|
47
|
+
"storybook-builder-rsbuild": "3.0.0-beta.1"
|
|
58
48
|
},
|
|
59
49
|
"devDependencies": {
|
|
60
50
|
"@rsbuild/core": "^1.5.17",
|
|
61
|
-
"@types/node": "^
|
|
62
|
-
"storybook": "
|
|
51
|
+
"@types/node": "^22.0.0",
|
|
52
|
+
"storybook": "10.0.7",
|
|
63
53
|
"typescript": "^5.9.3",
|
|
64
54
|
"vue": "^3.5.22"
|
|
65
55
|
},
|
|
66
56
|
"peerDependencies": {
|
|
67
57
|
"@rsbuild/core": "^1.5.0",
|
|
68
|
-
"storybook": "^
|
|
58
|
+
"storybook": "^10.0.0",
|
|
69
59
|
"vue": "^3.0.0"
|
|
70
60
|
},
|
|
71
61
|
"engines": {
|
|
@@ -83,8 +73,8 @@
|
|
|
83
73
|
"platform": "node"
|
|
84
74
|
},
|
|
85
75
|
"scripts": {
|
|
86
|
-
"build": "pnpm run prep
|
|
87
|
-
"check": "jiti ../../scripts/
|
|
88
|
-
"prep": "jiti ../../scripts/
|
|
76
|
+
"build": "pnpm run prep",
|
|
77
|
+
"check": "jiti ../../scripts/check/check-package.ts",
|
|
78
|
+
"prep": "jiti ../../scripts/build/build-package.ts"
|
|
89
79
|
}
|
|
90
80
|
}
|
package/preset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './dist/preset.js'
|
package/dist/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@storybook/vue3';
|
package/dist/node/index.mjs
DELETED
package/dist/preset.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PresetProperty } from 'storybook/internal/types';
|
|
2
|
-
import { StorybookConfig } from './index.js';
|
|
3
|
-
import '@storybook/vue3';
|
|
4
|
-
import 'storybook-builder-rsbuild';
|
|
5
|
-
|
|
6
|
-
declare const rsbuildFinal: StorybookConfig['rsbuildFinal'];
|
|
7
|
-
|
|
8
|
-
declare const core: PresetProperty<'core'>;
|
|
9
|
-
declare const typescript: PresetProperty<'typescript'>;
|
|
10
|
-
|
|
11
|
-
export { core, rsbuildFinal, typescript };
|