@alauda/doom 0.6.9 → 0.6.11
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/lib/cli/load-config.js
CHANGED
|
@@ -2,10 +2,8 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { nodeTypes } from '@mdx-js/mdx';
|
|
4
4
|
import { addLeadingSlash, addTrailingSlash, normalizeSlash, removeLeadingSlash, removeTrailingSlash, } from '@rspress/core';
|
|
5
|
-
import { pluginPreview } from '@rspress/plugin-preview';
|
|
6
5
|
import { logger } from '@rspress/shared/logger';
|
|
7
6
|
import { transformerMetaHighlight, transformerMetaWordHighlight, transformerNotationDiff, transformerNotationErrorLevel, transformerNotationFocus, transformerNotationHighlight, transformerNotationWordHighlight, transformerRemoveNotationEscape, } from '@shikijs/transformers';
|
|
8
|
-
import getPort from 'get-port';
|
|
9
7
|
import rehypeRaw from 'rehype-raw';
|
|
10
8
|
import { apiPlugin, autoSidebarPlugin, createTransformerCallouts, globalPlugin, shikiPlugin, } from '../plugins/index.js';
|
|
11
9
|
import { normalizeVersion } from '../shared/index.js';
|
|
@@ -21,7 +19,7 @@ const zhLocaleConfig = {
|
|
|
21
19
|
prevPageText: '上一页',
|
|
22
20
|
nextPageText: '下一页',
|
|
23
21
|
};
|
|
24
|
-
const getCommonConfig =
|
|
22
|
+
const getCommonConfig = (config, cliRoot, prefix, configFilePath, version, force) => {
|
|
25
23
|
const fallbackToZh = 'lang' in config && config.lang == null;
|
|
26
24
|
const root = resolveDocRoot(CWD, cliRoot, config.root);
|
|
27
25
|
let base = addLeadingSlash(config.base || '/');
|
|
@@ -67,12 +65,6 @@ const getCommonConfig = async (config, cliRoot, prefix, configFilePath, version,
|
|
|
67
65
|
}),
|
|
68
66
|
},
|
|
69
67
|
plugins: [
|
|
70
|
-
pluginPreview({
|
|
71
|
-
iframeOptions: {
|
|
72
|
-
devPort: await getPort({ port: 7891 }),
|
|
73
|
-
},
|
|
74
|
-
defaultRenderMode: 'pure',
|
|
75
|
-
}),
|
|
76
68
|
apiPlugin(config.api),
|
|
77
69
|
autoSidebarPlugin(config.sidebar),
|
|
78
70
|
globalPlugin({
|
|
@@ -174,7 +166,7 @@ export async function loadConfig(root, configFile, prefix, version, force) {
|
|
|
174
166
|
}
|
|
175
167
|
}
|
|
176
168
|
const normalizedVersion = normalizeVersion(version);
|
|
177
|
-
const commonConfig =
|
|
169
|
+
const commonConfig = getCommonConfig(config, root, prefix, configFilePath, normalizedVersion, force);
|
|
178
170
|
const mergedConfig = mergeRsbuildConfig(commonConfig, config, {
|
|
179
171
|
base: commonConfig.base,
|
|
180
172
|
root: commonConfig.root,
|
|
@@ -334,9 +334,13 @@ export const remarkReplace = function ({ lang, localBasePath, root, items, force
|
|
|
334
334
|
if (checkContent) {
|
|
335
335
|
const newContent = processor.stringify({
|
|
336
336
|
...ast,
|
|
337
|
-
children: newContentChildren
|
|
338
|
-
.
|
|
339
|
-
|
|
337
|
+
children: newContentChildren.flat().filter((n) => {
|
|
338
|
+
if (n.type !== 'mdxjsEsm') {
|
|
339
|
+
return true;
|
|
340
|
+
}
|
|
341
|
+
const matched = n.value.match(/^import\b.+\bfrom\b\s+(['"])([^'"]+)\1$/);
|
|
342
|
+
return !matched?.[2] || !path.isAbsolute(matched[2]);
|
|
343
|
+
}),
|
|
340
344
|
});
|
|
341
345
|
if (content !== newContent) {
|
|
342
346
|
await fs.writeFile(filepath, newContent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/doom",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Doctor Doom making docs.",
|
|
6
6
|
"repository": {
|
|
@@ -41,14 +41,12 @@
|
|
|
41
41
|
"@inquirer/prompts": "^7.2.1",
|
|
42
42
|
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
|
|
43
43
|
"@rspress/core": "1.39.3",
|
|
44
|
-
"@rspress/plugin-preview": "1.39.3",
|
|
45
44
|
"@shikijs/transformers": "^1.26.1",
|
|
46
45
|
"chokidar": "^4.0.3",
|
|
47
46
|
"clsx": "^2.1.1",
|
|
48
47
|
"commander": "^12.1.0",
|
|
49
48
|
"ejs": "^3.1.10",
|
|
50
49
|
"es-toolkit": "^1.31.0",
|
|
51
|
-
"get-port": "^7.1.0",
|
|
52
50
|
"openapi-types": "^12.1.3",
|
|
53
51
|
"react-markdown": "^8.0.7",
|
|
54
52
|
"rehype-raw": "^6.1.1",
|