From 9b79b32596461c4c39af6dfc1036b004a6c56ef0 Mon Sep 17 00:00:00 2001 From: v8tenko Date: Mon, 2 Oct 2023 18:38:29 +0300 Subject: [PATCH] feat: migrate to diplodoc --- src/constants.ts | 40 ++++++++++++------------ src/index.ts | 2 +- src/models.ts | 6 ++-- src/resolvers/lintPage.ts | 4 +-- src/resolvers/md2html.ts | 8 ++--- src/resolvers/md2md.ts | 6 ++-- src/services/leading.ts | 2 +- src/services/plugins.ts | 2 +- src/services/tocs.ts | 4 +-- src/services/utils.ts | 4 +-- src/steps/processLinter.ts | 2 +- src/steps/processLogs.ts | 2 +- src/steps/processPages.ts | 2 +- src/steps/processServiceFiles.ts | 2 +- src/utils/logger.ts | 2 +- src/utils/singlePage.ts | 2 +- src/validator.ts | 2 +- src/vcs-connector/client/github.ts | 2 +- src/vcs-connector/connector-validator.ts | 2 +- src/workers/linter/index.ts | 2 +- 20 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index a7c2ca03..7d1b06ca 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,28 +1,28 @@ import {dirname} from 'path'; const os = require('os'); -const notes = require('@doc-tools/transform/lib/plugins/notes'); -const anchors = require('@doc-tools/transform/lib/plugins/anchors'); -const code = require('@doc-tools/transform/lib/plugins/code'); -const cut = require('@doc-tools/transform/lib/plugins/cut'); -const deflist = require('@doc-tools/transform/lib/plugins/deflist'); -const imsize = require('@doc-tools/transform/lib/plugins/imsize'); -const meta = require('@doc-tools/transform/lib/plugins/meta'); -const sup = require('@doc-tools/transform/lib/plugins/sup'); -const tabs = require('@doc-tools/transform/lib/plugins/tabs'); -const video = require('@doc-tools/transform/lib/plugins/video'); -const includes = require('@doc-tools/transform/lib/plugins/includes'); -const links = require('@doc-tools/transform/lib/plugins/links'); -const images = require('@doc-tools/transform/lib/plugins/images'); -const monospace = require('@doc-tools/transform/lib/plugins/monospace'); -const table = require('@doc-tools/transform/lib/plugins/table'); -const term = require('@doc-tools/transform/lib/plugins/term'); -const changelog = require('@doc-tools/transform/lib/plugins/changelog'); +const notes = require('@diplodoc/transform/lib/plugins/notes'); +const anchors = require('@diplodoc/transform/lib/plugins/anchors'); +const code = require('@diplodoc/transform/lib/plugins/code'); +const cut = require('@diplodoc/transform/lib/plugins/cut'); +const deflist = require('@diplodoc/transform/lib/plugins/deflist'); +const imsize = require('@diplodoc/transform/lib/plugins/imsize'); +const meta = require('@diplodoc/transform/lib/plugins/meta'); +const sup = require('@diplodoc/transform/lib/plugins/sup'); +const tabs = require('@diplodoc/transform/lib/plugins/tabs'); +const video = require('@diplodoc/transform/lib/plugins/video'); +const includes = require('@diplodoc/transform/lib/plugins/includes'); +const links = require('@diplodoc/transform/lib/plugins/links'); +const images = require('@diplodoc/transform/lib/plugins/images'); +const monospace = require('@diplodoc/transform/lib/plugins/monospace'); +const table = require('@diplodoc/transform/lib/plugins/table'); +const term = require('@diplodoc/transform/lib/plugins/term'); +const changelog = require('@diplodoc/transform/lib/plugins/changelog'); const mermaid = require('@diplodoc/mermaid-extension'); const openapi = require('@diplodoc/openapi-extension'); -includes.collect = require('@doc-tools/transform/lib/plugins/includes/collect'); -images.collect = require('@doc-tools/transform/lib/plugins/images/collect'); -changelog.collect = require('@doc-tools/transform/lib/plugins/changelog/collect'); +includes.collect = require('@diplodoc/transform/lib/plugins/includes/collect'); +images.collect = require('@diplodoc/transform/lib/plugins/images/collect'); +changelog.collect = require('@diplodoc/transform/lib/plugins/changelog/collect'); export const BUILD_FOLDER = 'build'; export const BUNDLE_FOLDER = '_bundle'; diff --git a/src/index.ts b/src/index.ts index 1cff3b01..0ea281ac 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import yargs from 'yargs'; import {hideBin} from 'yargs/helpers'; -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import 'threads/register'; import {MAIN_TIMER_ID} from './constants'; diff --git a/src/models.ts b/src/models.ts index ee8570af..27ee01a0 100644 --- a/src/models.ts +++ b/src/models.ts @@ -1,9 +1,9 @@ -import {Logger} from '@doc-tools/transform/lib/log'; -import {LintConfig} from '@doc-tools/transform/lib/yfmlint'; +import {Logger} from '@diplodoc/transform/lib/log'; +import {LintConfig} from '@diplodoc/transform/lib/yfmlint'; import {FileContributors, VCSConnector, VCSConnectorConfig} from './vcs-connector/connector-models'; import {Lang, Stage, IncludeMode, ResourceType} from './constants'; -import {ChangelogItem} from '@doc-tools/transform/lib/plugins/changelog/types'; +import {ChangelogItem} from '@diplodoc/transform/lib/plugins/changelog/types'; export type VarsPreset = 'internal'|'external'; diff --git a/src/resolvers/lintPage.ts b/src/resolvers/lintPage.ts index 4b054d13..726783aa 100644 --- a/src/resolvers/lintPage.ts +++ b/src/resolvers/lintPage.ts @@ -1,10 +1,10 @@ import {dirname, relative, resolve} from 'path'; -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import { default as yfmlint, LintMarkdownFunctionOptions, PluginOptions, -} from '@doc-tools/transform/lib/yfmlint'; +} from '@diplodoc/transform/lib/yfmlint'; import {readFileSync} from 'fs'; import {bold} from 'chalk'; diff --git a/src/resolvers/md2html.ts b/src/resolvers/md2html.ts index f23873a0..22afb202 100644 --- a/src/resolvers/md2html.ts +++ b/src/resolvers/md2html.ts @@ -2,16 +2,16 @@ import {basename, dirname, join, relative, resolve, sep} from 'path'; import {readFileSync, writeFileSync} from 'fs'; import yaml from 'js-yaml'; -import transform, {Output} from '@doc-tools/transform'; -import log from '@doc-tools/transform/lib/log'; -import liquid from '@doc-tools/transform/lib/liquid'; +import transform, {Output} from '@diplodoc/transform'; +import log from '@diplodoc/transform/lib/log'; +import liquid from '@diplodoc/transform/lib/liquid'; import {ResolverOptions, YfmToc, ResolveMd2HTMLResult, LeadingPage} from '../models'; import {ArgvService, TocService, PluginService} from '../services'; import {generateStaticMarkup, logger, transformToc, getVarsPerFile, getVarsPerRelativeFile} from '../utils'; import {PROCESSING_FINISHED, Lang} from '../constants'; import {getAssetsPublicPath, getUpdatedMetadata} from '../services/metadata'; -import {MarkdownItPluginCb} from '@doc-tools/transform/lib/plugins/typings'; +import {MarkdownItPluginCb} from '@diplodoc/transform/lib/plugins/typings'; export interface FileTransformOptions { path: string; diff --git a/src/resolvers/md2md.ts b/src/resolvers/md2md.ts index fdb7d341..0584b2b3 100644 --- a/src/resolvers/md2md.ts +++ b/src/resolvers/md2md.ts @@ -1,15 +1,15 @@ import {existsSync, readFileSync, writeFileSync} from 'fs'; import {dirname, resolve, join, basename, extname} from 'path'; import shell from 'shelljs'; -import log from '@doc-tools/transform/lib/log'; -import liquid from '@doc-tools/transform/lib/liquid'; +import log from '@diplodoc/transform/lib/log'; +import liquid from '@diplodoc/transform/lib/liquid'; import {ArgvService, PluginService} from '../services'; import {logger, getVarsPerFile} from '../utils'; import {PluginOptions, ResolveMd2MdOptions} from '../models'; import {PROCESSING_FINISHED} from '../constants'; import {getContentWithUpdatedMetadata} from '../services/metadata'; -import {ChangelogItem} from '@doc-tools/transform/lib/plugins/changelog/types'; +import {ChangelogItem} from '@diplodoc/transform/lib/plugins/changelog/types'; export async function resolveMd2Md(options: ResolveMd2MdOptions): Promise { const {inputPath, outputPath, metadata} = options; diff --git a/src/services/leading.ts b/src/services/leading.ts index 4a208fe3..8e2b1dee 100644 --- a/src/services/leading.ts +++ b/src/services/leading.ts @@ -1,7 +1,7 @@ import {dirname, resolve} from 'path'; import {readFileSync, writeFileSync} from 'fs'; import {dump, load} from 'js-yaml'; -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import {ArgvService, PresetService} from './index'; import {LeadingPage} from '../models'; diff --git a/src/services/plugins.ts b/src/services/plugins.ts index a1d1970d..fadb9a0b 100644 --- a/src/services/plugins.ts +++ b/src/services/plugins.ts @@ -1,4 +1,4 @@ -import {LintRule, LintConfig} from '@doc-tools/transform/lib/yfmlint'; +import {LintRule, LintConfig} from '@diplodoc/transform/lib/yfmlint'; import {PluginOptions, Plugin, CollectionOfPluginsFunction} from '../models'; import {YFM_PLUGINS} from '../constants'; diff --git a/src/services/tocs.ts b/src/services/tocs.ts index 201300cf..6332097d 100644 --- a/src/services/tocs.ts +++ b/src/services/tocs.ts @@ -3,8 +3,8 @@ import {copyFileSync, readFileSync, writeFileSync, existsSync} from 'fs'; import {load, dump} from 'js-yaml'; import shell from 'shelljs'; import walkSync from 'walk-sync'; -import liquid from '@doc-tools/transform/lib/liquid'; -import log from '@doc-tools/transform/lib/log'; +import liquid from '@diplodoc/transform/lib/liquid'; +import log from '@diplodoc/transform/lib/log'; import {bold} from 'chalk'; import {ArgvService, PresetService} from './index'; diff --git a/src/services/utils.ts b/src/services/utils.ts index 41cb0120..55950916 100644 --- a/src/services/utils.ts +++ b/src/services/utils.ts @@ -1,6 +1,6 @@ -import evalExp from '@doc-tools/transform/lib/liquid/evaluation'; +import evalExp from '@diplodoc/transform/lib/liquid/evaluation'; import {Filter, TextItems} from '../models'; -import liquid from '@doc-tools/transform/lib/liquid'; +import liquid from '@diplodoc/transform/lib/liquid'; import {ArgvService} from './index'; export interface FilterFilesOptions { diff --git a/src/steps/processLinter.ts b/src/steps/processLinter.ts index 6d6f1039..f8c4732f 100644 --- a/src/steps/processLinter.ts +++ b/src/steps/processLinter.ts @@ -1,4 +1,4 @@ -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import {spawn, Worker, Thread} from 'threads'; import {extname} from 'path'; diff --git a/src/steps/processLogs.ts b/src/steps/processLogs.ts index 1298cea7..ab12ec99 100644 --- a/src/steps/processLogs.ts +++ b/src/steps/processLogs.ts @@ -1,4 +1,4 @@ -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import _uniq from 'lodash/uniq'; export function processLogs(inputFolder: string) { diff --git a/src/steps/processPages.ts b/src/steps/processPages.ts index 9bbec2a3..7009e69a 100644 --- a/src/steps/processPages.ts +++ b/src/steps/processPages.ts @@ -6,7 +6,7 @@ import {bold} from 'chalk'; import {dump, load} from 'js-yaml'; import {mapLimit, asyncify} from 'async'; -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import {ArgvService, LeadingService, TocService, PluginService} from '../services'; import {resolveMd2HTML, resolveMd2Md} from '../resolvers'; diff --git a/src/steps/processServiceFiles.ts b/src/steps/processServiceFiles.ts index b48f22c0..47c808d3 100644 --- a/src/steps/processServiceFiles.ts +++ b/src/steps/processServiceFiles.ts @@ -2,7 +2,7 @@ import {dirname, resolve} from 'path'; import walkSync from 'walk-sync'; import {readFileSync, writeFileSync} from 'fs'; import {load, dump} from 'js-yaml'; -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import {ArgvService, PresetService, TocService} from '../services'; import {logger} from '../utils'; diff --git a/src/utils/logger.ts b/src/utils/logger.ts index f46abbbb..26c0badb 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,4 +1,4 @@ -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import {blue, green, grey, red, yellow} from 'chalk'; import {ArgvService} from '../services'; diff --git a/src/utils/singlePage.ts b/src/utils/singlePage.ts index 6d224f41..fbff96f7 100644 --- a/src/utils/singlePage.ts +++ b/src/utils/singlePage.ts @@ -1,7 +1,7 @@ import HTMLElement from 'node-html-parser/dist/nodes/html'; import {parse} from 'node-html-parser'; import {resolve, sep, relative} from 'path'; -import {resolveRelativePath} from '@doc-tools/transform/lib/utilsFS'; +import {resolveRelativePath} from '@diplodoc/transform/lib/utilsFS'; import url from 'url'; import _ from 'lodash'; diff --git a/src/validator.ts b/src/validator.ts index 7d2d1980..2712b68a 100644 --- a/src/validator.ts +++ b/src/validator.ts @@ -3,7 +3,7 @@ import {join, resolve} from 'path'; import {readFileSync} from 'fs'; import {load} from 'js-yaml'; import merge from 'lodash/merge'; -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import {REDIRECTS_FILENAME, LINT_CONFIG_FILENAME, YFM_CONFIG_FILENAME} from './constants'; import {ConnectorValidatorProps} from './vcs-connector/connector-models'; diff --git a/src/vcs-connector/client/github.ts b/src/vcs-connector/client/github.ts index 9f055628..f5e1b926 100644 --- a/src/vcs-connector/client/github.ts +++ b/src/vcs-connector/client/github.ts @@ -1,4 +1,4 @@ -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import {Octokit} from '@octokit/core'; import {ArgvService} from '../../services'; import { diff --git a/src/vcs-connector/connector-validator.ts b/src/vcs-connector/connector-validator.ts index c5caf9a1..d7dcb075 100644 --- a/src/vcs-connector/connector-validator.ts +++ b/src/vcs-connector/connector-validator.ts @@ -1,4 +1,4 @@ -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import {ConnectorValidatorProps, GitHubConnectorFields, SourceType, VCSConnectorConfig} from './connector-models'; import {getMsgСonfigurationMustBeProvided} from '../constants'; diff --git a/src/workers/linter/index.ts b/src/workers/linter/index.ts index e37f94b1..3cb182ed 100644 --- a/src/workers/linter/index.ts +++ b/src/workers/linter/index.ts @@ -1,4 +1,4 @@ -import log from '@doc-tools/transform/lib/log'; +import log from '@diplodoc/transform/lib/log'; import {extname} from 'path'; import {Observable, Subject} from 'threads/observable'; import {expose} from 'threads';