Skip to content

Commit

Permalink
feat: migrate to diplodoc
Browse files Browse the repository at this point in the history
  • Loading branch information
v8tenko committed Oct 2, 2023
1 parent 434d6b3 commit 9b79b32
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 49 deletions.
40 changes: 20 additions & 20 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 3 additions & 3 deletions src/models.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
4 changes: 2 additions & 2 deletions src/resolvers/lintPage.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
8 changes: 4 additions & 4 deletions src/resolvers/md2html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/resolvers/md2md.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
const {inputPath, outputPath, metadata} = options;
Expand Down
2 changes: 1 addition & 1 deletion src/services/leading.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/services/plugins.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions src/services/tocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions src/services/utils.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/steps/processLinter.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/steps/processLogs.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/steps/processPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/steps/processServiceFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/utils/logger.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/utils/singlePage.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/vcs-connector/client/github.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/vcs-connector/connector-validator.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/workers/linter/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 9b79b32

Please sign in to comment.