storybook-builder-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/compiled/@storybook/core-webpack/index.d.ts +4 -3066
- package/compiled/@storybook/core-webpack/index.js +323 -281
- package/compiled/@storybook/core-webpack/package.json +1 -1
- package/dist/_node-chunks/chunk-MIMCYZFR.js +45 -0
- package/dist/index.d.ts +3 -72
- package/dist/index.js +423 -650
- package/dist/loaders/export-order-loader.js +31 -52
- package/dist/preview-preset.js +17 -39
- package/package.json +17 -30
- package/dist/chunk-TTFRSOOU.mjs +0 -34
- package/dist/index.mjs +0 -947
- package/dist/loaders/export-order-loader.d.ts +0 -5
- package/dist/loaders/export-order-loader.mjs +0 -49
- package/dist/preview-preset.d.ts +0 -3
|
@@ -1,66 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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);
|
|
1
|
+
import CJS_COMPAT_NODE_URL_c7aef05d0183c9d0 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_c7aef05d0183c9d0 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_c7aef05d0183c9d0 from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_c7aef05d0183c9d0.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_c7aef05d0183c9d0.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_c7aef05d0183c9d0.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import "../_node-chunks/chunk-MIMCYZFR.js";
|
|
29
13
|
|
|
30
14
|
// src/loaders/export-order-loader.ts
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
module.exports = __toCommonJS(export_order_loader_exports);
|
|
36
|
-
var import_node_assert = __toESM(require("assert"));
|
|
37
|
-
var import_cjs_module_lexer = require("cjs-module-lexer");
|
|
38
|
-
var import_es_module_lexer = require("es-module-lexer");
|
|
39
|
-
var import_magic_string = __toESM(require("magic-string"));
|
|
15
|
+
import assert from "node:assert";
|
|
16
|
+
import { init as initCjsParser, parse as parseCjs } from "cjs-module-lexer";
|
|
17
|
+
import { parse as parseEs } from "es-module-lexer";
|
|
18
|
+
import MagicString from "magic-string";
|
|
40
19
|
async function loader(source, map, meta) {
|
|
41
|
-
|
|
20
|
+
let callback = this.async();
|
|
42
21
|
try {
|
|
43
|
-
|
|
22
|
+
let magicString = new MagicString(source);
|
|
44
23
|
try {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
(0, import_node_assert.default)(
|
|
24
|
+
let namedExportsOrder = ((await parseEs(source))[1] || []).map((e) => source.substring(e.s, e.e)).filter((e) => e !== "default");
|
|
25
|
+
assert(
|
|
48
26
|
namedExportsOrder.length > 0,
|
|
49
27
|
"No named exports found. Very likely that this is not a ES module."
|
|
50
|
-
)
|
|
51
|
-
magicString.append(
|
|
28
|
+
), magicString.append(
|
|
52
29
|
`;export const __namedExportsOrder = ${JSON.stringify(namedExportsOrder)};`
|
|
53
30
|
);
|
|
54
31
|
} catch {
|
|
55
|
-
await (
|
|
56
|
-
|
|
32
|
+
await initCjsParser();
|
|
33
|
+
let namedExportsOrder = (parseCjs(source).exports || []).filter(
|
|
57
34
|
(e) => e !== "default" && e !== "__esModule"
|
|
58
35
|
);
|
|
59
|
-
(
|
|
36
|
+
assert(
|
|
60
37
|
namedExportsOrder.length > 0,
|
|
61
38
|
"No named exports found. Very likely that this is not a CJS module."
|
|
62
|
-
)
|
|
63
|
-
magicString.append(
|
|
39
|
+
), magicString.append(
|
|
64
40
|
`;module.exports.__namedExportsOrder = ${JSON.stringify(namedExportsOrder)};`
|
|
65
41
|
);
|
|
66
42
|
}
|
|
@@ -68,13 +44,16 @@ async function loader(source, map, meta) {
|
|
|
68
44
|
null,
|
|
69
45
|
magicString.toString(),
|
|
70
46
|
map ?? magicString.generateMap({
|
|
71
|
-
hires:
|
|
72
|
-
includeContent:
|
|
47
|
+
hires: !0,
|
|
48
|
+
includeContent: !0,
|
|
73
49
|
source: this.resourcePath
|
|
74
50
|
}),
|
|
75
51
|
meta
|
|
76
52
|
);
|
|
77
|
-
} catch
|
|
53
|
+
} catch {
|
|
78
54
|
return callback(null, source, map, meta);
|
|
79
55
|
}
|
|
80
56
|
}
|
|
57
|
+
export {
|
|
58
|
+
loader as default
|
|
59
|
+
};
|
package/dist/preview-preset.js
CHANGED
|
@@ -1,42 +1,20 @@
|
|
|
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_c7aef05d0183c9d0 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_c7aef05d0183c9d0 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_c7aef05d0183c9d0 from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_c7aef05d0183c9d0.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_c7aef05d0183c9d0.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_c7aef05d0183c9d0.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-MIMCYZFR.js";
|
|
29
15
|
|
|
30
16
|
// src/preview-preset.ts
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
previewMainTemplate: () => previewMainTemplate
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(preview_preset_exports);
|
|
36
|
-
var previewMainTemplate = () => {
|
|
37
|
-
return require.resolve("storybook-builder-rsbuild/templates/preview.ejs");
|
|
38
|
-
};
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
17
|
+
var previewMainTemplate = () => __require.resolve("storybook-builder-rsbuild/templates/preview.ejs");
|
|
18
|
+
export {
|
|
41
19
|
previewMainTemplate
|
|
42
|
-
}
|
|
20
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook-builder-rsbuild",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.1",
|
|
4
4
|
"description": "Rsbuild builder for Storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -17,33 +17,19 @@
|
|
|
17
17
|
"directory": "packages/builder-rsbuild"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
|
+
"type": "module",
|
|
20
21
|
"exports": {
|
|
21
22
|
".": {
|
|
22
23
|
"types": "./dist/index.d.ts",
|
|
23
|
-
"
|
|
24
|
-
"require": "./dist/index.js",
|
|
25
|
-
"import": "./dist/index.mjs"
|
|
24
|
+
"default": "./dist/index.js"
|
|
26
25
|
},
|
|
27
|
-
"./
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"require": "./dist/presets/custom-rsbuild-preset.js"
|
|
31
|
-
},
|
|
32
|
-
"./preview-preset": {
|
|
33
|
-
"types": "./dist/preview-preset.d.ts",
|
|
34
|
-
"node": "./dist/preview-preset.js",
|
|
35
|
-
"require": "./dist/preview-preset.js"
|
|
36
|
-
},
|
|
37
|
-
"./loaders/export-order-loader": {
|
|
38
|
-
"types": "./dist/loaders/export-order-loader.d.ts",
|
|
39
|
-
"node": "./dist/loaders/export-order-loader.js",
|
|
40
|
-
"require": "./dist/loaders/export-order-loader.js"
|
|
41
|
-
},
|
|
42
|
-
"./templates/virtualModuleModernEntry.js": "./templates/virtualModuleModernEntry.js",
|
|
26
|
+
"./loaders/export-order-loader": "./dist/loaders/export-order-loader.js",
|
|
27
|
+
"./package.json": "./package.json",
|
|
28
|
+
"./presets/preview-preset": "./dist/preview-preset.js",
|
|
43
29
|
"./templates/preview.ejs": "./templates/preview.ejs",
|
|
44
30
|
"./templates/virtualModuleEntry.template.js": "./templates/virtualModuleEntry.template.js",
|
|
45
|
-
"./templates/
|
|
46
|
-
"./
|
|
31
|
+
"./templates/virtualModuleModernEntry.js": "./templates/virtualModuleModernEntry.js",
|
|
32
|
+
"./templates/virtualModuleStory.template.js": "./templates/virtualModuleStory.template.js"
|
|
47
33
|
},
|
|
48
34
|
"main": "dist/index.js",
|
|
49
35
|
"module": "dist/index.mjs",
|
|
@@ -77,23 +63,24 @@
|
|
|
77
63
|
},
|
|
78
64
|
"devDependencies": {
|
|
79
65
|
"@rsbuild/core": "^1.5.17",
|
|
80
|
-
"@storybook/core-webpack": "^
|
|
66
|
+
"@storybook/core-webpack": "^10.0.0",
|
|
81
67
|
"@types/find-cache-dir": "^5.0.2",
|
|
82
68
|
"@types/fs-extra": "^11.0.4",
|
|
83
|
-
"@types/node": "^
|
|
69
|
+
"@types/node": "^22.0.0",
|
|
84
70
|
"@types/pretty-hrtime": "^1.0.3",
|
|
85
71
|
"find-cache-dir": "^5.0.0",
|
|
86
|
-
"
|
|
72
|
+
"jiti": "^2.4.2",
|
|
73
|
+
"prebundle": "^1.6.0",
|
|
87
74
|
"pretty-hrtime": "^1.0.3",
|
|
88
75
|
"slash": "^5.1.0",
|
|
89
|
-
"storybook": "
|
|
76
|
+
"storybook": "10.0.7",
|
|
90
77
|
"typescript": "^5.9.3"
|
|
91
78
|
},
|
|
92
79
|
"peerDependencies": {
|
|
93
80
|
"@rsbuild/core": "^1.5.0",
|
|
94
81
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
|
|
95
82
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
|
|
96
|
-
"storybook": "^
|
|
83
|
+
"storybook": "^10.0.0"
|
|
97
84
|
},
|
|
98
85
|
"peerDependenciesMeta": {
|
|
99
86
|
"react": {
|
|
@@ -118,8 +105,8 @@
|
|
|
118
105
|
"platform": "node"
|
|
119
106
|
},
|
|
120
107
|
"scripts": {
|
|
121
|
-
"build": "pnpm run prep
|
|
122
|
-
"check": "jiti ../../scripts/
|
|
123
|
-
"prep": "prebundle && jiti ../../scripts/
|
|
108
|
+
"build": "pnpm run prep",
|
|
109
|
+
"check": "jiti ../../scripts/check/check-package.ts",
|
|
110
|
+
"prep": "prebundle && jiti ../../scripts/build/build-package.ts"
|
|
124
111
|
}
|
|
125
112
|
}
|
package/dist/chunk-TTFRSOOU.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
-
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined")
|
|
11
|
-
return require.apply(this, arguments);
|
|
12
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
-
});
|
|
14
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
|
-
};
|
|
17
|
-
var __copyProps = (to, from, except, desc) => {
|
|
18
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
-
for (let key of __getOwnPropNames(from))
|
|
20
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
-
}
|
|
23
|
-
return to;
|
|
24
|
-
};
|
|
25
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
-
mod
|
|
32
|
-
));
|
|
33
|
-
|
|
34
|
-
export { __commonJS, __require, __toESM };
|