Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infra: use npm 9 version #583

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
with:
node-version: '18.x'
cache: 'npm'
- name: npm10:
run: npm i -g 'npm@10.*' --registry=https://registry.npmjs.org
- name: Install Packages
run: npm ci
- name: Lint Files
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: npm i -g 'npm@10.*' --registry=https://registry.npmjs.org
- run: npm ci
shell: bash
- uses: codex-team/action-nodejs-package-info@v1
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
cache: 'npm'
- name: npm10
run: npm i -g 'npm@10.*' --registry=https://registry.npmjs.org
- name: Install packages for project
run: npm ci
- run: npm run build
Expand Down
43 changes: 24 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
},
"engines": {
"node": "18.*",
"npm:": "10.*"
"npm:": "9.*"
},
"dependencies": {
"@apidevtools/swagger-parser": "^10.1.0",
"@aws-sdk/client-s3": "^3.369.0",
"@diplodoc/client": "^1.0.2",
"@diplodoc/markdown-translation": "^1.0.0-beta.3",
"@diplodoc/markdown-translation": "^1.0.0-beta.4",
"@diplodoc/mermaid-extension": "^1.1.1",
"@diplodoc/openapi-extension": "^1.3.3",
"@diplodoc/transform": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/publish/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {join} from 'path';
import {ArgvService} from '../../services';
import {logger} from '../../utils';

import {Argv, Arguments} from 'yargs';
import {Arguments, Argv} from 'yargs';

import {upload} from './upload';

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/publish/upload.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {createReadStream} from 'fs';
import walkSync from 'walk-sync';
import {resolve, join} from 'path';
import {S3Client, PutObjectCommand} from '@aws-sdk/client-s3';
import {join, resolve} from 'path';
import {PutObjectCommand, S3Client} from '@aws-sdk/client-s3';
import mime from 'mime-types';

import {convertBackSlashToSlash, logger} from '../../utils';
Expand Down
10 changes: 5 additions & 5 deletions src/cmd/translate/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {eachLimit, retry, asyncify} from 'async';
import {asyncify, eachLimit, retry} from 'async';

import {dirname, resolve, join} from 'path';
import {readFile, writeFile, mkdir} from 'fs/promises';
import {dirname, join, resolve} from 'path';
import {mkdir, readFile, writeFile} from 'fs/promises';
import {XMLParser} from 'fast-xml-parser';

import {Session} from '@yandex-cloud/nodejs-sdk/dist/session';
import {TranslationServiceClient} from '@yandex-cloud/nodejs-sdk/dist/generated/yandex/cloud/service_clients';
import {
TranslateRequest,
TranslateRequest_Format as Format,
TranslateRequest,
} from '@yandex-cloud/nodejs-sdk/dist/generated/yandex/cloud/ai/translate/v2/translation_service';

import markdownTranslation from '@diplodoc/markdown-translation';
Expand All @@ -17,7 +17,7 @@ import {ArgvService} from '../../services';
import {getYandexOAuthToken} from '../../packages/credentials';
import {glob, logger} from '../../utils';

import {Argv, Arguments} from 'yargs';
import {Arguments, Argv} from 'yargs';

import {YandexCloudTranslateGlossaryPair} from '../../models';

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/xliff/compose.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const {
promises: {readFile, writeFile, mkdir},
} = require('fs');
import {join, extname, dirname} from 'path';
import {dirname, extname, join} from 'path';

import markdownTranslation, {ComposeParameters} from '@diplodoc/markdown-translation';
import {Arguments, Argv} from 'yargs';
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/xliff/extract.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const {
promises: {readFile, writeFile, mkdir},
} = require('fs');
import {join, dirname, extname} from 'path';
import {dirname, extname, join} from 'path';

import markdownTranslation, {ExtractParameters} from '@diplodoc/markdown-translation';
import {Arguments, Argv} from 'yargs';
import {eachLimit, asyncify} from 'async';
import {asyncify, eachLimit} from 'async';

import {ArgvService} from '../../services';
import {glob, logger} from '../../utils';
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import {MAIN_TIMER_ID} from './constants';

import {build, xliff, translate, publish} from './cmd';
import {build, publish, translate, xliff} from './cmd';

console.time(MAIN_TIMER_ID);

Expand All @@ -32,7 +32,7 @@
type: 'boolean',
})
.group(['config', 'strict', 'quiet', 'help', 'version'], 'Common options:')
.version(typeof VERSION !== 'undefined' ? VERSION : '')

