dumi 2.2.11 → 2.2.13
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/features/routes.js +6 -28
- package/dist/service/forkedDev.js +1 -1
- package/package.json +6 -6
package/dist/features/routes.js
CHANGED
|
@@ -39,9 +39,6 @@ var import_path = __toESM(require("path"));
|
|
|
39
39
|
var import_pluralize = require("pluralize");
|
|
40
40
|
var import_plugin_utils = require("umi/plugin-utils");
|
|
41
41
|
var CTX_LAYOUT_ID = "dumi-context-layout";
|
|
42
|
-
var ALIAS_THEME_TMP = "@/dumi__theme";
|
|
43
|
-
var ALIAS_LAYOUTS_LOCAL = "@/dumi__theme__layouts";
|
|
44
|
-
var ALIAS_INTERNAL_PAGES = "@/dumi__pages";
|
|
45
42
|
function normalizeDocDir(docDir) {
|
|
46
43
|
return typeof docDir === "object" ? docDir : { dir: docDir };
|
|
47
44
|
}
|
|
@@ -80,13 +77,6 @@ function flatRoute(route, docLayoutId) {
|
|
|
80
77
|
) : route.absPath.slice(1);
|
|
81
78
|
}
|
|
82
79
|
}
|
|
83
|
-
function getAliasLayoutFile({
|
|
84
|
-
source,
|
|
85
|
-
specifier
|
|
86
|
-
}) {
|
|
87
|
-
const alias = source.includes("/.dumi/theme/layouts/") ? ALIAS_LAYOUTS_LOCAL : `${ALIAS_THEME_TMP}/layouts`;
|
|
88
|
-
return `${alias}/${specifier}`;
|
|
89
|
-
}
|
|
90
80
|
var routes_default = (api) => {
|
|
91
81
|
api.describe({ key: "dumi:routes" });
|
|
92
82
|
api.addTmpGenerateWatcherPaths(
|
|
@@ -104,15 +94,6 @@ var routes_default = (api) => {
|
|
|
104
94
|
memo.resolve[key] = [];
|
|
105
95
|
});
|
|
106
96
|
}
|
|
107
|
-
memo.alias[ALIAS_THEME_TMP] = (0, import_plugin_utils.winPath)(
|
|
108
|
-
import_path.default.join(api.paths.absTmpPath, "dumi/theme")
|
|
109
|
-
);
|
|
110
|
-
memo.alias[ALIAS_LAYOUTS_LOCAL] = (0, import_plugin_utils.winPath)(
|
|
111
|
-
import_path.default.join(api.cwd, import_constants.LOCAL_THEME_DIR, "layouts")
|
|
112
|
-
);
|
|
113
|
-
memo.alias[ALIAS_INTERNAL_PAGES] = (0, import_plugin_utils.winPath)(
|
|
114
|
-
import_path.default.join(__dirname, "../client/pages")
|
|
115
|
-
);
|
|
116
97
|
return memo;
|
|
117
98
|
});
|
|
118
99
|
api.modifyRoutes((oRoutes) => {
|
|
@@ -141,10 +122,7 @@ var routes_default = (api) => {
|
|
|
141
122
|
routes[DocLayout.specifier] = {
|
|
142
123
|
id: DocLayout.specifier,
|
|
143
124
|
path: "/",
|
|
144
|
-
|
|
145
|
-
// because umi will generate chunk name from file path
|
|
146
|
-
// but source may too long in pnpm/monorepo project
|
|
147
|
-
file: getAliasLayoutFile(DocLayout),
|
|
125
|
+
file: DocLayout.source,
|
|
148
126
|
parentId: lastLayoutId,
|
|
149
127
|
absPath: "/",
|
|
150
128
|
isLayout: true
|
|
@@ -155,7 +133,7 @@ var routes_default = (api) => {
|
|
|
155
133
|
routes[DemoLayout.specifier] = {
|
|
156
134
|
id: DemoLayout.specifier,
|
|
157
135
|
path: "/",
|
|
158
|
-
file:
|
|
136
|
+
file: DemoLayout.source,
|
|
159
137
|
parentId: lastLayoutId,
|
|
160
138
|
absPath: "/",
|
|
161
139
|
isLayout: true
|
|
@@ -224,7 +202,7 @@ var routes_default = (api) => {
|
|
|
224
202
|
path: "*",
|
|
225
203
|
absPath: "/*",
|
|
226
204
|
parentId: docLayoutId,
|
|
227
|
-
file:
|
|
205
|
+
file: require.resolve("../client/pages/404")
|
|
228
206
|
};
|
|
229
207
|
}
|
|
230
208
|
routes["demo-render"] = {
|
|
@@ -232,7 +210,7 @@ var routes_default = (api) => {
|
|
|
232
210
|
path: `${import_constants.SP_ROUTE_PREFIX}demos/:id`,
|
|
233
211
|
absPath: `/${import_constants.SP_ROUTE_PREFIX}demos/:id`,
|
|
234
212
|
parentId: demoLayoutId,
|
|
235
|
-
file:
|
|
213
|
+
file: require.resolve("../client/pages/Demo")
|
|
236
214
|
};
|
|
237
215
|
return routes;
|
|
238
216
|
});
|
|
@@ -240,14 +218,14 @@ var routes_default = (api) => {
|
|
|
240
218
|
const layouts = [
|
|
241
219
|
{
|
|
242
220
|
id: CTX_LAYOUT_ID,
|
|
243
|
-
file: `${
|
|
221
|
+
file: `${api.paths.absTmpPath}/dumi/theme/ContextWrapper`
|
|
244
222
|
}
|
|
245
223
|
];
|
|
246
224
|
const { GlobalLayout } = api.service.themeData.layouts;
|
|
247
225
|
if (GlobalLayout) {
|
|
248
226
|
layouts.unshift({
|
|
249
227
|
id: GlobalLayout.specifier,
|
|
250
|
-
file:
|
|
228
|
+
file: GlobalLayout.source
|
|
251
229
|
});
|
|
252
230
|
}
|
|
253
231
|
return layouts;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/service/forkedDev.ts
|
|
2
|
-
var import_node = require("
|
|
2
|
+
var import_node = require("@umijs/utils/dist/node");
|
|
3
3
|
var import_plugin_utils = require("umi/plugin-utils");
|
|
4
4
|
var import_constants = require("./constants");
|
|
5
5
|
var import_service = require("./service");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dumi",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.13",
|
|
4
4
|
"description": "📖 Documentation Generator of React Component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"generator",
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"@swc/core": "1.3.72",
|
|
83
83
|
"@types/hast": "^2.3.5",
|
|
84
84
|
"@types/mdast": "^3.0.12",
|
|
85
|
-
"@umijs/bundler-utils": "^4.0.
|
|
86
|
-
"@umijs/core": "^4.0.
|
|
87
|
-
"@umijs/utils": "^4.0.
|
|
85
|
+
"@umijs/bundler-utils": "^4.0.84",
|
|
86
|
+
"@umijs/core": "^4.0.84",
|
|
87
|
+
"@umijs/utils": "^4.0.84",
|
|
88
88
|
"animated-scroll-to": "^2.3.0",
|
|
89
89
|
"classnames": "2.3.2",
|
|
90
90
|
"codesandbox": "^2.2.3",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"remark-rehype": "^10.1.0",
|
|
132
132
|
"sass": "^1.64.1",
|
|
133
133
|
"sitemap": "^7.1.1",
|
|
134
|
-
"umi": "^4.0.
|
|
134
|
+
"umi": "^4.0.84",
|
|
135
135
|
"unified": "^10.1.2",
|
|
136
136
|
"unist-util-visit": "^4.1.2",
|
|
137
137
|
"unist-util-visit-parents": "^5.1.3",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"@types/pluralize": "^0.0.30",
|
|
152
152
|
"@types/react": "^18.2.17",
|
|
153
153
|
"@types/react-copy-to-clipboard": "^5.0.4",
|
|
154
|
-
"@umijs/lint": "^4.0.
|
|
154
|
+
"@umijs/lint": "^4.0.84",
|
|
155
155
|
"@umijs/plugins": "4.0.32",
|
|
156
156
|
"dumi-theme-mobile": "workspace:*",
|
|
157
157
|
"eslint": "^8.46.0",
|