@diplodoc/cli 4.2.0 → 4.2.1
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 +1 -1
- package/build/index.js.map +1 -1
- package/build/linter.js.map +1 -1
- package/package.json +3 -3
- 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 +5 -5
- package/src/steps/processExcludedFiles.ts +1 -1
- package/src/steps/processLinter.ts +3 -3
- package/src/steps/processPages.ts +7 -7
- package/src/steps/processServiceFiles.ts +1 -1
- package/src/steps/publishFilesToS3.ts +1 -1
- 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/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 {copyFileSync, readFileSync, writeFileSync
|
|
3
|
-
import {
|
|
1
|
+
import {dirname, extname, join, normalize, parse, relative, resolve, sep} from 'path';
|
|
2
|
+
import {copyFileSync, 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>;
|
|
@@ -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
4
|
import {copyFileSync, 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>> = {};
|
|
@@ -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/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();
|