@diplodoc/cli 4.2.0 → 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 +15 -7
- package/src/cmd/build/index.ts +2 -1
- package/src/cmd/publish/index.ts +1 -1
- package/src/cmd/publish/upload.ts +2 -2
- package/src/cmd/translate/index.ts +5 -5
- package/src/cmd/xliff/compose.ts +1 -1
- package/src/cmd/xliff/extract.ts +2 -2
- package/src/index.ts +1 -1
- package/src/models.ts +1 -1
- package/src/resolvers/lintPage.ts +1 -1
- package/src/resolvers/md2html.ts +5 -5
- package/src/resolvers/md2md.ts +2 -2
- package/src/services/includers/batteries/generic.ts +2 -2
- package/src/services/includers/batteries/unarchive.ts +3 -3
- package/src/services/includers/index.ts +1 -1
- package/src/services/leading.ts +2 -2
- package/src/services/metadata.ts +2 -2
- package/src/services/plugins.ts +2 -2
- package/src/services/tocs.ts +6 -6
- package/src/steps/processExcludedFiles.ts +1 -1
- package/src/steps/processLinter.ts +3 -3
- package/src/steps/processPages.ts +9 -9
- package/src/steps/processServiceFiles.ts +1 -1
- package/src/steps/publishFilesToS3.ts +1 -1
- package/src/utils/file.ts +11 -6
- package/src/utils/markup.ts +2 -2
- package/src/utils/singlePage.ts +1 -1
- package/src/utils/toc.ts +1 -1
- package/src/validator.ts +1 -1
- package/src/vcs-connector/client/github.ts +2 -2
- package/src/vcs-connector/index.ts +1 -1
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.0",
|
|
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:": "
|
|
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
|
-
"@diplodoc/markdown-translation": "^1.0.0-beta.
|
|
36
|
-
"@diplodoc/mermaid-extension": "^1.1.
|
|
37
|
-
"@diplodoc/openapi-extension": "^1.
|
|
38
|
-
"@diplodoc/transform": "^4.
|
|
35
|
+
"@diplodoc/markdown-translation": "^1.0.0-beta.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/cmd/publish/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {createReadStream} from 'fs';
|
|
2
2
|
import walkSync from 'walk-sync';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import {join, resolve} from 'path';
|
|
4
|
+
import {PutObjectCommand, S3Client} from '@aws-sdk/client-s3';
|
|
5
5
|
import mime from 'mime-types';
|
|
6
6
|
|
|
7
7
|
import {convertBackSlashToSlash, logger} from '../../utils';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {eachLimit, retry
|
|
1
|
+
import {asyncify, eachLimit, retry} from 'async';
|
|
2
2
|
|
|
3
|
-
import {dirname,
|
|
4
|
-
import {readFile, writeFile
|
|
3
|
+
import {dirname, join, resolve} from 'path';
|
|
4
|
+
import {mkdir, readFile, writeFile} from 'fs/promises';
|
|
5
5
|
import {XMLParser} from 'fast-xml-parser';
|
|
6
6
|
|
|
7
7
|
import {Session} from '@yandex-cloud/nodejs-sdk/dist/session';
|
|
8
8
|
import {TranslationServiceClient} from '@yandex-cloud/nodejs-sdk/dist/generated/yandex/cloud/service_clients';
|
|
9
9
|
import {
|
|
10
|
-
TranslateRequest,
|
|
11
10
|
TranslateRequest_Format as Format,
|
|
11
|
+
TranslateRequest,
|
|
12
12
|
} from '@yandex-cloud/nodejs-sdk/dist/generated/yandex/cloud/ai/translate/v2/translation_service';
|
|
13
13
|
|
|
14
14
|
import markdownTranslation from '@diplodoc/markdown-translation';
|
|
@@ -17,7 +17,7 @@ import {ArgvService} from '../../services';
|
|
|
17
17
|
import {getYandexOAuthToken} from '../../packages/credentials';
|
|
18
18
|
import {glob, logger} from '../../utils';
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import {Arguments, Argv} from 'yargs';
|
|
21
21
|
|
|
22
22
|
import {YandexCloudTranslateGlossaryPair} from '../../models';
|
|
23
23
|
|
package/src/cmd/xliff/compose.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const {
|
|
2
2
|
promises: {readFile, writeFile, mkdir},
|
|
3
3
|
} = require('fs');
|
|
4
|
-
import {
|
|
4
|
+
import {dirname, extname, join} from 'path';
|
|
5
5
|
|
|
6
6
|
import markdownTranslation, {ComposeParameters} from '@diplodoc/markdown-translation';
|
|
7
7
|
import {Arguments, Argv} from 'yargs';
|
package/src/cmd/xliff/extract.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const {
|
|
2
2
|
promises: {readFile, writeFile, mkdir},
|
|
3
3
|
} = require('fs');
|
|
4
|
-
import {
|
|
4
|
+
import {dirname, extname, join} from 'path';
|
|
5
5
|
|
|
6
6
|
import markdownTranslation, {ExtractParameters} from '@diplodoc/markdown-translation';
|
|
7
7
|
import {Arguments, Argv} from 'yargs';
|
|
8
|
-
import {
|
|
8
|
+
import {asyncify, eachLimit} from 'async';
|
|
9
9
|
|
|
10
10
|
import {ArgvService} from '../../services';
|
|
11
11
|
import {glob, logger} from '../../utils';
|
package/src/index.ts
CHANGED
package/src/models.ts
CHANGED
|
@@ -2,7 +2,7 @@ import {Logger} from '@diplodoc/transform/lib/log';
|
|
|
2
2
|
import {LintConfig} from '@diplodoc/transform/lib/yfmlint';
|
|
3
3
|
|
|
4
4
|
import {FileContributors, VCSConnector, VCSConnectorConfig} from './vcs-connector/connector-models';
|
|
5
|
-
import {
|
|
5
|
+
import {IncludeMode, Lang, ResourceType, Stage} from './constants';
|
|
6
6
|
import {ChangelogItem} from '@diplodoc/transform/lib/plugins/changelog/types';
|
|
7
7
|
|
|
8
8
|
export type VarsPreset = 'internal' | 'external';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {dirname, relative, resolve} from 'path';
|
|
2
2
|
import log from '@diplodoc/transform/lib/log';
|
|
3
3
|
import {
|
|
4
|
-
default as yfmlint,
|
|
5
4
|
LintMarkdownFunctionOptions,
|
|
6
5
|
PluginOptions,
|
|
6
|
+
default as yfmlint,
|
|
7
7
|
} from '@diplodoc/transform/lib/yfmlint';
|
|
8
8
|
import {readFileSync} from 'fs';
|
|
9
9
|
import {bold} from 'chalk';
|
package/src/resolvers/md2html.ts
CHANGED
|
@@ -6,16 +6,16 @@ import transform, {Output} from '@diplodoc/transform';
|
|
|
6
6
|
import log from '@diplodoc/transform/lib/log';
|
|
7
7
|
import liquid from '@diplodoc/transform/lib/liquid';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {ArgvService,
|
|
9
|
+
import {LeadingPage, ResolveMd2HTMLResult, ResolverOptions, YfmToc} from '../models';
|
|
10
|
+
import {ArgvService, PluginService, TocService} from '../services';
|
|
11
11
|
import {
|
|
12
12
|
generateStaticMarkup,
|
|
13
|
-
logger,
|
|
14
|
-
transformToc,
|
|
15
13
|
getVarsPerFile,
|
|
16
14
|
getVarsPerRelativeFile,
|
|
15
|
+
logger,
|
|
16
|
+
transformToc,
|
|
17
17
|
} from '../utils';
|
|
18
|
-
import {
|
|
18
|
+
import {Lang, PROCESSING_FINISHED} from '../constants';
|
|
19
19
|
import {getAssetsPublicPath, getUpdatedMetadata} from '../services/metadata';
|
|
20
20
|
import {MarkdownItPluginCb} from '@diplodoc/transform/lib/plugins/typings';
|
|
21
21
|
|
package/src/resolvers/md2md.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {existsSync, readFileSync, writeFileSync} from 'fs';
|
|
2
|
-
import {dirname,
|
|
2
|
+
import {basename, dirname, extname, join, resolve} from 'path';
|
|
3
3
|
import shell from 'shelljs';
|
|
4
4
|
import log from '@diplodoc/transform/lib/log';
|
|
5
5
|
import liquid from '@diplodoc/transform/lib/liquid';
|
|
6
6
|
|
|
7
7
|
import {ArgvService, PluginService} from '../services';
|
|
8
|
-
import {
|
|
8
|
+
import {getVarsPerFile, logger} from '../utils';
|
|
9
9
|
import {PluginOptions, ResolveMd2MdOptions} from '../models';
|
|
10
10
|
import {PROCESSING_FINISHED} from '../constants';
|
|
11
11
|
import {getContentWithUpdatedMetadata} from '../services/metadata';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {readFile, writeFile
|
|
2
|
-
import {
|
|
1
|
+
import {mkdir, readFile, writeFile} from 'fs/promises';
|
|
2
|
+
import {dirname, join, parse} from 'path';
|
|
3
3
|
|
|
4
4
|
import {updateWith} from 'lodash';
|
|
5
5
|
import {dump} from 'js-yaml';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {createReadStream, createWriteStream, mkdirSync} from 'fs';
|
|
2
|
+
import {dirname, join} from 'path';
|
|
3
|
+
import {Headers, extract} from 'tar-stream';
|
|
4
4
|
|
|
5
5
|
import type {PassThrough} from 'stream';
|
|
6
6
|
|
package/src/services/leading.ts
CHANGED
|
@@ -6,11 +6,11 @@ import log from '@diplodoc/transform/lib/log';
|
|
|
6
6
|
import {ArgvService, PresetService} from './index';
|
|
7
7
|
import {LeadingPage} from '../models';
|
|
8
8
|
import {
|
|
9
|
-
filterTextItems,
|
|
10
9
|
filterFiles,
|
|
10
|
+
filterTextItems,
|
|
11
11
|
firstFilterTextItems,
|
|
12
|
-
liquidFields,
|
|
13
12
|
liquidField,
|
|
13
|
+
liquidFields,
|
|
14
14
|
} from './utils';
|
|
15
15
|
|
|
16
16
|
function filterFile(path: string) {
|
package/src/services/metadata.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {dump} from 'js-yaml';
|
|
2
2
|
|
|
3
3
|
import {VCSConnector} from '../vcs-connector/connector-models';
|
|
4
|
-
import {
|
|
4
|
+
import {MetaDataOptions, Metadata, Resources} from '../models';
|
|
5
5
|
import {
|
|
6
6
|
getAuthorDetails,
|
|
7
7
|
updateAuthorMetadataStringByAuthorLogin,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {getFileContributorsMetadata, getFileContributorsString} from './contributors';
|
|
11
11
|
import {isObject} from './utils';
|
|
12
12
|
import {сarriage} from '../utils';
|
|
13
|
-
import {
|
|
13
|
+
import {REGEXP_AUTHOR, metadataBorder} from '../constants';
|
|
14
14
|
import {dirname, relative, resolve} from 'path';
|
|
15
15
|
import {ArgvService} from './index';
|
|
16
16
|
|
package/src/services/plugins.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {LintConfig, LintRule} from '@diplodoc/transform/lib/yfmlint';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {CollectionOfPluginsFunction, Plugin, PluginOptions} from '../models';
|
|
4
4
|
import {YFM_PLUGINS} from '../constants';
|
|
5
5
|
|
|
6
6
|
let plugins: Function[] | Plugin[];
|
package/src/services/tocs.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {dirname, extname, join,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {dirname, extname, join, normalize, parse, relative, resolve, sep} from 'path';
|
|
2
|
+
import {existsSync, readFileSync, writeFileSync} from 'fs';
|
|
3
|
+
import {dump, load} from 'js-yaml';
|
|
4
4
|
import shell from 'shelljs';
|
|
5
5
|
import walkSync from 'walk-sync';
|
|
6
6
|
import liquid from '@diplodoc/transform/lib/liquid';
|
|
@@ -10,10 +10,10 @@ import {bold} from 'chalk';
|
|
|
10
10
|
import {ArgvService, PresetService} from './index';
|
|
11
11
|
import {getContentWithUpdatedStaticMetadata} from './metadata';
|
|
12
12
|
import {YfmToc} from '../models';
|
|
13
|
-
import {
|
|
13
|
+
import {IncludeMode, Stage} from '../constants';
|
|
14
14
|
import {isExternalHref, logger} from '../utils';
|
|
15
15
|
import {filterFiles, firstFilterTextItems, liquidField} from './utils';
|
|
16
|
-
import {
|
|
16
|
+
import {IncludersError, applyIncluders} from './includers';
|
|
17
17
|
|
|
18
18
|
export interface TocServiceData {
|
|
19
19
|
storage: Map<string, YfmToc>;
|
|
@@ -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,11 +1,11 @@
|
|
|
1
1
|
import log from '@diplodoc/transform/lib/log';
|
|
2
|
-
import {
|
|
2
|
+
import {Thread, Worker, spawn} from 'threads';
|
|
3
3
|
import {extname} from 'path';
|
|
4
4
|
|
|
5
|
-
import {ArgvService,
|
|
5
|
+
import {ArgvService, PluginService, PresetService, TocService} from '../services';
|
|
6
6
|
import {ProcessLinterWorker} from '../workers/linter';
|
|
7
7
|
import {logger} from '../utils';
|
|
8
|
-
import {LINTING_FINISHED,
|
|
8
|
+
import {LINTING_FINISHED, MIN_CHUNK_SIZE, WORKERS_COUNT} from '../constants';
|
|
9
9
|
import {lintPage} from '../resolvers';
|
|
10
10
|
import {splitOnChunks} from '../utils/worker';
|
|
11
11
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type {DocInnerProps} from '@diplodoc/client';
|
|
2
|
-
import {basename, dirname, extname,
|
|
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
|
-
import {
|
|
7
|
+
import {asyncify, mapLimit} from 'async';
|
|
8
8
|
|
|
9
9
|
import log from '@diplodoc/transform/lib/log';
|
|
10
10
|
|
|
11
|
-
import {ArgvService, LeadingService,
|
|
11
|
+
import {ArgvService, LeadingService, PluginService, TocService} from '../services';
|
|
12
12
|
import {resolveMd2HTML, resolveMd2Md} from '../resolvers';
|
|
13
13
|
import {
|
|
14
14
|
generateStaticMarkup,
|
|
@@ -17,16 +17,16 @@ import {
|
|
|
17
17
|
transformTocForSinglePage,
|
|
18
18
|
} from '../utils';
|
|
19
19
|
import {
|
|
20
|
+
LeadingPage,
|
|
20
21
|
MetaDataOptions,
|
|
21
|
-
SinglePageResult,
|
|
22
22
|
PathData,
|
|
23
|
-
YfmToc,
|
|
24
23
|
Resources,
|
|
25
|
-
|
|
24
|
+
SinglePageResult,
|
|
25
|
+
YfmToc,
|
|
26
26
|
} from '../models';
|
|
27
27
|
import {VCSConnector} from '../vcs-connector/connector-models';
|
|
28
28
|
import {getVCSConnector} from '../vcs-connector';
|
|
29
|
-
import {
|
|
29
|
+
import {Lang, ResourceType, SINGLE_PAGE_DATA_FILENAME, SINGLE_PAGE_FILENAME} from '../constants';
|
|
30
30
|
|
|
31
31
|
const singlePageResults: Record<string, SinglePageResult[]> = {};
|
|
32
32
|
const singlePagePaths: Record<string, Set<string>> = {};
|
|
@@ -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> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {dirname, resolve} from 'path';
|
|
2
2
|
import walkSync from 'walk-sync';
|
|
3
3
|
import {readFileSync, writeFileSync} from 'fs';
|
|
4
|
-
import {
|
|
4
|
+
import {dump, load} from 'js-yaml';
|
|
5
5
|
import log from '@diplodoc/transform/lib/log';
|
|
6
6
|
|
|
7
7
|
import {ArgvService, PresetService, TocService} from '../services';
|
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
|
}
|
package/src/utils/markup.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {platform} from 'process';
|
|
2
2
|
|
|
3
3
|
import {CUSTOM_STYLE, Platforms, ResourceType} from '../constants';
|
|
4
|
-
import {
|
|
4
|
+
import {Resources, SinglePageResult} from '../models';
|
|
5
5
|
import {ArgvService, PluginService} from '../services';
|
|
6
6
|
import {preprocessPageHtmlForSinglePage} from './singlePage';
|
|
7
|
-
import {
|
|
7
|
+
import {DocInnerProps, DocPageData, render} from '@diplodoc/client';
|
|
8
8
|
import client from '../../scripts/client';
|
|
9
9
|
|
|
10
10
|
export interface TitleMeta {
|
package/src/utils/singlePage.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import HTMLElement from 'node-html-parser/dist/nodes/html';
|
|
2
2
|
import {parse} from 'node-html-parser';
|
|
3
|
-
import {resolve, sep
|
|
3
|
+
import {relative, resolve, sep} from 'path';
|
|
4
4
|
import {resolveRelativePath} from '@diplodoc/transform/lib/utilsFS';
|
|
5
5
|
import url from 'url';
|
|
6
6
|
import _ from 'lodash';
|
package/src/utils/toc.ts
CHANGED
package/src/validator.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {readFileSync} from 'fs';
|
|
|
4
4
|
import {load} from 'js-yaml';
|
|
5
5
|
import merge from 'lodash/merge';
|
|
6
6
|
import log from '@diplodoc/transform/lib/log';
|
|
7
|
-
import {
|
|
7
|
+
import {LINT_CONFIG_FILENAME, REDIRECTS_FILENAME, YFM_CONFIG_FILENAME} from './constants';
|
|
8
8
|
import {ConnectorValidatorProps} from './vcs-connector/connector-models';
|
|
9
9
|
|
|
10
10
|
function notEmptyStringValidator(value: unknown): Boolean {
|
|
@@ -2,10 +2,10 @@ import log from '@diplodoc/transform/lib/log';
|
|
|
2
2
|
import {Octokit} from '@octokit/core';
|
|
3
3
|
import {ArgvService} from '../../services';
|
|
4
4
|
import {
|
|
5
|
-
GithubCommitDTO,
|
|
6
5
|
GitHubConnectorFields,
|
|
7
|
-
|
|
6
|
+
GithubCommitDTO,
|
|
8
7
|
GithubUserDTO,
|
|
8
|
+
SourceType,
|
|
9
9
|
} from '../connector-models';
|
|
10
10
|
import {validateConnectorFields} from '../connector-validator';
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ArgvService} from '../services';
|
|
2
2
|
import getGitHubVCSConnector from './github';
|
|
3
|
-
import {
|
|
3
|
+
import {SourceType, VCSConnector} from './connector-models';
|
|
4
4
|
|
|
5
5
|
export async function getVCSConnector(): Promise<VCSConnector | undefined> {
|
|
6
6
|
const {connector} = ArgvService.getConfig();
|