dumi 2.4.25 → 2.5.0-beta.0
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.
|
@@ -97,8 +97,7 @@ var compile_default = (api) => {
|
|
|
97
97
|
path: import_utoopackLoaders.LOADER_CTX_FILENAME,
|
|
98
98
|
content: (0, import_utoopackLoaders.buildLoaderContextContent)(
|
|
99
99
|
techStacks,
|
|
100
|
-
((_a = api.service.themeData) == null ? void 0 : _a.builtins) ?? {}
|
|
101
|
-
api.appData.routes ?? {}
|
|
100
|
+
((_a = api.service.themeData) == null ? void 0 : _a.builtins) ?? {}
|
|
102
101
|
)
|
|
103
102
|
});
|
|
104
103
|
}
|
|
@@ -4,5 +4,5 @@ export declare const LOADER_CTX_FILENAME = "dumi-loader-ctx.cjs";
|
|
|
4
4
|
export declare function buildLoaderContextContent(techStacks: IDumiTechStack[], builtins?: Record<string, {
|
|
5
5
|
specifier: string;
|
|
6
6
|
source: string;
|
|
7
|
-
}
|
|
7
|
+
}>): string;
|
|
8
8
|
export declare const getUtoopackRules: (api: IApi) => Record<string, unknown>;
|
|
@@ -59,7 +59,7 @@ function findInRequireCache(target) {
|
|
|
59
59
|
}
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
|
-
function buildLoaderContextContent(techStacks, builtins = {}
|
|
62
|
+
function buildLoaderContextContent(techStacks, builtins = {}) {
|
|
63
63
|
const refs = [];
|
|
64
64
|
for (const ts of techStacks) {
|
|
65
65
|
const ctor = ts.constructor;
|
|
@@ -82,7 +82,6 @@ function buildLoaderContextContent(techStacks, builtins = {}, routes = {}) {
|
|
|
82
82
|
return `'use strict';
|
|
83
83
|
exports.techStacks = [${refs.join(", ")}];
|
|
84
84
|
exports.builtins = ${JSON.stringify(builtins)};
|
|
85
|
-
exports.routes = ${JSON.stringify(routes)};
|
|
86
85
|
`;
|
|
87
86
|
}
|
|
88
87
|
var getUtoopackRules = (api) => {
|
|
@@ -102,7 +101,7 @@ var getUtoopackRules = (api) => {
|
|
|
102
101
|
forceKebabCaseRouting: cfgResolve.forceKebabCaseRouting ?? true,
|
|
103
102
|
...cfgResolve.entryFile ? { entryFile: cfgResolve.entryFile } : {}
|
|
104
103
|
},
|
|
105
|
-
routes: {},
|
|
104
|
+
routes: api.appData.routes || {},
|
|
106
105
|
builtins: {},
|
|
107
106
|
locales: api.config.locales || [],
|
|
108
107
|
pkg: api.pkg,
|
|
@@ -320,9 +320,6 @@ function mdLoader(content) {
|
|
|
320
320
|
if (ctx.builtins && !Object.keys(opts.builtins ?? {}).length) {
|
|
321
321
|
opts.builtins = ctx.builtins;
|
|
322
322
|
}
|
|
323
|
-
if (ctx.routes && !Object.keys(opts.routes ?? {}).length) {
|
|
324
|
-
opts.routes = ctx.routes;
|
|
325
|
-
}
|
|
326
323
|
}
|
|
327
324
|
const cb = this.async();
|
|
328
325
|
if (process.env.NODE_ENV === "production" && ["onResolveDemos", "onResolveAtomMeta"].some((k) => k in opts)) {
|
|
@@ -65,12 +65,9 @@ function rehypeLink(opts) {
|
|
|
65
65
|
});
|
|
66
66
|
} else if (parsedUrl.pathname && /^[^/]+/.test(parsedUrl.pathname)) {
|
|
67
67
|
const routes = Object.values(opts.routes);
|
|
68
|
-
const
|
|
68
|
+
const basePath = routes.find(
|
|
69
69
|
(route) => route.file === hostAbsPath
|
|
70
|
-
);
|
|
71
|
-
if (!currentRoute)
|
|
72
|
-
return;
|
|
73
|
-
const basePath = currentRoute.absPath;
|
|
70
|
+
).absPath;
|
|
74
71
|
const htmlTargetPath = import_url.default.resolve(basePath, parsedUrl.pathname);
|
|
75
72
|
const rr6TargetPath = (0, import_plugin_utils.winPath)(
|
|
76
73
|
import_path.default.resolve(basePath, parsedUrl.pathname)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dumi",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-beta.0",
|
|
4
4
|
"description": "📖 Documentation Generator of React Component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"generator",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"@swc/core": "1.9.2",
|
|
66
66
|
"@types/hast": "^2.3.5",
|
|
67
67
|
"@types/mdast": "^3.0.12",
|
|
68
|
-
"@umijs/bundler-utils": "^4.6.
|
|
69
|
-
"@umijs/core": "^4.6.
|
|
70
|
-
"@umijs/utils": "^4.6.
|
|
68
|
+
"@umijs/bundler-utils": "^4.6.48",
|
|
69
|
+
"@umijs/core": "^4.6.48",
|
|
70
|
+
"@umijs/utils": "^4.6.48",
|
|
71
71
|
"animated-scroll-to": "^2.3.0",
|
|
72
72
|
"classnames": "2.3.2",
|
|
73
73
|
"codesandbox-import-utils": "^2.2.3",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"sass": "^1.64.1",
|
|
120
120
|
"sitemap": "^7.1.1",
|
|
121
121
|
"sucrase": "^3.34.0",
|
|
122
|
-
"umi": "^4.6.
|
|
122
|
+
"umi": "^4.6.48",
|
|
123
123
|
"unified": "^10.1.2",
|
|
124
124
|
"unist-util-visit": "^4.1.2",
|
|
125
125
|
"unist-util-visit-parents": "^5.1.3",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"@types/react": "^18.2.17",
|
|
143
143
|
"@types/react-copy-to-clipboard": "^5.0.4",
|
|
144
144
|
"@types/react-dom": "^18.2.7",
|
|
145
|
-
"@umijs/lint": "^4.6.
|
|
145
|
+
"@umijs/lint": "^4.6.48",
|
|
146
146
|
"@umijs/plugins": "4.0.32",
|
|
147
147
|
"eslint": "^8.46.0",
|
|
148
148
|
"esno": "^4.7.0",
|