@diplodoc/cli 4.19.0 → 4.19.2
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/build/index.js +11 -10
- package/build/index.js.map +2 -2
- package/package.json +6 -6
- package/src/cmd/translate/utils/fs.ts +1 -1
- package/src/steps/processAssets.ts +11 -9
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "Yandex Data UI Team <data-ui@yandex-team.ru>",
|
|
4
4
|
"description": "Make documentation using yfm-docs in Markdown and HTML formats",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "4.19.
|
|
6
|
+
"version": "4.19.2",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git@github.com:diplodoc-platform/cli.git"
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"schemas",
|
|
19
19
|
"src"
|
|
20
20
|
],
|
|
21
|
-
"
|
|
22
|
-
"
|
|
21
|
+
"exports": {
|
|
22
|
+
"./package": "./package.json"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "node scripts/build.cli.js",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"@types/chalk": "2.2.0",
|
|
56
56
|
"@types/glob": "^8.1.0",
|
|
57
57
|
"@types/html-escaper": "^3.0.0",
|
|
58
|
-
"@types/js-yaml": "4.0.
|
|
58
|
+
"@types/js-yaml": "4.0.9",
|
|
59
59
|
"@types/json-stringify-safe": "^5.0.3",
|
|
60
60
|
"@types/lodash": "4.14.195",
|
|
61
|
-
"@types/mime-types": "2.1.
|
|
61
|
+
"@types/mime-types": "2.1.4",
|
|
62
62
|
"@types/node": "14.*",
|
|
63
|
-
"@types/shelljs": "0.8.
|
|
63
|
+
"@types/shelljs": "0.8.15",
|
|
64
64
|
"@types/tar-stream": "^2.2.2",
|
|
65
65
|
"@types/yargs": "17.0.24",
|
|
66
66
|
"ajv": "^8.11.0",
|
|
@@ -3,7 +3,7 @@ import {dirname, join} from 'node:path';
|
|
|
3
3
|
import {readFile, writeFile} from 'node:fs/promises';
|
|
4
4
|
import {dump, load} from 'js-yaml';
|
|
5
5
|
|
|
6
|
-
const ROOT = dirname(require.resolve('
|
|
6
|
+
const ROOT = dirname(require.resolve('@diplodoc/cli/package'));
|
|
7
7
|
|
|
8
8
|
function last<T>(array: T[]): T | undefined {
|
|
9
9
|
return array[array.length - 1];
|
|
@@ -4,7 +4,7 @@ import {readFileSync} from 'fs';
|
|
|
4
4
|
import shell from 'shelljs';
|
|
5
5
|
import {join, resolve} from 'path';
|
|
6
6
|
|
|
7
|
-
import {ArgvService} from '../services';
|
|
7
|
+
import {ArgvService, TocService} from '../services';
|
|
8
8
|
import {checkPathExists, copyFiles, findAllValuesByKeys} from '../utils';
|
|
9
9
|
|
|
10
10
|
import {LINK_KEYS} from '@diplodoc/client/ssr';
|
|
@@ -60,7 +60,7 @@ function processAssetsHtmlRun({outputBundlePath}) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function processAssetsMdRun({args, tmpOutputFolder}) {
|
|
63
|
-
const {allowCustomResources, resources} = ArgvService.getConfig();
|
|
63
|
+
const {input: inputFolderPath, allowCustomResources, resources} = ArgvService.getConfig();
|
|
64
64
|
|
|
65
65
|
const pathToConfig = args.config || join(args.input, YFM_CONFIG_FILENAME);
|
|
66
66
|
const pathToRedirects = join(args.input, REDIRECTS_FILENAME);
|
|
@@ -82,14 +82,16 @@ function processAssetsMdRun({args, tmpOutputFolder}) {
|
|
|
82
82
|
copyFiles(args.input, tmpOutputFolder, resourcePaths);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
const tocYamlFiles = TocService.getNavigationPaths().reduce((acc, file) => {
|
|
86
|
+
if (file.endsWith('.yaml')) {
|
|
87
|
+
const resolvedPathToFile = resolve(inputFolderPath, file);
|
|
88
|
+
|
|
89
|
+
acc.push(resolvedPathToFile);
|
|
90
|
+
}
|
|
91
|
+
return acc;
|
|
92
|
+
}, []);
|
|
91
93
|
|
|
92
|
-
|
|
94
|
+
tocYamlFiles.forEach((yamlFile) => {
|
|
93
95
|
const content = load(readFileSync(yamlFile, 'utf8'));
|
|
94
96
|
|
|
95
97
|
if (!Object.prototype.hasOwnProperty.call(content, 'blocks')) {
|