@alauda/doom 1.12.1 → 1.12.3
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 +15 -1
- package/lib/global/VersionsNav/index.js +4 -4
- package/lib/theme.js +1 -1
- package/package.json +8 -8
package/lib/cli/load-config.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import fs_ from 'node:fs';
|
|
1
2
|
import fs from 'node:fs/promises';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import { fileURLToPath } from 'node:url';
|
|
@@ -126,6 +127,7 @@ const getCommonConfig = async ({ config, root, configFilePath, base, version, do
|
|
|
126
127
|
? ALAUDA_ALGOLIA_OPTIONS
|
|
127
128
|
: algolia === 'alauda-ru' && ALAUDA_RU_ALGOLIA_OPTIONS)) ||
|
|
128
129
|
null;
|
|
130
|
+
const publicPath = path.resolve(root, 'public');
|
|
129
131
|
return {
|
|
130
132
|
userBase,
|
|
131
133
|
root,
|
|
@@ -146,6 +148,18 @@ const getCommonConfig = async ({ config, root, configFilePath, base, version, do
|
|
|
146
148
|
],
|
|
147
149
|
},
|
|
148
150
|
markdown: {
|
|
151
|
+
defaultWrapCode: export_,
|
|
152
|
+
link: {
|
|
153
|
+
checkDeadLinks: {
|
|
154
|
+
excludes(url) {
|
|
155
|
+
if (!url.startsWith('/')) {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
const { pathname } = new URL(url, 'https://example.com');
|
|
159
|
+
return fs_.existsSync(path.resolve(publicPath, pathname.slice(1)));
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
149
163
|
shiki: {
|
|
150
164
|
transformers: [
|
|
151
165
|
// builtin transformers
|
|
@@ -350,7 +364,7 @@ export async function loadConfig(root, { config: configFile, base, prefix, v: ve
|
|
|
350
364
|
ensureDefaultLogo = true;
|
|
351
365
|
}
|
|
352
366
|
if (ensureDefaultLogo) {
|
|
353
|
-
const publicPath = path.resolve(mergedConfig.root,
|
|
367
|
+
const publicPath = path.resolve(mergedConfig.root, 'public');
|
|
354
368
|
await fs.mkdir(publicPath, { recursive: true });
|
|
355
369
|
const logoPath = path.resolve(publicPath, removeLeadingSlash(DEFAULT_LOGO));
|
|
356
370
|
if (!(await pathExists(logoPath))) {
|
|
@@ -5,7 +5,7 @@ import virtual from 'doom-@global-virtual';
|
|
|
5
5
|
import { noop } from 'es-toolkit';
|
|
6
6
|
import { useEffect, useMemo, useState } from 'react';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
|
-
import
|
|
8
|
+
import siteData from 'virtual-site-data';
|
|
9
9
|
import { parse } from 'yaml';
|
|
10
10
|
import { ACP_BASE, getPdfName, getUnversionedVersion, isExplicitlyUnversioned, } from '../../shared/index.js';
|
|
11
11
|
import { NavMenuGroup } from './NavMenuGroup.js';
|
|
@@ -45,7 +45,7 @@ const VersionsNav_ = () => {
|
|
|
45
45
|
return [
|
|
46
46
|
isExplicitlyUnversioned(virtual.version)
|
|
47
47
|
? undefined
|
|
48
|
-
: base.slice(0, -unversionedVersion.length - 1),
|
|
48
|
+
: siteData.base.slice(0, -unversionedVersion.length - 1),
|
|
49
49
|
unversionedVersion,
|
|
50
50
|
];
|
|
51
51
|
}, []);
|
|
@@ -59,7 +59,7 @@ const VersionsNav_ = () => {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
|
-
const res = await fetch(`${isProduction() ? versionsBase : base}/versions.yaml`);
|
|
62
|
+
const res = await fetch(`${isProduction() ? versionsBase : siteData.base}/versions.yaml`);
|
|
63
63
|
if (!res.ok) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
@@ -112,7 +112,7 @@ const VersionsNav_ = () => {
|
|
|
112
112
|
!(finalNavMenu = getNavMenu())) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
return createPortal(_jsxs(_Fragment, { children: [downloadLink && (_jsx(NavMenuSingleItem, { text: t('download_pdf'), link: downloadLink, download: true })), !navItems.length || (_jsx(NavMenuGroup, { text: version, base: versionsBase, items: navItems, pathname: base }))] }), finalNavMenu);
|
|
115
|
+
return createPortal(_jsxs(_Fragment, { children: [downloadLink && (_jsx(NavMenuSingleItem, { text: t('download_pdf'), link: downloadLink, download: true })), !navItems.length || (_jsx(NavMenuGroup, { text: version, base: versionsBase, items: navItems, pathname: siteData.base }))] }), finalNavMenu);
|
|
116
116
|
};
|
|
117
117
|
export const VersionsNav = () => (_jsx(NoSSR, { children: _jsx(VersionsNav_, {}) }));
|
|
118
118
|
export default VersionsNav;
|
package/lib/theme.js
CHANGED
|
@@ -68,7 +68,7 @@ export const Layout = () => {
|
|
|
68
68
|
if (!virtual.download || !virtual.export?.length) {
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
if (themeConfig.locales
|
|
71
|
+
if (themeConfig.locales.length) {
|
|
72
72
|
let found;
|
|
73
73
|
for (const { lang, sidebar } of themeConfig.locales) {
|
|
74
74
|
const sidebarItems = sidebar[siteLang === lang ? '/' : `/${lang}`];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/doom",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Doctor Doom making docs.",
|
|
6
6
|
"repository": {
|
|
@@ -42,19 +42,19 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@alauda/doom-export": "^0.1.0",
|
|
44
44
|
"@cspell/eslint-plugin": "^8.19.4 || ^9.2.0",
|
|
45
|
-
"@eslint-react/eslint-plugin": "^1.52.
|
|
45
|
+
"@eslint-react/eslint-plugin": "^1.52.7",
|
|
46
46
|
"@inquirer/prompts": "^7.8.4",
|
|
47
47
|
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
|
|
48
48
|
"@playwright/browser-chromium": "^1.55.0",
|
|
49
|
-
"@rsbuild/plugin-react": "^1.
|
|
49
|
+
"@rsbuild/plugin-react": "^1.4.0",
|
|
50
50
|
"@rsbuild/plugin-sass": "^1.4.0",
|
|
51
51
|
"@rsbuild/plugin-svgr": "^1.2.2",
|
|
52
52
|
"@rsbuild/plugin-yaml": "^1.0.3",
|
|
53
|
-
"@rspress/core": "2.0.0-beta.
|
|
54
|
-
"@rspress/plugin-algolia": "2.0.0-beta.
|
|
55
|
-
"@rspress/plugin-llms": "2.0.0-beta.
|
|
56
|
-
"@rspress/plugin-sitemap": "2.0.0-beta.
|
|
57
|
-
"@rspress/shared": "2.0.0-beta.
|
|
53
|
+
"@rspress/core": "2.0.0-beta.29",
|
|
54
|
+
"@rspress/plugin-algolia": "2.0.0-beta.29",
|
|
55
|
+
"@rspress/plugin-llms": "2.0.0-beta.29",
|
|
56
|
+
"@rspress/plugin-sitemap": "2.0.0-beta.29",
|
|
57
|
+
"@rspress/shared": "2.0.0-beta.29",
|
|
58
58
|
"@shikijs/transformers": "^3.12.0",
|
|
59
59
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
60
60
|
"ab64": "^0.1.6",
|