@modern-js/storybook-builder 0.0.0-next-20240218090823 → 0.0.0-next-20240220105216
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/cjs/core.js +1 -0
- package/dist/cjs/docgen/index.js +5 -4
- package/dist/cjs/plugin-storybook.js +1 -1
- package/dist/cjs/preset.js +2 -0
- package/dist/esm/core.js +1 -0
- package/dist/esm/docgen/index.js +2 -1
- package/dist/esm/plugin-storybook.js +1 -1
- package/dist/esm/preset.js +2 -0
- package/package.json +7 -8
package/dist/cjs/core.js
CHANGED
@@ -39,6 +39,7 @@ async function getCompiler(cwd, builderOptions, options) {
|
|
39
39
|
bundlerType,
|
40
40
|
cwd,
|
41
41
|
target: "web",
|
42
|
+
frameworkConfigPath: (res === null || res === void 0 ? void 0 : res.path) ? res.path : void 0,
|
42
43
|
config: bundlerType === "webpack" ? await (0, import_plugin_storybook.addonBabelAdapter)(uniBuilderConfig, options) : uniBuilderConfig,
|
43
44
|
entry: {
|
44
45
|
main: entries
|
package/dist/cjs/docgen/index.js
CHANGED
@@ -33,6 +33,7 @@ __export(docgen_exports, {
|
|
33
33
|
});
|
34
34
|
module.exports = __toCommonJS(docgen_exports);
|
35
35
|
var import_utils = require("@modern-js/utils");
|
36
|
+
var import_shared = require("@rsbuild/shared");
|
36
37
|
async function applyDocgenWebpack(chain, options) {
|
37
38
|
const typescriptOptions = await options.presets.apply("typescript", {});
|
38
39
|
const { reactDocgen, reactDocgenTypescriptOptions } = typescriptOptions || {};
|
@@ -50,14 +51,14 @@ async function applyDocgenWebpack(chain, options) {
|
|
50
51
|
} else if (reactDocgen === "react-docgen") {
|
51
52
|
const loader = require.resolve("./loader");
|
52
53
|
const resolveOptions = chain.toConfig().resolve;
|
53
|
-
chain.module.rule(
|
54
|
+
chain.module.rule(import_shared.CHAIN_ID.RULE.JS).use("react-docgen").loader(loader).options({
|
54
55
|
resolveOptions
|
55
|
-
}).after(
|
56
|
-
const tsRuls = chain.module.rule(
|
56
|
+
}).after(import_shared.CHAIN_ID.USE.BABEL).after(import_shared.CHAIN_ID.USE.ESBUILD).after(import_shared.CHAIN_ID.USE.SWC).end();
|
57
|
+
const tsRuls = chain.module.rule(import_shared.CHAIN_ID.RULE.TS);
|
57
58
|
if (tsRuls.uses.values().length !== 0) {
|
58
59
|
tsRuls.use("react-docgen").loader(loader).options({
|
59
60
|
resolveOptions
|
60
|
-
}).after(
|
61
|
+
}).after(import_shared.CHAIN_ID.USE.TS).after(import_shared.CHAIN_ID.USE.ESBUILD).after(import_shared.CHAIN_ID.USE.SWC).end();
|
61
62
|
}
|
62
63
|
}
|
63
64
|
}
|
@@ -90,7 +90,7 @@ const pluginStorybook = (cwd, options) => {
|
|
90
90
|
api.modifyWebpackChain(async (chain) => {
|
91
91
|
await (0, import_docgen.applyDocgenWebpack)(chain, options);
|
92
92
|
});
|
93
|
-
} else
|
93
|
+
} else {
|
94
94
|
api.modifyRspackConfig(async (config) => {
|
95
95
|
await modifyConfig(config);
|
96
96
|
await (0, import_docgen.applyDocgenRspack)(config, options);
|
package/dist/cjs/preset.js
CHANGED
package/dist/esm/core.js
CHANGED
@@ -22,6 +22,7 @@ async function getCompiler(cwd, builderOptions, options) {
|
|
22
22
|
bundlerType,
|
23
23
|
cwd,
|
24
24
|
target: "web",
|
25
|
+
frameworkConfigPath: (res == null ? void 0 : res.path) ? res.path : void 0,
|
25
26
|
config: bundlerType === "webpack" ? await addonBabelAdapter(uniBuilderConfig, options) : uniBuilderConfig,
|
26
27
|
entry: {
|
27
28
|
main: entries
|
package/dist/esm/docgen/index.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { logger } from "@modern-js/utils";
|
2
|
+
import { CHAIN_ID } from "@rsbuild/shared";
|
2
3
|
async function applyDocgenWebpack(chain, options) {
|
3
4
|
const typescriptOptions = await options.presets.apply(
|
4
5
|
"typescript",
|
@@ -79,7 +79,7 @@ const pluginStorybook = (cwd, options) => {
|
|
79
79
|
api.modifyWebpackChain(async (chain) => {
|
80
80
|
await applyDocgenWebpack(chain, options);
|
81
81
|
});
|
82
|
-
} else
|
82
|
+
} else {
|
83
83
|
api.modifyRspackConfig(async (config) => {
|
84
84
|
await modifyConfig(config);
|
85
85
|
await applyDocgenRspack(config, options);
|
package/dist/esm/preset.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@modern-js/storybook-builder",
|
3
|
-
"version": "0.0.0-next-
|
3
|
+
"version": "0.0.0-next-20240220105216",
|
4
4
|
"description": "modern.js support for storybook",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -51,7 +51,6 @@
|
|
51
51
|
},
|
52
52
|
"license": "MIT",
|
53
53
|
"dependencies": {
|
54
|
-
"@rsbuild/core": "0.4.3",
|
55
54
|
"@rsbuild/shared": "0.4.3",
|
56
55
|
"@rspack/plugin-react-refresh": "0.4.5",
|
57
56
|
"@storybook/components": "~7.6.12",
|
@@ -73,10 +72,10 @@
|
|
73
72
|
"serve-static": "^1.14.1",
|
74
73
|
"tinypool": "^0.8.0",
|
75
74
|
"webpack-hot-middleware": "^2.25.4",
|
76
|
-
"@modern-js/uni-builder": "0.0.0-next-
|
77
|
-
"@modern-js/core": "0.0.0-next-
|
78
|
-
"@modern-js/runtime": "0.0.0-next-
|
79
|
-
"@modern-js/utils": "0.0.0-next-
|
75
|
+
"@modern-js/uni-builder": "0.0.0-next-20240220105216",
|
76
|
+
"@modern-js/core": "0.0.0-next-20240220105216",
|
77
|
+
"@modern-js/runtime": "0.0.0-next-20240220105216",
|
78
|
+
"@modern-js/utils": "0.0.0-next-20240220105216"
|
80
79
|
},
|
81
80
|
"devDependencies": {
|
82
81
|
"@storybook/types": "~7.6.12",
|
@@ -84,8 +83,8 @@
|
|
84
83
|
"@types/serve-static": "^1.13.10",
|
85
84
|
"@types/webpack-hot-middleware": "^2.25.6",
|
86
85
|
"typescript": "^5.2.2",
|
87
|
-
"@modern-js/core": "0.0.0-next-
|
88
|
-
"@scripts/build": "0.0.0-next-
|
86
|
+
"@modern-js/core": "0.0.0-next-20240220105216",
|
87
|
+
"@scripts/build": "0.0.0-next-20240220105216"
|
89
88
|
},
|
90
89
|
"publishConfig": {
|
91
90
|
"registry": "https://registry.npmjs.org/",
|