Check warning on line 35 in src/index.ts

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected negated condition
.help()
.parse(hideBin(process.argv), {}, (err, {strict}, output) => {
console.timeEnd(MAIN_TIMER_ID);
Expand Down
2 changes: 1 addition & 1 deletion src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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 {IncludeMode, Lang, ResourceType, Stage} from './constants';
import {ChangelogItem} from '@diplodoc/transform/lib/plugins/changelog/types';

export type VarsPreset = 'internal' | 'external';
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/lintPage.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {dirname, relative, resolve} from 'path';
import log from '@diplodoc/transform/lib/log';
import {
default as yfmlint,
LintMarkdownFunctionOptions,
PluginOptions,
default as yfmlint,
} from '@diplodoc/transform/lib/yfmlint';
import {readFileSync} from 'fs';
import {bold} from 'chalk';
Expand Down
10 changes: 5 additions & 5 deletions src/resolvers/md2html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ 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 {LeadingPage, ResolveMd2HTMLResult, ResolverOptions, YfmToc} from '../models';
import {ArgvService, PluginService, TocService} from '../services';
import {
generateStaticMarkup,
logger,
transformToc,
getVarsPerFile,
getVarsPerRelativeFile,
logger,
transformToc,
} from '../utils';
import {PROCESSING_FINISHED, Lang} from '../constants';
import {Lang, PROCESSING_FINISHED} from '../constants';
import {getAssetsPublicPath, getUpdatedMetadata} from '../services/metadata';
import {MarkdownItPluginCb} from '@diplodoc/transform/lib/plugins/typings';

Expand Down
4 changes: 2 additions & 2 deletions src/resolvers/md2md.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {existsSync, readFileSync, writeFileSync} from 'fs';
import {dirname, resolve, join, basename, extname} from 'path';
import {basename, dirname, extname, join, resolve} from 'path';
import shell from 'shelljs';
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 {getVarsPerFile, logger} from '../utils';
import {PluginOptions, ResolveMd2MdOptions} from '../models';
import {PROCESSING_FINISHED} from '../constants';
import {getContentWithUpdatedMetadata} from '../services/metadata';
Expand Down
4 changes: 2 additions & 2 deletions src/services/includers/batteries/generic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {readFile, writeFile, mkdir} from 'fs/promises';
import {parse, join, dirname} from 'path';
import {mkdir, readFile, writeFile} from 'fs/promises';
import {dirname, join, parse} from 'path';

import {updateWith} from 'lodash';
import {dump} from 'js-yaml';
Expand Down Expand Up @@ -119,9 +119,9 @@
function createToc(leadingPageName: string, tocName: string) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return function createTocRec(
graph: Record<string, any>,

Check warning on line 122 in src/services/includers/batteries/generic.ts

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected any. Specify a different type
cursor: string[],
): Record<string, any> {

Check warning on line 124 in src/services/includers/batteries/generic.ts

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected any. Specify a different type
const handler = (file: string) => ({
name: parse(file).name === 'index' ? leadingPageName : file,
href: join(...cursor, file),
Expand Down
6 changes: 3 additions & 3 deletions src/services/includers/batteries/unarchive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {mkdirSync, createReadStream, createWriteStream} from 'fs';
import {join, dirname} from 'path';
import {extract, Headers} from 'tar-stream';
import {createReadStream, createWriteStream, mkdirSync} from 'fs';
import {dirname, join} from 'path';
import {Headers, extract} from 'tar-stream';

import type {PassThrough} from 'stream';

Expand Down
2 changes: 1 addition & 1 deletion src/services/includers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {IncludeMode} from '../../constants';
import {generic, sourcedocs, unarchive} from './batteries';

import type {
YfmPreset,
Includer,
YfmPreset,
YfmToc,
YfmTocInclude,
YfmTocIncluder,
Expand Down
4 changes: 2 additions & 2 deletions src/services/leading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import log from '@diplodoc/transform/lib/log';
import {ArgvService, PresetService} from './index';
import {LeadingPage} from '../models';
import {
filterTextItems,
filterFiles,
filterTextItems,
firstFilterTextItems,
liquidFields,
liquidField,
liquidFields,
} from './utils';

function filterFile(path: string) {
Expand Down
4 changes: 2 additions & 2 deletions src/services/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {dump} from 'js-yaml';

import {VCSConnector} from '../vcs-connector/connector-models';
import {Metadata, MetaDataOptions, Resources} from '../models';
import {MetaDataOptions, Metadata, Resources} from '../models';
import {
getAuthorDetails,
updateAuthorMetadataStringByAuthorLogin,
Expand All @@ -10,7 +10,7 @@ import {
import {getFileContributorsMetadata, getFileContributorsString} from './contributors';
import {isObject} from './utils';
import {сarriage} from '../utils';
import {metadataBorder, REGEXP_AUTHOR} from '../constants';
import {REGEXP_AUTHOR, metadataBorder} from '../constants';
import {dirname, relative, resolve} from 'path';
import {ArgvService} from './index';

Expand Down
4 changes: 2 additions & 2 deletions src/services/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {LintRule, LintConfig} from '@diplodoc/transform/lib/yfmlint';
import {LintConfig, LintRule} from '@diplodoc/transform/lib/yfmlint';

import {PluginOptions, Plugin, CollectionOfPluginsFunction} from '../models';
import {CollectionOfPluginsFunction, Plugin, PluginOptions} from '../models';
import {YFM_PLUGINS} from '../constants';

let plugins: Function[] | Plugin[];
Expand Down
10 changes: 5 additions & 5 deletions src/services/tocs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {dirname, extname, join, parse, resolve, relative, normalize, sep} from 'path';
import {copyFileSync, readFileSync, writeFileSync, existsSync} from 'fs';
import {load, dump} from 'js-yaml';
import {dirname, extname, join, normalize, parse, relative, resolve, sep} from 'path';
import {copyFileSync, existsSync, readFileSync, writeFileSync} from 'fs';
import {dump, load} from 'js-yaml';
import shell from 'shelljs';
import walkSync from 'walk-sync';
import liquid from '@diplodoc/transform/lib/liquid';
Expand All @@ -10,10 +10,10 @@ import {bold} from 'chalk';
import {ArgvService, PresetService} from './index';
import {getContentWithUpdatedStaticMetadata} from './metadata';
import {YfmToc} from '../models';
import {Stage, IncludeMode} from '../constants';
import {IncludeMode, Stage} from '../constants';
import {isExternalHref, logger} from '../utils';
import {filterFiles, firstFilterTextItems, liquidField} from './utils';
import {applyIncluders, IncludersError} from './includers';
import {IncludersError, applyIncluders} from './includers';

export interface TocServiceData {
storage: Map<string, YfmToc>;
Expand Down
2 changes: 1 addition & 1 deletion src/steps/processExcludedFiles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {resolve, relative} from 'path';
import {relative, resolve} from 'path';
import walkSync from 'walk-sync';
import shell from 'shelljs';

Expand Down
6 changes: 3 additions & 3 deletions src/steps/processLinter.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import log from '@diplodoc/transform/lib/log';
import {spawn, Worker, Thread} from 'threads';
import {Thread, Worker, spawn} from 'threads';
import {extname} from 'path';

import {ArgvService, TocService, PresetService, PluginService} from '../services';
import {ArgvService, PluginService, PresetService, TocService} from '../services';
import {ProcessLinterWorker} from '../workers/linter';
import {logger} from '../utils';
import {LINTING_FINISHED, WORKERS_COUNT, MIN_CHUNK_SIZE} from '../constants';
import {LINTING_FINISHED, MIN_CHUNK_SIZE, WORKERS_COUNT} from '../constants';
import {lintPage} from '../resolvers';
import {splitOnChunks} from '../utils/worker';

Expand Down
Loading
Loading