0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-03-16 00:54:53 +00:00

chore: use node: protocol imports ()

This commit is contained in:
Jamie Magee 2023-03-28 14:05:36 -07:00 committed by GitHub
parent c87d84c0b8
commit 176282e65f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 94 additions and 90 deletions

View file

@ -1,5 +1,5 @@
import os from 'os';
import v8 from 'v8';
import os from 'node:os';
import v8 from 'node:v8';
import type { InitialOptionsTsJest } from 'ts-jest/dist/types';
const ci = !!process.env.CI;

View file

@ -1,4 +1,4 @@
import crypto from 'crypto';
import crypto from 'node:crypto';
import is from '@sindresorhus/is';
import * as openpgp from 'openpgp';
import { logger } from '../logger';

View file

@ -1,4 +1,4 @@
import { ClientRequest } from 'http';
import { ClientRequest } from 'node:http';
import type {
Context,
Span,

View file

@ -1,8 +1,8 @@
// Code originally derived from https://github.com/hadfieldn/node-bunyan-prettystream but since heavily edited
// Neither fork nor original repo appear to be maintained
import { Stream } from 'stream';
import * as util from 'util';
import { Stream } from 'node:stream';
import * as util from 'node:util';
import chalk from 'chalk';
import stringify from 'json-stringify-pretty-compact';
import type { BunyanRecord } from './types';

View file

@ -1,4 +1,4 @@
import type { Stream } from 'stream';
import type { Stream } from 'node:stream';
import type { LogLevel } from 'bunyan';
export interface LogError {

View file

@ -1,4 +1,4 @@
import { Stream } from 'stream';
import { Stream } from 'node:stream';
import is from '@sindresorhus/is';
import bunyan from 'bunyan';
import fs from 'fs-extra';

View file

@ -1,4 +1,4 @@
import URL from 'url';
import URL from 'node:url';
import { ECR } from '@aws-sdk/client-ecr';
import type { ECRClientConfig } from '@aws-sdk/client-ecr';
import is from '@sindresorhus/is';

View file

@ -1,6 +1,6 @@
// TODO: types (#7154)
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import URL from 'url';
import URL from 'node:url';
import { logger } from '../../../logger';
import { detectPlatform } from '../../../util/common';
import * as hostRules from '../../../util/host-rules';

View file

@ -1,4 +1,4 @@
import { Readable } from 'stream';
import { Readable } from 'node:stream';
import {
GetObjectCommand,
HeadObjectCommand,

View file

@ -1,4 +1,4 @@
import { Readable } from 'stream';
import { Readable } from 'node:stream';
import { GetObjectCommand, HeadObjectCommand } from '@aws-sdk/client-s3';
import { DateTime } from 'luxon';
import { XmlDocument } from 'xmldoc';

View file

@ -1,4 +1,4 @@
import url from 'url';
import url from 'node:url';
import is from '@sindresorhus/is';
import { DateTime } from 'luxon';
import { GlobalConfig } from '../../../config/global';

View file

@ -1,4 +1,4 @@
import url from 'url';
import url from 'node:url';
import is from '@sindresorhus/is';
import ini from 'ini';
import { GlobalConfig } from '../../../config/global';

View file

@ -1,4 +1,4 @@
import crypto from 'crypto';
import crypto from 'node:crypto';
import { HOST_DISABLED } from '../../../constants/error-messages';
import { logger } from '../../../logger';
import { ExternalHostError } from '../../../types/errors/external-host-error';

View file

@ -1,4 +1,4 @@
import url from 'url';
import url from 'node:url';
import changelogFilenameRegex from 'changelog-filename-regex';
import { logger } from '../../../logger';
import { parse } from '../../../util/html';

View file

@ -1,4 +1,4 @@
import crypto from 'crypto';
import crypto from 'node:crypto';
import { codeBlock } from 'common-tags';
import * as httpMock from '../../../../test/http-mock';
import { partial } from '../../../../test/util';

View file

@ -1,4 +1,4 @@
import URL from 'url';
import URL from 'node:url';
import Git, { SimpleGit } from 'simple-git';
import upath from 'upath';
import { GlobalConfig } from '../../../config/global';

View file

@ -1,5 +1,5 @@
import type { Stats } from 'fs';
import os from 'os';
import type { Stats } from 'node:fs';
import os from 'node:os';
import { join } from 'upath';
import { envMock, mockExecAll } from '../../../../test/exec-util';
import { Fixtures } from '../../../../test/fixtures';

View file

@ -1,5 +1,5 @@
import type { Stats } from 'fs';
import os from 'os';
import type { Stats } from 'node:fs';
import os from 'node:os';
import { fs, partial } from '../../../../test/util';
import { GlobalConfig } from '../../../config/global';
import {

View file

@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
import { GlobalConfig } from '../../../config/global';
import { logger } from '../../../logger';
import { chmodLocalFile, statLocalFile } from '../../../util/fs';

View file

@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
import { join } from 'upath';
import {
envMock,

View file

@ -1,4 +1,4 @@
import url from 'url';
import URL from 'node:url';
import upath from 'upath';
import { logger } from '../../../../logger';
import { getSiblingFileName } from '../../../../util/fs';
@ -289,7 +289,7 @@ export function handleCustomRegistryUrl(ctx: Ctx): Ctx {
if (registryUrl) {
registryUrl = registryUrl.replace(regEx(/\\/g), '');
try {
const { host, protocol } = url.parse(registryUrl);
const { host, protocol } = URL.parse(registryUrl);
if (host && protocol) {
ctx.registryUrls.push({
registryUrl,

View file

@ -1,4 +1,4 @@
import { Readable } from 'stream';
import { Readable } from 'node:stream';
import { Fixtures } from '../../../../test/fixtures';
import * as httpMock from '../../../../test/http-mock';
import { updateDependency } from '.';

View file

@ -1,5 +1,5 @@
import type { Stats } from 'fs';
import os from 'os';
import type { Stats } from 'node:fs';
import os from 'node:os';
import type { StatusResult } from 'simple-git';
import { join } from 'upath';
import { envMock, mockExecAll } from '../../../../test/exec-util';

View file

@ -1,5 +1,5 @@
import type { Stats } from 'fs';
import os from 'os';
import type { Stats } from 'node:fs';
import os from 'node:os';
import is from '@sindresorhus/is';
import { dirname, join } from 'upath';
import { GlobalConfig } from '../../../config/global';

View file

@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
import is from '@sindresorhus/is';
import upath from 'upath';
import { logger } from '../../../logger';

View file

@ -1,4 +1,4 @@
import { EOL } from 'os';
import { EOL } from 'node:os';
import { Fixtures } from '../../../../test/fixtures';
import { GitTagsDatasource } from '../../datasource/git-tags';
import { GithubTagsDatasource } from '../../datasource/github-tags';

View file

@ -1,4 +1,4 @@
import { EOL } from 'os';
import { EOL } from 'node:os';
import { Fixtures } from '../../../../test/fixtures';
import { parsePuppetfile } from './puppetfile-parser';

View file

@ -1,4 +1,4 @@
import { URL } from 'url';
import { URL } from 'node:url';
import is from '@sindresorhus/is';
import { migrateDatasource } from '../../../config/migrations/custom/datasource-migration';
import type { RegexManagerTemplates } from '../../../config/types';

View file

@ -1,4 +1,4 @@
import { createReadStream } from 'fs';
import { createReadStream } from 'node:fs';
import { DirectoryResult, dir } from 'tmp-promise';
import { Fixtures } from '../../../../../test/fixtures';
import * as httpMock from '../../../../../test/http-mock';

View file

@ -1,4 +1,4 @@
import crypto from 'crypto';
import crypto from 'node:crypto';
import extract from 'extract-zip';
import upath from 'upath';
import { logger } from '../../../../logger';

View file

@ -1,4 +1,4 @@
import { Readable } from 'stream';
import { Readable } from 'node:stream';
import { GitPullRequestMergeStrategy } from 'azure-devops-node-api/interfaces/GitInterfaces.js';
describe('modules/platform/azure/azure-helper', () => {

View file

@ -1,4 +1,4 @@
import { Readable } from 'stream';
import { Readable } from 'node:stream';
import is from '@sindresorhus/is';
import type { IGitApi } from 'azure-devops-node-api/GitApi';
import {

View file

@ -1,4 +1,4 @@
import { Readable } from 'stream';
import { Readable } from 'node:stream';
import { streamToString } from '../../../util/streams';
import {
getBranchNameWithoutRefsheadsPrefix,

View file

@ -1,5 +1,5 @@
// SEE for the reference https://github.com/renovatebot/renovate/blob/c3e9e572b225085448d94aa121c7ec81c14d3955/lib/platform/bitbucket/utils.js
import url from 'url';
import url, { URL } from 'node:url';
import is from '@sindresorhus/is';
import { CONFIG_GIT_URL_UNAVAILABLE } from '../../../constants/error-messages';
import { logger } from '../../../logger';

View file

@ -1,4 +1,4 @@
import URL from 'url';
import URL from 'node:url';
import is from '@sindresorhus/is';
import JSON5 from 'json5';
import { REPOSITORY_NOT_FOUND } from '../../../constants/error-messages';

View file

@ -1,4 +1,4 @@
import url from 'url';
import URL from 'node:url';
import type { MergeStrategy } from '../../../config/types';
import type { BranchStatus } from '../../../types';
import { BitbucketHttp } from '../../../util/http/bitbucket';
@ -64,8 +64,8 @@ export const buildStates: Record<BranchStatus, BitbucketBranchState> = {
};
const addMaxLength = (inputUrl: string, pagelen = 100): string => {
const { search, ...parsedUrl } = url.parse(inputUrl, true);
const maxedUrl = url.format({
const { search, ...parsedUrl } = URL.parse(inputUrl, true);
const maxedUrl = URL.format({
...parsedUrl,
query: { ...parsedUrl.query, pagelen },
});

View file

@ -1,4 +1,4 @@
import { Buffer } from 'buffer';
import { Buffer } from 'node:buffer';
import {
GetCommentsForPullRequestOutput,
ListRepositoriesOutput,

View file

@ -1,6 +1,6 @@
// TODO: types (#7154)
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import URL from 'url';
import URL from 'node:url';
import is from '@sindresorhus/is';
import delay from 'delay';
import JSON5 from 'json5';

View file

@ -1,4 +1,4 @@
import URL from 'url';
import URL from 'node:url';
import is from '@sindresorhus/is';
import delay from 'delay';
import JSON5 from 'json5';

View file

@ -1,4 +1,4 @@
import URL from 'url';
import URL from 'node:url';
import type { AllConfig } from '../../config/types';
import type { PlatformId } from '../../constants';
import { PLATFORM_NOT_FOUND } from '../../constants/error-messages';

View file

@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
import { GlobalConfig } from '../../../config/global';
import * as memCache from '../memory';
import { cache } from './decorator';

View file

@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
import cacache from 'cacache';
import { cleanup, get, init, set } from './file';

View file

@ -1,4 +1,4 @@
import { Readable } from 'stream';
import { Readable } from 'node:stream';
import {
GetObjectCommand,
GetObjectCommandInput,

View file

@ -1,4 +1,4 @@
import { Readable } from 'stream';
import { Readable } from 'node:stream';
import {
GetObjectCommand,
GetObjectCommandInput,

View file

@ -1,5 +1,5 @@
import { promisify } from 'util';
import zlib from 'zlib';
import { promisify } from 'node:util';
import zlib from 'node:zlib';
const brotliCompress = promisify(zlib.brotliCompress);
const brotliDecompress = promisify(zlib.brotliDecompress);

View file

@ -1,11 +1,11 @@
import { spawn as _spawn } from 'child_process';
import type { SendHandle, Serializable } from 'child_process';
import { Readable } from 'stream';
import { spawn as _spawn } from 'node:child_process';
import type { SendHandle, Serializable } from 'node:child_process';
import { Readable } from 'node:stream';
import { mockedFunction, partial } from '../../../test/util';
import { exec } from './common';
import type { RawExecOptions } from './types';
jest.mock('child_process');
jest.mock('node:child_process');
const spawn = mockedFunction(_spawn);
type MessageListener = (message: Serializable, sendHandle: SendHandle) => void;

View file

@ -1,4 +1,4 @@
import { ChildProcess, spawn } from 'child_process';
import { ChildProcess, spawn } from 'node:child_process';
import { ExecError, ExecErrorData } from './exec-error';
import type { ExecResult, RawExecOptions } from './types';

View file

@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
import _findUp from 'find-up';
import upath from 'upath';
import { mockExecAll } from '../../../test/exec-util';

View file

@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
import upath from 'upath';
import { GlobalConfig } from '../../config/global';
import { logger } from '../../logger';

View file

@ -1,4 +1,4 @@
import type { SpawnOptions as ChildProcessSpawnOptions } from 'child_process';
import type { SpawnOptions as ChildProcessSpawnOptions } from 'node:child_process';
export interface ToolConstraint {
toolName: string;

View file

@ -1,5 +1,5 @@
import stream from 'stream';
import util from 'util';
import stream from 'node:stream';
import util from 'node:util';
import is from '@sindresorhus/is';
import findUp from 'find-up';
import fs from 'fs-extra';

View file

@ -1,4 +1,4 @@
import URL from 'url';
import URL from 'node:url';
import is from '@sindresorhus/is';
import delay from 'delay';
import fs from 'fs-extra';

View file

@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
import is from '@sindresorhus/is';
import fs from 'fs-extra';
import upath from 'upath';

View file

@ -1,4 +1,8 @@
import { LookupAllOptions, LookupOneOptions, lookup as _dnsLookup } from 'dns';
import {
LookupAllOptions,
LookupOneOptions,
lookup as _dnsLookup,
} from 'node:dns';
import type { EntryObject, IPFamily, LookupOptions } from 'cacheable-lookup';
import QuickLRU from 'quick-lru';
import { logger } from '../../logger';

View file

@ -1,4 +1,4 @@
import type { IncomingHttpHeaders } from 'http';
import type { IncomingHttpHeaders } from 'node:http';
import type {
OptionsOfBufferResponseBody,
OptionsOfJSONResponseBody,

View file

@ -1,4 +1,4 @@
import fs from 'fs';
import fs from 'node:fs';
import upath from 'upath';
function relatePath(here: string, there: string): string {

View file

@ -1,4 +1,4 @@
import { Readable } from 'stream';
import { Readable } from 'node:stream';
import { streamToString } from './streams';
describe('util/streams', () => {

View file

@ -1,4 +1,4 @@
import { Readable } from 'stream';
import { Readable } from 'node:stream';
export async function streamToString(
stream: NodeJS.ReadableStream

View file

@ -1,4 +1,4 @@
import readline from 'readline';
import readline from 'node:readline';
import type { AllConfig } from '../../../../config/types';
// istanbul ignore next

View file

@ -1,4 +1,4 @@
import fs from 'fs';
import fs from 'node:fs';
import fsExtra from 'fs-extra';
import { DirectoryResult, dir } from 'tmp-promise';
import upath from 'upath';

View file

@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
import fs from 'fs-extra';
import upath from 'upath';
import { applySecretsToConfig } from '../../config/secrets';

View file

@ -1,4 +1,4 @@
import URL from 'url';
import URL from 'node:url';
import { logger } from '../../logger';
import { sortNumeric } from '../../util/array';
import * as memCache from '../../util/cache/memory';

View file

@ -1,5 +1,5 @@
// TODO #7154
import URL from 'url';
import URL from 'node:url';
import is from '@sindresorhus/is';
import { DateTime } from 'luxon';
import MarkdownIt from 'markdown-it';

View file

@ -1,5 +1,5 @@
// TODO #7154
import URL from 'url';
import URL from 'node:url';
import { GlobalConfig } from '../../../../../config/global';
import { logger } from '../../../../../logger';
import type { Release } from '../../../../../modules/datasource/types';

View file

@ -1,5 +1,5 @@
// TODO #7154
import URL from 'url';
import URL from 'node:url';
import { logger } from '../../../../../logger';
import type { Release } from '../../../../../modules/datasource/types';
import * as allVersioning from '../../../../../modules/versioning';

View file

@ -1,5 +1,5 @@
import type fs from 'fs';
import type { PathLike, Stats } from 'fs';
import type fs from 'node:fs';
import type { PathLike, Stats } from 'node:fs';
import { jest } from '@jest/globals';
import callsite from 'callsite';
import { DirectoryJSON, fs as memfs, vol } from 'memfs';

View file

@ -1,4 +1,4 @@
import type { Url } from 'url';
import type { Url } from 'node:url';
import { afterAll, afterEach, beforeAll } from '@jest/globals';
// eslint-disable-next-line no-restricted-imports
import nock from 'nock';

View file

@ -1,4 +1,4 @@
import util from 'util';
import util from 'node:util';
import _glob from 'glob';
const glob = util.promisify(_glob);

View file

@ -1,4 +1,4 @@
import crypto from 'crypto';
import crypto from 'node:crypto';
import { expect, jest } from '@jest/globals';
import type { Plugin } from 'pretty-format';
import upath from 'upath';

View file

@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
import fs from 'fs';
import fs from 'node:fs';
import is from '@sindresorhus/is';
import { getOptions } from '../lib/config/options';

View file

@ -1,4 +1,4 @@
import { promisify } from 'util';
import { promisify } from 'node:util';
import fs from 'fs-extra';
import g from 'glob';
import MarkdownIt from 'markdown-it';

View file

@ -1,4 +1,4 @@
import { tmpdir } from 'os';
import { tmpdir } from 'node:os';
import { remove } from 'fs-extra';
import upath from 'upath';

View file

@ -1,4 +1,4 @@
import util from 'util';
import util from 'node:util';
import fs from 'fs-extra';
import _glob from 'glob';
import hasha from 'hasha';

View file

@ -1,5 +1,5 @@
import os from 'os';
import { promisify } from 'util';
import os from 'node:os';
import { promisify } from 'node:util';
import fs from 'fs-extra';
import g from 'glob';
import JSON5 from 'json5';