@alauda/doom 0.23.5 → 0.23.7
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/helpers.d.ts +1 -1
- package/lib/cli/helpers.js +1 -1
- package/lib/cli/index.js +2 -1
- package/lib/cli/translate.js +3 -3
- package/package.json +8 -8
package/lib/cli/helpers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const parseBoolean: (value
|
|
1
|
+
export declare const parseBoolean: (value?: string) => boolean;
|
|
2
2
|
export declare const getMatchedDocFilePaths: (matched: string[]) => Promise<(string | string[])[]>;
|
|
3
3
|
/**
|
|
4
4
|
* Support custom id like `#hello world {#custom-id}`
|
package/lib/cli/helpers.js
CHANGED
|
@@ -3,7 +3,7 @@ import { glob } from 'tinyglobby';
|
|
|
3
3
|
import { xfetch } from 'x-fetch';
|
|
4
4
|
import { parse } from 'yaml';
|
|
5
5
|
import { FALSY_VALUES } from '../shared/index.js';
|
|
6
|
-
export const parseBoolean = (value) =>
|
|
6
|
+
export const parseBoolean = (value) => value === undefined || !FALSY_VALUES.has(value);
|
|
7
7
|
const DOC_PATTERN = /\.mdx?$/;
|
|
8
8
|
const isDoc = (filename) => DOC_PATTERN.test(filename);
|
|
9
9
|
export const getMatchedDocFilePaths = (matched) => Promise.all(matched.map(async (it) => {
|
package/lib/cli/index.js
CHANGED
|
@@ -43,7 +43,8 @@ program
|
|
|
43
43
|
.option('-E, --exclude <language...>', 'Include all languages except the specific language(s), `ru` for example')
|
|
44
44
|
.option('-o, --out-dir <path>', 'Override the `outDir` defined in the config file or the default `dist/{base}/{version}`, the resulting path will be `dist/{outDir}/{version}`')
|
|
45
45
|
.option('-r, --redirect <enum>', 'Whether to redirect to the locale closest to `navigator.language` when the user visits the site, could be `auto`, `never` or `only-default-lang`', 'only-default-lang')
|
|
46
|
-
.option('-R, --edit-repo [boolean|url]', 'Whether to enable or override the `editRepoBaseUrl` config feature, `https://github.com/` prefix could be omitted', (value) =>
|
|
46
|
+
.option('-R, --edit-repo [boolean|url]', 'Whether to enable or override the `editRepoBaseUrl` config feature, `https://github.com/` prefix could be omitted', (value) => value === undefined ||
|
|
47
|
+
(!FALSY_VALUES.has(value) && (TRUTHY_VALUES.has(value) || value)), false)
|
|
47
48
|
.option('-n, --no-open [boolean]', 'Do not open the browser after starting the server')
|
|
48
49
|
.command('dev', { isDefault: true })
|
|
49
50
|
.description('Start the development server')
|
package/lib/cli/translate.js
CHANGED
|
@@ -50,9 +50,9 @@ const DEFAULT_SYSTEM_PROMPT = `
|
|
|
50
50
|
- 语句不通顺,指出位置,不需要给出修改意见,意译时修复
|
|
51
51
|
- 晦涩难懂,模棱两可,不易理解,可以尝试给出解释
|
|
52
52
|
3. 根据第一步直译的结果和第二步指出的问题,重新进行意译,保证内容的原意的基础上,使其更易于理解,更符合<%= targetLang %>技术文档的表达习惯,同时保持原有的格式不变
|
|
53
|
-
4. 当存在之前翻译过的<%= targetLang %>文档时,将第三步的结果分段与之前的<%= targetLang
|
|
53
|
+
4. 当存在之前翻译过的<%= targetLang %>文档时,将第三步的结果分段与之前的<%= targetLang %>文档细致地比较,不要遗漏任何新的分段(包括文本、代码块、图片、超链接等等),如果分段内翻译结果意思相近,仅仅表达方式不同的,且没有新增任何内容时,则该分段只需要保持之前翻译过的内容即可,不需要重复翻译
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
最终只需要完整输出最后一步的结果,不需要输出任何提及提示词或之前步骤的内容,也不要只返回新增的内容。
|
|
56
56
|
|
|
57
57
|
<%= userPrompt %>
|
|
58
58
|
|
|
@@ -106,7 +106,7 @@ export const translate = async ({ source, sourceContent, target, targetContent =
|
|
|
106
106
|
},
|
|
107
107
|
],
|
|
108
108
|
model: 'gpt-4o-mini',
|
|
109
|
-
temperature: 0,
|
|
109
|
+
temperature: 0.1,
|
|
110
110
|
});
|
|
111
111
|
const { content, refusal } = choices[0].message;
|
|
112
112
|
if (refusal) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/doom",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Doctor Doom making docs.",
|
|
6
6
|
"repository": "git+https://github.com/alauda/doom.git",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"rspress-plugins"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@cspell/eslint-plugin": "^9.0.
|
|
37
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
38
|
-
"@inquirer/prompts": "^7.5.
|
|
36
|
+
"@cspell/eslint-plugin": "^9.0.2",
|
|
37
|
+
"@eslint-react/eslint-plugin": "^1.50.0",
|
|
38
|
+
"@inquirer/prompts": "^7.5.3",
|
|
39
39
|
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
|
|
40
40
|
"@playwright/browser-chromium": "^1.52.0",
|
|
41
41
|
"@rsbuild/plugin-yaml": "^1.0.2",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"clsx": "^2.1.1",
|
|
47
47
|
"commander": "^13.1.0",
|
|
48
48
|
"ejs": "^3.1.10",
|
|
49
|
-
"es-toolkit": "^1.
|
|
50
|
-
"eslint": "^9.
|
|
49
|
+
"es-toolkit": "^1.38.0",
|
|
50
|
+
"eslint": "^9.27.0",
|
|
51
51
|
"eslint-plugin-mdx": "^3.4.2",
|
|
52
52
|
"html-tag-names": "^2.1.0",
|
|
53
53
|
"mdast-util-mdx": "^2.0.1",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"shiki": "^3.4.2",
|
|
71
71
|
"simple-git": "^3.27.0",
|
|
72
72
|
"swagger2openapi": "^7.0.8",
|
|
73
|
-
"tinyglobby": "^0.2.
|
|
73
|
+
"tinyglobby": "^0.2.14",
|
|
74
74
|
"type-fest": "^4.41.0",
|
|
75
|
-
"typescript-eslint": "^8.
|
|
75
|
+
"typescript-eslint": "^8.33.0",
|
|
76
76
|
"x-fetch": "^0.2.6",
|
|
77
77
|
"yaml": "^2.8.0",
|
|
78
78
|
"yoctocolors": "^2.1.1"
|