@diplodoc/cli 4.2.1 → 4.2.2-beta.0
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 +53 -50
- package/build/index.js.map +3 -3
- package/build/linter.js +20 -21
- package/build/linter.js.map +3 -3
- package/package.json +14 -6
- package/src/cmd/build/index.ts +2 -1
- package/src/services/tocs.ts +2 -2
- package/src/steps/processPages.ts +2 -2
- package/src/utils/file.ts +11 -6
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.2.
|
|
6
|
+
"version": "4.2.2-beta.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git@github.com:diplodoc-platform/cli.git"
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"git:head": "git checkout master && git pull"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": "18.*",
|
|
29
|
-
"npm:": "9.*"
|
|
28
|
+
"node": ">=18.*",
|
|
29
|
+
"npm:": ">=9.*"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
33
33
|
"@aws-sdk/client-s3": "^3.369.0",
|
|
34
34
|
"@diplodoc/client": "^1.0.2",
|
|
35
35
|
"@diplodoc/markdown-translation": "^1.0.0-beta.4",
|
|
36
|
-
"@diplodoc/mermaid-extension": "^1.1.
|
|
37
|
-
"@diplodoc/openapi-extension": "^1.
|
|
38
|
-
"@diplodoc/transform": "^4.
|
|
36
|
+
"@diplodoc/mermaid-extension": "^1.1.3",
|
|
37
|
+
"@diplodoc/openapi-extension": "^1.4.0",
|
|
38
|
+
"@diplodoc/transform": "^4.2.1",
|
|
39
39
|
"@octokit/core": "4.2.4",
|
|
40
40
|
"@types/glob": "^8.0.0",
|
|
41
41
|
"@types/json-stringify-safe": "^5.0.0",
|
|
@@ -56,6 +56,8 @@
|
|
|
56
56
|
"mime-types": "2.1.35",
|
|
57
57
|
"minimatch": "^9.0.3",
|
|
58
58
|
"node-html-parser": "^6.1.5",
|
|
59
|
+
"react": "^18.2.0",
|
|
60
|
+
"react-dom": "^18.2.0",
|
|
59
61
|
"shelljs": "0.8.5",
|
|
60
62
|
"simple-git": "3.19.0",
|
|
61
63
|
"slugify": "^1.6.5",
|
|
@@ -89,6 +91,12 @@
|
|
|
89
91
|
"ts-node": "^10.9.1",
|
|
90
92
|
"typescript": "4.9.5"
|
|
91
93
|
},
|
|
94
|
+
"overrides": {
|
|
95
|
+
"react-sortable-hoc": {
|
|
96
|
+
"react": "^18.2.0",
|
|
97
|
+
"react-dom": "^18.2.0"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
92
100
|
"husky": {
|
|
93
101
|
"hooks": {
|
|
94
102
|
"pre-commit": "lint-staged"
|
package/src/cmd/build/index.ts
CHANGED
|
@@ -303,7 +303,6 @@ function preparingTemporaryFolders(userOutputFolder: string) {
|
|
|
303
303
|
// Create temporary input/output folders
|
|
304
304
|
shell.rm('-rf', args.input, args.output);
|
|
305
305
|
shell.mkdir(args.input, args.output);
|
|
306
|
-
shell.chmod('-R', 'u+w', args.input);
|
|
307
306
|
|
|
308
307
|
copyFiles(
|
|
309
308
|
args.rootInput,
|
|
@@ -315,4 +314,6 @@ function preparingTemporaryFolders(userOutputFolder: string) {
|
|
|
315
314
|
ignore: ['node_modules/**', '*/node_modules/**'],
|
|
316
315
|
}),
|
|
317
316
|
);
|
|
317
|
+
|
|
318
|
+
shell.chmod('-R', 'u+w', args.input);
|
|
318
319
|
}
|
package/src/services/tocs.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {dirname, extname, join, normalize, parse, relative, resolve, sep} from 'path';
|
|
2
|
-
import {
|
|
2
|
+
import {existsSync, readFileSync, writeFileSync} from 'fs';
|
|
3
3
|
import {dump, load} from 'js-yaml';
|
|
4
4
|
import shell from 'shelljs';
|
|
5
5
|
import walkSync from 'walk-sync';
|
|
@@ -205,7 +205,7 @@ function _copyTocDir(tocPath: string, destDir: string) {
|
|
|
205
205
|
|
|
206
206
|
writeFileSync(to, updatedFileContent);
|
|
207
207
|
} else {
|
|
208
|
-
|
|
208
|
+
shell.cp(from, to);
|
|
209
209
|
}
|
|
210
210
|
});
|
|
211
211
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {DocInnerProps} from '@diplodoc/client';
|
|
2
2
|
import {basename, dirname, extname, join, relative, resolve} from 'path';
|
|
3
3
|
import shell from 'shelljs';
|
|
4
|
-
import {
|
|
4
|
+
import {readFileSync, writeFileSync} from 'fs';
|
|
5
5
|
import {bold} from 'chalk';
|
|
6
6
|
import {dump, load} from 'js-yaml';
|
|
7
7
|
import {asyncify, mapLimit} from 'async';
|
|
@@ -312,7 +312,7 @@ function copyFileWithoutChanges(
|
|
|
312
312
|
const from = resolvedPathToFile;
|
|
313
313
|
const to = resolve(outputDir, filename);
|
|
314
314
|
|
|
315
|
-
|
|
315
|
+
shell.cp(from, to);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
async function processingFileToMd(path: PathData, metaDataOptions: MetaDataOptions): Promise<void> {
|
package/src/utils/file.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {dirname, resolve} from 'path';
|
|
2
2
|
import shell from 'shelljs';
|
|
3
|
-
import {copyFileSync} from 'fs';
|
|
4
3
|
import {logger} from './logger';
|
|
5
4
|
|
|
6
5
|
export function copyFiles(
|
|
@@ -8,14 +7,20 @@ export function copyFiles(
|
|
|
8
7
|
outputFolderPath: string,
|
|
9
8
|
files: string[],
|
|
10
9
|
): void {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const dirs = new Set<string>();
|
|
11
|
+
|
|
12
|
+
files.forEach((pathToAsset) => {
|
|
13
|
+
const outputDir = resolve(outputFolderPath, dirname(pathToAsset));
|
|
13
14
|
const from = resolve(inputFolderPath, pathToAsset);
|
|
14
15
|
const to = resolve(outputFolderPath, pathToAsset);
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
if (!dirs.has(outputDir)) {
|
|
18
|
+
dirs.add(outputDir);
|
|
19
|
+
shell.mkdir('-p', outputDir);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
shell.cp(from, to);
|
|
18
23
|
|
|
19
24
|
logger.copy(pathToAsset);
|
|
20
|
-
}
|
|
25
|
+
});
|
|
21
26
|
}
|