@alauda/doom 0.23.4 → 0.23.6
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-pdf-core/generatePdf.js +1 -1
- package/lib/cli/export-pdf-core/utils/mergePDF.js +1 -1
- package/lib/cli/export.js +3 -2
- 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 +1 -1
- package/package.json +8 -9
|
@@ -74,7 +74,7 @@ export async function generatePdf({ pages, tempDir, port, host, outFile, outDir,
|
|
|
74
74
|
singleBar.stop();
|
|
75
75
|
await printer.closeBrowser();
|
|
76
76
|
const exportedPath = await mergePDF(normalizePages, outFile, outDir, allOutlines);
|
|
77
|
-
const message =
|
|
77
|
+
const message = `Exported to ${yellow(exportedPath)}\n`;
|
|
78
78
|
process.stdout.write(message);
|
|
79
79
|
await fs.rm(tempDir, { force: true, recursive: true });
|
|
80
80
|
return exportedPath;
|
|
@@ -112,7 +112,7 @@ export async function mergePDF(pages, outFile, outDir, pdfOutlines) {
|
|
|
112
112
|
}
|
|
113
113
|
const saveFilePath = join(saveDirPath, outFile);
|
|
114
114
|
if (pages.length === 0) {
|
|
115
|
-
process.
|
|
115
|
+
process.stderr.write(red('The website has no pages, please check whether the export path is set correctly'));
|
|
116
116
|
process.exit(1);
|
|
117
117
|
}
|
|
118
118
|
else if (pages.length === 1) {
|
package/lib/cli/export.js
CHANGED
|
@@ -85,9 +85,10 @@ export const exportCommand = new Command('export')
|
|
|
85
85
|
},
|
|
86
86
|
};
|
|
87
87
|
const exportPdf = async (sidebarItems, lang = config.lang) => {
|
|
88
|
-
|
|
88
|
+
const pages = collectPages(sidebarItems);
|
|
89
|
+
logger.start(`Exporting ${lang} language documents with ${pages.length} pages...`);
|
|
89
90
|
await generatePdf({
|
|
90
|
-
pages
|
|
91
|
+
pages,
|
|
91
92
|
outFile: getPdfName(lang, config.userBase, config.title),
|
|
92
93
|
...commonOptions,
|
|
93
94
|
});
|
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
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/doom",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Doctor Doom making docs.",
|
|
6
6
|
"repository": "git+https://github.com/alauda/doom.git",
|
|
7
7
|
"homepage": "https://github.com/alauda/doom#readme",
|
|
8
|
-
"funding": "https://opencollective.com/alauda",
|
|
9
8
|
"license": "MIT",
|
|
10
9
|
"engines": {
|
|
11
10
|
"node": ">=18.17.0 <20 || >=20.1.0"
|
|
@@ -34,9 +33,9 @@
|
|
|
34
33
|
"rspress-plugins"
|
|
35
34
|
],
|
|
36
35
|
"dependencies": {
|
|
37
|
-
"@cspell/eslint-plugin": "^9.0.
|
|
38
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
39
|
-
"@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",
|
|
40
39
|
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
|
|
41
40
|
"@playwright/browser-chromium": "^1.52.0",
|
|
42
41
|
"@rsbuild/plugin-yaml": "^1.0.2",
|
|
@@ -47,8 +46,8 @@
|
|
|
47
46
|
"clsx": "^2.1.1",
|
|
48
47
|
"commander": "^13.1.0",
|
|
49
48
|
"ejs": "^3.1.10",
|
|
50
|
-
"es-toolkit": "^1.
|
|
51
|
-
"eslint": "^9.
|
|
49
|
+
"es-toolkit": "^1.38.0",
|
|
50
|
+
"eslint": "^9.27.0",
|
|
52
51
|
"eslint-plugin-mdx": "^3.4.2",
|
|
53
52
|
"html-tag-names": "^2.1.0",
|
|
54
53
|
"mdast-util-mdx": "^2.0.1",
|
|
@@ -71,9 +70,9 @@
|
|
|
71
70
|
"shiki": "^3.4.2",
|
|
72
71
|
"simple-git": "^3.27.0",
|
|
73
72
|
"swagger2openapi": "^7.0.8",
|
|
74
|
-
"tinyglobby": "^0.2.
|
|
73
|
+
"tinyglobby": "^0.2.14",
|
|
75
74
|
"type-fest": "^4.41.0",
|
|
76
|
-
"typescript-eslint": "^8.
|
|
75
|
+
"typescript-eslint": "^8.33.0",
|
|
77
76
|
"x-fetch": "^0.2.6",
|
|
78
77
|
"yaml": "^2.8.0",
|
|
79
78
|
"yoctocolors": "^2.1.1"
|