@alauda/doom 0.19.4 → 0.19.5
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/global.d.ts +1 -0
- package/lib/cli/load-config.js +9 -5
- package/package.json +2 -1
package/global.d.ts
CHANGED
package/lib/cli/load-config.js
CHANGED
|
@@ -8,7 +8,7 @@ import { transformerMetaHighlight, transformerMetaWordHighlight, transformerNota
|
|
|
8
8
|
import rehypeRaw from 'rehype-raw';
|
|
9
9
|
import { apiPlugin, autoSidebarPlugin, createTransformerCallouts, directivesPlugin, globalPlugin, mermaidPlugin, permissionPlugin, replacePlugin, shikiPlugin, } from '../plugins/index.js';
|
|
10
10
|
import {} from '../shared/index.js';
|
|
11
|
-
import { pkgResolve, resolveStaticConfig } from '../utils/index.js';
|
|
11
|
+
import { pathExists, pkgResolve, resolveStaticConfig } from '../utils/index.js';
|
|
12
12
|
import { CWD, DEFAULT_CONFIG_NAME, DEFAULT_EXTENSIONS, I18N_FILE, SITES_FILE, YAML_EXTENSIONS, } from './constants.js';
|
|
13
13
|
const DEFAULT_LOGO = '/logo.svg';
|
|
14
14
|
const zhLocaleConfig = {
|
|
@@ -27,7 +27,7 @@ const ruLocaleConfig = {
|
|
|
27
27
|
prevPageText: 'Предыдущая страница',
|
|
28
28
|
nextPageText: 'Следующая страница',
|
|
29
29
|
};
|
|
30
|
-
const getCommonConfig = ({ config, root, configFilePath, base, version, download, export: export_, ignore, force, open, lazy, }) => {
|
|
30
|
+
const getCommonConfig = async ({ config, root, configFilePath, base, version, download, export: export_, ignore, force, open, lazy, }) => {
|
|
31
31
|
const fallbackToZh = 'lang' in config && !config.lang;
|
|
32
32
|
root = resolveDocRoot(CWD, root, config.root);
|
|
33
33
|
const localBasePath = configFilePath ? path.dirname(configFilePath) : root;
|
|
@@ -70,8 +70,12 @@ const getCommonConfig = ({ config, root, configFilePath, base, version, download
|
|
|
70
70
|
locales: [
|
|
71
71
|
{ lang: 'en', label: 'English' },
|
|
72
72
|
{ lang: 'zh', label: '简体中文', ...zhLocaleConfig },
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
(await pathExists(path.resolve(root, 'ru'), 'directory')) && {
|
|
74
|
+
lang: 'ru',
|
|
75
|
+
label: 'Русский',
|
|
76
|
+
...ruLocaleConfig,
|
|
77
|
+
},
|
|
78
|
+
].filter(Boolean),
|
|
75
79
|
}),
|
|
76
80
|
},
|
|
77
81
|
plugins: [
|
|
@@ -193,7 +197,7 @@ export async function loadConfig(root, { config: configFile, base, prefix, v: ve
|
|
|
193
197
|
}
|
|
194
198
|
}
|
|
195
199
|
version ||= '';
|
|
196
|
-
const commonConfig = getCommonConfig({
|
|
200
|
+
const commonConfig = await getCommonConfig({
|
|
197
201
|
config,
|
|
198
202
|
configFilePath,
|
|
199
203
|
root,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/doom",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Doctor Doom making docs.",
|
|
6
6
|
"repository": "https://gitlab-ce.alauda.cn/idp/Doom.git",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"@eslint/js": "^9.24.0",
|
|
81
81
|
"@swc-node/register": "^1.10.10",
|
|
82
82
|
"@swc/core": "1.11.21",
|
|
83
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
83
84
|
"@types/cli-progress": "^3.11.6",
|
|
84
85
|
"@types/ejs": "^3.1.5",
|
|
85
86
|
"@types/node": "^18.19.86",
|