@alauda/doom 0.14.15 → 0.14.17
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/export.js +1 -1
- package/lib/cli/load-config.js +5 -6
- package/lib/plugins/global/index.js +2 -2
- package/lib/runtime/components/TermsTable.d.ts +3 -2
- package/lib/runtime/components/TermsTable.js +5 -9
- package/lib/shared/helpers.d.ts +0 -1
- package/lib/shared/helpers.js +0 -2
- package/lib/terms.d.ts +0 -2
- package/lib/terms.js +0 -5
- package/package.json +7 -7
package/lib/cli/export.js
CHANGED
package/lib/cli/load-config.js
CHANGED
|
@@ -6,7 +6,7 @@ import { logger } from '@rspress/shared/logger';
|
|
|
6
6
|
import { transformerMetaHighlight, transformerMetaWordHighlight, transformerNotationDiff, transformerNotationErrorLevel, transformerNotationFocus, transformerNotationHighlight, transformerNotationWordHighlight, transformerRemoveNotationEscape, } from '@shikijs/transformers';
|
|
7
7
|
import rehypeRaw from 'rehype-raw';
|
|
8
8
|
import { apiPlugin, autoSidebarPlugin, createTransformerCallouts, directivesPlugin, globalPlugin, mermaidPlugin, permissionPlugin, replacePlugin, shikiPlugin, } from '../plugins/index.js';
|
|
9
|
-
import {
|
|
9
|
+
import {} from '../shared/index.js';
|
|
10
10
|
import { pkgResolve, resolveStaticConfig } from '../utils/index.js';
|
|
11
11
|
import { CWD, DEFAULT_CONFIG_NAME, DEFAULT_EXTENSIONS, I18N_FILE, SITES_FILE, YAML_EXTENSIONS, } from './constants.js';
|
|
12
12
|
const DEFAULT_LOGO = '/logo.svg';
|
|
@@ -167,13 +167,13 @@ export async function loadConfig(root, { config: configFile, base, prefix, v: ve
|
|
|
167
167
|
config.sites = await resolveStaticConfig(sitesConfigFilePath);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
version ||= '';
|
|
171
171
|
const commonConfig = getCommonConfig({
|
|
172
172
|
config,
|
|
173
173
|
configFilePath,
|
|
174
174
|
root,
|
|
175
175
|
base,
|
|
176
|
-
version
|
|
176
|
+
version,
|
|
177
177
|
download,
|
|
178
178
|
ignore,
|
|
179
179
|
force,
|
|
@@ -213,11 +213,10 @@ export async function loadConfig(root, { config: configFile, base, prefix, v: ve
|
|
|
213
213
|
mergedConfig.i18nSourcePath = path.resolve(mergedConfig.root, I18N_FILE);
|
|
214
214
|
}
|
|
215
215
|
if (mergedConfig.outDir) {
|
|
216
|
-
mergedConfig.outDir =
|
|
217
|
-
addTrailingSlash(mergedConfig.outDir) + normalizedVersion;
|
|
216
|
+
mergedConfig.outDir = addTrailingSlash(mergedConfig.outDir) + version;
|
|
218
217
|
}
|
|
219
218
|
else {
|
|
220
|
-
mergedConfig.outDir = `dist${
|
|
219
|
+
mergedConfig.outDir = `dist${version === 'unversioned' ? `${base}unversioned` : base}`;
|
|
221
220
|
}
|
|
222
221
|
if (mergedConfig.builderConfig?.server?.open === true) {
|
|
223
222
|
mergedConfig.builderConfig.server.open = mergedConfig.base;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { addTrailingSlash } from '@rspress/core';
|
|
4
|
-
import { ACP_BASE
|
|
4
|
+
import { ACP_BASE } from '../../shared/index.js';
|
|
5
5
|
import { baseResolve, pkgResolve } from '../../utils/index.js';
|
|
6
6
|
const globalComponentsDir = baseResolve('global');
|
|
7
7
|
const componentsDir = baseResolve('runtime/components');
|
|
@@ -33,7 +33,7 @@ export const globalPlugin = ({ version, download, }) => {
|
|
|
33
33
|
sites: config.sites?.map((site) => ({
|
|
34
34
|
...site,
|
|
35
35
|
base: addTrailingSlash(site.base || (site.name === 'acp' ? ACP_BASE : '')),
|
|
36
|
-
version:
|
|
36
|
+
version: site.version,
|
|
37
37
|
})),
|
|
38
38
|
}, null, isProd ? 0 : 2)}`,
|
|
39
39
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type NormalizedTermItem } from '../../terms.js';
|
|
1
2
|
export interface TermsTableProps {
|
|
2
|
-
|
|
3
|
+
terms?: NormalizedTermItem[];
|
|
3
4
|
}
|
|
4
|
-
export declare const TermsTable: ({
|
|
5
|
+
export declare const TermsTable: ({ terms }: TermsTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
export default TermsTable;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getCustomMDXComponent } from '@rspress/core/theme';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { namedTermItems } from '../../terms.js';
|
|
5
5
|
import { useTranslation } from '../hooks/index.js';
|
|
6
|
-
export const TermsTable = ({
|
|
6
|
+
export const TermsTable = ({ terms }) => {
|
|
7
7
|
const [X] = useState(getCustomMDXComponent);
|
|
8
8
|
const t = useTranslation();
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
? namedTermItems
|
|
12
|
-
: noNamed
|
|
13
|
-
? unnamedTermItems
|
|
14
|
-
: allTermItems;
|
|
9
|
+
const normalized = terms ?? namedTermItems;
|
|
10
|
+
const withName = normalized.some(({ name }) => name);
|
|
15
11
|
const renderBadCases = (list) => list?.length ? (_jsx(X.ul, { children: list.map((item, index) => (_jsx(X.li, { children: item }, index))) })) : ('-');
|
|
16
|
-
return (_jsxs(X.table, { children: [_jsx("thead", { children: _jsxs(X.tr, { children: [
|
|
12
|
+
return (_jsxs(X.table, { children: [_jsx("thead", { children: _jsxs(X.tr, { children: [withName && _jsx(X.th, { children: t('name') }), _jsx(X.th, { children: t('chinese') }), _jsx(X.th, { children: t('chinese_bad_cases') }), _jsx(X.th, { children: t('english') }), _jsx(X.th, { children: t('english_bad_cases') }), _jsx(X.th, { children: t('description') })] }) }), _jsx("tbody", { children: normalized.map((term, index) => (_jsxs(X.tr, { children: [withName && _jsx(X.td, { children: term.name || '-' }), _jsx(X.td, { children: term.zh || term.en }), _jsx(X.td, { children: renderBadCases(term.badCases?.zh) }), _jsx(X.td, { children: term.en }), _jsx(X.td, { children: renderBadCases(term.badCases?.en) }), _jsx(X.td, { children: term.description || '-' })] }, term.name || index))) })] }));
|
|
17
13
|
};
|
|
18
14
|
export default TermsTable;
|
package/lib/shared/helpers.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const normalizeVersion: (version?: string) => string;
|
|
2
1
|
export declare const removeBothEndsSlashes: (str?: string) => string;
|
|
3
2
|
export declare const getPdfName: (lang: string, userBase?: string, title?: string) => string;
|
|
4
3
|
export declare const DOC_PATTERN: RegExp;
|
package/lib/shared/helpers.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
const PLAIN_VERSION_PATTERN = /^(\d+\.)*\d+$/;
|
|
2
|
-
export const normalizeVersion = (version = '') => PLAIN_VERSION_PATTERN.test(version) ? `v${version}` : version;
|
|
3
1
|
export const removeBothEndsSlashes = (str) => str?.replace(/^\/|\/$/g, '') || '';
|
|
4
2
|
export const getPdfName = (lang, userBase, title) => `${removeBothEndsSlashes(userBase) || title || 'exported'}-${lang}.pdf`;
|
|
5
3
|
export const DOC_PATTERN = /\.mdx?$/;
|
package/lib/terms.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export interface TermItem {
|
|
|
8
8
|
en?: string[];
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
export declare const unnamedTermItems: TermItem[];
|
|
12
11
|
declare const terms: {
|
|
13
12
|
readonly company: {
|
|
14
13
|
readonly en: "Alauda";
|
|
@@ -33,5 +32,4 @@ export interface NamedTermItem extends TermItem {
|
|
|
33
32
|
export type NormalizedTermItem = SetOptional<NamedTermItem, 'name'>;
|
|
34
33
|
export declare const namedTerms: NamedTerms;
|
|
35
34
|
export declare const namedTermItems: NamedTermItem[];
|
|
36
|
-
export declare const allTermItems: NormalizedTermItem[];
|
|
37
35
|
export {};
|
package/lib/terms.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export const unnamedTermItems = [];
|
|
2
1
|
const terms = {
|
|
3
2
|
company: {
|
|
4
3
|
en: 'Alauda',
|
|
@@ -23,7 +22,3 @@ export const namedTermItems = Object.keys(terms).map((name_) => {
|
|
|
23
22
|
...terms[name],
|
|
24
23
|
};
|
|
25
24
|
});
|
|
26
|
-
export const allTermItems = [
|
|
27
|
-
...namedTermItems,
|
|
28
|
-
...unnamedTermItems,
|
|
29
|
-
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/doom",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Doctor Doom making docs.",
|
|
6
6
|
"repository": {
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"translate": "yarn doom translate fixture-docs"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@inquirer/prompts": "^7.
|
|
46
|
+
"@inquirer/prompts": "^7.4.0",
|
|
47
47
|
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
|
|
48
48
|
"@playwright/browser-chromium": "^1.51.0",
|
|
49
|
-
"@rspress/core": "1.43.
|
|
49
|
+
"@rspress/core": "1.43.5",
|
|
50
50
|
"@shikijs/transformers": "^3.2.1",
|
|
51
51
|
"chokidar": "^4.0.3",
|
|
52
52
|
"cli-progress": "^3.12.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"es-toolkit": "^1.33.0",
|
|
57
57
|
"fs-extra": "^11.3.0",
|
|
58
58
|
"html-tag-names": "^2.1.0",
|
|
59
|
-
"mermaid": "^11.
|
|
59
|
+
"mermaid": "^11.5.0",
|
|
60
60
|
"openai": "^5.0.0-beta.0",
|
|
61
61
|
"openapi-types": "^12.1.3",
|
|
62
62
|
"p-ratelimit": "^1.0.1",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@eslint/js": "^9.22.0",
|
|
82
|
-
"@swc-node/register": "^1.10.
|
|
83
|
-
"@swc/core": "1.11.
|
|
82
|
+
"@swc-node/register": "^1.10.10",
|
|
83
|
+
"@swc/core": "1.11.9",
|
|
84
84
|
"@types/cli-progress": "^3.11.6",
|
|
85
85
|
"@types/ejs": "^3.1.5",
|
|
86
86
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@types/swagger2openapi": "^7.0.4",
|
|
92
92
|
"@unts/patch-package": "^8.1.1",
|
|
93
93
|
"eslint": "^9.22.0",
|
|
94
|
-
"lint-staged": "^15.
|
|
94
|
+
"lint-staged": "^15.5.0",
|
|
95
95
|
"npm-run-all2": "^7.0.2",
|
|
96
96
|
"prettier": "^3.5.3",
|
|
97
97
|
"prettier-plugin-pkg": "^0.18.1",
|