From 9eab1adb9ddfeef2a475ef8b60442a008713ca4c Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Fri, 11 Nov 2022 09:24:06 -0600 Subject: [PATCH] feat(esm): convert to esm (#2569) for #2543 BREAKING CHANGE: semantic-release is now ESM-only. since it is used through its own executable, the impact on consuming projects should be minimal BREAKING CHANGE: references to plugin files in configs need to include the file extension because of executing in an ESM context --- bin/semantic-release.js | 28 +- cli.js | 22 +- index.js | 51 +- lib/branches/expand.js | 10 +- lib/branches/get-tags.js | 17 +- lib/branches/index.js | 22 +- lib/branches/normalize.js | 29 +- lib/definitions/branches.js | 14 +- lib/definitions/constants.js | 30 +- lib/definitions/errors.js | 172 +- lib/definitions/plugins.js | 12 +- lib/get-commits.js | 10 +- lib/get-config.js | 41 +- lib/get-error.js | 8 +- lib/get-git-auth-url.js | 16 +- lib/get-last-release.js | 12 +- lib/get-logger.js | 10 +- lib/get-next-version.js | 10 +- lib/get-release-to-add.js | 14 +- lib/git.js | 72 +- lib/hide-sensitive.js | 8 +- lib/plugins/index.js | 18 +- lib/plugins/normalize.js | 18 +- lib/plugins/pipeline.js | 12 +- lib/plugins/utils.js | 19 +- lib/utils.js | 56 +- lib/verify.js | 12 +- package-lock.json | 2708 ++++++++++++----- package.json | 50 +- test/branches/branches.test.js | 72 +- test/branches/expand.test.js | 6 +- test/branches/get-tags.test.js | 6 +- test/branches/normalize.test.js | 4 +- test/cli.test.js | 146 +- test/definitions/branches.test.js | 4 +- test/definitions/plugins.test.js | 6 +- test/fixtures/index.js | 2 +- .../{multi-plugin.js => multi-plugin.cjs} | 0 test/fixtures/plugin-error-inherited.js | 6 +- test/fixtures/plugin-error.js | 4 +- test/fixtures/plugin-errors.js | 6 +- test/fixtures/plugin-identity.js | 2 +- test/fixtures/plugin-log-env.js | 4 +- .../{plugin-noop.js => plugin-noop.cjs} | 0 test/fixtures/plugin-result-config.js | 2 +- test/get-commits.test.js | 8 +- test/get-config.test.js | 308 +- test/get-git-auth-url.test.js | 6 +- test/get-last-release.test.js | 4 +- test/get-logger.test.js | 6 +- test/get-next-version.test.js | 6 +- test/get-release-to-add.test.js | 4 +- test/git.test.js | 60 +- test/helpers/git-utils.js | 93 +- test/helpers/gitbox.js | 18 +- test/helpers/mockserver.js | 22 +- test/helpers/npm-registry.js | 24 +- test/helpers/npm-utils.js | 6 +- test/hide-sensitive.test.js | 8 +- test/index.test.js | 243 +- test/integration.test.js | 61 +- test/plugins/normalize.test.js | 38 +- test/plugins/pipeline.test.js | 24 +- test/plugins/plugins.test.js | 44 +- test/plugins/utils.test.js | 10 +- test/utils.test.js | 26 +- test/verify.test.js | 22 +- 67 files changed, 3026 insertions(+), 1786 deletions(-) rename test/fixtures/{multi-plugin.js => multi-plugin.cjs} (100%) rename test/fixtures/{plugin-noop.js => plugin-noop.cjs} (100%) diff --git a/bin/semantic-release.js b/bin/semantic-release.js index c7d928d2bb..e9da11ca4c 100755 --- a/bin/semantic-release.js +++ b/bin/semantic-release.js @@ -1,20 +1,22 @@ #!/usr/bin/env node -// Bad news: We have to write plain ES5 in this file -// Good news: It's the only file of the entire project - /* eslint-disable no-var */ -var semver = require('semver'); -var execa = require('execa'); -var findVersions = require('find-versions'); -var pkg = require('../package.json'); +import semver from 'semver'; +import { execa } from 'execa'; +import findVersions from 'find-versions'; +import cli from '../cli.js'; +import {createRequire} from 'node:module'; + +const require = createRequire(import.meta.url); +const { engines } = require('../package.json'); +const { satisfies, lt } = semver; -var MIN_GIT_VERSION = '2.7.1'; +const MIN_GIT_VERSION = '2.7.1'; -if (!semver.satisfies(process.version, pkg.engines.node)) { +if (!satisfies(process.version, engines.node)) { console.error( - `[semantic-release]: node version ${pkg.engines.node} is required. Found ${process.version}. + `[semantic-release]: node version ${engines.node} is required. Found ${process.version}. See https://github.com/semantic-release/semantic-release/blob/master/docs/support/node-version.md for more details and solutions.` ); @@ -23,8 +25,8 @@ See https://github.com/semantic-release/semantic-release/blob/master/docs/suppor execa('git', ['--version']) .then(({stdout}) => { - var gitVersion = findVersions(stdout)[0]; - if (semver.lt(gitVersion, MIN_GIT_VERSION)) { + const gitVersion = findVersions(stdout)[0]; + if (lt(gitVersion, MIN_GIT_VERSION)) { console.error(`[semantic-release]: Git version ${MIN_GIT_VERSION} is required. Found ${gitVersion}.`); process.exit(1); } @@ -36,7 +38,7 @@ execa('git', ['--version']) }); // Node 10+ from this point on -require('../cli')() +cli() .then((exitCode) => { process.exitCode = exitCode; }) diff --git a/cli.js b/cli.js index 9040236228..2d0d10d499 100755 --- a/cli.js +++ b/cli.js @@ -1,6 +1,7 @@ -const {argv, env, stderr} = require('process'); // eslint-disable-line node/prefer-global/process -const util = require('util'); -const hideSensitive = require('./lib/hide-sensitive'); +import util from 'node:util'; +import yargs from 'yargs'; +import {hideBin} from 'yargs/helpers'; +import hideSensitive from './lib/hide-sensitive.js'; const stringList = { type: 'string', @@ -11,8 +12,8 @@ const stringList = { : values.reduce((values, value) => values.concat(value.split(',').map((value) => value.trim())), []), }; -module.exports = async () => { - const cli = require('yargs') +export default async () => { + const cli = yargs(hideBin(process.argv)) .command('$0', 'Run automated package publishing', (yargs) => { yargs.demandCommand(0, 0).usage(`Run automated package publishing @@ -36,12 +37,11 @@ Usage: .option('debug', {describe: 'Output debugging information', type: 'boolean', group: 'Options'}) .option('d', {alias: 'dry-run', describe: 'Skip publishing', type: 'boolean', group: 'Options'}) .option('h', {alias: 'help', group: 'Options'}) - .option('v', {alias: 'version', group: 'Options'}) .strict(false) .exitProcess(false); try { - const {help, version, ...options} = cli.parse(argv.slice(2)); + const {help, version, ...options} = cli.parse(process.argv.slice(2)); if (Boolean(help) || Boolean(version)) { return 0; @@ -49,16 +49,16 @@ Usage: if (options.debug) { // Debug must be enabled before other requires in order to work - require('debug').enable('semantic-release:*'); + (await import('debug')).default.enable('semantic-release:*'); } - await require('.')(options); + await (await import('./index.js')).default(options); return 0; } catch (error) { if (error.name !== 'YError') { - stderr.write(hideSensitive(env)(util.inspect(error, {colors: true}))); + process.stderr.write(hideSensitive(process.env)(util.inspect(error, {colors: true}))); } return 1; } -}; +} diff --git a/index.js b/index.js index b5b67a6458..e6718d640c 100644 --- a/index.js +++ b/index.js @@ -1,24 +1,27 @@ -const {pick} = require('lodash'); -const marked = require('marked'); -const envCi = require('env-ci'); -const hookStd = require('hook-std'); -const semver = require('semver'); -const AggregateError = require('aggregate-error'); +import {createRequire} from 'node:module'; +import {pick} from 'lodash-es'; +import * as marked from 'marked'; +import envCi from 'env-ci'; +import {hookStdout} from 'hook-std'; +import semver from 'semver'; +import AggregateError from 'aggregate-error'; +import hideSensitive from './lib/hide-sensitive.js'; +import getConfig from './lib/get-config.js'; +import verify from './lib/verify.js'; +import getNextVersion from './lib/get-next-version.js'; +import getCommits from './lib/get-commits.js'; +import getLastRelease from './lib/get-last-release.js'; +import getReleaseToAdd from './lib/get-release-to-add.js'; +import {extractErrors, makeTag} from './lib/utils.js'; +import getGitAuthUrl from './lib/get-git-auth-url.js'; +import getBranches from './lib/branches/index.js'; +import getLogger from './lib/get-logger.js'; +import {addNote, getGitHead, getTagHead, isBranchUpToDate, push, pushNotes, tag, verifyAuth} from './lib/git.js'; +import getError from './lib/get-error.js'; +import {COMMIT_EMAIL, COMMIT_NAME} from './lib/definitions/constants.js'; + +const require = createRequire(import.meta.url); const pkg = require('./package.json'); -const hideSensitive = require('./lib/hide-sensitive'); -const getConfig = require('./lib/get-config'); -const verify = require('./lib/verify'); -const getNextVersion = require('./lib/get-next-version'); -const getCommits = require('./lib/get-commits'); -const getLastRelease = require('./lib/get-last-release'); -const getReleaseToAdd = require('./lib/get-release-to-add'); -const {extractErrors, makeTag} = require('./lib/utils'); -const getGitAuthUrl = require('./lib/get-git-auth-url'); -const getBranches = require('./lib/branches'); -const getLogger = require('./lib/get-logger'); -const {verifyAuth, isBranchUpToDate, getGitHead, tag, push, pushNotes, getTagHead, addNote} = require('./lib/git'); -const getError = require('./lib/get-error'); -const {COMMIT_NAME, COMMIT_EMAIL} = require('./lib/definitions/constants'); let markedOptionsSet = false; async function terminalOutput(text) { @@ -41,7 +44,7 @@ async function run(context, plugins) { logger.warn('This run was not triggered in a known CI environment, running in dry-run mode.'); options.dryRun = true; } else { - // When running on CI, set the commits author and commiter info and prevent the `git` CLI to prompt for username/password. See #703. + // When running on CI, set the commits author and committer info and prevent the `git` CLI to prompt for username/password. See #703. Object.assign(env, { GIT_AUTHOR_NAME: COMMIT_NAME, GIT_AUTHOR_EMAIL: COMMIT_EMAIL, @@ -247,8 +250,8 @@ async function callFail(context, plugins, err) { } } -module.exports = async (cliOptions = {}, {cwd = process.cwd(), env = process.env, stdout, stderr} = {}) => { - const {unhook} = hookStd( +export default async (cliOptions = {}, {cwd = process.cwd(), env = process.env, stdout, stderr} = {}) => { + const {unhook} = hookStdout( {silent: false, streams: [process.stdout, process.stderr, stdout, stderr].filter(Boolean)}, hideSensitive(env) ); @@ -278,4 +281,4 @@ module.exports = async (cliOptions = {}, {cwd = process.cwd(), env = process.env unhook(); throw error; } -}; +} diff --git a/lib/branches/expand.js b/lib/branches/expand.js index 3deea97c0e..6ecb828c44 100644 --- a/lib/branches/expand.js +++ b/lib/branches/expand.js @@ -1,8 +1,8 @@ -const {isString, remove, omit, mapValues, template} = require('lodash'); -const micromatch = require('micromatch'); -const {getBranches} = require('../git'); +import {isString, mapValues, omit, remove, template} from 'lodash-es'; +import micromatch from 'micromatch'; +import {getBranches} from '../git.js'; -module.exports = async (repositoryUrl, {cwd}, branches) => { +export default async (repositoryUrl, {cwd}, branches) => { const gitBranches = await getBranches(repositoryUrl, {cwd}); return branches.reduce( @@ -15,4 +15,4 @@ module.exports = async (repositoryUrl, {cwd}, branches) => { ], [] ); -}; +} diff --git a/lib/branches/get-tags.js b/lib/branches/get-tags.js index 8cffbeb405..080cb54e12 100644 --- a/lib/branches/get-tags.js +++ b/lib/branches/get-tags.js @@ -1,10 +1,13 @@ -const {template, escapeRegExp} = require('lodash'); -const semver = require('semver'); -const pReduce = require('p-reduce'); -const debug = require('debug')('semantic-release:get-tags'); -const {getTags, getNote} = require('../../lib/git'); +import {escapeRegExp, template} from 'lodash-es'; +import semver from 'semver'; +import pReduce from 'p-reduce'; +import debugTags from 'debug'; +import {getNote, getTags} from '../../lib/git.js'; -module.exports = async ({cwd, env, options: {tagFormat}}, branches) => { +const debug = debugTags('semantic-release:get-tags'); + + +export default async ({cwd, env, options: {tagFormat}}, branches) => { // Generate a regex to parse tags formatted with `tagFormat` // by replacing the `version` variable in the template by `(.+)`. // The `tagFormat` is compiled with space as the `version` as it's an invalid tag character, @@ -30,4 +33,4 @@ module.exports = async ({cwd, env, options: {tagFormat}}, branches) => { }, [] ); -}; +} diff --git a/lib/branches/index.js b/lib/branches/index.js index 951500dc47..0e058311b7 100644 --- a/lib/branches/index.js +++ b/lib/branches/index.js @@ -1,14 +1,14 @@ -const {isString, isRegExp} = require('lodash'); -const AggregateError = require('aggregate-error'); -const pEachSeries = require('p-each-series'); -const DEFINITIONS = require('../definitions/branches'); -const getError = require('../get-error'); -const {fetch, fetchNotes, verifyBranchName} = require('../git'); -const expand = require('./expand'); -const getTags = require('./get-tags'); -const normalize = require('./normalize'); +import {isRegExp, isString} from 'lodash-es'; +import AggregateError from 'aggregate-error'; +import pEachSeries from 'p-each-series'; +import * as DEFINITIONS from '../definitions/branches.js'; +import getError from '../get-error.js'; +import {fetch, fetchNotes, verifyBranchName} from '../git.js'; +import expand from './expand.js'; +import getTags from './get-tags.js'; +import * as normalize from './normalize.js'; -module.exports = async (repositoryUrl, ciBranch, context) => { +export default async (repositoryUrl, ciBranch, context) => { const {cwd, env} = context; const remoteBranches = await expand( @@ -68,4 +68,4 @@ module.exports = async (repositoryUrl, ciBranch, context) => { } return [...result.maintenance, ...result.release, ...result.prerelease]; -}; +} diff --git a/lib/branches/normalize.js b/lib/branches/normalize.js index 369bd9d717..09f9785c98 100644 --- a/lib/branches/normalize.js +++ b/lib/branches/normalize.js @@ -1,19 +1,18 @@ -const {sortBy, isNil} = require('lodash'); -const semverDiff = require('semver-diff'); -const {FIRST_RELEASE, RELEASE_TYPE} = require('../definitions/constants'); -const { - tagsToVersions, - isMajorRange, +import {isNil, sortBy} from 'lodash-es'; +import semverDiff from 'semver-diff'; +import {FIRST_RELEASE, RELEASE_TYPE} from '../definitions/constants.js'; +import { + getFirstVersion, + getLatestVersion, + getLowerBound, getRange, getUpperBound, - getLowerBound, highest, + isMajorRange, lowest, - getLatestVersion, - getFirstVersion, - getRange, -} = require('../utils'); + tagsToVersions +} from '../utils.js'; -function maintenance({maintenance, release}) { +export function maintenance({maintenance, release}) { return sortBy( maintenance.map(({name, range, channel, ...rest}) => ({ ...rest, @@ -55,7 +54,7 @@ function maintenance({maintenance, release}) { }); } -function release({release}) { +export function release({release}) { if (release.length === 0) { return release; } @@ -89,7 +88,7 @@ function release({release}) { }); } -function prerelease({prerelease}) { +export function prerelease({prerelease}) { return prerelease.map(({name, prerelease, channel, tags, ...rest}) => { const preid = prerelease === true ? name : prerelease; return { @@ -102,5 +101,3 @@ function prerelease({prerelease}) { }; }); } - -module.exports = {maintenance, release, prerelease}; diff --git a/lib/definitions/branches.js b/lib/definitions/branches.js index c47fc65683..f23d048488 100644 --- a/lib/definitions/branches.js +++ b/lib/definitions/branches.js @@ -1,24 +1,22 @@ -const {isNil, uniqBy} = require('lodash'); -const semver = require('semver'); -const {isMaintenanceRange} = require('../utils'); +import {isNil, uniqBy} from 'lodash-es'; +import semver from 'semver'; +import {isMaintenanceRange} from '../utils.js'; -const maintenance = { +export const maintenance = { filter: ({name, range}) => (!isNil(range) && range !== false) || isMaintenanceRange(name), branchValidator: ({range}) => (isNil(range) ? true : isMaintenanceRange(range)), branchesValidator: (branches) => uniqBy(branches, ({range}) => semver.validRange(range)).length === branches.length, }; -const prerelease = { +export const prerelease = { filter: ({prerelease}) => !isNil(prerelease) && prerelease !== false, branchValidator: ({name, prerelease}) => Boolean(prerelease) && Boolean(semver.valid(`1.0.0-${prerelease === true ? name : prerelease}.1`)), branchesValidator: (branches) => uniqBy(branches, 'prerelease').length === branches.length, }; -const release = { +export const release = { // eslint-disable-next-line unicorn/no-fn-reference-in-iterator filter: (branch) => !maintenance.filter(branch) && !prerelease.filter(branch), branchesValidator: (branches) => branches.length <= 3 && branches.length > 0, }; - -module.exports = {maintenance, prerelease, release}; diff --git a/lib/definitions/constants.js b/lib/definitions/constants.js index 999999c9ac..d75b7a174d 100644 --- a/lib/definitions/constants.js +++ b/lib/definitions/constants.js @@ -1,29 +1,17 @@ -const RELEASE_TYPE = ['patch', 'minor', 'major']; +export const RELEASE_TYPE = ['patch', 'minor', 'major']; -const FIRST_RELEASE = '1.0.0'; +export const FIRST_RELEASE = '1.0.0'; -const FIRSTPRERELEASE = '1'; +export const FIRSTPRERELEASE = '1'; -const COMMIT_NAME = 'semantic-release-bot'; +export const COMMIT_NAME = 'semantic-release-bot'; -const COMMIT_EMAIL = 'semantic-release-bot@martynus.net'; +export const COMMIT_EMAIL = 'semantic-release-bot@martynus.net'; -const RELEASE_NOTES_SEPARATOR = '\n\n'; +export const RELEASE_NOTES_SEPARATOR = '\n\n'; -const SECRET_REPLACEMENT = '[secure]'; +export const SECRET_REPLACEMENT = '[secure]'; -const SECRET_MIN_SIZE = 5; +export const SECRET_MIN_SIZE = 5; -const GIT_NOTE_REF = 'semantic-release'; - -module.exports = { - RELEASE_TYPE, - FIRST_RELEASE, - FIRSTPRERELEASE, - COMMIT_NAME, - COMMIT_EMAIL, - RELEASE_NOTES_SEPARATOR, - SECRET_REPLACEMENT, - SECRET_MIN_SIZE, - GIT_NOTE_REF, -}; +export const GIT_NOTE_REF = 'semantic-release'; diff --git a/lib/definitions/errors.js b/lib/definitions/errors.js index dad72ba4bc..7e7e978ffc 100644 --- a/lib/definitions/errors.js +++ b/lib/definitions/errors.js @@ -1,7 +1,10 @@ -const {inspect} = require('util'); -const {toLower, isString, trim} = require('lodash'); +import {inspect} from 'node:util'; +import {createRequire} from 'node:module'; +import {isString, toLower, trim} from 'lodash-es'; +import {RELEASE_TYPE} from './constants.js'; + +const require = createRequire(import.meta.url); const pkg = require('../../package.json'); -const {RELEASE_TYPE} = require('./constants'); const [homepage] = pkg.homepage.split('#'); const stringify = (object) => @@ -10,16 +13,19 @@ const linkify = (file) => `${homepage}/blob/master/${file}`; const wordsList = (words) => `${words.slice(0, -1).join(', ')}${words.length > 1 ? ` or ${words[words.length - 1]}` : trim(words[0])}`; -module.exports = { - ENOGITREPO: ({cwd}) => ({ +export function ENOGITREPO({cwd}) { + return { message: 'Not running from a git repository.', details: `The \`semantic-release\` command must be executed from a Git repository. The current working directory is \`${cwd}\`. Please verify your CI configuration to make sure the \`semantic-release\` command is executed from the root of the cloned repository.`, - }), - ENOREPOURL: () => ({ + }; +} + +export function ENOREPOURL() { + return { message: 'The `repositoryUrl` option is required.', details: `The [repositoryUrl option](${linkify( 'docs/usage/configuration.md#repositoryurl' @@ -28,8 +34,11 @@ Please verify your CI configuration to make sure the \`semantic-release\` comman Please make sure to add the \`repositoryUrl\` to the [semantic-release configuration] (${linkify( 'docs/usage/configuration.md' )}).`, - }), - EGITNOPERMISSION: ({options: {repositoryUrl}, branch: {name}}) => ({ + }; +} + +export function EGITNOPERMISSION({options: {repositoryUrl}, branch: {name}}) { + return { message: 'Cannot push to the Git repository.', details: `**semantic-release** cannot push the version tag to the branch \`${name}\` on the remote Git repository with URL \`${repositoryUrl}\`. @@ -37,42 +46,57 @@ This can be caused by: - a misconfiguration of the [repositoryUrl](${linkify('docs/usage/configuration.md#repositoryurl')}) option - the repository being unavailable - or missing push permission for the user configured via the [Git credentials on your CI environment](${linkify( - 'docs/usage/ci-configuration.md#authentication' - )})`, - }), - EINVALIDTAGFORMAT: ({options: {tagFormat}}) => ({ + 'docs/usage/ci-configuration.md#authentication' + )})`, + }; +} + +export function EINVALIDTAGFORMAT({options: {tagFormat}}) { + return { message: 'Invalid `tagFormat` option.', details: `The [tagFormat](${linkify( 'docs/usage/configuration.md#tagformat' )}) must compile to a [valid Git reference](https://git-scm.com/docs/git-check-ref-format#_description). Your configuration for the \`tagFormat\` option is \`${stringify(tagFormat)}\`.`, - }), - ETAGNOVERSION: ({options: {tagFormat}}) => ({ + }; +} + +export function ETAGNOVERSION({options: {tagFormat}}) { + return { message: 'Invalid `tagFormat` option.', details: `The [tagFormat](${linkify( 'docs/usage/configuration.md#tagformat' )}) option must contain the variable \`version\` exactly once. Your configuration for the \`tagFormat\` option is \`${stringify(tagFormat)}\`.`, - }), - EPLUGINCONF: ({type, required, pluginConf}) => ({ + }; +} + +export function EPLUGINCONF({type, required, pluginConf}) { + return { message: `The \`${type}\` plugin configuration is invalid.`, details: `The [${type} plugin configuration](${linkify(`docs/usage/plugins.md#${toLower(type)}-plugin`)}) ${ required ? 'is required and ' : '' } must be a single or an array of plugins definition. A plugin definition is an npm module name, optionally wrapped in an array with an object. Your configuration for the \`${type}\` plugin is \`${stringify(pluginConf)}\`.`, - }), - EPLUGINSCONF: ({plugin}) => ({ + }; +} + +export function EPLUGINSCONF({plugin}) { + return { message: 'The `plugins` configuration is invalid.', details: `The [plugins](${linkify( 'docs/usage/configuration.md#plugins' )}) option must be an array of plugin definitions. A plugin definition is an npm module name, optionally wrapped in an array with an object. The invalid configuration is \`${stringify(plugin)}\`.`, - }), - EPLUGIN: ({pluginName, type}) => ({ + }; +} + +export function EPLUGIN({pluginName, type}) { + return { message: `A plugin configured in the step ${type} is not a valid semantic-release plugin.`, details: `A valid \`${type}\` **semantic-release** plugin must be a function or an object with a function in the property \`${type}\`. @@ -81,8 +105,11 @@ The plugin \`${pluginName}\` doesn't have the property \`${type}\` and cannot be Please refer to the \`${pluginName}\` and [semantic-release plugins configuration](${linkify( 'docs/usage/plugins.md' )}) documentation for more details.`, - }), - EANALYZECOMMITSOUTPUT: ({result, pluginName}) => ({ + }; +} + +export function EANALYZECOMMITSOUTPUT({result, pluginName}) { + return { message: 'The `analyzeCommits` plugin returned an invalid value. It must return a valid semver release type.', details: `The \`analyzeCommits\` plugin must return a valid [semver](https://semver.org) release type. The valid values are: ${RELEASE_TYPE.map( (type) => `\`${type}\`` @@ -97,8 +124,11 @@ We recommend to report the issue to the \`${pluginName}\` authors, providing the - A link to the **semantic-release** plugin developer guide: [${linkify('docs/developer-guide/plugin.md')}](${linkify( 'docs/developer-guide/plugin.md' )})`, - }), - EGENERATENOTESOUTPUT: ({result, pluginName}) => ({ + }; +} + +export function EGENERATENOTESOUTPUT({result, pluginName}) { + return { message: 'The `generateNotes` plugin returned an invalid value. It must return a `String`.', details: `The \`generateNotes\` plugin must return a \`String\`. @@ -111,8 +141,11 @@ We recommend to report the issue to the \`${pluginName}\` authors, providing the - A link to the **semantic-release** plugin developer guide: [${linkify('docs/developer-guide/plugin.md')}](${linkify( 'docs/developer-guide/plugin.md' )})`, - }), - EPUBLISHOUTPUT: ({result, pluginName}) => ({ + }; +} + +export function EPUBLISHOUTPUT({result, pluginName}) { + return { message: 'A `publish` plugin returned an invalid value. It must return an `Object`.', details: `The \`publish\` plugins must return an \`Object\`. @@ -125,8 +158,11 @@ We recommend to report the issue to the \`${pluginName}\` authors, providing the - A link to the **semantic-release** plugin developer guide: [${linkify('docs/developer-guide/plugin.md')}](${linkify( 'docs/developer-guide/plugin.md' )})`, - }), - EADDCHANNELOUTPUT: ({result, pluginName}) => ({ + }; +} + +export function EADDCHANNELOUTPUT({result, pluginName}) { + return { message: 'A `addChannel` plugin returned an invalid value. It must return an `Object`.', details: `The \`addChannel\` plugins must return an \`Object\`. @@ -139,48 +175,66 @@ We recommend to report the issue to the \`${pluginName}\` authors, providing the - A link to the **semantic-release** plugin developer guide: [${linkify('docs/developer-guide/plugin.md')}](${linkify( 'docs/developer-guide/plugin.md' )})`, - }), - EINVALIDBRANCH: ({branch}) => ({ + }; +} + +export function EINVALIDBRANCH({branch}) { + return { message: 'A branch is invalid in the `branches` configuration.', details: `Each branch in the [branches configuration](${linkify( 'docs/usage/configuration.md#branches' )}) must be either a string, a regexp or an object with a \`name\` property. Your configuration for the problematic branch is \`${stringify(branch)}\`.`, - }), - EINVALIDBRANCHNAME: ({branch}) => ({ + }; +} + +export function EINVALIDBRANCHNAME({branch}) { + return { message: 'A branch name is invalid in the `branches` configuration.', details: `Each branch in the [branches configuration](${linkify( 'docs/usage/configuration.md#branches' )}) must be a [valid Git reference](https://git-scm.com/docs/git-check-ref-format#_description). Your configuration for the problematic branch is \`${stringify(branch)}\`.`, - }), - EDUPLICATEBRANCHES: ({duplicates}) => ({ + }; +} + +export function EDUPLICATEBRANCHES({duplicates}) { + return { message: 'The `branches` configuration has duplicate branches.', details: `Each branch in the [branches configuration](${linkify( 'docs/usage/configuration.md#branches' )}) must havea unique name. Your configuration contains duplicates for the following branch names: \`${stringify(duplicates)}\`.`, - }), - EMAINTENANCEBRANCH: ({branch}) => ({ + }; +} + +export function EMAINTENANCEBRANCH({branch}) { + return { message: 'A maintenance branch is invalid in the `branches` configuration.', details: `Each maintenance branch in the [branches configuration](${linkify( 'docs/usage/configuration.md#branches' )}) must have a \`range\` property formatted like \`N.x\`, \`N.x.x\` or \`N.N.x\` (\`N\` is a number). Your configuration for the problematic branch is \`${stringify(branch)}\`.`, - }), - EMAINTENANCEBRANCHES: ({branches}) => ({ + }; +} + +export function EMAINTENANCEBRANCHES({branches}) { + return { message: 'The maintenance branches are invalid in the `branches` configuration.', details: `Each maintenance branch in the [branches configuration](${linkify( 'docs/usage/configuration.md#branches' )}) must have a unique \`range\` property. Your configuration for the problematic branches is \`${stringify(branches)}\`.`, - }), - ERELEASEBRANCHES: ({branches}) => ({ + }; +} + +export function ERELEASEBRANCHES({branches}) { + return { message: 'The release branches are invalid in the `branches` configuration.', details: `A minimum of 1 and a maximum of 3 release branches are required in the [branches configuration](${linkify( 'docs/usage/configuration.md#branches' @@ -189,24 +243,33 @@ Your configuration for the problematic branches is \`${stringify(branches)}\`.`, This may occur if your repository does not have a release branch, such as \`master\`. Your configuration for the problematic branches is \`${stringify(branches)}\`.`, - }), - EPRERELEASEBRANCH: ({branch}) => ({ + }; +} + +export function EPRERELEASEBRANCH({branch}) { + return { message: 'A pre-release branch configuration is invalid in the `branches` configuration.', details: `Each pre-release branch in the [branches configuration](${linkify( 'docs/usage/configuration.md#branches' )}) must have a \`prerelease\` property valid per the [Semantic Versioning Specification](https://semver.org/#spec-item-9). If the \`prerelease\` property is set to \`true\`, then the \`name\` property is used instead. Your configuration for the problematic branch is \`${stringify(branch)}\`.`, - }), - EPRERELEASEBRANCHES: ({branches}) => ({ + }; +} + +export function EPRERELEASEBRANCHES({branches}) { + return { message: 'The pre-release branches are invalid in the `branches` configuration.', details: `Each pre-release branch in the [branches configuration](${linkify( 'docs/usage/configuration.md#branches' )}) must have a unique \`prerelease\` property. If the \`prerelease\` property is set to \`true\`, then the \`name\` property is used instead. Your configuration for the problematic branches is \`${stringify(branches)}\`.`, - }), - EINVALIDNEXTVERSION: ({nextRelease: {version}, branch: {name, range}, commits, validBranches}) => ({ + }; +} + +export function EINVALIDNEXTVERSION({nextRelease: {version}, branch: {name, range}, commits, validBranches}) { + return { message: `The release \`${version}\` on branch \`${name}\` cannot be published as it is out of range.`, details: `Based on the releases published on other branches, only versions within the range \`${range}\` can be published from branch \`${name}\`. @@ -214,19 +277,22 @@ The following commit${commits.length > 1 ? 's are' : ' is'} responsible for the ${commits.map(({commit: {short}, subject}) => `- ${subject} (${short})`).join('\n')} ${ - commits.length > 1 ? 'Those commits' : 'This commit' -} should be moved to a valid branch with [git merge](https://git-scm.com/docs/git-merge) or [git cherry-pick](https://git-scm.com/docs/git-cherry-pick) and removed from branch \`${name}\` with [git revert](https://git-scm.com/docs/git-revert) or [git reset](https://git-scm.com/docs/git-reset). + commits.length > 1 ? 'Those commits' : 'This commit' + } should be moved to a valid branch with [git merge](https://git-scm.com/docs/git-merge) or [git cherry-pick](https://git-scm.com/docs/git-cherry-pick) and removed from branch \`${name}\` with [git revert](https://git-scm.com/docs/git-revert) or [git reset](https://git-scm.com/docs/git-reset). A valid branch could be ${wordsList(validBranches.map(({name}) => `\`${name}\``))}. See the [workflow configuration documentation](${linkify('docs/usage/workflow-configuration.md')}) for more details.`, - }), - EINVALIDMAINTENANCEMERGE: ({nextRelease: {channel, gitTag, version}, branch: {mergeRange, name}}) => ({ + }; +} + +export function EINVALIDMAINTENANCEMERGE({nextRelease: {channel, gitTag, version}, branch: {mergeRange, name}}) { + return { message: `The release \`${version}\` on branch \`${name}\` cannot be published as it is out of range.`, details: `Only releases within the range \`${mergeRange}\` can be merged into the maintenance branch \`${name}\` and published to the \`${channel}\` distribution channel. The branch \`${name}\` head should be [reset](https://git-scm.com/docs/git-reset) to a previous commit so the commit with tag \`${gitTag}\` is removed from the branch history. See the [workflow configuration documentation](${linkify('docs/usage/workflow-configuration.md')}) for more details.`, - }), -}; + }; +} diff --git a/lib/definitions/plugins.js b/lib/definitions/plugins.js index c2e536ed71..19b5288926 100644 --- a/lib/definitions/plugins.js +++ b/lib/definitions/plugins.js @@ -1,12 +1,12 @@ /* eslint require-atomic-updates: off */ -const {isString, isPlainObject} = require('lodash'); -const {getGitHead} = require('../git'); -const hideSensitive = require('../hide-sensitive'); -const {hideSensitiveValues} = require('../utils'); -const {RELEASE_TYPE, RELEASE_NOTES_SEPARATOR} = require('./constants'); +import {isPlainObject, isString} from 'lodash-es'; +import {getGitHead} from '../git.js'; +import hideSensitive from '../hide-sensitive.js'; +import {hideSensitiveValues} from '../utils.js'; +import {RELEASE_NOTES_SEPARATOR, RELEASE_TYPE} from './constants.js'; -module.exports = { +export default { verifyConditions: { required: false, dryRun: true, diff --git a/lib/get-commits.js b/lib/get-commits.js index 2bd5ec777c..f46bc9d91b 100644 --- a/lib/get-commits.js +++ b/lib/get-commits.js @@ -1,5 +1,7 @@ -const debug = require('debug')('semantic-release:get-commits'); -const {getCommits} = require('./git'); +import debugCommits from 'debug'; +import {getCommits} from './git.js'; + +const debug = debugCommits('semantic-release:get-commits'); /** * Retrieve the list of commits on the current branch since the commit sha associated with the last release, or all the commits of the current branch if there is no last released version. @@ -8,7 +10,7 @@ const {getCommits} = require('./git'); * * @return {Promise>} The list of commits on the branch `branch` since the last release. */ -module.exports = async ({cwd, env, lastRelease: {gitHead: from}, nextRelease: {gitHead: to = 'HEAD'} = {}, logger}) => { +export default async ({cwd, env, lastRelease: {gitHead: from}, nextRelease: {gitHead: to = 'HEAD'} = {}, logger}) => { if (from) { debug('Use from: %s', from); } else { @@ -20,4 +22,4 @@ module.exports = async ({cwd, env, lastRelease: {gitHead: from}, nextRelease: {g logger.log(`Found ${commits.length} commits since last release`); debug('Parsed commits: %o', commits); return commits; -}; +} diff --git a/lib/get-config.js b/lib/get-config.js index 1f16962ac9..4dc017b3b9 100644 --- a/lib/get-config.js +++ b/lib/get-config.js @@ -1,16 +1,24 @@ -const {castArray, pickBy, isNil, isString, isPlainObject} = require('lodash'); -const readPkgUp = require('read-pkg-up'); -const {cosmiconfig} = require('cosmiconfig'); -const resolveFrom = require('resolve-from'); -const debug = require('debug')('semantic-release:config'); -const {repoUrl} = require('./git'); -const PLUGINS_DEFINITIONS = require('./definitions/plugins'); -const plugins = require('./plugins'); -const {validatePlugin, parseConfig} = require('./plugins/utils'); +import {dirname, resolve} from 'node:path'; +import {fileURLToPath} from 'node:url'; +import {createRequire} from 'node:module'; + +import {castArray, isNil, isPlainObject, isString, pickBy} from 'lodash-es'; +import {readPackageUp} from 'read-pkg-up'; +import {cosmiconfig} from 'cosmiconfig'; +import resolveFrom from 'resolve-from'; +import debugConfig from 'debug'; +import {repoUrl} from './git.js'; +import PLUGINS_DEFINITIONS from './definitions/plugins.js'; +import plugins from './plugins/index.js'; +import {parseConfig, validatePlugin} from './plugins/utils.js'; + +const debug = debugConfig('semantic-release:config'); +const __dirname = dirname(fileURLToPath(import.meta.url)); +const require = createRequire(import.meta.url); const CONFIG_NAME = 'release'; -module.exports = async (context, cliOptions) => { +export default async (context, cliOptions) => { const {cwd, env} = context; const {config, filepath} = (await cosmiconfig(CONFIG_NAME).search(cwd)) || {}; @@ -25,11 +33,12 @@ module.exports = async (context, cliOptions) => { if (extendPaths) { // If `extends` is defined, load and merge each shareable config with `options` options = { - ...castArray(extendPaths).reduce((result, extendPath) => { + ...await (castArray(extendPaths).reduce(async(eventualResult, extendPath) => { + const result = await eventualResult; const extendsOptions = require(resolveFrom.silent(__dirname, extendPath) || resolveFrom(cwd, extendPath)); // For each plugin defined in a shareable config, save in `pluginsPath` the extendable config path, - // so those plugin will be loaded relatively to the config file + // so those plugin will be loaded relative to the config file Object.entries(extendsOptions) .filter(([, value]) => Boolean(value)) .reduce((pluginsPath, [option, value]) => { @@ -47,7 +56,7 @@ module.exports = async (context, cliOptions) => { }, pluginsPath); return {...result, ...extendsOptions}; - }, {}), + }, {})), ...options, }; } @@ -70,7 +79,7 @@ module.exports = async (context, cliOptions) => { '@semantic-release/npm', '@semantic-release/github', ], - // Remove `null` and `undefined` options so they can be replaced with default ones + // Remove `null` and `undefined` options, so they can be replaced with default ones ...pickBy(options, (option) => !isNil(option)), ...(options.branches ? {branches: castArray(options.branches)} : {}), }; @@ -82,9 +91,9 @@ module.exports = async (context, cliOptions) => { debug('options values: %O', options); return {options, plugins: await plugins({...context, options}, pluginsPath)}; -}; +} async function pkgRepoUrl(options) { - const {packageJson} = (await readPkgUp(options)) || {}; + const {packageJson} = (await readPackageUp(options)) || {}; return packageJson && (isPlainObject(packageJson.repository) ? packageJson.repository.url : packageJson.repository); } diff --git a/lib/get-error.js b/lib/get-error.js index 56a09c0d51..d80e9b1c62 100644 --- a/lib/get-error.js +++ b/lib/get-error.js @@ -1,7 +1,7 @@ -const SemanticReleaseError = require('@semantic-release/error'); -const ERROR_DEFINITIONS = require('./definitions/errors'); +import SemanticReleaseError from '@semantic-release/error'; +import * as ERROR_DEFINITIONS from './definitions/errors.js'; -module.exports = (code, ctx = {}) => { +export default (code, ctx = {}) => { const {message, details} = ERROR_DEFINITIONS[code](ctx); return new SemanticReleaseError(message, code, details); -}; +} diff --git a/lib/get-git-auth-url.js b/lib/get-git-auth-url.js index 56b5fc6932..8b5f94e720 100644 --- a/lib/get-git-auth-url.js +++ b/lib/get-git-auth-url.js @@ -1,8 +1,10 @@ -const {parse, format} = require('url'); // eslint-disable-line node/no-deprecated-api -const {isNil} = require('lodash'); -const hostedGitInfo = require('hosted-git-info'); -const {verifyAuth} = require('./git'); -const debug = require('debug')('semantic-release:get-git-auth-url'); +import {format, parse} from 'node:url'; +import {isNil} from 'lodash-es'; +import hostedGitInfo from 'hosted-git-info'; +import debugAuthUrl from 'debug'; +import {verifyAuth} from './git.js'; + +const debug = debugAuthUrl('semantic-release:get-git-auth-url'); /** * Machinery to format a repository URL with the given credentials @@ -57,7 +59,7 @@ async function ensureValidAuthUrl({cwd, env, branch}, authUrl) { * * @return {String} The formatted Git repository URL. */ -module.exports = async (context) => { +export default async (context) => { const {cwd, env, branch} = context; const GIT_TOKENS = { GIT_CREDENTIALS: undefined, @@ -119,4 +121,4 @@ module.exports = async (context) => { } return repositoryUrl; -}; +} diff --git a/lib/get-last-release.js b/lib/get-last-release.js index 110fd85f4f..676b6615f5 100644 --- a/lib/get-last-release.js +++ b/lib/get-last-release.js @@ -1,6 +1,6 @@ -const {isUndefined} = require('lodash'); -const semver = require('semver'); -const {makeTag, isSameChannel} = require('./utils'); +import {isUndefined} from 'lodash-es'; +import semver from 'semver'; +import {isSameChannel, makeTag} from './utils.js'; /** * Last release. @@ -18,7 +18,7 @@ const {makeTag, isSameChannel} = require('./utils'); * * - Filter out the branch tags that are not valid semantic version * - Sort the versions - * - Retrive the highest version + * - Retrieve the highest version * * @param {Object} context semantic-release context. * @param {Object} params Function parameters. @@ -26,7 +26,7 @@ const {makeTag, isSameChannel} = require('./utils'); * * @return {LastRelease} The last tagged release or empty object if none is found. */ -module.exports = ({branch, options: {tagFormat}}, {before} = {}) => { +export default ({branch, options: {tagFormat}}, {before} = {}) => { const [{version, gitTag, channels} = {}] = branch.tags .filter( (tag) => @@ -41,4 +41,4 @@ module.exports = ({branch, options: {tagFormat}}, {before} = {}) => { } return {}; -}; +} diff --git a/lib/get-logger.js b/lib/get-logger.js index d37da6bbb0..20c62a6eb0 100644 --- a/lib/get-logger.js +++ b/lib/get-logger.js @@ -1,7 +1,9 @@ -const {Signale} = require('signale'); -const figures = require('figures'); +import signale from 'signale'; +import figures from 'figures'; -module.exports = ({stdout, stderr}) => +const {Signale} = signale; + +export default ({stdout, stderr}) => new Signale({ config: {displayTimestamp: true, underlineMessage: false, displayLabel: false}, disabled: false, @@ -13,4 +15,4 @@ module.exports = ({stdout, stderr}) => log: {badge: figures.info, color: 'magenta', label: '', stream: [stdout]}, success: {badge: figures.tick, color: 'green', label: '', stream: [stdout]}, }, - }); + }) diff --git a/lib/get-next-version.js b/lib/get-next-version.js index 8734922d3e..bbfaacc4d1 100644 --- a/lib/get-next-version.js +++ b/lib/get-next-version.js @@ -1,8 +1,8 @@ -const semver = require('semver'); -const {FIRST_RELEASE, FIRSTPRERELEASE} = require('./definitions/constants'); -const {isSameChannel, getLatestVersion, tagsToVersions, highest} = require('./utils'); +import semver from 'semver'; +import {FIRST_RELEASE, FIRSTPRERELEASE} from './definitions/constants.js'; +import {getLatestVersion, highest, isSameChannel, tagsToVersions} from './utils.js'; -module.exports = ({branch, nextRelease: {type, channel}, lastRelease, logger}) => { +export default ({branch, nextRelease: {type, channel}, lastRelease, logger}) => { let version; if (lastRelease.version) { const {major, minor, patch} = semver.parse(lastRelease.version); @@ -32,4 +32,4 @@ module.exports = ({branch, nextRelease: {type, channel}, lastRelease, logger}) = } return version; -}; +} diff --git a/lib/get-release-to-add.js b/lib/get-release-to-add.js index a76ce5ef20..32f48b2435 100644 --- a/lib/get-release-to-add.js +++ b/lib/get-release-to-add.js @@ -1,8 +1,8 @@ -const {uniqBy, intersection} = require('lodash'); -const semver = require('semver'); -const semverDiff = require('semver-diff'); -const getLastRelease = require('./get-last-release'); -const {makeTag, getLowerBound} = require('./utils'); +import {intersection, uniqBy} from 'lodash-es'; +import semver from 'semver'; +import semverDiff from 'semver-diff'; +import getLastRelease from './get-last-release.js'; +import {getLowerBound, makeTag} from './utils.js'; /** * Find releases that have been merged from from a higher branch but not added on the channel of the current branch. @@ -11,7 +11,7 @@ const {makeTag, getLowerBound} = require('./utils'); * * @return {Array} Last release and next release to be added on the channel of the current branch. */ -module.exports = (context) => { +export default (context) => { const { branch, branches, @@ -57,4 +57,4 @@ module.exports = (context) => { }, }; } -}; +} diff --git a/lib/git.js b/lib/git.js index c4e7ff4c3d..3745aaaf63 100644 --- a/lib/git.js +++ b/lib/git.js @@ -1,8 +1,10 @@ -const gitLogParser = require('git-log-parser'); -const getStream = require('get-stream'); -const execa = require('execa'); -const debug = require('debug')('semantic-release:git'); -const {GIT_NOTE_REF} = require('./definitions/constants'); +import gitLogParser from 'git-log-parser'; +import getStream from 'get-stream'; +import {execa} from 'execa'; +import debugGit from 'debug'; +import {GIT_NOTE_REF} from './definitions/constants.js'; + +const debug = debugGit('semantic-release:git'); Object.assign(gitLogParser.fields, {hash: 'H', message: 'B', gitTags: 'd', committerDate: {key: 'ci', type: Date}}); @@ -14,7 +16,7 @@ Object.assign(gitLogParser.fields, {hash: 'H', message: 'B', gitTags: 'd', commi * * @return {String} The commit sha of the tag in parameter or `null`. */ -async function getTagHead(tagName, execaOptions) { +export async function getTagHead(tagName, execaOptions) { return (await execa('git', ['rev-list', '-1', tagName], execaOptions)).stdout; } @@ -27,7 +29,7 @@ async function getTagHead(tagName, execaOptions) { * @return {Array} List of git tags. * @throws {Error} If the `git` command fails. */ -async function getTags(branch, execaOptions) { +export async function getTags(branch, execaOptions) { return (await execa('git', ['tag', '--merged', branch], execaOptions)).stdout .split('\n') .map((tag) => tag.trim()) @@ -42,7 +44,7 @@ async function getTags(branch, execaOptions) { * @param {Object} [execaOpts] Options to pass to `execa`. * @return {Promise>} The list of commits between `from` and `to`. */ -async function getCommits(from, to, execaOptions) { +export async function getCommits(from, to, execaOptions) { return ( await getStream.array( gitLogParser.parse( @@ -62,7 +64,7 @@ async function getCommits(from, to, execaOptions) { * @return {Array} List of git branches. * @throws {Error} If the `git` command fails. */ -async function getBranches(repositoryUrl, execaOptions) { +export async function getBranches(repositoryUrl, execaOptions) { return (await execa('git', ['ls-remote', '--heads', repositoryUrl], execaOptions)).stdout .split('\n') .filter(Boolean) @@ -77,7 +79,7 @@ async function getBranches(repositoryUrl, execaOptions) { * * @return {Boolean} `true` if the reference exists, falsy otherwise. */ -async function isRefExists(ref, execaOptions) { +export async function isRefExists(ref, execaOptions) { try { return (await execa('git', ['rev-parse', '--verify', ref], execaOptions)).exitCode === 0; } catch (error) { @@ -99,7 +101,7 @@ async function isRefExists(ref, execaOptions) { * @param {String} branch The repository branch to fetch. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function fetch(repositoryUrl, branch, ciBranch, execaOptions) { +export async function fetch(repositoryUrl, branch, ciBranch, execaOptions) { const isDetachedHead = (await execa('git', ['rev-parse', '--abbrev-ref', 'HEAD'], {...execaOptions, reject: false})).stdout === 'HEAD'; @@ -137,7 +139,7 @@ async function fetch(repositoryUrl, branch, ciBranch, execaOptions) { * @param {String} repositoryUrl The remote repository URL. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function fetchNotes(repositoryUrl, execaOptions) { +export async function fetchNotes(repositoryUrl, execaOptions) { try { await execa( 'git', @@ -159,7 +161,7 @@ async function fetchNotes(repositoryUrl, execaOptions) { * * @return {String} the sha of the HEAD commit. */ -async function getGitHead(execaOptions) { +export async function getGitHead(execaOptions) { return (await execa('git', ['rev-parse', 'HEAD'], execaOptions)).stdout; } @@ -170,7 +172,7 @@ async function getGitHead(execaOptions) { * * @return {string} The value of the remote git URL. */ -async function repoUrl(execaOptions) { +export async function repoUrl(execaOptions) { try { return (await execa('git', ['config', '--get', 'remote.origin.url'], execaOptions)).stdout; } catch (error) { @@ -185,7 +187,7 @@ async function repoUrl(execaOptions) { * * @return {Boolean} `true` if the current working directory is in a git repository, falsy otherwise. */ -async function isGitRepo(execaOptions) { +export async function isGitRepo(execaOptions) { try { return (await execa('git', ['rev-parse', '--git-dir'], execaOptions)).exitCode === 0; } catch (error) { @@ -202,7 +204,7 @@ async function isGitRepo(execaOptions) { * * @throws {Error} if not authorized to push. */ -async function verifyAuth(repositoryUrl, branch, execaOptions) { +export async function verifyAuth(repositoryUrl, branch, execaOptions) { try { await execa('git', ['push', '--dry-run', '--no-verify', repositoryUrl, `HEAD:${branch}`], execaOptions); } catch (error) { @@ -220,7 +222,7 @@ async function verifyAuth(repositoryUrl, branch, execaOptions) { * * @throws {Error} if the tag creation failed. */ -async function tag(tagName, ref, execaOptions) { +export async function tag(tagName, ref, execaOptions) { await execa('git', ['tag', tagName, ref], execaOptions); } @@ -232,7 +234,7 @@ async function tag(tagName, ref, execaOptions) { * * @throws {Error} if the push failed. */ -async function push(repositoryUrl, execaOptions) { +export async function push(repositoryUrl, execaOptions) { await execa('git', ['push', '--tags', repositoryUrl], execaOptions); } @@ -244,7 +246,7 @@ async function push(repositoryUrl, execaOptions) { * * @throws {Error} if the push failed. */ -async function pushNotes(repositoryUrl, execaOptions) { +export async function pushNotes(repositoryUrl, execaOptions) { await execa('git', ['push', repositoryUrl, `refs/notes/${GIT_NOTE_REF}`], execaOptions); } @@ -256,7 +258,7 @@ async function pushNotes(repositoryUrl, execaOptions) { * * @return {Boolean} `true` if valid, falsy otherwise. */ -async function verifyTagName(tagName, execaOptions) { +export async function verifyTagName(tagName, execaOptions) { try { return (await execa('git', ['check-ref-format', `refs/tags/${tagName}`], execaOptions)).exitCode === 0; } catch (error) { @@ -272,7 +274,7 @@ async function verifyTagName(tagName, execaOptions) { * * @return {Boolean} `true` if valid, falsy otherwise. */ -async function verifyBranchName(branch, execaOptions) { +export async function verifyBranchName(branch, execaOptions) { try { return (await execa('git', ['check-ref-format', `refs/heads/${branch}`], execaOptions)).exitCode === 0; } catch (error) { @@ -289,7 +291,7 @@ async function verifyBranchName(branch, execaOptions) { * * @return {Boolean} `true` is the HEAD of the current local branch is the same as the HEAD of the remote branch, falsy otherwise. */ -async function isBranchUpToDate(repositoryUrl, branch, execaOptions) { +export async function isBranchUpToDate(repositoryUrl, branch, execaOptions) { return ( (await getGitHead(execaOptions)) === (await execa('git', ['ls-remote', '--heads', repositoryUrl, branch], execaOptions)).stdout.match(/^(?\w+)?/)[1] @@ -304,7 +306,7 @@ async function isBranchUpToDate(repositoryUrl, branch, execaOptions) { * * @return {Object} the parsed JSON note if there is one, an empty object otherwise. */ -async function getNote(ref, execaOptions) { +export async function getNote(ref, execaOptions) { try { return JSON.parse((await execa('git', ['notes', '--ref', GIT_NOTE_REF, 'show', ref], execaOptions)).stdout); } catch (error) { @@ -324,28 +326,6 @@ async function getNote(ref, execaOptions) { * @param {String} ref The Git reference to add the note to. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function addNote(note, ref, execaOptions) { +export async function addNote(note, ref, execaOptions) { await execa('git', ['notes', '--ref', GIT_NOTE_REF, 'add', '-f', '-m', JSON.stringify(note), ref], execaOptions); } - -module.exports = { - getTagHead, - getTags, - getCommits, - getBranches, - isRefExists, - fetch, - fetchNotes, - getGitHead, - repoUrl, - isGitRepo, - verifyAuth, - tag, - push, - pushNotes, - verifyTagName, - isBranchUpToDate, - verifyBranchName, - getNote, - addNote, -}; diff --git a/lib/hide-sensitive.js b/lib/hide-sensitive.js index 1768c5901b..b05f5a9384 100644 --- a/lib/hide-sensitive.js +++ b/lib/hide-sensitive.js @@ -1,7 +1,7 @@ -const {escapeRegExp, size, isString} = require('lodash'); -const {SECRET_REPLACEMENT, SECRET_MIN_SIZE} = require('./definitions/constants'); +import {escapeRegExp, isString, size} from 'lodash-es'; +import {SECRET_MIN_SIZE, SECRET_REPLACEMENT} from './definitions/constants.js'; -module.exports = (env) => { +export default (env) => { const toReplace = Object.keys(env).filter((envVar) => { // https://github.com/semantic-release/semantic-release/issues/1558 if (envVar === 'GOPRIVATE') { @@ -17,4 +17,4 @@ module.exports = (env) => { ); return (output) => output && isString(output) && toReplace.length > 0 ? output.toString().replace(regexp, SECRET_REPLACEMENT) : output; -}; +} diff --git a/lib/plugins/index.js b/lib/plugins/index.js index 47ff577a30..dc8a055277 100644 --- a/lib/plugins/index.js +++ b/lib/plugins/index.js @@ -1,12 +1,12 @@ -const {identity, isPlainObject, omit, castArray, isNil, isString} = require('lodash'); -const AggregateError = require('aggregate-error'); -const getError = require('../get-error'); -const PLUGINS_DEFINITIONS = require('../definitions/plugins'); -const {validatePlugin, validateStep, loadPlugin, parseConfig} = require('./utils'); -const pipeline = require('./pipeline'); -const normalize = require('./normalize'); +import {castArray, identity, isNil, isPlainObject, isString, omit} from 'lodash-es'; +import AggregateError from 'aggregate-error'; +import getError from '../get-error.js'; +import PLUGINS_DEFINITIONS from '../definitions/plugins.js'; +import {loadPlugin, parseConfig, validatePlugin, validateStep} from './utils.js'; +import pipeline from './pipeline.js'; +import normalize from './normalize.js'; -module.exports = async (context, pluginsPath) => { +export default async (context, pluginsPath) => { let {options, logger} = context; const errors = []; @@ -100,4 +100,4 @@ module.exports = async (context, pluginsPath) => { } return pluginsConfig; -}; +} diff --git a/lib/plugins/normalize.js b/lib/plugins/normalize.js index d44400d24c..5efe68cb3f 100644 --- a/lib/plugins/normalize.js +++ b/lib/plugins/normalize.js @@ -1,11 +1,13 @@ -const {isPlainObject, isFunction, noop, cloneDeep, omit} = require('lodash'); -const debug = require('debug')('semantic-release:plugins'); -const getError = require('../get-error'); -const {extractErrors} = require('../utils'); -const PLUGINS_DEFINITIONS = require('../definitions/plugins'); -const {loadPlugin, parseConfig} = require('./utils'); +import {cloneDeep, isFunction, isPlainObject, noop, omit} from 'lodash-es'; +import debugPlugins from 'debug'; +import getError from '../get-error.js'; +import {extractErrors} from '../utils.js'; +import PLUGINS_DEFINITIONS from '../definitions/plugins.js'; +import {loadPlugin, parseConfig} from './utils.js'; -module.exports = async (context, type, pluginOpt, pluginsPath) => { +const debug = debugPlugins('semantic-release:plugins'); + +export default async (context, type, pluginOpt, pluginsPath) => { const {stdout, stderr, options, logger} = context; if (!pluginOpt) { return noop; @@ -64,4 +66,4 @@ module.exports = async (context, type, pluginOpt, pluginsPath) => { } return validator; -}; +} diff --git a/lib/plugins/pipeline.js b/lib/plugins/pipeline.js index 3ed4f4fe8c..3ff6f30d88 100644 --- a/lib/plugins/pipeline.js +++ b/lib/plugins/pipeline.js @@ -1,7 +1,7 @@ -const {identity} = require('lodash'); -const pReduce = require('p-reduce'); -const AggregateError = require('aggregate-error'); -const {extractErrors} = require('../utils'); +import {identity} from 'lodash-es'; +import pReduce from 'p-reduce'; +import AggregateError from 'aggregate-error'; +import {extractErrors} from '../utils.js'; /** * A Function that execute a list of function sequencially. If at least one Function ins the pipeline throws an Error or rejects, the pipeline function rejects as well. @@ -25,7 +25,7 @@ const {extractErrors} = require('../utils'); * * @return {Pipeline} A Function that execute the `steps` sequencially */ -module.exports = (steps, {settleAll = false, getNextInput = identity, transform = identity} = {}) => async (input) => { +export default (steps, {settleAll = false, getNextInput = identity, transform = identity} = {}) => async (input) => { const results = []; const errors = []; await pReduce( @@ -55,4 +55,4 @@ module.exports = (steps, {settleAll = false, getNextInput = identity, transform } return results; -}; +} diff --git a/lib/plugins/utils.js b/lib/plugins/utils.js index 2b69da41a5..a156c0468d 100644 --- a/lib/plugins/utils.js +++ b/lib/plugins/utils.js @@ -1,6 +1,9 @@ -const {dirname} = require('path'); -const {isString, isFunction, castArray, isArray, isPlainObject, isNil} = require('lodash'); -const resolveFrom = require('resolve-from'); +import {dirname} from 'node:path'; +import {fileURLToPath} from 'node:url'; +import {castArray, isArray, isFunction, isNil, isPlainObject, isString} from 'lodash-es'; +import resolveFrom from 'resolve-from'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); const validateSteps = (conf) => { return conf.every((conf) => { @@ -24,7 +27,7 @@ const validateSteps = (conf) => { }); }; -function validatePlugin(conf) { +export function validatePlugin(conf) { return ( isString(conf) || (isArray(conf) && @@ -35,7 +38,7 @@ function validatePlugin(conf) { ); } -function validateStep({required}, conf) { +export function validateStep({required}, conf) { conf = castArray(conf).filter(Boolean); if (required) { return conf.length >= 1 && validateSteps(conf); @@ -44,7 +47,7 @@ function validateStep({required}, conf) { return conf.length === 0 || validateSteps(conf); } -async function loadPlugin({cwd}, name, pluginsPath) { +export async function loadPlugin({cwd}, name, pluginsPath) { const basePath = pluginsPath[name] ? dirname(resolveFrom.silent(__dirname, pluginsPath[name]) || resolveFrom(cwd, pluginsPath[name])) : __dirname; @@ -54,7 +57,7 @@ async function loadPlugin({cwd}, name, pluginsPath) { return isFunction(name) ? name : (await import(resolveFrom.silent(basePath, name) || resolveFrom(cwd, name))).default; } -function parseConfig(plugin) { +export function parseConfig(plugin) { let path; let config; if (isArray(plugin)) { @@ -67,5 +70,3 @@ function parseConfig(plugin) { return [path, config || {}]; } - -module.exports = {validatePlugin, validateStep, loadPlugin, parseConfig}; diff --git a/lib/utils.js b/lib/utils.js index 895e9d04d4..13c820b339 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,12 +1,12 @@ -const {isFunction, union, template} = require('lodash'); -const semver = require('semver'); -const hideSensitive = require('./hide-sensitive'); +import {isFunction, template, union} from 'lodash-es'; +import semver from 'semver'; +import hideSensitive from './hide-sensitive.js'; -function extractErrors(err) { - return err && isFunction(err[Symbol.iterator]) ? [...err] : [err]; +export function extractErrors(err) { + return err && err.errors ? [...err.errors] : [err]; } -function hideSensitiveValues(env, objs) { +export function hideSensitiveValues(env, objs) { const hideFunction = hideSensitive(env); return objs.map((object) => { Object.getOwnPropertyNames(object).forEach((prop) => { @@ -18,19 +18,19 @@ function hideSensitiveValues(env, objs) { }); } -function tagsToVersions(tags) { +export function tagsToVersions(tags) { return tags.map(({version}) => version); } -function isMajorRange(range) { +export function isMajorRange(range) { return /^\d+\.x(?:\.x)?$/i.test(range); } -function isMaintenanceRange(range) { +export function isMaintenanceRange(range) { return /^\d+\.(?:\d+|x)(?:\.x)?$/i.test(range); } -function getUpperBound(range) { +export function getUpperBound(range) { const result = semver.valid(range) ? range : ((semver.validRange(range) || '').match(/<(?\d+\.\d+\.\d+(-\d+)?)$/) || [])[1]; @@ -41,27 +41,27 @@ function getUpperBound(range) { : result; } -function getLowerBound(range) { +export function getLowerBound(range) { return ((semver.validRange(range) || '').match(/(?\d+\.\d+\.\d+)/) || [])[1]; } -function highest(version1, version2) { +export function highest(version1, version2) { return version1 && version2 ? (semver.gt(version1, version2) ? version1 : version2) : version1 || version2; } -function lowest(version1, version2) { +export function lowest(version1, version2) { return version1 && version2 ? (semver.lt(version1, version2) ? version1 : version2) : version1 || version2; } -function getLatestVersion(versions, {withPrerelease} = {}) { +export function getLatestVersion(versions, {withPrerelease} = {}) { return versions.filter((version) => withPrerelease || !semver.prerelease(version)).sort(semver.rcompare)[0]; } -function getEarliestVersion(versions, {withPrerelease} = {}) { +export function getEarliestVersion(versions, {withPrerelease} = {}) { return versions.filter((version) => withPrerelease || !semver.prerelease(version)).sort(semver.compare)[0]; } -function getFirstVersion(versions, lowerBranches) { +export function getFirstVersion(versions, lowerBranches) { const lowerVersion = union(...lowerBranches.map(({tags}) => tagsToVersions(tags))).sort(semver.rcompare); if (lowerVersion[0]) { return versions.sort(semver.compare).find((version) => semver.gt(version, lowerVersion[0])); @@ -70,32 +70,14 @@ function getFirstVersion(versions, lowerBranches) { return getEarliestVersion(versions); } -function getRange(min, max) { +export function getRange(min, max) { return `>=${min}${max ? ` <${max}` : ''}`; } -function makeTag(tagFormat, version) { +export function makeTag(tagFormat, version) { return template(tagFormat)({version}); } -function isSameChannel(channel, otherChannel) { +export function isSameChannel(channel, otherChannel) { return channel === otherChannel || (!channel && !otherChannel); } - -module.exports = { - extractErrors, - hideSensitiveValues, - tagsToVersions, - isMajorRange, - isMaintenanceRange, - getUpperBound, - getLowerBound, - highest, - lowest, - getLatestVersion, - getEarliestVersion, - getFirstVersion, - getRange, - makeTag, - isSameChannel, -}; diff --git a/lib/verify.js b/lib/verify.js index 01fc98d68f..26735b5e3e 100644 --- a/lib/verify.js +++ b/lib/verify.js @@ -1,9 +1,9 @@ -const {template, isString, isPlainObject} = require('lodash'); -const AggregateError = require('aggregate-error'); -const {isGitRepo, verifyTagName} = require('./git'); -const getError = require('./get-error'); +import {isPlainObject, isString, template} from 'lodash-es'; +import AggregateError from 'aggregate-error'; +import {isGitRepo, verifyTagName} from './git.js'; +import getError from './get-error.js'; -module.exports = async (context) => { +export default async (context) => { const { cwd, env, @@ -40,4 +40,4 @@ module.exports = async (context) => { if (errors.length > 0) { throw new AggregateError(errors); } -}; +} diff --git a/package-lock.json b/package-lock.json index 9c59b5f070..c358db1965 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,29 +14,29 @@ "@semantic-release/github": "^8.0.0", "@semantic-release/npm": "^9.0.0", "@semantic-release/release-notes-generator": "^10.0.0", - "aggregate-error": "^3.0.0", + "aggregate-error": "^4.0.1", "cosmiconfig": "^7.0.0", "debug": "^4.0.0", - "env-ci": "^5.0.0", - "execa": "^5.0.0", - "figures": "^3.0.0", - "find-versions": "^4.0.0", + "env-ci": "8.0.0-beta.1", + "execa": "^6.1.0", + "figures": "^5.0.0", + "find-versions": "^5.1.0", "get-stream": "^6.0.0", "git-log-parser": "^1.2.0", - "hook-std": "^2.0.0", - "hosted-git-info": "^4.0.0", - "lodash": "^4.17.21", - "marked": "^4.0.10", - "marked-terminal": "^5.0.0", + "hook-std": "^3.0.0", + "hosted-git-info": "^5.1.0", + "lodash-es": "^4.17.21", + "marked": "^4.1.0", + "marked-terminal": "^5.1.1", "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "p-reduce": "^2.0.0", - "read-pkg-up": "^7.0.0", + "p-each-series": "^3.0.0", + "p-reduce": "^3.0.0", + "read-pkg-up": "^9.1.0", "resolve-from": "^5.0.0", "semver": "^7.3.2", "semver-diff": "^3.1.1", "signale": "^1.2.1", - "yargs": "^16.2.0" + "yargs": "^17.5.1" }, "bin": { "semantic-release": "bin/semantic-release.js" @@ -48,16 +48,16 @@ "codecov": "3.8.3", "delay": "5.0.0", "dockerode": "3.3.4", - "file-url": "3.0.0", - "fs-extra": "9.1.0", - "got": "11.8.5", + "file-url": "^4.0.0", + "fs-extra": "^10.1.0", + "got": "^12.5.0", "js-yaml": "4.1.0", "mockserver-client": "5.14.0", "nock": "13.2.9", - "p-retry": "4.6.2", + "p-retry": "^5.1.1", "sinon": "14.0.0", "stream-buffers": "3.0.2", - "tempy": "1.0.1", + "tempy": "^3.0.0", "testdouble": "3.16.6", "xo": "0.32.1" }, @@ -803,17 +803,41 @@ "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-2.2.0.tgz", "integrity": "sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg==" }, - "node_modules/@semantic-release/github/node_modules/fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "node_modules/@semantic-release/github/node_modules/@types/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" + }, + "node_modules/@semantic-release/github/node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" }, "engines": { - "node": ">=12" + "node": ">=8" + } + }, + "node_modules/@semantic-release/github/node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/@semantic-release/github/node_modules/p-retry": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", + "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", + "dependencies": { + "@types/retry": "0.12.0", + "retry": "^0.13.1" + }, + "engines": { + "node": ">=8" } }, "node_modules/@semantic-release/npm": { @@ -842,17 +866,135 @@ "semantic-release": ">=19.0.0" } }, - "node_modules/@semantic-release/npm/node_modules/fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "node_modules/@semantic-release/npm/node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" }, "engines": { - "node": ">=12" + "node": ">=8" + } + }, + "node_modules/@semantic-release/npm/node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/@semantic-release/npm/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/@semantic-release/npm/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/@semantic-release/npm/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/@semantic-release/npm/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@semantic-release/npm/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/@semantic-release/npm/node_modules/tempy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-1.0.1.tgz", + "integrity": "sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w==", + "dependencies": { + "del": "^6.0.0", + "is-stream": "^2.0.0", + "temp-dir": "^2.0.0", + "type-fest": "^0.16.0", + "unique-string": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/type-fest": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", + "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@semantic-release/release-notes-generator": { @@ -878,6 +1020,30 @@ "semantic-release": ">=18.0.0-beta.1" } }, + "node_modules/@semantic-release/release-notes-generator/node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/release-notes-generator/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "engines": { + "node": ">=8" + } + }, "node_modules/@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -942,18 +1108,6 @@ "node": ">= 6" } }, - "node_modules/@types/cacheable-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", - "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "*", - "@types/node": "*", - "@types/responselike": "*" - } - }, "node_modules/@types/eslint": { "version": "8.4.3", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.3.tgz", @@ -1023,15 +1177,6 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, - "node_modules/@types/keyv": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.3.tgz", - "integrity": "sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.4.tgz", @@ -1050,28 +1195,20 @@ "dev": true }, "node_modules/@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==" }, "node_modules/@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" }, - "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", + "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==", + "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "3.10.1", @@ -1438,15 +1575,29 @@ } }, "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/aggregate-error/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ajv": { @@ -1920,22 +2071,6 @@ } } }, - "node_modules/ava/node_modules/aggregate-error": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", - "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", - "dev": true, - "dependencies": { - "clean-stack": "^4.0.0", - "indent-string": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ava/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", @@ -2002,25 +2137,10 @@ "integrity": "sha512-t5QdPT5jq3o262DOQ8zA6E1tlH2upmUc4Hlvrbx1pGYJuiiHl7O7rvVNI+l8HTVhd/q3Qc9vqimkNk5yiXsAug==", "dev": true }, - "node_modules/ava/node_modules/clean-stack": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", - "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ava/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "node_modules/ava/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "engines": { "node": ">=12" @@ -2104,18 +2224,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ava/node_modules/is-unicode-supported": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", - "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ava/node_modules/load-json-file": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-7.0.1.tgz", @@ -2247,33 +2355,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/ava/node_modules/yargs": { - "version": "17.5.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", - "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/ava/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/ava/node_modules/yocto-queue": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", @@ -2662,6 +2743,17 @@ "node": ">=10.12.0" } }, + "node_modules/c8/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, "node_modules/c8/node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2723,6 +2815,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/c8/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -2744,12 +2854,12 @@ } }, "node_modules/cacheable-lookup": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true, "engines": { - "node": ">=10.6.0" + "node": ">=14.16" } }, "node_modules/cacheable-request": { @@ -3002,11 +3112,28 @@ } }, "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dependencies": { + "escape-string-regexp": "5.0.0" + }, "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clean-stack/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/clean-yaml-object": { @@ -3139,13 +3266,16 @@ } }, "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dependencies": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/clone-response": { @@ -3808,6 +3938,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/del/node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/del/node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "engines": { + "node": ">=6" + } + }, "node_modules/del/node_modules/p-map": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", @@ -4037,6 +4187,7 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, "dependencies": { "once": "^1.4.0" } @@ -4080,59 +4231,15 @@ } }, "node_modules/env-ci": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-5.0.2.tgz", - "integrity": "sha512-Xc41mKvjouTXD3Oy9AqySz1IeyvJvHZ20Twf5ZLYbNpPPIuCnL/qHCmNlD01LoNy0JTunw9HPYVptD19Ac7Mbw==", + "version": "8.0.0-beta.1", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-8.0.0-beta.1.tgz", + "integrity": "sha512-KutSrQjIPfFImnaqjAJSlN8gGQ8KxXUcLOhDxGfiKHNk17wcTH6/YT/hNDTPlaNmxjWtzKaNCZ3dNX6/LCk8fw==", "dependencies": { - "execa": "^4.0.0", - "java-properties": "^1.0.0" - }, - "engines": { - "node": ">=10.13" - } - }, - "node_modules/env-ci/node_modules/execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "dependencies": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" + "execa": "^6.1.0", + "java-properties": "^1.0.2" }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/env-ci/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/env-ci/node_modules/human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "engines": { - "node": ">=8.12.0" + "node": "^16.10 || >=18" } }, "node_modules/env-editor": { @@ -5138,6 +5245,23 @@ "eslint": ">=7.0.0" } }, + "node_modules/eslint-plugin-unicorn/node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-plugin-unicorn/node_modules/safe-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", @@ -5147,6 +5271,15 @@ "regexp-tree": "~0.1.1" } }, + "node_modules/eslint-plugin-unicorn/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/eslint-rule-docs": { "version": "1.1.223", "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.223.tgz", @@ -5500,22 +5633,22 @@ } }, "node_modules/execa": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", - "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" @@ -5774,14 +5907,26 @@ } }, "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", "dependencies": { - "escape-string-regexp": "^1.0.5" + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" }, "engines": { - "node": ">=8" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "engines": { + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5800,12 +5945,15 @@ } }, "node_modules/file-url": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/file-url/-/file-url-3.0.0.tgz", - "integrity": "sha512-g872QGsHexznxkIAdK8UiZRe7SkE6kvylShU4Nsj8NvfvZag7S0QuQ4IgvPDkk75HxgjIVDwycFTDAgIiO4nDA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/file-url/-/file-url-4.0.0.tgz", + "integrity": "sha512-vRCdScQ6j3Ku6Kd7W1kZk9c++5SqD6Xz5Jotrjr/nkY714M14RFHy/AAVA2WQvpsqVAVgTbDrYyBpU205F0cLw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/fill-range": { @@ -5855,14 +6003,14 @@ } }, "node_modules/find-versions": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-5.1.0.tgz", + "integrity": "sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==", "dependencies": { - "semver-regex": "^3.1.2" + "semver-regex": "^4.0.5" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5909,6 +6057,15 @@ "node": ">=8.0.0" } }, + "node_modules/form-data-encoder": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", + "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", + "dev": true, + "engines": { + "node": ">= 14.17" + } + }, "node_modules/fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -5957,6 +6114,26 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -5964,18 +6141,16 @@ "dev": true }, "node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dependencies": { - "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/fs.realpath": { @@ -6061,9 +6236,9 @@ } }, "node_modules/get-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz", - "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "engines": { "node": ">=10" }, @@ -6202,70 +6377,82 @@ } }, "node_modules/got": { - "version": "11.8.5", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.5.tgz", - "integrity": "sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ==", + "version": "12.5.2", + "resolved": "https://registry.npmjs.org/got/-/got-12.5.2.tgz", + "integrity": "sha512-guHGMSEcsA5m1oPRweXUJnug0vuvlkX9wx5hzOka+ZBrBUOJHU0Z1JcNu3QE5IPGnA5aXUsQHdWOD4eJg9/v3A==", "dev": true, "dependencies": { - "@sindresorhus/is": "^4.0.0", - "@szmarczak/http-timer": "^4.0.5", - "@types/cacheable-request": "^6.0.1", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.2", + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.1", "decompress-response": "^6.0.0", - "http2-wrapper": "^1.0.0-beta.5.2", - "lowercase-keys": "^2.0.0", - "p-cancelable": "^2.0.0", - "responselike": "^2.0.0" + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" }, "engines": { - "node": ">=10.19.0" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sindresorhus/got?sponsor=1" } }, "node_modules/got/node_modules/@sindresorhus/is": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz", - "integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", + "integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sindresorhus/is?sponsor=1" } }, "node_modules/got/node_modules/@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dev": true, "dependencies": { - "defer-to-connect": "^2.0.0" + "defer-to-connect": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=14.16" } }, "node_modules/got/node_modules/cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.2.tgz", + "integrity": "sha512-KxjQZM3UIo7/J6W4sLpwFvu1GB3Whv8NtZ8ZrUL284eiQjiXeeqWTdhixNrp/NLZ/JNuFBo6BD4ZaO8ZJ5BN8Q==", "dev": true, "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" + "@types/http-cache-semantics": "^4.0.1", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.0", + "keyv": "^4.5.0", + "mimic-response": "^4.0.0", + "normalize-url": "^7.2.0", + "responselike": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=14.16" + } + }, + "node_modules/got/node_modules/cacheable-request/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/got/node_modules/decompress-response": { @@ -6292,21 +6479,6 @@ "node": ">=10" } }, - "node_modules/got/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/got/node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -6314,21 +6486,24 @@ "dev": true }, "node_modules/got/node_modules/keyv": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.4.tgz", - "integrity": "sha512-vqNHbAc8BBsxk+7QBYLW0Y219rWcClspR6WSeoHYKG5mnsSoOH+BL1pWq02DDCVdvvuUny5rkBlzMRzoqc+GIg==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", + "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", "dev": true, "dependencies": { "json-buffer": "3.0.1" } }, "node_modules/got/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "dev": true, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/got/node_modules/mimic-response": { @@ -6343,22 +6518,40 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/got/node_modules/normalize-url": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-7.2.0.tgz", + "integrity": "sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/got/node_modules/p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12.20" } }, "node_modules/got/node_modules/responselike": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz", - "integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, "dependencies": { - "lowercase-keys": "^2.0.0" + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/graceful-fs": { @@ -6542,22 +6735,33 @@ } }, "node_modules/hook-std": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz", - "integrity": "sha512-zZ6T5WcuBMIUVh49iPQS9t977t7C0l7OtHrpeMb5uk48JdflRX0NSFvCekfYNmGQETnLq9W/isMyHl69kxGi8g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz", + "integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==", "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hosted-git-info": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", - "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dependencies": { - "lru-cache": "^6.0.0" + "lru-cache": "^7.5.1" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.1.tgz", + "integrity": "sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA==", + "engines": { + "node": ">=12" } }, "node_modules/html-escaper": { @@ -6586,13 +6790,13 @@ } }, "node_modules/http2-wrapper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.1.11.tgz", + "integrity": "sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ==", "dev": true, "dependencies": { "quick-lru": "^5.1.1", - "resolve-alpn": "^1.0.0" + "resolve-alpn": "^1.2.0" }, "engines": { "node": ">=10.19.0" @@ -6629,11 +6833,11 @@ } }, "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "engines": { - "node": ">=10.17.0" + "node": ">=12.20.0" } }, "node_modules/ieee754": { @@ -7190,11 +7394,14 @@ } }, "node_modules/is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-string": { @@ -7253,6 +7460,17 @@ "node": ">=0.10.0" } }, + "node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -7678,6 +7896,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, "node_modules/lodash.capitalize": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", @@ -7821,9 +8044,9 @@ } }, "node_modules/marked": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.10.tgz", - "integrity": "sha512-+QvuFj0nGgO970fySghXGmuw+Fd0gD2x3+MqCWLIPf5oxdv1Ka6b2q+z9RP01P/IaKPMEramy+7cNy/Lw8c3hw==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.2.tgz", + "integrity": "sha512-JjBTFTAvuTgANXx82a5vzK9JLSMoV6V3LBVn4Uhdso6t7vXrGx7g1Cd2r6NYSsxrYbQGFCMqBDhFHyK5q2UvcQ==", "bin": { "marked": "bin/marked.js" }, @@ -7832,19 +8055,19 @@ } }, "node_modules/marked-terminal": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-5.0.0.tgz", - "integrity": "sha512-26604GmGmW63ElxcXpE2xfMdbtgD/qiwIqOh/+5+uPe6NVU4bU433+wvPTfq6NZcGr16KWqwu/dzsKxg3IL2Xw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-5.1.1.tgz", + "integrity": "sha512-+cKTOx9P4l7HwINYhzbrBSyzgxO2HaHKGZGuB1orZsMIgXYaJyfidT81VXRdpelW/PcHEWxywscePVgI/oUF6g==", "dependencies": { "ansi-escapes": "^5.0.0", "cardinal": "^2.1.1", "chalk": "^5.0.0", - "cli-table3": "^0.6.0", + "cli-table3": "^0.6.1", "node-emoji": "^1.11.0", "supports-hyperlinks": "^2.2.0" }, "engines": { - "node": " >=14.13.1 || >=16.0.0" + "node": ">=14.13.1 || >=16.0.0" }, "peerDependencies": { "marked": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" @@ -7952,18 +8175,6 @@ "url": "https://github.com/sindresorhus/mem?sponsor=1" } }, - "node_modules/mem/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/memory-fs": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz", @@ -7994,6 +8205,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/meow/node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "engines": { + "node": ">=8" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -8079,11 +8314,14 @@ } }, "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mimic-response": { @@ -8455,6 +8693,17 @@ "node": ">=10" } }, + "node_modules/normalize-package-data/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/normalize-package-data/node_modules/is-core-module": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", @@ -8643,14 +8892,28 @@ } }, "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dependencies": { - "path-key": "^3.0.0" + "path-key": "^4.0.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm/node_modules/@colors/colors": { @@ -10875,14 +11138,14 @@ } }, "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dependencies": { - "mimic-fn": "^2.1.0" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -10956,11 +11219,11 @@ } }, "node_modules/p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", + "integrity": "sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==", "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -11034,23 +11297,30 @@ } }, "node_modules/p-reduce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", - "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-retry": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", - "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-5.1.1.tgz", + "integrity": "sha512-i69WkEU5ZAL8mrmdmVviWwU+DN+IUF8f4sSJThoJ3z5A7Nn5iuO5ROX3Boye0u+uYQLOSfgFl7SuFZCjlAVbQA==", + "dev": true, "dependencies": { - "@types/retry": "0.12.0", + "@types/retry": "0.12.1", "retry": "^0.13.1" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-timeout": { @@ -11542,6 +11812,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -11685,35 +11956,131 @@ } }, "node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-9.1.0.tgz", + "integrity": "sha512-vaMRR1AC1nrd5CQM0PhlRsO5oc2AAigqr7cCrZ/MW/Rsaflz4RlgzkpL4qoU/z1F6wrbd85iFv1OQj/y5RdGvg==", "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" + "find-up": "^6.3.0", + "read-pkg": "^7.1.0", + "type-fest": "^2.5.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-pkg/node_modules/hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" - }, - "node_modules/read-pkg/node_modules/normalize-package-data": { + "node_modules/read-pkg-up/node_modules/locate-path": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.1.1.tgz", + "integrity": "sha512-vJXaRMJgRVD3+cUZs3Mncj2mxpt5mP0EmNOsxRSZRMlbqjvxzDEOIUWXGmavo0ZC9+tNZCBLQ66reA11nbpHZg==", + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/read-pkg-up/node_modules/read-pkg": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", + "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", + "dependencies": { + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^2.0.0" + }, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", @@ -12068,40 +12435,304 @@ "integrity": "sha512-HaFbydST1cDKZHuFZxB8DTrBLJVK/AnDExpK0s3EqLIAAUAHUgnd+VSJCUtTYQKkAkauL8G9CucODrVCc7BuAA==", "peer": true, "dependencies": { - "@semantic-release/commit-analyzer": "^9.0.2", - "@semantic-release/error": "^3.0.0", - "@semantic-release/github": "^8.0.0", - "@semantic-release/npm": "^9.0.0", - "@semantic-release/release-notes-generator": "^10.0.0", - "aggregate-error": "^3.0.0", - "cosmiconfig": "^7.0.0", - "debug": "^4.0.0", - "env-ci": "^5.0.0", - "execa": "^5.0.0", - "figures": "^3.0.0", - "find-versions": "^4.0.0", - "get-stream": "^6.0.0", - "git-log-parser": "^1.2.0", - "hook-std": "^2.0.0", - "hosted-git-info": "^4.0.0", - "lodash": "^4.17.21", - "marked": "^4.0.10", - "marked-terminal": "^5.0.0", - "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "p-reduce": "^2.0.0", - "read-pkg-up": "^7.0.0", - "resolve-from": "^5.0.0", - "semver": "^7.3.2", - "semver-diff": "^3.1.1", - "signale": "^1.2.1", - "yargs": "^16.2.0" - }, - "bin": { - "semantic-release": "bin/semantic-release.js" + "@semantic-release/commit-analyzer": "^9.0.2", + "@semantic-release/error": "^3.0.0", + "@semantic-release/github": "^8.0.0", + "@semantic-release/npm": "^9.0.0", + "@semantic-release/release-notes-generator": "^10.0.0", + "aggregate-error": "^3.0.0", + "cosmiconfig": "^7.0.0", + "debug": "^4.0.0", + "env-ci": "^5.0.0", + "execa": "^5.0.0", + "figures": "^3.0.0", + "find-versions": "^4.0.0", + "get-stream": "^6.0.0", + "git-log-parser": "^1.2.0", + "hook-std": "^2.0.0", + "hosted-git-info": "^4.0.0", + "lodash": "^4.17.21", + "marked": "^4.0.10", + "marked-terminal": "^5.0.0", + "micromatch": "^4.0.2", + "p-each-series": "^2.1.0", + "p-reduce": "^2.0.0", + "read-pkg-up": "^7.0.0", + "resolve-from": "^5.0.0", + "semver": "^7.3.2", + "semver-diff": "^3.1.1", + "signale": "^1.2.1", + "yargs": "^16.2.0" + }, + "bin": { + "semantic-release": "bin/semantic-release.js" + }, + "engines": { + "node": ">=16 || ^14.17" + } + }, + "node_modules/semantic-release/node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "peer": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/semantic-release/node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/semantic-release/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/semantic-release/node_modules/env-ci": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-5.5.0.tgz", + "integrity": "sha512-o0JdWIbOLP+WJKIUt36hz1ImQQFuN92nhsfTkHHap+J8CiI8WgGpH/a9jEGHh4/TU5BUUGjlnKXNoDb57+ne+A==", + "peer": true, + "dependencies": { + "execa": "^5.0.0", + "fromentries": "^1.3.2", + "java-properties": "^1.0.0" + }, + "engines": { + "node": ">=10.17" + } + }, + "node_modules/semantic-release/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/semantic-release/node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "peer": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/find-versions": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", + "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", + "peer": true, + "dependencies": { + "semver-regex": "^3.1.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/hook-std": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz", + "integrity": "sha512-zZ6T5WcuBMIUVh49iPQS9t977t7C0l7OtHrpeMb5uk48JdflRX0NSFvCekfYNmGQETnLq9W/isMyHl69kxGi8g==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/semantic-release/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semantic-release/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "peer": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/semantic-release/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/semantic-release/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "peer": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/semantic-release/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "peer": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/p-each-series": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", + "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/p-reduce": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", + "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/semantic-release/node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "peer": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/semver-regex": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", + "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/semantic-release/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/semantic-release/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "peer": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" }, "engines": { - "node": ">=16 || ^14.17" + "node": ">=10" } }, "node_modules/semver": { @@ -12138,11 +12769,11 @@ } }, "node_modules/semver-regex": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", - "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", + "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==", "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -12935,11 +13566,14 @@ } }, "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/strip-indent": { @@ -13235,16 +13869,43 @@ } }, "node_modules/tempy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-1.0.1.tgz", - "integrity": "sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.0.0.tgz", + "integrity": "sha512-B2I9X7+o2wOaW4r/CWMkpOO9mdiTRCxXNgob6iGvPmfPWgH/KyUD6Uy5crtWBxIBe3YrNZKR2lSzv1JJKWD4vA==", + "dev": true, "dependencies": { - "del": "^6.0.0", - "is-stream": "^2.0.0", + "is-stream": "^3.0.0", "temp-dir": "^2.0.0", - "type-fest": "^0.16.0", - "unique-string": "^2.0.0" + "type-fest": "^2.12.2", + "unique-string": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/tempy/node_modules/crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "dev": true, + "dependencies": { + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/tempy/node_modules/crypto-random-string/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, "engines": { "node": ">=10" }, @@ -13253,11 +13914,27 @@ } }, "node_modules/tempy/node_modules/type-fest": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", - "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, "engines": { - "node": ">=10" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/tempy/node_modules/unique-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", + "dev": true, + "dependencies": { + "crypto-random-string": "^4.0.0" + }, + "engines": { + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -14496,6 +15173,21 @@ "node": ">=0.10.0" } }, + "node_modules/xo/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/xo/node_modules/glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -14698,6 +15390,15 @@ "semver": "bin/semver" } }, + "node_modules/xo/node_modules/p-reduce": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", + "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/xo/node_modules/pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", @@ -14719,6 +15420,23 @@ "node": ">=10.13.0" } }, + "node_modules/xo/node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/xo/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -14832,20 +15550,20 @@ } }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { @@ -14856,6 +15574,14 @@ "node": ">=10" } }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -15496,14 +16222,32 @@ "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-2.2.0.tgz", "integrity": "sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg==" }, - "fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "@types/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + }, + "p-retry": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", + "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", + "requires": { + "@types/retry": "0.12.0", + "retry": "^0.13.1" } } } @@ -15528,15 +16272,88 @@ "tempy": "^1.0.0" }, "dependencies": { - "fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" } + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "requires": { + "path-key": "^3.0.0" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, + "tempy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-1.0.1.tgz", + "integrity": "sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w==", + "requires": { + "del": "^6.0.0", + "is-stream": "^2.0.0", + "temp-dir": "^2.0.0", + "type-fest": "^0.16.0", + "unique-string": "^2.0.0" + } + }, + "type-fest": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", + "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==" } } }, @@ -15555,6 +16372,23 @@ "into-stream": "^6.0.0", "lodash": "^4.17.4", "read-pkg-up": "^7.0.0" + }, + "dependencies": { + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + } } }, "@sindresorhus/is": { @@ -15612,18 +16446,6 @@ "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" }, - "@types/cacheable-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", - "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", - "dev": true, - "requires": { - "@types/http-cache-semantics": "*", - "@types/keyv": "*", - "@types/node": "*", - "@types/responselike": "*" - } - }, "@types/eslint": { "version": "8.4.3", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.3.tgz", @@ -15693,15 +16515,6 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, - "@types/keyv": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.3.tgz", - "integrity": "sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.4.tgz", @@ -15720,29 +16533,21 @@ "dev": true }, "@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==" }, "@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" }, - "@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" - }, + "@types/retry": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", + "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==", + "dev": true + }, "@typescript-eslint/eslint-plugin": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz", @@ -16025,12 +16830,19 @@ } }, "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "dependencies": { + "indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==" + } } }, "ajv": { @@ -16399,16 +17211,6 @@ "yargs": "^17.5.1" }, "dependencies": { - "aggregate-error": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", - "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", - "dev": true, - "requires": { - "clean-stack": "^4.0.0", - "indent-string": "^5.0.0" - } - }, "ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", @@ -16445,15 +17247,6 @@ "integrity": "sha512-t5QdPT5jq3o262DOQ8zA6E1tlH2upmUc4Hlvrbx1pGYJuiiHl7O7rvVNI+l8HTVhd/q3Qc9vqimkNk5yiXsAug==", "dev": true }, - "clean-stack": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", - "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", - "dev": true, - "requires": { - "escape-string-regexp": "5.0.0" - } - }, "escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", @@ -16507,12 +17300,6 @@ "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true }, - "is-unicode-supported": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", - "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", - "dev": true - }, "load-json-file": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-7.0.1.tgz", @@ -16596,27 +17383,6 @@ "signal-exit": "^3.0.7" } }, - "yargs": { - "version": "17.5.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", - "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - } - }, - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true - }, "yocto-queue": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", @@ -16932,6 +17698,17 @@ "yargs-parser": "^20.2.9" }, "dependencies": { + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -16968,6 +17745,21 @@ "requires": { "p-limit": "^3.0.2" } + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } } } }, @@ -16989,9 +17781,9 @@ } }, "cacheable-lookup": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true }, "cacheable-request": { @@ -17186,9 +17978,19 @@ } }, "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "requires": { + "escape-string-regexp": "5.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==" + } + } }, "clean-yaml-object": { "version": "0.1.0", @@ -17277,12 +18079,12 @@ } }, "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "requires": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, @@ -17825,6 +18627,20 @@ "slash": "^3.0.0" }, "dependencies": { + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + }, "p-map": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", @@ -18022,6 +18838,7 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, "requires": { "once": "^1.4.0" } @@ -18056,43 +18873,12 @@ } }, "env-ci": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-5.0.2.tgz", - "integrity": "sha512-Xc41mKvjouTXD3Oy9AqySz1IeyvJvHZ20Twf5ZLYbNpPPIuCnL/qHCmNlD01LoNy0JTunw9HPYVptD19Ac7Mbw==", + "version": "8.0.0-beta.1", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-8.0.0-beta.1.tgz", + "integrity": "sha512-KutSrQjIPfFImnaqjAJSlN8gGQ8KxXUcLOhDxGfiKHNk17wcTH6/YT/hNDTPlaNmxjWtzKaNCZ3dNX6/LCk8fw==", "requires": { - "execa": "^4.0.0", - "java-properties": "^1.0.0" - }, - "dependencies": { - "execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - } - }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "requires": { - "pump": "^3.0.0" - } - }, - "human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" - } + "execa": "^6.1.0", + "java-properties": "^1.0.2" } }, "env-editor": { @@ -18978,6 +19764,17 @@ "semver": "^7.3.2" }, "dependencies": { + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + } + }, "safe-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", @@ -18986,6 +19783,12 @@ "requires": { "regexp-tree": "~0.1.1" } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true } } }, @@ -19134,19 +19937,19 @@ } }, "execa": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", - "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "requires": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" } }, "expand-brackets": { @@ -19373,11 +20176,19 @@ } }, "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", "requires": { - "escape-string-regexp": "^1.0.5" + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==" + } } }, "file-entry-cache": { @@ -19390,9 +20201,9 @@ } }, "file-url": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/file-url/-/file-url-3.0.0.tgz", - "integrity": "sha512-g872QGsHexznxkIAdK8UiZRe7SkE6kvylShU4Nsj8NvfvZag7S0QuQ4IgvPDkk75HxgjIVDwycFTDAgIiO4nDA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/file-url/-/file-url-4.0.0.tgz", + "integrity": "sha512-vRCdScQ6j3Ku6Kd7W1kZk9c++5SqD6Xz5Jotrjr/nkY714M14RFHy/AAVA2WQvpsqVAVgTbDrYyBpU205F0cLw==", "dev": true }, "fill-range": { @@ -19430,11 +20241,11 @@ } }, "find-versions": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-5.1.0.tgz", + "integrity": "sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==", "requires": { - "semver-regex": "^3.1.2" + "semver-regex": "^4.0.5" } }, "flat-cache": { @@ -19469,6 +20280,12 @@ "signal-exit": "^3.0.2" } }, + "form-data-encoder": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", + "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", + "dev": true + }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -19516,6 +20333,12 @@ } } }, + "fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "peer": true + }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -19523,12 +20346,10 @@ "dev": true }, "fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "requires": { - "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" @@ -19592,9 +20413,9 @@ "dev": true }, "get-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz", - "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" }, "get-value": { "version": "2.0.6", @@ -19708,52 +20529,60 @@ } }, "got": { - "version": "11.8.5", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.5.tgz", - "integrity": "sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ==", + "version": "12.5.2", + "resolved": "https://registry.npmjs.org/got/-/got-12.5.2.tgz", + "integrity": "sha512-guHGMSEcsA5m1oPRweXUJnug0vuvlkX9wx5hzOka+ZBrBUOJHU0Z1JcNu3QE5IPGnA5aXUsQHdWOD4eJg9/v3A==", "dev": true, "requires": { - "@sindresorhus/is": "^4.0.0", - "@szmarczak/http-timer": "^4.0.5", - "@types/cacheable-request": "^6.0.1", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.2", + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.1", "decompress-response": "^6.0.0", - "http2-wrapper": "^1.0.0-beta.5.2", - "lowercase-keys": "^2.0.0", - "p-cancelable": "^2.0.0", - "responselike": "^2.0.0" + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" }, "dependencies": { "@sindresorhus/is": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz", - "integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", + "integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==", "dev": true }, "@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dev": true, "requires": { - "defer-to-connect": "^2.0.0" + "defer-to-connect": "^2.0.1" } }, "cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.2.tgz", + "integrity": "sha512-KxjQZM3UIo7/J6W4sLpwFvu1GB3Whv8NtZ8ZrUL284eiQjiXeeqWTdhixNrp/NLZ/JNuFBo6BD4ZaO8ZJ5BN8Q==", "dev": true, "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" + "@types/http-cache-semantics": "^4.0.1", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.0", + "keyv": "^4.5.0", + "mimic-response": "^4.0.0", + "normalize-url": "^7.2.0", + "responselike": "^3.0.0" + }, + "dependencies": { + "mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "dev": true + } } }, "decompress-response": { @@ -19771,15 +20600,6 @@ "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", "dev": true }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, "json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -19787,18 +20607,18 @@ "dev": true }, "keyv": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.4.tgz", - "integrity": "sha512-vqNHbAc8BBsxk+7QBYLW0Y219rWcClspR6WSeoHYKG5mnsSoOH+BL1pWq02DDCVdvvuUny5rkBlzMRzoqc+GIg==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", + "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", "dev": true, "requires": { "json-buffer": "3.0.1" } }, "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "dev": true }, "mimic-response": { @@ -19807,19 +20627,25 @@ "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", "dev": true }, + "normalize-url": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-7.2.0.tgz", + "integrity": "sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==", + "dev": true + }, "p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "dev": true }, "responselike": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz", - "integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, "requires": { - "lowercase-keys": "^2.0.0" + "lowercase-keys": "^3.0.0" } } } @@ -19962,16 +20788,23 @@ } }, "hook-std": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz", - "integrity": "sha512-zZ6T5WcuBMIUVh49iPQS9t977t7C0l7OtHrpeMb5uk48JdflRX0NSFvCekfYNmGQETnLq9W/isMyHl69kxGi8g==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz", + "integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==" }, "hosted-git-info": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", - "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "requires": { - "lru-cache": "^6.0.0" + "lru-cache": "^7.5.1" + }, + "dependencies": { + "lru-cache": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.1.tgz", + "integrity": "sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA==" + } } }, "html-escaper": { @@ -19997,13 +20830,13 @@ } }, "http2-wrapper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.1.11.tgz", + "integrity": "sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ==", "dev": true, "requires": { "quick-lru": "^5.1.1", - "resolve-alpn": "^1.0.0" + "resolve-alpn": "^1.2.0" }, "dependencies": { "quick-lru": { @@ -20030,9 +20863,9 @@ } }, "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==" }, "ieee754": { "version": "1.2.1", @@ -20429,9 +21262,9 @@ } }, "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==" }, "is-string": { "version": "1.0.5", @@ -20471,6 +21304,11 @@ "unc-path-regex": "^0.1.2" } }, + "is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==" + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -20805,6 +21643,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, "lodash.capitalize": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", @@ -20920,19 +21763,19 @@ } }, "marked": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.10.tgz", - "integrity": "sha512-+QvuFj0nGgO970fySghXGmuw+Fd0gD2x3+MqCWLIPf5oxdv1Ka6b2q+z9RP01P/IaKPMEramy+7cNy/Lw8c3hw==" + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.2.tgz", + "integrity": "sha512-JjBTFTAvuTgANXx82a5vzK9JLSMoV6V3LBVn4Uhdso6t7vXrGx7g1Cd2r6NYSsxrYbQGFCMqBDhFHyK5q2UvcQ==" }, "marked-terminal": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-5.0.0.tgz", - "integrity": "sha512-26604GmGmW63ElxcXpE2xfMdbtgD/qiwIqOh/+5+uPe6NVU4bU433+wvPTfq6NZcGr16KWqwu/dzsKxg3IL2Xw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-5.1.1.tgz", + "integrity": "sha512-+cKTOx9P4l7HwINYhzbrBSyzgxO2HaHKGZGuB1orZsMIgXYaJyfidT81VXRdpelW/PcHEWxywscePVgI/oUF6g==", "requires": { "ansi-escapes": "^5.0.0", "cardinal": "^2.1.1", "chalk": "^5.0.0", - "cli-table3": "^0.6.0", + "cli-table3": "^0.6.1", "node-emoji": "^1.11.0", "supports-hyperlinks": "^2.2.0" }, @@ -21002,14 +21845,6 @@ "requires": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^4.0.0" - }, - "dependencies": { - "mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true - } } }, "memory-fs": { @@ -21034,6 +21869,25 @@ "trim-newlines": "^3.0.0", "type-fest": "^0.18.0", "yargs-parser": "^20.2.3" + }, + "dependencies": { + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + } + } + } } }, "merge-stream": { @@ -21102,9 +21956,9 @@ } }, "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==" }, "mimic-response": { "version": "1.0.1", @@ -21428,6 +22282,14 @@ "validate-npm-package-license": "^3.0.1" }, "dependencies": { + "hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "requires": { + "lru-cache": "^6.0.0" + } + }, "is-core-module": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", @@ -22951,11 +23813,18 @@ } }, "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "requires": { - "path-key": "^3.0.0" + "path-key": "^4.0.0" + }, + "dependencies": { + "path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==" + } } }, "obj-props": { @@ -23064,11 +23933,11 @@ } }, "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "requires": { - "mimic-fn": "^2.1.0" + "mimic-fn": "^4.0.0" } }, "open": { @@ -23124,9 +23993,9 @@ "dev": true }, "p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", + "integrity": "sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==" }, "p-event": { "version": "5.0.1", @@ -23172,16 +24041,17 @@ "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==" }, "p-reduce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", - "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==" }, "p-retry": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", - "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-5.1.1.tgz", + "integrity": "sha512-i69WkEU5ZAL8mrmdmVviWwU+DN+IUF8f4sSJThoJ3z5A7Nn5iuO5ROX3Boye0u+uYQLOSfgFl7SuFZCjlAVbQA==", + "dev": true, "requires": { - "@types/retry": "0.12.0", + "@types/retry": "0.12.1", "retry": "^0.13.1" } }, @@ -23553,6 +24423,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -23680,19 +24551,73 @@ } }, "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-9.1.0.tgz", + "integrity": "sha512-vaMRR1AC1nrd5CQM0PhlRsO5oc2AAigqr7cCrZ/MW/Rsaflz4RlgzkpL4qoU/z1F6wrbd85iFv1OQj/y5RdGvg==", "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" + "find-up": "^6.3.0", + "read-pkg": "^7.1.0", + "type-fest": "^2.5.0" }, "dependencies": { + "find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "requires": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + } + }, + "locate-path": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.1.1.tgz", + "integrity": "sha512-vJXaRMJgRVD3+cUZs3Mncj2mxpt5mP0EmNOsxRSZRMlbqjvxzDEOIUWXGmavo0ZC9+tNZCBLQ66reA11nbpHZg==", + "requires": { + "p-locate": "^6.0.0" + } + }, + "p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "requires": { + "yocto-queue": "^1.0.0" + } + }, + "p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "requires": { + "p-limit": "^4.0.0" + } + }, + "path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==" + }, + "read-pkg": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", + "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", + "requires": { + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^2.0.0" + } + }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==" + }, + "yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==" } } }, @@ -23952,6 +24877,188 @@ "semver-diff": "^3.1.1", "signale": "^1.2.1", "yargs": "^16.2.0" + }, + "dependencies": { + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "peer": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "peer": true + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "peer": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "env-ci": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-5.5.0.tgz", + "integrity": "sha512-o0JdWIbOLP+WJKIUt36hz1ImQQFuN92nhsfTkHHap+J8CiI8WgGpH/a9jEGHh4/TU5BUUGjlnKXNoDb57+ne+A==", + "peer": true, + "requires": { + "execa": "^5.0.0", + "fromentries": "^1.3.2", + "java-properties": "^1.0.0" + } + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "peer": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "peer": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "find-versions": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", + "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", + "peer": true, + "requires": { + "semver-regex": "^3.1.2" + } + }, + "hook-std": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz", + "integrity": "sha512-zZ6T5WcuBMIUVh49iPQS9t977t7C0l7OtHrpeMb5uk48JdflRX0NSFvCekfYNmGQETnLq9W/isMyHl69kxGi8g==", + "peer": true + }, + "hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "peer": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "peer": true + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "peer": true + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "peer": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "peer": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "peer": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "p-each-series": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", + "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", + "peer": true + }, + "p-reduce": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", + "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", + "peer": true + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "peer": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + } + }, + "semver-regex": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", + "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", + "peer": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "peer": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "peer": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "peer": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + } } }, "semver": { @@ -23978,9 +25085,9 @@ } }, "semver-regex": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", - "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==" + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", + "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==" }, "serialize-error": { "version": "7.0.1", @@ -24649,9 +25756,9 @@ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" }, "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==" }, "strip-indent": { "version": "3.0.0", @@ -24875,21 +25982,48 @@ "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==" }, "tempy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-1.0.1.tgz", - "integrity": "sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.0.0.tgz", + "integrity": "sha512-B2I9X7+o2wOaW4r/CWMkpOO9mdiTRCxXNgob6iGvPmfPWgH/KyUD6Uy5crtWBxIBe3YrNZKR2lSzv1JJKWD4vA==", + "dev": true, "requires": { - "del": "^6.0.0", - "is-stream": "^2.0.0", + "is-stream": "^3.0.0", "temp-dir": "^2.0.0", - "type-fest": "^0.16.0", - "unique-string": "^2.0.0" + "type-fest": "^2.12.2", + "unique-string": "^3.0.0" }, "dependencies": { + "crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "dev": true, + "requires": { + "type-fest": "^1.0.1" + }, + "dependencies": { + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true + } + } + }, "type-fest": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", - "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==" + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true + }, + "unique-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", + "dev": true, + "requires": { + "crypto-random-string": "^4.0.0" + } } } }, @@ -25878,6 +27012,18 @@ } } }, + "fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -26039,6 +27185,12 @@ } } }, + "p-reduce": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", + "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", + "dev": true + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", @@ -26051,6 +27203,17 @@ "integrity": "sha512-SVJIQ51spzFDvh4fIbCLvciiDMCrRhlN3mbZvv/+ycjvmF5E73bKdGfU8QDLNmjYJf+lsGnDBC4UUnvTe5OO0w==", "dev": true }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -26136,17 +27299,24 @@ "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" }, "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", "requires": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" + }, + "dependencies": { + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" + } } }, "yargs-parser": { diff --git a/package.json b/package.json index ae6da92b6a..a9d4f8371e 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,16 @@ "name": "semantic-release", "description": "Automated semver compliant package publishing", "version": "0.0.0-development", + "type": "module", "author": "Stephan Bönnemann (http://boennemann.me)", "ava": { "files": [ "test/**/*.test.js" ], + "nodeArguments": [ + "--loader=testdouble", + "--no-warnings" + ], "timeout": "2m" }, "bin": { @@ -17,7 +22,8 @@ }, "contributors": [ "Gregor Martynus (https://twitter.com/gr2m)", - "Pierre Vanduynslager (https://twitter.com/@pvdlg_)" + "Pierre Vanduynslager (https://twitter.com/@pvdlg_)", + "Matt Travi (https://matt.travi.org/)" ], "dependencies": { "@semantic-release/commit-analyzer": "^9.0.2", @@ -25,29 +31,29 @@ "@semantic-release/github": "^8.0.0", "@semantic-release/npm": "^9.0.0", "@semantic-release/release-notes-generator": "^10.0.0", - "aggregate-error": "^3.0.0", + "aggregate-error": "^4.0.1", "cosmiconfig": "^7.0.0", "debug": "^4.0.0", - "env-ci": "^5.0.0", - "execa": "^5.0.0", - "figures": "^3.0.0", - "find-versions": "^4.0.0", + "env-ci": "8.0.0-beta.1", + "execa": "^6.1.0", + "figures": "^5.0.0", + "find-versions": "^5.1.0", "get-stream": "^6.0.0", "git-log-parser": "^1.2.0", - "hook-std": "^2.0.0", - "hosted-git-info": "^4.0.0", - "lodash": "^4.17.21", - "marked": "^4.0.10", - "marked-terminal": "^5.0.0", + "hook-std": "^3.0.0", + "hosted-git-info": "^5.1.0", + "lodash-es": "^4.17.21", + "marked": "^4.1.0", + "marked-terminal": "^5.1.1", "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "p-reduce": "^2.0.0", - "read-pkg-up": "^7.0.0", + "p-each-series": "^3.0.0", + "p-reduce": "^3.0.0", + "read-pkg-up": "^9.1.0", "resolve-from": "^5.0.0", "semver": "^7.3.2", "semver-diff": "^3.1.1", "signale": "^1.2.1", - "yargs": "^16.2.0" + "yargs": "^17.5.1" }, "devDependencies": { "ava": "4.3.3", @@ -56,16 +62,16 @@ "codecov": "3.8.3", "delay": "5.0.0", "dockerode": "3.3.4", - "file-url": "3.0.0", - "fs-extra": "9.1.0", - "got": "11.8.5", + "file-url": "^4.0.0", + "fs-extra": "^10.1.0", + "got": "^12.5.0", "js-yaml": "4.1.0", "mockserver-client": "5.14.0", "nock": "13.2.9", - "p-retry": "4.6.2", + "p-retry": "^5.1.1", "sinon": "14.0.0", "stream-buffers": "3.0.2", - "tempy": "1.0.1", + "tempy": "^3.0.0", "testdouble": "3.16.6", "xo": "0.32.1" }, @@ -122,8 +128,8 @@ "lint": "xo", "pretest": "npm run lint", "semantic-release": "./bin/semantic-release.js", - "test": "c8 ava -v", - "test:ci": "c8 ava -v" + "test": "c8 ava --verbose", + "test:ci": "c8 ava --verbose" }, "xo": { "prettier": true, diff --git a/test/branches/branches.test.js b/test/branches/branches.test.js index 266123529a..8ec438a671 100644 --- a/test/branches/branches.test.js +++ b/test/branches/branches.test.js @@ -1,7 +1,7 @@ -const test = require('ava'); -const {union} = require('lodash'); -const semver = require('semver'); -const td = require('testdouble'); +import test from 'ava'; +import {union} from 'lodash-es'; +import semver from 'semver'; +import * as td from 'testdouble'; const getBranch = (branches, branch) => branches.find(({name}) => name === branch); const release = (branches, name, version) => getBranch(branches, name).tags.push({version}); @@ -11,8 +11,21 @@ const merge = (branches, source, target, tag) => { getBranch(branches, target).tags ); }; +const remoteBranches = []; +const repositoryUrl = 'repositoryUrl'; +let expand, getTags, getBranches; -test('Enforce ranges with branching release workflow', async (t) => { +test.beforeEach(async (t) => { + getTags = (await td.replaceEsm('../../lib/branches/get-tags.js')).default; + expand = (await td.replaceEsm('../../lib/branches/expand.js')).default; + getBranches = (await import('../../lib/branches/index.js')).default; +}) + +test.afterEach.always((t) => { + td.reset(); +}); + +test.serial('Enforce ranges with branching release workflow', async (t) => { const branches = [ {name: '1.x', tags: []}, {name: '1.0.x', tags: []}, @@ -22,14 +35,11 @@ test('Enforce ranges with branching release workflow', async (t) => { {name: 'beta', prerelease: true, tags: []}, {name: 'alpha', prerelease: true, tags: []}, ]; - td.replace('../../lib/branches/get-tags', () => branches); - td.replace('../../lib/branches/expand', () => []); - const getBranches = require('../../lib/branches'); + const context = {options: {branches}}; + td.when(expand(repositoryUrl, context, branches)).thenResolve(remoteBranches); + td.when(getTags(context, remoteBranches)).thenResolve(branches); - let result = (await getBranches('repositoryUrl', 'master', {options: {branches}})).map(({name, range}) => ({ - name, - range, - })); + let result = (await getBranches(repositoryUrl, 'master', context)).map(({name, range}) => ({name, range,})); t.is(getBranch(result, '1.0.x').range, '>=1.0.0 <1.0.0', 'Cannot release on 1.0.x before a releasing on master'); t.is(getBranch(result, '1.x').range, '>=1.1.0 <1.0.0', 'Cannot release on 1.x before a releasing on master'); t.is(getBranch(result, 'master').range, '>=1.0.0'); @@ -37,10 +47,7 @@ test('Enforce ranges with branching release workflow', async (t) => { t.is(getBranch(result, 'next-major').range, '>=1.0.0'); release(branches, 'master', '1.0.0'); - result = (await getBranches('repositoryUrl', 'master', {options: {branches}})).map(({name, range}) => ({ - name, - range, - })); + result = (await getBranches('repositoryUrl', 'master', context)).map(({name, range}) => ({name, range})); t.is(getBranch(result, '1.0.x').range, '>=1.0.0 <1.0.0', 'Cannot release on 1.0.x before a releasing on master'); t.is(getBranch(result, '1.x').range, '>=1.1.0 <1.0.0', 'Cannot release on 1.x before a releasing on master'); t.is(getBranch(result, 'master').range, '>=1.0.0'); @@ -191,7 +198,7 @@ test('Enforce ranges with branching release workflow', async (t) => { t.is(getBranch(result, '1.x').range, '>=1.2.0 <2.0.0', 'Can release on 1.x only within range'); }); -test('Throw SemanticReleaseError for invalid configurations', async (t) => { +test.serial('Throw SemanticReleaseError for invalid configurations', async (t) => { const branches = [ {name: '123', range: '123', tags: []}, {name: '1.x', tags: []}, @@ -201,10 +208,12 @@ test('Throw SemanticReleaseError for invalid configurations', async (t) => { {name: 'alpha', prerelease: 'alpha', tags: []}, {name: 'preview', prerelease: 'alpha', tags: []}, ]; - td.replace('../../lib/branches/get-tags', () => branches); - td.replace('../../lib/branches/expand', () => []); - const getBranches = require('../../lib/branches'); - const errors = [...(await t.throwsAsync(getBranches('repositoryUrl', 'master', {options: {branches}})))]; + const context = {options: {branches}}; + td.when(expand(repositoryUrl, context, branches)).thenResolve(remoteBranches); + td.when(getTags(context, remoteBranches)).thenResolve(branches); + + const error = await t.throwsAsync(getBranches(repositoryUrl, 'master', context)); + const errors = [...error.errors]; t.is(errors[0].name, 'SemanticReleaseError'); t.is(errors[0].code, 'EMAINTENANCEBRANCH'); @@ -228,16 +237,16 @@ test('Throw SemanticReleaseError for invalid configurations', async (t) => { t.truthy(errors[4].details); }); -test('Throw a SemanticReleaseError if there is duplicate branches', async (t) => { +test.serial('Throw a SemanticReleaseError if there is duplicate branches', async (t) => { const branches = [ {name: 'master', tags: []}, {name: 'master', tags: []}, ]; - td.replace('../../lib/branches/get-tags', () => branches); - td.replace('../../lib/branches/expand', () => []); - const getBranches = require('../../lib/branches'); + const context = {options: {branches}}; + td.when(expand(repositoryUrl, context, branches)).thenResolve(remoteBranches); + td.when(getTags(context, remoteBranches)).thenResolve(branches); - const errors = [...(await t.throwsAsync(getBranches('repositoryUrl', 'master', {options: {branches}})))]; + const errors = [...(await t.throwsAsync(getBranches(repositoryUrl, 'master', context))).errors]; t.is(errors[0].name, 'SemanticReleaseError'); t.is(errors[0].code, 'EDUPLICATEBRANCHES'); @@ -245,16 +254,17 @@ test('Throw a SemanticReleaseError if there is duplicate branches', async (t) => t.truthy(errors[0].details); }); -test('Throw a SemanticReleaseError for each invalid branch name', async (t) => { +test.serial('Throw a SemanticReleaseError for each invalid branch name', async (t) => { const branches = [ {name: '~master', tags: []}, {name: '^master', tags: []}, ]; - td.replace('../../lib/branches/get-tags', () => branches); - td.replace('../../lib/branches/expand', () => []); - const getBranches = require('../../lib/branches'); + const context = {options: {branches}}; + const remoteBranches = []; + td.when(expand(repositoryUrl, context, branches)).thenResolve(remoteBranches); + td.when(getTags(context, remoteBranches)).thenResolve(branches); - const errors = [...(await t.throwsAsync(getBranches('repositoryUrl', 'master', {options: {branches}})))]; + const errors = [...(await t.throwsAsync(getBranches(repositoryUrl, 'master', context))).errors]; t.is(errors[0].name, 'SemanticReleaseError'); t.is(errors[0].code, 'EINVALIDBRANCHNAME'); diff --git a/test/branches/expand.test.js b/test/branches/expand.test.js index 0318d412c0..75acde35b4 100644 --- a/test/branches/expand.test.js +++ b/test/branches/expand.test.js @@ -1,6 +1,6 @@ -const test = require('ava'); -const expand = require('../../lib/branches/expand'); -const {gitRepo, gitCommits, gitCheckout, gitPush} = require('../helpers/git-utils'); +import test from 'ava'; +import expand from '../../lib/branches/expand.js'; +import {gitCheckout, gitCommits, gitPush, gitRepo} from '../helpers/git-utils.js'; test('Expand branches defined with globs', async (t) => { const {cwd, repositoryUrl} = await gitRepo(true); diff --git a/test/branches/get-tags.test.js b/test/branches/get-tags.test.js index 74e0bcbca3..9ef318d0ea 100644 --- a/test/branches/get-tags.test.js +++ b/test/branches/get-tags.test.js @@ -1,6 +1,6 @@ -const test = require('ava'); -const getTags = require('../../lib/branches/get-tags'); -const {gitRepo, gitCommits, gitTagVersion, gitCheckout, gitAddNote} = require('../helpers/git-utils'); +import test from 'ava'; +import getTags from '../../lib/branches/get-tags.js'; +import {gitAddNote, gitCheckout, gitCommits, gitRepo, gitTagVersion} from '../helpers/git-utils.js'; test('Get the valid tags', async (t) => { const {cwd} = await gitRepo(); diff --git a/test/branches/normalize.test.js b/test/branches/normalize.test.js index 9d8a934c64..43badf2fd1 100644 --- a/test/branches/normalize.test.js +++ b/test/branches/normalize.test.js @@ -1,5 +1,5 @@ -const test = require('ava'); -const normalize = require('../../lib/branches/normalize'); +import test from 'ava'; +import * as normalize from '../../lib/branches/normalize.js'; const toTags = (versions) => versions.map((version) => ({version})); diff --git a/test/cli.test.js b/test/cli.test.js index d60743d64c..a0bf5e4910 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -1,8 +1,8 @@ -const test = require('ava'); -const {escapeRegExp} = require('lodash'); -const td = require('testdouble'); -const {stub} = require('sinon'); -const {SECRET_REPLACEMENT} = require('../lib/definitions/constants'); +import test from 'ava'; +import {escapeRegExp} from 'lodash-es'; +import * as td from 'testdouble'; +import {stub} from 'sinon'; +import {SECRET_REPLACEMENT} from '../lib/definitions/constants.js'; let previousArgv; let previousEnv; @@ -27,10 +27,11 @@ test.afterEach.always((t) => { process.argv = previousArgv; process.env = previousEnv; + + td.reset(); }); test.serial('Pass options to semantic-release API', async (t) => { - const run = stub().resolves(true); const argv = [ '', '', @@ -72,33 +73,49 @@ test.serial('Pass options to semantic-release API', async (t) => { '--debug', '-d', ]; - td.replace('..', run); + const index = await td.replaceEsm('../index.js'); process.argv = argv; - const cli = require('../cli'); + const cli = (await import('../cli.js')).default; const exitCode = await cli(); - t.deepEqual(run.args[0][0].branches, ['master', 'next']); - t.is(run.args[0][0].repositoryUrl, 'https://github/com/owner/repo.git'); - t.is(run.args[0][0].tagFormat, `v\${version}`); - t.deepEqual(run.args[0][0].plugins, ['plugin1', 'plugin2']); - t.deepEqual(run.args[0][0].extends, ['config1', 'config2']); - t.deepEqual(run.args[0][0].verifyConditions, ['condition1', 'condition2']); - t.is(run.args[0][0].analyzeCommits, 'analyze'); - t.deepEqual(run.args[0][0].verifyRelease, ['verify1', 'verify2']); - t.deepEqual(run.args[0][0].generateNotes, ['notes']); - t.deepEqual(run.args[0][0].prepare, ['prepare1', 'prepare2']); - t.deepEqual(run.args[0][0].publish, ['publish1', 'publish2']); - t.deepEqual(run.args[0][0].success, ['success1', 'success2']); - t.deepEqual(run.args[0][0].fail, ['fail1', 'fail2']); - t.is(run.args[0][0].debug, true); - t.is(run.args[0][0].dryRun, true); + td.verify(index.default({ + branches: ['master', 'next'], + b: ['master', 'next'], + 'repository-url': 'https://github/com/owner/repo.git', + repositoryUrl: 'https://github/com/owner/repo.git', + r: 'https://github/com/owner/repo.git', + 'tag-format': `v\${version}`, + tagFormat: `v\${version}`, + t: `v\${version}`, + plugins: ['plugin1', 'plugin2'], + p: ['plugin1', 'plugin2'], + extends: ['config1', 'config2'], + e: ['config1', 'config2'], + 'dry-run': true, + dryRun: true, + d: true, + verifyConditions: ['condition1', 'condition2'], + 'verify-conditions': ['condition1', 'condition2'], + analyzeCommits: 'analyze', + 'analyze-commits': 'analyze', + verifyRelease: ['verify1', 'verify2'], + 'verify-release': ['verify1', 'verify2'], + generateNotes: ['notes'], + 'generate-notes': ['notes'], + prepare: ['prepare1', 'prepare2'], + publish: ['publish1', 'publish2'], + success: ['success1', 'success2'], + fail: ['fail1', 'fail2'], + debug: true, + _: [], + '$0': '' + })); t.is(exitCode, 0); }); test.serial('Pass options to semantic-release API with alias arguments', async (t) => { - const run = stub().resolves(true); const argv = [ '', '', @@ -116,48 +133,65 @@ test.serial('Pass options to semantic-release API with alias arguments', async ( 'config2', '--dry-run', ]; - td.replace('..', run); + const index = await td.replaceEsm('../index.js'); process.argv = argv; - const cli = require('../cli'); + const cli = (await import('../cli.js')).default; const exitCode = await cli(); - t.deepEqual(run.args[0][0].branches, ['master']); - t.is(run.args[0][0].repositoryUrl, 'https://github/com/owner/repo.git'); - t.is(run.args[0][0].tagFormat, `v\${version}`); - t.deepEqual(run.args[0][0].plugins, ['plugin1', 'plugin2']); - t.deepEqual(run.args[0][0].extends, ['config1', 'config2']); - t.is(run.args[0][0].dryRun, true); + td.verify(index.default({ + branches: ['master'], + b: ['master'], + 'repository-url': 'https://github/com/owner/repo.git', + repositoryUrl: 'https://github/com/owner/repo.git', + r: 'https://github/com/owner/repo.git', + 'tag-format': `v\${version}`, + tagFormat: `v\${version}`, + t: `v\${version}`, + plugins: ['plugin1', 'plugin2'], + p: ['plugin1', 'plugin2'], + extends: ['config1', 'config2'], + e: ['config1', 'config2'], + 'dry-run': true, + dryRun: true, + d: true, + _: [], + '$0': '' + })); t.is(exitCode, 0); }); test.serial('Pass unknown options to semantic-release API', async (t) => { - const run = stub().resolves(true); const argv = ['', '', '--bool', '--first-option', 'value1', '--second-option', 'value2', '--second-option', 'value3']; - td.replace('..', run); + const index = await td.replaceEsm('../index.js'); process.argv = argv; - const cli = require('../cli'); + const cli = (await import('../cli.js')).default; const exitCode = await cli(); - t.is(run.args[0][0].bool, true); - t.is(run.args[0][0].firstOption, 'value1'); - t.deepEqual(run.args[0][0].secondOption, ['value2', 'value3']); + td.verify(index.default({ + bool: true, + firstOption: 'value1', + 'first-option': 'value1', + secondOption: ['value2', 'value3'], + 'second-option': ['value2', 'value3'], + _: [], + '$0': '' + })); t.is(exitCode, 0); }); test.serial('Pass empty Array to semantic-release API for list option set to "false"', async (t) => { - const run = stub().resolves(true); const argv = ['', '', '--publish', 'false']; - td.replace('..', run); + const index = await td.replaceEsm('../index.js'); process.argv = argv; - const cli = require('../cli'); + const cli = (await import('../cli.js')).default; const exitCode = await cli(); - t.deepEqual(run.args[0][0].publish, []); + td.verify(index.default({publish: [], _: [], '$0': ''})); t.is(exitCode, 0); }); @@ -165,9 +199,9 @@ test.serial('Pass empty Array to semantic-release API for list option set to "fa test.serial('Do not set properties in option for which arg is not in command line', async (t) => { const run = stub().resolves(true); const argv = ['', '', '-b', 'master']; - td.replace('..', run); + await td.replaceEsm('../index.js', null, run); process.argv = argv; - const cli = require('../cli'); + const cli = (await import('../cli.js')).default; await cli(); @@ -184,9 +218,9 @@ test.serial('Do not set properties in option for which arg is not in command lin test.serial('Display help', async (t) => { const run = stub().resolves(true); const argv = ['', '', '--help']; - td.replace('..', run); + await td.replaceEsm('../index.js', null, run); process.argv = argv; - const cli = require('../cli'); + const cli = (await import('../cli.js')).default; const exitCode = await cli(); @@ -197,9 +231,9 @@ test.serial('Display help', async (t) => { test.serial('Return error exitCode and prints help if called with a command', async (t) => { const run = stub().resolves(true); const argv = ['', '', 'pre']; - td.replace('..', run); + await td.replaceEsm('../index.js', null, run); process.argv = argv; - const cli = require('../cli'); + const cli = (await import('../cli.js')).default; const exitCode = await cli(); @@ -211,9 +245,9 @@ test.serial('Return error exitCode and prints help if called with a command', as test.serial('Return error exitCode if multiple plugin are set for single plugin', async (t) => { const run = stub().resolves(true); const argv = ['', '', '--analyze-commits', 'analyze1', 'analyze2']; - td.replace('..', run); + await td.replaceEsm('../index.js', null, run); process.argv = argv; - const cli = require('../cli'); + const cli = (await import('../cli.js')).default; const exitCode = await cli(); @@ -223,11 +257,11 @@ test.serial('Return error exitCode if multiple plugin are set for single plugin' }); test.serial('Return error exitCode if semantic-release throw error', async (t) => { - const run = stub().rejects(new Error('semantic-release error')); const argv = ['', '']; - td.replace('..', run); + const index = await td.replaceEsm('../index.js'); + td.when(index.default({_: [], '$0': ''})).thenReject(new Error('semantic-release error')); process.argv = argv; - const cli = require('../cli'); + const cli = (await import('../cli.js')).default; const exitCode = await cli(); @@ -237,12 +271,12 @@ test.serial('Return error exitCode if semantic-release throw error', async (t) = test.serial('Hide sensitive environment variable values from the logs', async (t) => { const env = {MY_TOKEN: 'secret token'}; - const run = stub().rejects(new Error(`Throw error: Exposing token ${env.MY_TOKEN}`)); const argv = ['', '']; - td.replace('..', run); + const index = await td.replaceEsm('../index.js'); + td.when(index.default({_: [], '$0': ''})).thenReject(new Error(`Throw error: Exposing token ${env.MY_TOKEN}`)); process.argv = argv; process.env = {...process.env, ...env}; - const cli = require('../cli'); + const cli = (await import('../cli.js')).default; const exitCode = await cli(); diff --git a/test/definitions/branches.test.js b/test/definitions/branches.test.js index db5cbe38c5..6ccce3bc2a 100644 --- a/test/definitions/branches.test.js +++ b/test/definitions/branches.test.js @@ -1,5 +1,5 @@ -const test = require('ava'); -const {maintenance, prerelease, release} = require('../../lib/definitions/branches'); +import test from 'ava'; +import {maintenance, prerelease, release} from '../../lib/definitions/branches.js'; test('A "maintenance" branch is identified by having a "range" property or a "name" formatted like "N.x", "N.x.x" or "N.N.x"', (t) => { /* eslint-disable unicorn/no-fn-reference-in-iterator */ diff --git a/test/definitions/plugins.test.js b/test/definitions/plugins.test.js index 4b72cca6fe..ec50137e40 100644 --- a/test/definitions/plugins.test.js +++ b/test/definitions/plugins.test.js @@ -1,6 +1,6 @@ -const test = require('ava'); -const plugins = require('../../lib/definitions/plugins'); -const {RELEASE_NOTES_SEPARATOR, SECRET_REPLACEMENT} = require('../../lib/definitions/constants'); +import test from 'ava'; +import plugins from '../../lib/definitions/plugins.js'; +import {RELEASE_NOTES_SEPARATOR, SECRET_REPLACEMENT} from '../../lib/definitions/constants.js'; test('The "analyzeCommits" plugin output must be either undefined or a valid semver release type', (t) => { t.false(plugins.analyzeCommits.outputValidator('invalid')); diff --git a/test/fixtures/index.js b/test/fixtures/index.js index cc40a4649c..ead516c976 100644 --- a/test/fixtures/index.js +++ b/test/fixtures/index.js @@ -1 +1 @@ -module.exports = () => {}; +export default () => {} diff --git a/test/fixtures/multi-plugin.js b/test/fixtures/multi-plugin.cjs similarity index 100% rename from test/fixtures/multi-plugin.js rename to test/fixtures/multi-plugin.cjs diff --git a/test/fixtures/plugin-error-inherited.js b/test/fixtures/plugin-error-inherited.js index b5a592ed62..fd6e6110c1 100644 --- a/test/fixtures/plugin-error-inherited.js +++ b/test/fixtures/plugin-error-inherited.js @@ -1,4 +1,4 @@ -const SemanticReleaseError = require('@semantic-release/error'); +import SemanticReleaseError from '@semantic-release/error'; class InheritedError extends SemanticReleaseError { constructor(message, code) { @@ -9,6 +9,6 @@ class InheritedError extends SemanticReleaseError { } } -module.exports = () => { +export default () => { throw new InheritedError('Inherited error', 'EINHERITED'); -}; +} diff --git a/test/fixtures/plugin-error.js b/test/fixtures/plugin-error.js index 2c3dee2487..a9a3f1b4bb 100644 --- a/test/fixtures/plugin-error.js +++ b/test/fixtures/plugin-error.js @@ -1,5 +1,5 @@ -module.exports = () => { +export default () => { const error = new Error('a'); error.errorProperty = 'errorProperty'; throw error; -}; +} diff --git a/test/fixtures/plugin-errors.js b/test/fixtures/plugin-errors.js index e89211daca..0c5f269a4b 100644 --- a/test/fixtures/plugin-errors.js +++ b/test/fixtures/plugin-errors.js @@ -1,5 +1,5 @@ -const AggregateError = require('aggregate-error'); +import AggregateError from 'aggregate-error'; -module.exports = () => { +export default () => { throw new AggregateError([new Error('a'), new Error('b')]); -}; +} diff --git a/test/fixtures/plugin-identity.js b/test/fixtures/plugin-identity.js index 5a8cc03553..8452a404a3 100644 --- a/test/fixtures/plugin-identity.js +++ b/test/fixtures/plugin-identity.js @@ -1 +1 @@ -module.exports = (pluginConfig, context) => context; +export default (pluginConfig, context) => context diff --git a/test/fixtures/plugin-log-env.js b/test/fixtures/plugin-log-env.js index cccd82ca54..d965a0a28f 100644 --- a/test/fixtures/plugin-log-env.js +++ b/test/fixtures/plugin-log-env.js @@ -1,6 +1,6 @@ -module.exports = (pluginConfig, {env, logger}) => { +export default (pluginConfig, {env, logger}) => { console.log(`Console: Exposing token ${env.MY_TOKEN}`); logger.log(`Log: Exposing token ${env.MY_TOKEN}`); logger.error(`Error: Console token ${env.MY_TOKEN}`); throw new Error(`Throw error: Exposing ${env.MY_TOKEN}`); -}; +} diff --git a/test/fixtures/plugin-noop.js b/test/fixtures/plugin-noop.cjs similarity index 100% rename from test/fixtures/plugin-noop.js rename to test/fixtures/plugin-noop.cjs diff --git a/test/fixtures/plugin-result-config.js b/test/fixtures/plugin-result-config.js index 1e85ec782c..9caabd16be 100644 --- a/test/fixtures/plugin-result-config.js +++ b/test/fixtures/plugin-result-config.js @@ -1 +1 @@ -module.exports = (pluginConfig, context) => ({pluginConfig, context}); +export default (pluginConfig, context) => ({pluginConfig, context}) diff --git a/test/get-commits.test.js b/test/get-commits.test.js index c50b296989..6e2e5eb421 100644 --- a/test/get-commits.test.js +++ b/test/get-commits.test.js @@ -1,7 +1,7 @@ -const test = require('ava'); -const {stub} = require('sinon'); -const getCommits = require('../lib/get-commits'); -const {gitRepo, gitCommits, gitDetachedHead} = require('./helpers/git-utils'); +import test from 'ava'; +import {stub} from 'sinon'; +import getCommits from '../lib/get-commits.js'; +import {gitCommits, gitDetachedHead, gitRepo} from './helpers/git-utils.js'; test.beforeEach((t) => { // Stub the logger functions diff --git a/test/get-config.test.js b/test/get-config.test.js index 76eab49e8f..838a4c9c0f 100644 --- a/test/get-config.test.js +++ b/test/get-config.test.js @@ -1,12 +1,15 @@ -const path = require('path'); -const {format} = require('util'); -const test = require('ava'); -const {writeFile, outputJson} = require('fs-extra'); -const {omit} = require('lodash'); -const td = require('testdouble'); -const {stub} = require('sinon'); -const yaml = require('js-yaml'); -const {gitRepo, gitTagVersion, gitCommits, gitShallowClone, gitAddConfig} = require('./helpers/git-utils'); +import path from 'node:path'; +import {format} from 'node:util'; +import test from 'ava'; +import fsExtra from 'fs-extra'; +import {omit} from 'lodash-es'; +import * as td from 'testdouble'; +import yaml from 'js-yaml'; +import {gitAddConfig, gitCommits, gitRepo, gitShallowClone, gitTagVersion} from './helpers/git-utils.js'; + +const {outputJson, writeFile} = fsExtra; +const pluginsConfig = {foo: 'bar', baz: 'qux'}; +let plugins; const DEFAULT_PLUGINS = [ '@semantic-release/commit-analyzer', @@ -15,10 +18,13 @@ const DEFAULT_PLUGINS = [ '@semantic-release/github', ]; -test.beforeEach((t) => { - t.context.plugins = stub().returns({}); - td.replace('../lib/plugins', t.context.plugins); - t.context.getConfig = require('../lib/get-config'); +test.beforeEach(async (t) => { + plugins = (await td.replaceEsm('../lib/plugins/index.js')).default; + t.context.getConfig = (await import('../lib/get-config.js')).default; +}); + +test.afterEach.always((t) => { + td.reset(); }); test('Default values, reading repositoryUrl from package.json', async (t) => { @@ -103,7 +109,7 @@ test('Convert "ci" option to "noCi"', async (t) => { t.is(result.noCi, true); }); -test('Read options from package.json', async (t) => { +test.serial('Read options from package.json', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const options = { @@ -114,19 +120,18 @@ test('Read options from package.json', async (t) => { tagFormat: `v\${version}`, plugins: false, }; + // Verify the plugins module is called with the plugin options from package.json + td.when(plugins({cwd, options}, {})).thenResolve(pluginsConfig); // Create package.json in repository root await outputJson(path.resolve(cwd, 'package.json'), {release: options}); - const {options: result} = await t.context.getConfig({cwd}); + const result = await t.context.getConfig({cwd}); - const expected = {...options, branches: ['test_branch']}; // Verify the options contains the plugin config from package.json - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from package.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); + t.deepEqual(result, {options, plugins: pluginsConfig}); }); -test('Read options from .releaserc.yml', async (t) => { +test.serial('Read options from .releaserc.yml', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const options = { @@ -138,17 +143,16 @@ test('Read options from .releaserc.yml', async (t) => { }; // Create package.json in repository root await writeFile(path.resolve(cwd, '.releaserc.yml'), yaml.dump(options)); + // Verify the plugins module is called with the plugin options from package.json + td.when(plugins({cwd, options}, {})).thenResolve(pluginsConfig); - const {options: result} = await t.context.getConfig({cwd}); + const result = await t.context.getConfig({cwd}); - const expected = {...options, branches: ['test_branch']}; // Verify the options contains the plugin config from package.json - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from package.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); + t.deepEqual(result, {options, plugins: pluginsConfig}); }); -test('Read options from .releaserc.json', async (t) => { +test.serial('Read options from .releaserc.json', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const options = { @@ -160,17 +164,16 @@ test('Read options from .releaserc.json', async (t) => { }; // Create package.json in repository root await outputJson(path.resolve(cwd, '.releaserc.json'), options); + // Verify the plugins module is called with the plugin options from package.json + td.when(plugins({cwd, options}, {})).thenResolve(pluginsConfig); - const {options: result} = await t.context.getConfig({cwd}); + const result = await t.context.getConfig({cwd}); - const expected = {...options, branches: ['test_branch']}; // Verify the options contains the plugin config from package.json - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from package.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); + t.deepEqual(result, {options, plugins: pluginsConfig}); }); -test('Read options from .releaserc.js', async (t) => { +test.serial('Read options from .releaserc.js', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const options = { @@ -182,17 +185,16 @@ test('Read options from .releaserc.js', async (t) => { }; // Create package.json in repository root await writeFile(path.resolve(cwd, '.releaserc.js'), `module.exports = ${JSON.stringify(options)}`); + // Verify the plugins module is called with the plugin options from package.json + td.when(plugins({cwd, options}, {})).thenResolve(pluginsConfig); - const {options: result} = await t.context.getConfig({cwd}); + const result = await t.context.getConfig({cwd}); - const expected = {...options, branches: ['test_branch']}; // Verify the options contains the plugin config from package.json - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from package.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); + t.deepEqual(result, {options, plugins: pluginsConfig}); }); -test('Read options from .releaserc.cjs', async (t) => { +test.serial('Read options from .releaserc.cjs', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const options = { @@ -204,17 +206,16 @@ test('Read options from .releaserc.cjs', async (t) => { }; // Create .releaserc.cjs in repository root await writeFile(path.resolve(cwd, '.releaserc.cjs'), `module.exports = ${JSON.stringify(options)}`); + // Verify the plugins module is called with the plugin options from .releaserc.cjs + td.when(plugins({cwd, options}, {})).thenResolve(pluginsConfig); - const {options: result} = await t.context.getConfig({cwd}); + const result = await t.context.getConfig({cwd}); - const expected = {...options, branches: ['test_branch']}; // Verify the options contains the plugin config from .releaserc.cjs - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from .releaserc.cjs - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); + t.deepEqual(result, {options, plugins: pluginsConfig}); }); -test('Read options from release.config.js', async (t) => { +test.serial('Read options from release.config.js', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const options = { @@ -226,17 +227,16 @@ test('Read options from release.config.js', async (t) => { }; // Create package.json in repository root await writeFile(path.resolve(cwd, 'release.config.js'), `module.exports = ${JSON.stringify(options)}`); + // Verify the plugins module is called with the plugin options from package.json + td.when(plugins({cwd, options}, {})).thenResolve(pluginsConfig); - const {options: result} = await t.context.getConfig({cwd}); + const result = await t.context.getConfig({cwd}); - const expected = {...options, branches: ['test_branch']}; // Verify the options contains the plugin config from package.json - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from package.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); + t.deepEqual(result, {options, plugins: pluginsConfig}); }); -test('Read options from release.config.cjs', async (t) => { +test.serial('Read options from release.config.cjs', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const options = { @@ -246,19 +246,18 @@ test('Read options from release.config.cjs', async (t) => { tagFormat: `v\${version}`, plugins: false, }; + // Verify the plugins module is called with the plugin options from release.config.cjs + td.when(plugins({cwd, options}, {})).thenResolve(pluginsConfig); // Create release.config.cjs in repository root await writeFile(path.resolve(cwd, 'release.config.cjs'), `module.exports = ${JSON.stringify(options)}`); - const {options: result} = await t.context.getConfig({cwd}); + const result = await t.context.getConfig({cwd}); - const expected = {...options, branches: ['test_branch']}; // Verify the options contains the plugin config from release.config.cjs - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from release.config.cjs - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); + t.deepEqual(result, {options, plugins: pluginsConfig}); }); -test('Prioritise CLI/API parameters over file configuration and git repo', async (t) => { +test.serial('Prioritise CLI/API parameters over file configuration and git repo', async (t) => { // Create a git repository, set the current working directory at the root of the repo let {cwd, repositoryUrl} = await gitRepo(); await gitCommits(['First'], {cwd}); @@ -275,20 +274,19 @@ test('Prioritise CLI/API parameters over file configuration and git repo', async tagFormat: `cli\${version}`, plugins: false, }; + // Verify the plugins module is called with the plugin options from CLI/API + td.when(plugins({cwd, options}, {})).thenResolve(pluginsConfig); const pkg = {release: pkgOptions, repository: 'git@host.null:owner/module.git'}; // Create package.json in repository root await outputJson(path.resolve(cwd, 'package.json'), pkg); const result = await t.context.getConfig({cwd}, options); - const expected = {...options, branches: ['branch_cli']}; // Verify the options contains the plugin config from CLI/API - t.deepEqual(result.options, expected); - // Verify the plugins module is called with the plugin options from CLI/API - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); + t.deepEqual(result, {options, plugins: pluginsConfig}); }); -test('Read configuration from file path in "extends"', async (t) => { +test.serial('Read configuration from file path in "extends"', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const pkgOptions = {extends: './shareable.json'}; @@ -303,23 +301,24 @@ test('Read configuration from file path in "extends"', async (t) => { // Create package.json and shareable.json in repository root await outputJson(path.resolve(cwd, 'package.json'), {release: pkgOptions}); await outputJson(path.resolve(cwd, 'shareable.json'), options); + // Verify the plugins module is called with the plugin options from shareable.json + td.when(plugins( + {cwd, options}, + { + analyzeCommits: './shareable.json', + generateNotes: './shareable.json', + 'plugin-1': './shareable.json', + 'plugin-2': './shareable.json', + } + )).thenResolve(pluginsConfig); + + const result = await t.context.getConfig({cwd}); - const {options: result} = await t.context.getConfig({cwd}); - - const expected = {...options, branches: ['test_branch']}; // Verify the options contains the plugin config from shareable.json - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from shareable.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); - t.deepEqual(t.context.plugins.args[0][1], { - analyzeCommits: './shareable.json', - generateNotes: './shareable.json', - 'plugin-1': './shareable.json', - 'plugin-2': './shareable.json', - }); + t.deepEqual(result, {options, plugins: pluginsConfig}); }); -test('Read configuration from module path in "extends"', async (t) => { +test.serial('Read configuration from module path in "extends"', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const pkgOptions = {extends: 'shareable'}; @@ -334,21 +333,19 @@ test('Read configuration from module path in "extends"', async (t) => { // Create package.json and shareable.json in repository root await outputJson(path.resolve(cwd, 'package.json'), {release: pkgOptions}); await outputJson(path.resolve(cwd, 'node_modules/shareable/index.json'), options); + // Verify the plugins module is called with the plugin options from shareable.json + td.when(plugins( + {cwd, options}, + {analyzeCommits: 'shareable', generateNotes: 'shareable'} + )).thenResolve(pluginsConfig); - const {options: result} = await t.context.getConfig({cwd}); + const result = await t.context.getConfig({cwd}); - const expected = {...options, branches: ['test_branch']}; // Verify the options contains the plugin config from shareable.json - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from shareable.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); - t.deepEqual(t.context.plugins.args[0][1], { - analyzeCommits: 'shareable', - generateNotes: 'shareable', - }); + t.deepEqual(result, {options, plugins: pluginsConfig}); }); -test('Read configuration from an array of paths in "extends"', async (t) => { +test.serial('Read configuration from an array of paths in "extends"', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const pkgOptions = {extends: ['./shareable1.json', './shareable2.json']}; @@ -370,24 +367,26 @@ test('Read configuration from an array of paths in "extends"', async (t) => { await outputJson(path.resolve(cwd, 'package.json'), {release: pkgOptions}); await outputJson(path.resolve(cwd, 'shareable1.json'), options1); await outputJson(path.resolve(cwd, 'shareable2.json'), options2); + const expectedOptions = {...options1, ...options2, branches: ['test_branch']}; + // Verify the plugins module is called with the plugin options from shareable1.json and shareable2.json + td.when(plugins( + {options: expectedOptions, cwd}, + { + verifyRelease1: './shareable1.json', + verifyRelease2: './shareable2.json', + generateNotes2: './shareable2.json', + analyzeCommits1: './shareable1.json', + analyzeCommits2: './shareable2.json', + } + )).thenResolve(pluginsConfig); + + const result = await t.context.getConfig({cwd}); - const {options: result} = await t.context.getConfig({cwd}); - - const expected = {...options1, ...options2, branches: ['test_branch']}; // Verify the options contains the plugin config from shareable1.json and shareable2.json - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from shareable1.json and shareable2.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); - t.deepEqual(t.context.plugins.args[0][1], { - verifyRelease1: './shareable1.json', - verifyRelease2: './shareable2.json', - generateNotes2: './shareable2.json', - analyzeCommits1: './shareable1.json', - analyzeCommits2: './shareable2.json', - }); + t.deepEqual(result, {options: expectedOptions, plugins: pluginsConfig}); }); -test('Prioritize configuration from config file over "extends"', async (t) => { +test.serial('Prioritize configuration from config file over "extends"', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const pkgOptions = { @@ -408,22 +407,24 @@ test('Prioritize configuration from config file over "extends"', async (t) => { // Create package.json and shareable.json in repository root await outputJson(path.resolve(cwd, 'package.json'), {release: pkgOptions}); await outputJson(path.resolve(cwd, 'shareable.json'), options1); + const expectedOptions = omit({...options1, ...pkgOptions, branches: ['test_pkg']}, 'extends'); + // Verify the plugins module is called with the plugin options from package.json and shareable.json + td.when(plugins( + {cwd, options: expectedOptions}, + { + analyzeCommits: './shareable.json', + generateNotesShareable: './shareable.json', + publishShareable: './shareable.json', + } + )).thenResolve(pluginsConfig); - const {options: result} = await t.context.getConfig({cwd}); + const result = await t.context.getConfig({cwd}); - const expected = omit({...options1, ...pkgOptions, branches: ['test_pkg']}, 'extends'); // Verify the options contains the plugin config from package.json and shareable.json - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from package.json and shareable.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); - t.deepEqual(t.context.plugins.args[0][1], { - analyzeCommits: './shareable.json', - generateNotesShareable: './shareable.json', - publishShareable: './shareable.json', - }); + t.deepEqual(result, {options: expectedOptions, plugins: pluginsConfig}); }); -test('Prioritize configuration from cli/API options over "extends"', async (t) => { +test.serial('Prioritize configuration from cli/API options over "extends"', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const cliOptions = { @@ -456,17 +457,20 @@ test('Prioritize configuration from cli/API options over "extends"', async (t) = await outputJson(path.resolve(cwd, 'package.json'), {release: pkgOptions}); await outputJson(path.resolve(cwd, 'shareable1.json'), options1); await outputJson(path.resolve(cwd, 'shareable2.json'), options2); + const expectedOptions = omit({...options2, ...pkgOptions, ...cliOptions, branches: ['branch_opts']}, 'extends'); + // Verify the plugins module is called with the plugin options from package.json and shareable2.json + td.when(plugins( + {cwd, options: expectedOptions}, + {analyzeCommits2: './shareable2.json', publishShareable: './shareable2.json'} + )).thenResolve(pluginsConfig); - const {options: result} = await t.context.getConfig({cwd}, cliOptions); + const result = await t.context.getConfig({cwd}, cliOptions); - const expected = omit({...options2, ...pkgOptions, ...cliOptions, branches: ['branch_opts']}, 'extends'); // Verify the options contains the plugin config from package.json and shareable2.json - t.deepEqual(result, expected); - // Verify the plugins module is called with the plugin options from package.json and shareable2.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); + t.deepEqual(result, {options: expectedOptions, plugins: pluginsConfig}); }); -test('Allow to unset properties defined in shareable config with "null"', async (t) => { +test.serial('Allow to unset properties defined in shareable config with "null"', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const pkgOptions = { @@ -485,33 +489,40 @@ test('Allow to unset properties defined in shareable config with "null"', async // Create package.json and shareable.json in repository root await outputJson(path.resolve(cwd, 'package.json'), {release: pkgOptions}); await outputJson(path.resolve(cwd, 'shareable.json'), options1); - - const {options} = await t.context.getConfig({cwd}); - - // Verify the options contains the plugin config from shareable.json and the default `plugins` - t.deepEqual(options, { - ...omit(options1, ['analyzeCommits']), - ...omit(pkgOptions, ['extends', 'analyzeCommits']), - plugins: DEFAULT_PLUGINS, - }); // Verify the plugins module is called with the plugin options from shareable.json and the default `plugins` - t.deepEqual(t.context.plugins.args[0][0], { - options: { - ...omit(options1, 'analyzeCommits'), - ...omit(pkgOptions, ['extends', 'analyzeCommits']), - plugins: DEFAULT_PLUGINS, + td.when(plugins( + { + options: { + ...omit(options1, 'analyzeCommits'), + ...omit(pkgOptions, ['extends', 'analyzeCommits']), + plugins: DEFAULT_PLUGINS, + }, + cwd, }, - cwd, - }); + { + generateNotes: './shareable.json', + analyzeCommits: './shareable.json', + 'test-plugin': './shareable.json', + } + )).thenResolve(pluginsConfig); - t.deepEqual(t.context.plugins.args[0][1], { - generateNotes: './shareable.json', - analyzeCommits: './shareable.json', - 'test-plugin': './shareable.json', - }); + const result = await t.context.getConfig({cwd}); + + // Verify the options contains the plugin config from shareable.json and the default `plugins` + t.deepEqual( + result, + { + options: { + ...omit(options1, ['analyzeCommits']), + ...omit(pkgOptions, ['extends', 'analyzeCommits']), + plugins: DEFAULT_PLUGINS, + }, + plugins: pluginsConfig + } + ); }); -test('Allow to unset properties defined in shareable config with "undefined"', async (t) => { +test.serial('Allow to unset properties defined in shareable config with "undefined"', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); const pkgOptions = { @@ -526,25 +537,24 @@ test('Allow to unset properties defined in shareable config with "undefined"', a tagFormat: `v\${version}`, plugins: false, }; - // Create package.json and release.config.js in repository root + // Create release.config.js and shareable.json in repository root await writeFile(path.resolve(cwd, 'release.config.js'), `module.exports = ${format(pkgOptions)}`); await outputJson(path.resolve(cwd, 'shareable.json'), options1); - - const {options: result} = await t.context.getConfig({cwd}); - - const expected = { + const expectedOptions = { ...omit(options1, 'analyzeCommits'), ...omit(pkgOptions, ['extends', 'analyzeCommits']), branches: ['test_branch'], }; - // Verify the options contains the plugin config from shareable.json - t.deepEqual(result, expected); // Verify the plugins module is called with the plugin options from shareable.json - t.deepEqual(t.context.plugins.args[0][0], {options: expected, cwd}); - t.deepEqual(t.context.plugins.args[0][1], { - generateNotes: './shareable.json', - analyzeCommits: './shareable.json', - }); + td.when(plugins( + {options: expectedOptions, cwd}, + {generateNotes: './shareable.json', analyzeCommits: './shareable.json'} + )).thenResolve(pluginsConfig); + + const result = await t.context.getConfig({cwd}); + + // Verify the options contains the plugin config from shareable.json + t.deepEqual(result, {options: expectedOptions, plugins: pluginsConfig}); }); test('Throw an Error if one of the shareable config cannot be found', async (t) => { diff --git a/test/get-git-auth-url.test.js b/test/get-git-auth-url.test.js index a5711785fb..48c72ea0fe 100644 --- a/test/get-git-auth-url.test.js +++ b/test/get-git-auth-url.test.js @@ -1,6 +1,6 @@ -const test = require('ava'); -const getAuthUrl = require('../lib/get-git-auth-url'); -const {gitRepo} = require('./helpers/git-utils'); +import test from 'ava'; +import getAuthUrl from '../lib/get-git-auth-url.js'; +import {gitRepo} from './helpers/git-utils.js'; const env = {GIT_ASKPASS: 'echo', GIT_TERMINAL_PROMPT: 0}; diff --git a/test/get-last-release.test.js b/test/get-last-release.test.js index 726f4cb455..521c2e8b53 100644 --- a/test/get-last-release.test.js +++ b/test/get-last-release.test.js @@ -1,5 +1,5 @@ -const test = require('ava'); -const getLastRelease = require('../lib/get-last-release'); +import test from 'ava'; +import getLastRelease from '../lib/get-last-release.js'; test('Get the highest non-prerelease valid tag', (t) => { const result = getLastRelease({ diff --git a/test/get-logger.test.js b/test/get-logger.test.js index ee64940a02..efa718f054 100644 --- a/test/get-logger.test.js +++ b/test/get-logger.test.js @@ -1,6 +1,6 @@ -const test = require('ava'); -const {spy} = require('sinon'); -const getLogger = require('../lib/get-logger'); +import test from 'ava'; +import {spy} from 'sinon'; +import getLogger from '../lib/get-logger.js'; test('Expose "error", "success" and "log" functions', (t) => { const stdout = spy(); diff --git a/test/get-next-version.test.js b/test/get-next-version.test.js index 63c906f078..58ddff2916 100644 --- a/test/get-next-version.test.js +++ b/test/get-next-version.test.js @@ -1,6 +1,6 @@ -const test = require('ava'); -const {stub} = require('sinon'); -const getNextVersion = require('../lib/get-next-version'); +import test from 'ava'; +import {stub} from 'sinon'; +import getNextVersion from '../lib/get-next-version.js'; test.beforeEach((t) => { // Stub the logger functions diff --git a/test/get-release-to-add.test.js b/test/get-release-to-add.test.js index 80e2cf596c..964bcc4ee3 100644 --- a/test/get-release-to-add.test.js +++ b/test/get-release-to-add.test.js @@ -1,5 +1,5 @@ -const test = require('ava'); -const getReleaseToAdd = require('../lib/get-release-to-add'); +import test from 'ava'; +import getReleaseToAdd from '../lib/get-release-to-add.js'; test('Return versions merged from release to maintenance branch, excluding lower than branch start range', (t) => { const result = getReleaseToAdd({ diff --git a/test/git.test.js b/test/git.test.js index e56f8b6a68..ca50fe479f 100644 --- a/test/git.test.js +++ b/test/git.test.js @@ -1,40 +1,40 @@ -const test = require('ava'); -const tempy = require('tempy'); -const { - getTagHead, - isRefExists, +import test from 'ava'; +import {temporaryDirectory} from 'tempy'; +import { + addNote, fetch, + fetchNotes, + getBranches, getGitHead, - repoUrl, - tag, - push, + getNote, + getTagHead, getTags, - getBranches, - isGitRepo, - verifyTagName, isBranchUpToDate, - getNote, - addNote, - fetchNotes, -} = require('../lib/git'); -const { - gitRepo, - gitCommits, - gitCheckout, - gitTagVersion, - gitShallowClone, - gitGetCommits, + isGitRepo, + isRefExists, + push, + repoUrl, + tag, + verifyTagName +} from '../lib/git.js'; +import { gitAddConfig, + gitAddNote, + gitCheckout, + gitCommits, gitCommitTag, - gitRemoteTagHead, - gitPush, gitDetachedHead, gitDetachedHeadFromBranch, - gitAddNote, - gitGetNote, gitFetch, - initGit, -} = require('./helpers/git-utils'); + gitGetCommits, + gitGetNote, + gitPush, + gitRemoteTagHead, + gitRepo, + gitShallowClone, + gitTagVersion, + initGit +} from './helpers/git-utils.js'; test('Get the last commit sha', async (t) => { // Create a git repository, set the current working directory at the root of the repo @@ -268,7 +268,7 @@ test('Return "true" if in a Git repository', async (t) => { }); test('Return falsy if not in a Git repository', async (t) => { - const cwd = tempy.directory(); + const cwd = temporaryDirectory(); t.falsy(await isGitRepo({cwd})); }); @@ -288,7 +288,7 @@ test('Return falsy for invalid tag names', async (t) => { }); test('Throws error if obtaining the tags fails', async (t) => { - const cwd = tempy.directory(); + const cwd = temporaryDirectory(); await t.throwsAsync(getTags('master', {cwd})); }); diff --git a/test/helpers/git-utils.js b/test/helpers/git-utils.js index 85e889fba9..de8af1d147 100644 --- a/test/helpers/git-utils.js +++ b/test/helpers/git-utils.js @@ -1,10 +1,10 @@ -const tempy = require('tempy'); -const execa = require('execa'); -const fileUrl = require('file-url'); -const pEachSeries = require('p-each-series'); -const gitLogParser = require('git-log-parser'); -const getStream = require('get-stream'); -const {GIT_NOTE_REF} = require('../../lib/definitions/constants'); +import {temporaryDirectory} from 'tempy'; +import {execa} from 'execa'; +import fileUrl from 'file-url'; +import pEachSeries from 'p-each-series'; +import gitLogParser from 'git-log-parser'; +import getStream from 'get-stream'; +import {GIT_NOTE_REF} from '../../lib/definitions/constants.js'; /** * Commit message information. @@ -23,8 +23,8 @@ const {GIT_NOTE_REF} = require('../../lib/definitions/constants'); * @param {Boolean} withRemote `true` to create a shallow clone of a bare repository. * @return {String} The path of the repository */ -async function initGit(withRemote) { - const cwd = tempy.directory(); +export async function initGit(withRemote) { + const cwd = temporaryDirectory(); const args = withRemote ? ['--bare', '--initial-branch=master'] : ['--initial-branch=master']; await execa('git', ['init', ...args], {cwd}).catch(() => { @@ -45,7 +45,7 @@ async function initGit(withRemote) { * @param {String} [branch='master'] The branch to initialize. * @return {String} The path of the clone if `withRemote` is `true`, the path of the repository otherwise. */ -async function gitRepo(withRemote, branch = 'master') { +export async function gitRepo(withRemote, branch = 'master') { let {cwd, repositoryUrl} = await initGit(withRemote); if (withRemote) { await initBareRepo(repositoryUrl, branch); @@ -70,8 +70,8 @@ async function gitRepo(withRemote, branch = 'master') { * @param {String} repositoryUrl The URL of the bare repository. * @param {String} [branch='master'] the branch to initialize. */ -async function initBareRepo(repositoryUrl, branch = 'master') { - const cwd = tempy.directory(); +export async function initBareRepo(repositoryUrl, branch = 'master') { + const cwd = temporaryDirectory(); await execa('git', ['clone', '--no-hardlinks', repositoryUrl, cwd], {cwd}); await gitCheckout(branch, true, {cwd}); await gitCommits(['Initial commit'], {cwd}); @@ -86,7 +86,7 @@ async function initBareRepo(repositoryUrl, branch = 'master') { * * @returns {Array} The created commits, in reverse order (to match `git log` order). */ -async function gitCommits(messages, execaOptions) { +export async function gitCommits(messages, execaOptions) { await pEachSeries( messages, async (message) => @@ -103,7 +103,7 @@ async function gitCommits(messages, execaOptions) { * * @return {Array} The list of parsed commits. */ -async function gitGetCommits(from, execaOptions) { +export async function gitGetCommits(from, execaOptions) { Object.assign(gitLogParser.fields, {hash: 'H', message: 'B', gitTags: 'd', committerDate: {key: 'ci', type: Date}}); return ( await getStream.array( @@ -126,7 +126,7 @@ async function gitGetCommits(from, execaOptions) { * @param {Boolean} create to create the branch, `false` to checkout an existing branch. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function gitCheckout(branch, create, execaOptions) { +export async function gitCheckout(branch, create, execaOptions) { await execa('git', create ? ['checkout', '-b', branch] : ['checkout', branch], execaOptions); } @@ -136,7 +136,7 @@ async function gitCheckout(branch, create, execaOptions) { * @param {String} repositoryUrl The repository remote URL. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function gitFetch(repositoryUrl, execaOptions) { +export async function gitFetch(repositoryUrl, execaOptions) { await execa('git', ['fetch', repositoryUrl], execaOptions); } @@ -147,7 +147,7 @@ async function gitFetch(repositoryUrl, execaOptions) { * * @return {String} The sha of the head commit in the current git repository. */ -async function gitHead(execaOptions) { +export async function gitHead(execaOptions) { return (await execa('git', ['rev-parse', 'HEAD'], execaOptions)).stdout; } @@ -158,7 +158,7 @@ async function gitHead(execaOptions) { * @param {String} [sha] The commit on which to create the tag. If undefined the tag is created on the last commit. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function gitTagVersion(tagName, sha, execaOptions) { +export async function gitTagVersion(tagName, sha, execaOptions) { await execa('git', sha ? ['tag', '-f', tagName, sha] : ['tag', tagName], execaOptions); } @@ -171,8 +171,8 @@ async function gitTagVersion(tagName, sha, execaOptions) { * @param {Number} [depth=1] The number of commit to clone. * @return {String} The path of the cloned repository. */ -async function gitShallowClone(repositoryUrl, branch = 'master', depth = 1) { - const cwd = tempy.directory(); +export async function gitShallowClone(repositoryUrl, branch = 'master', depth = 1) { + const cwd = temporaryDirectory(); await execa('git', ['clone', '--no-hardlinks', '--no-tags', '-b', branch, '--depth', depth, repositoryUrl, cwd], { cwd, @@ -187,8 +187,8 @@ async function gitShallowClone(repositoryUrl, branch = 'master', depth = 1) { * @param {Number} head A commit sha of the remote repo that will become the detached head of the new one. * @return {String} The path of the new repository. */ -async function gitDetachedHead(repositoryUrl, head) { - const cwd = tempy.directory(); +export async function gitDetachedHead(repositoryUrl, head) { + const cwd = temporaryDirectory(); await execa('git', ['init'], {cwd}); await execa('git', ['remote', 'add', 'origin', repositoryUrl], {cwd}); @@ -197,8 +197,8 @@ async function gitDetachedHead(repositoryUrl, head) { return cwd; } -async function gitDetachedHeadFromBranch(repositoryUrl, branch, head) { - const cwd = tempy.directory(); +export async function gitDetachedHeadFromBranch(repositoryUrl, branch, head) { + const cwd = temporaryDirectory(); await execa('git', ['init'], {cwd}); await execa('git', ['remote', 'add', 'origin', repositoryUrl], {cwd}); @@ -215,7 +215,7 @@ async function gitDetachedHeadFromBranch(repositoryUrl, branch, head) { * @param {String} value Config value. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function gitAddConfig(name, value, execaOptions) { +export async function gitAddConfig(name, value, execaOptions) { await execa('git', ['config', '--add', name, value], execaOptions); } @@ -227,7 +227,7 @@ async function gitAddConfig(name, value, execaOptions) { * * @return {String} The sha of the commit associated with `tagName` on the local repository. */ -async function gitTagHead(tagName, execaOptions) { +export async function gitTagHead(tagName, execaOptions) { return (await execa('git', ['rev-list', '-1', tagName], execaOptions)).stdout; } @@ -240,7 +240,7 @@ async function gitTagHead(tagName, execaOptions) { * * @return {String} The sha of the commit associated with `tagName` on the remote repository. */ -async function gitRemoteTagHead(repositoryUrl, tagName, execaOptions) { +export async function gitRemoteTagHead(repositoryUrl, tagName, execaOptions) { return (await execa('git', ['ls-remote', '--tags', repositoryUrl, tagName], execaOptions)).stdout .split('\n') .filter((tag) => Boolean(tag)) @@ -255,7 +255,7 @@ async function gitRemoteTagHead(repositoryUrl, tagName, execaOptions) { * * @return {String} The tag associatedwith the sha in parameter or `null`. */ -async function gitCommitTag(gitHead, execaOptions) { +export async function gitCommitTag(gitHead, execaOptions) { return (await execa('git', ['describe', '--tags', '--exact-match', gitHead], execaOptions)).stdout; } @@ -268,7 +268,7 @@ async function gitCommitTag(gitHead, execaOptions) { * * @throws {Error} if the push failed. */ -async function gitPush(repositoryUrl, branch, execaOptions) { +export async function gitPush(repositoryUrl, branch, execaOptions) { await execa('git', ['push', '--tags', repositoryUrl, `HEAD:${branch}`], execaOptions); } @@ -278,7 +278,7 @@ async function gitPush(repositoryUrl, branch, execaOptions) { * @param {String} ref The ref to merge. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function merge(ref, execaOptions) { +export async function merge(ref, execaOptions) { await execa('git', ['merge', '--no-ff', ref], execaOptions); } @@ -288,7 +288,7 @@ async function merge(ref, execaOptions) { * @param {String} ref The ref to merge. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function mergeFf(ref, execaOptions) { +export async function mergeFf(ref, execaOptions) { await execa('git', ['merge', '--ff', ref], execaOptions); } @@ -298,7 +298,7 @@ async function mergeFf(ref, execaOptions) { * @param {String} ref The ref to merge. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function rebase(ref, execaOptions) { +export async function rebase(ref, execaOptions) { await execa('git', ['rebase', ref], execaOptions); } @@ -309,7 +309,7 @@ async function rebase(ref, execaOptions) { * @param {String} ref The ref to add the note to. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function gitAddNote(note, ref, execaOptions) { +export async function gitAddNote(note, ref, execaOptions) { await execa('git', ['notes', '--ref', GIT_NOTE_REF, 'add', '-m', note, ref], execaOptions); } @@ -319,31 +319,6 @@ async function gitAddNote(note, ref, execaOptions) { * @param {String} ref The ref to get the note from. * @param {Object} [execaOpts] Options to pass to `execa`. */ -async function gitGetNote(ref, execaOptions) { +export async function gitGetNote(ref, execaOptions) { return (await execa('git', ['notes', '--ref', GIT_NOTE_REF, 'show', ref], execaOptions)).stdout; } - -module.exports = { - initGit, - gitRepo, - initBareRepo, - gitCommits, - gitGetCommits, - gitCheckout, - gitFetch, - gitHead, - gitTagVersion, - gitShallowClone, - gitDetachedHead, - gitDetachedHeadFromBranch, - gitAddConfig, - gitTagHead, - gitRemoteTagHead, - gitCommitTag, - gitPush, - merge, - mergeFf, - rebase, - gitAddNote, - gitGetNote, -}; diff --git a/test/helpers/gitbox.js b/test/helpers/gitbox.js index ed033cade8..3fa310a998 100644 --- a/test/helpers/gitbox.js +++ b/test/helpers/gitbox.js @@ -1,7 +1,7 @@ -const Docker = require('dockerode'); -const getStream = require('get-stream'); -const pRetry = require('p-retry'); -const {initBareRepo, gitShallowClone} = require('./git-utils'); +import Docker from 'dockerode'; +import getStream from 'get-stream'; +import pRetry from 'p-retry'; +import {gitShallowClone, initBareRepo} from './git-utils.js'; const IMAGE = 'semanticrelease/docker-gitbox:latest'; const SERVER_PORT = 80; @@ -12,12 +12,12 @@ const GIT_PASSWORD = 'suchsecure'; const docker = new Docker(); let container; -const gitCredential = `${GIT_USERNAME}:${GIT_PASSWORD}`; +export const gitCredential = `${GIT_USERNAME}:${GIT_PASSWORD}`; /** * Download the `gitbox` Docker image, create a new container and start it. */ -async function start() { +export async function start() { await getStream(await docker.pull(IMAGE)); container = await docker.createContainer({ @@ -38,7 +38,7 @@ async function start() { /** * Stop and remote the `mockserver` Docker container. */ -async function stop() { +export async function stop() { await container.stop(); await container.remove(); } @@ -51,7 +51,7 @@ async function stop() { * @param {String} [description=`Repository ${name}`] The repository description. * @return {Object} The `repositoryUrl` (URL without auth) and `authUrl` (URL with auth). */ -async function createRepo(name, branch = 'master', description = `Repository ${name}`) { +export async function createRepo(name, branch = 'master', description = `Repository ${name}`) { const exec = await container.exec({ Cmd: ['repo-admin', '-n', name, '-d', description], AttachStdout: true, @@ -68,5 +68,3 @@ async function createRepo(name, branch = 'master', description = `Repository ${n return {cwd, repositoryUrl, authUrl}; } - -module.exports = {start, stop, gitCredential, createRepo}; diff --git a/test/helpers/mockserver.js b/test/helpers/mockserver.js index 404dd3a605..243fc40727 100644 --- a/test/helpers/mockserver.js +++ b/test/helpers/mockserver.js @@ -1,8 +1,8 @@ -const Docker = require('dockerode'); -const getStream = require('get-stream'); -const got = require('got'); -const pRetry = require('p-retry'); -const {mockServerClient} = require('mockserver-client'); +import Docker from 'dockerode'; +import getStream from 'get-stream'; +import got from 'got'; +import pRetry from 'p-retry'; +import {mockServerClient} from 'mockserver-client'; const IMAGE = 'mockserver/mockserver:latest'; const MOCK_SERVER_PORT = 1080; @@ -13,7 +13,7 @@ let container; /** * Download the `mockserver` Docker image, create a new container and start it. */ -async function start() { +export async function start() { await getStream(await docker.pull(IMAGE)); container = await docker.createContainer({ @@ -38,7 +38,7 @@ async function start() { /** * Stop and remove the `mockserver` Docker container. */ -async function stop() { +export async function stop() { await container.stop(); await container.remove(); } @@ -50,7 +50,7 @@ const client = mockServerClient(MOCK_SERVER_HOST, MOCK_SERVER_PORT); /** * @type {string} the url of the `mockserver` instance */ -const url = `http://${MOCK_SERVER_HOST}:${MOCK_SERVER_PORT}`; +export const url = `http://${MOCK_SERVER_HOST}:${MOCK_SERVER_PORT}`; /** * Set up the `mockserver` instance response for a specific request. @@ -65,7 +65,7 @@ const url = `http://${MOCK_SERVER_HOST}:${MOCK_SERVER_PORT}`; * @param {Object} response.body The JSON object to respond in the response body. * @return {Object} An object representation the expectation. Pass to the `verify` function to validate the `mockserver` has been called with a `request` matching the expectations. */ -async function mock( +export async function mock( path, {body: requestBody, headers: requestHeaders}, {method = 'POST', statusCode = 200, body: responseBody} @@ -96,8 +96,6 @@ async function mock( * @param {Object} expectation The expectation created with `mock` function. * @return {Promise} A Promise that resolves if the expectation is met or reject otherwise. */ -function verify(expectation) { +export function verify(expectation) { return client.verify(expectation); } - -module.exports = {start, stop, mock, verify, url}; diff --git a/test/helpers/npm-registry.js b/test/helpers/npm-registry.js index 2b05fd9a41..fff502a25c 100644 --- a/test/helpers/npm-registry.js +++ b/test/helpers/npm-registry.js @@ -1,9 +1,10 @@ -const Docker = require('dockerode'); -const getStream = require('get-stream'); -const got = require('got'); -const path = require('path'); -const delay = require('delay'); -const pRetry = require('p-retry'); +import path, {dirname} from 'node:path'; +import {fileURLToPath} from 'node:url'; +import Docker from 'dockerode'; +import getStream from 'get-stream'; +import got from 'got'; +import delay from 'delay'; +import pRetry from 'p-retry'; const IMAGE = 'verdaccio/verdaccio:4'; const REGISTRY_PORT = 4873; @@ -12,12 +13,13 @@ const NPM_USERNAME = 'integration'; const NPM_PASSWORD = 'suchsecure'; const NPM_EMAIL = 'integration@test.com'; const docker = new Docker(); +const __dirname = dirname(fileURLToPath(import.meta.url)); let container; /** * Download the `npm-registry-docker` Docker image, create a new container and start it. */ -async function start() { +export async function start() { await getStream(await docker.pull(IMAGE)); container = await docker.createContainer({ @@ -55,9 +57,9 @@ async function start() { }); } -const url = `http://${REGISTRY_HOST}:${REGISTRY_PORT}/`; +export const url = `http://${REGISTRY_HOST}:${REGISTRY_PORT}/`; -const authEnv = { +export const authEnv = { npm_config_registry: url, // eslint-disable-line camelcase NPM_USERNAME, NPM_PASSWORD, @@ -67,9 +69,7 @@ const authEnv = { /** * Stop and remote the `npm-registry-docker` Docker container. */ -async function stop() { +export async function stop() { await container.stop(); await container.remove(); } - -module.exports = {start, stop, authEnv, url}; diff --git a/test/helpers/npm-utils.js b/test/helpers/npm-utils.js index 942a31ead4..7b7831beb6 100644 --- a/test/helpers/npm-utils.js +++ b/test/helpers/npm-utils.js @@ -1,7 +1,5 @@ -const execa = require('execa'); +import {execa} from 'execa'; -async function npmView(packageName, env) { +export async function npmView(packageName, env) { return JSON.parse((await execa('npm', ['view', packageName, '--json'], {env})).stdout); } - -module.exports = {npmView}; diff --git a/test/hide-sensitive.test.js b/test/hide-sensitive.test.js index 14686839e2..7d5b54a07e 100644 --- a/test/hide-sensitive.test.js +++ b/test/hide-sensitive.test.js @@ -1,7 +1,7 @@ -const test = require('ava'); -const {repeat} = require('lodash'); -const hideSensitive = require('../lib/hide-sensitive'); -const {SECRET_REPLACEMENT, SECRET_MIN_SIZE} = require('../lib/definitions/constants'); +import test from 'ava'; +import {repeat} from 'lodash-es'; +import hideSensitive from '../lib/hide-sensitive.js'; +import {SECRET_MIN_SIZE, SECRET_REPLACEMENT} from '../lib/definitions/constants.js'; test('Replace multiple sensitive environment variable values', (t) => { const env = {SOME_PASSWORD: 'password', SOME_TOKEN: 'secret'}; diff --git a/test/index.test.js b/test/index.test.js index 6d38b4898d..a7b1e5acb0 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,29 +1,28 @@ -const test = require('ava'); -const {escapeRegExp, isString, sortBy, omit} = require('lodash'); -const td = require('testdouble'); -const {spy, stub} = require('sinon'); -const {WritableStreamBuffer} = require('stream-buffers'); -const AggregateError = require('aggregate-error'); -const SemanticReleaseError = require('@semantic-release/error'); -const {COMMIT_NAME, COMMIT_EMAIL, SECRET_REPLACEMENT} = require('../lib/definitions/constants'); -const { - gitHead: getGitHead, +import test from 'ava'; +import {escapeRegExp, isString, omit, sortBy} from 'lodash-es'; +import * as td from 'testdouble'; +import {spy, stub} from 'sinon'; +import {WritableStreamBuffer} from 'stream-buffers'; +import AggregateError from 'aggregate-error'; +import SemanticReleaseError from '@semantic-release/error'; +import {COMMIT_EMAIL, COMMIT_NAME, SECRET_REPLACEMENT} from '../lib/definitions/constants.js'; +import { + gitAddNote, gitCheckout, - gitTagHead, - gitRepo, gitCommits, - gitTagVersion, - gitRemoteTagHead, + gitGetNote, + gitHead as getGitHead, gitPush, + gitRemoteTagHead, + gitRepo, gitShallowClone, + gitTagHead, + gitTagVersion, merge, mergeFf, - rebase, - gitAddNote, - gitGetNote, -} = require('./helpers/git-utils'); - -const pluginNoop = require.resolve('./fixtures/plugin-noop'); + rebase +} from './helpers/git-utils.js'; +import pluginNoop from './fixtures/plugin-noop.cjs'; test.beforeEach((t) => { // Stub the logger functions @@ -143,9 +142,9 @@ test('Plugins are called with expected values', async (t) => { {...nextRelease, notes: `${notes1}\n\n${notes2}\n\n${notes3}`, pluginName: pluginNoop}, ]; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => envCi); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => envCi); + const semanticRelease = (await import('../index.js')).default; const result = await semanticRelease(options, { cwd, env, @@ -418,9 +417,9 @@ test('Use custom tag format', async (t) => { fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.truthy( await semanticRelease(options, { cwd, @@ -476,9 +475,9 @@ test('Use new gitHead, and recreate release notes if a prepare plugin create a c fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.truthy( await semanticRelease(options, { @@ -542,9 +541,9 @@ test('Make a new release when a commit is forward-ported to an upper branch', as success, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.truthy(await semanticRelease(options, {cwd, env: {}, stdout: {write: () => {}}, stderr: {write: () => {}}})); t.is(addChannel.callCount, 0); @@ -576,9 +575,9 @@ test('Publish a pre-release version', async (t) => { fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'beta', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'beta', isPr: false})); + const semanticRelease = (await import('../index.js')).default; let {releases} = await semanticRelease(options, {cwd, env: {}, stdout: {write: () => {}}, stderr: {write: () => {}}}); t.is(releases.length, 1); @@ -628,9 +627,9 @@ test('Publish releases from different branch on the same channel', async (t) => fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'next', isPr: false})); - let semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'next', isPr: false})); + let semanticRelease = (await import('../index.js')).default; let {releases} = await semanticRelease(options, {cwd, env: {}, stdout: {write: () => {}}, stderr: {write: () => {}}}); t.is(releases.length, 1); @@ -653,9 +652,9 @@ test('Publish releases from different branch on the same channel', async (t) => await merge('next', {cwd}); await gitPush('origin', 'master', {cwd}); - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + semanticRelease = (await import('../index.js')).default; t.falsy(await semanticRelease(options, {cwd, env: {}, stdout: {write: () => {}}, stderr: {write: () => {}}})); t.is(addChannel.callCount, 0); @@ -686,9 +685,9 @@ test('Publish pre-releases the same channel as regular releases', async (t) => { fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'beta', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'beta', isPr: false})); + const semanticRelease = (await import('../index.js')).default; let {releases} = await semanticRelease(options, {cwd, env: {}, stdout: {write: () => {}}, stderr: {write: () => {}}}); t.is(releases.length, 1); @@ -751,9 +750,9 @@ test('Do not add pre-releases to a different channel', async (t) => { success, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.truthy(await semanticRelease(options, {cwd, env: {}, stdout: {write: () => {}}, stderr: {write: () => {}}})); t.is(addChannel.callCount, 0); @@ -819,9 +818,9 @@ async function addChannelMacro(t, mergeFunction) { gitHead: commits[2].hash, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; const result = await semanticRelease(options, {cwd, env: {}, stdout: {write: () => {}}, stderr: {write: () => {}}}); t.deepEqual(result.releases, [ @@ -885,9 +884,9 @@ test('Call all "success" plugins even if one errors out', async (t) => { success: [success1, success2], }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; await t.throwsAsync( semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}) @@ -929,9 +928,9 @@ test('Log all "verifyConditions" errors', async (t) => { fail, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; const errors = [ ...(await t.throwsAsync( semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}) @@ -973,9 +972,9 @@ test('Log all "verifyRelease" errors', async (t) => { fail, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; const errors = [ ...(await t.throwsAsync( semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}) @@ -1026,9 +1025,9 @@ test('Dry-run skips addChannel, prepare, publish and success', async (t) => { success, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.truthy( await semanticRelease(options, { cwd, @@ -1078,9 +1077,9 @@ test('Dry-run skips fail', async (t) => { fail, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; const errors = [ ...(await t.throwsAsync( semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}) @@ -1137,9 +1136,9 @@ test('Force a dry-run if not on a CI and "noCi" is not explicitly set', async (t fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: false, branch: 'master'})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: false, branch: 'master'})); + const semanticRelease = (await import('../index.js')).default; t.truthy( await semanticRelease(options, { cwd, @@ -1186,9 +1185,9 @@ test('Dry-run does not print changelog if "generateNotes" return "undefined"', a success: false, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.truthy( await semanticRelease(options, { cwd, @@ -1244,9 +1243,9 @@ test('Allow local releases with "noCi" option', async (t) => { fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: false, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: false, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.truthy( await semanticRelease(options, { cwd, @@ -1313,9 +1312,9 @@ test('Accept "undefined" value returned by "generateNotes" and "false" by "publi fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.truthy( await semanticRelease(options, { cwd, @@ -1341,9 +1340,9 @@ test('Returns false if triggered by a PR', async (t) => { // Create a git repository, set the current working directory at the root of the repo const {cwd, repositoryUrl} = await gitRepo(true); - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', prBranch: 'patch-1', isPr: true})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', prBranch: 'patch-1', isPr: true})); + const semanticRelease = (await import('../index.js')).default; t.false( await semanticRelease( @@ -1393,9 +1392,9 @@ test('Throws "EINVALIDNEXTVERSION" if next release is out of range of the curren success, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: '1.x', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: '1.x', isPr: false})); + const semanticRelease = (await import('../index.js')).default; const error = await t.throwsAsync( semanticRelease(options, {cwd, env: {}, stdout: {write: () => {}}, stderr: {write: () => {}}}) @@ -1444,9 +1443,9 @@ test('Throws "EINVALIDNEXTVERSION" if next release is out of range of the curren success, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; const error = await t.throwsAsync( semanticRelease(options, {cwd, env: {}, stdout: {write: () => {}}, stderr: {write: () => {}}}) @@ -1503,9 +1502,9 @@ test('Throws "EINVALIDMAINTENANCEMERGE" if merge an out of range release in a ma fail, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: '1.1.x', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: '1.1.x', isPr: false})); + const semanticRelease = await import('../index.js'); const errors = [ ...(await t.throwsAsync( semanticRelease(options, {cwd, env: {}, stdout: {write: () => {}}, stderr: {write: () => {}}}) @@ -1539,9 +1538,9 @@ test('Returns false value if triggered on an outdated clone', async (t) => { await gitCommits(['Third'], {cwd}); await gitPush(repositoryUrl, 'master', {cwd}); - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.false( await semanticRelease( @@ -1571,9 +1570,9 @@ test('Returns false if not running from the configured branch', async (t) => { fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'other-branch', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'other-branch', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.false( await semanticRelease(options, { @@ -1615,9 +1614,9 @@ test('Returns false if there is no relevant changes', async (t) => { fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.false( await semanticRelease(options, { @@ -1670,9 +1669,9 @@ test('Exclude commits with [skip release] or [release skip] from analysis', asyn fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; await semanticRelease(options, { cwd, env: {}, @@ -1697,9 +1696,9 @@ test('Log both plugins errors and errors thrown by "fail" plugin', async (t) => verifyConditions: stub().rejects(pluginError), fail: [stub().rejects(failError1), stub().rejects(failError2)], }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; await t.throwsAsync( semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}) @@ -1721,9 +1720,9 @@ test('Call "fail" only if a plugin returns a SemanticReleaseError', async (t) => verifyConditions: stub().rejects(pluginError), fail, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; await t.throwsAsync( semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}) @@ -1737,9 +1736,9 @@ test('Throw SemanticReleaseError if repositoryUrl is not set and cannot be found // Create a git repository, set the current working directory at the root of the repo const {cwd} = await gitRepo(); - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; const errors = [ ...(await t.throwsAsync( semanticRelease({}, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}) @@ -1776,9 +1775,9 @@ test('Throw an Error if plugin returns an unexpected value', async (t) => { fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; const error = await t.throwsAsync( semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}), {instanceOf: SemanticReleaseError} @@ -1805,9 +1804,9 @@ test('Hide sensitive information passed to "fail" plugin', async (t) => { fail, }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; await t.throwsAsync( semanticRelease(options, {cwd, env, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}) ); @@ -1849,9 +1848,9 @@ test('Hide sensitive information passed to "success" plugin', async (t) => { fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; await semanticRelease(options, {cwd, env, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}); const release = success.args[0][1].releases[0]; @@ -1898,9 +1897,9 @@ test('Get all commits including the ones not in the shallow clone', async (t) => fail: stub().resolves(), }; - td.replace('../lib/get-logger', () => t.context.logger); - td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + await td.replaceEsm('../lib/get-logger.js', null, () => t.context.logger); + await td.replaceEsm('env-ci', null, () => ({isCi: true, branch: 'master', isPr: false})); + const semanticRelease = (await import('../index.js')).default; t.truthy( await semanticRelease(options, { cwd, diff --git a/test/integration.test.js b/test/integration.test.js index c3cb7ff390..d7f06f83df 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -1,28 +1,31 @@ -const path = require('path'); -const test = require('ava'); -const td = require('testdouble'); -const {escapeRegExp} = require('lodash'); -const {writeJson, readJson} = require('fs-extra'); -const execa = require('execa'); -const {WritableStreamBuffer} = require('stream-buffers'); -const delay = require('delay'); -const getAuthUrl = require('../lib/get-git-auth-url'); -const {SECRET_REPLACEMENT} = require('../lib/definitions/constants'); -const { - gitHead, - gitTagHead, - gitRepo, - gitCommits, - gitRemoteTagHead, - gitPush, +import path from 'path'; +import test from 'ava'; +import * as td from 'testdouble'; +import {escapeRegExp} from 'lodash-es'; +import fsExtra from 'fs-extra'; +import {execa} from 'execa'; +import {WritableStreamBuffer} from 'stream-buffers'; +import delay from 'delay'; + +import getAuthUrl from '../lib/get-git-auth-url.js'; +import {SECRET_REPLACEMENT} from '../lib/definitions/constants.js'; +import { gitCheckout, - merge, + gitCommits, gitGetNote, -} = require('./helpers/git-utils'); -const {npmView} = require('./helpers/npm-utils'); -const gitbox = require('./helpers/gitbox'); -const mockServer = require('./helpers/mockserver'); -const npmRegistry = require('./helpers/npm-registry'); + gitHead, + gitPush, + gitRemoteTagHead, + gitRepo, + gitTagHead, + merge +} from './helpers/git-utils.js'; +import {npmView} from './helpers/npm-utils.js'; +import * as gitbox from './helpers/gitbox.js'; +import * as mockServer from './helpers/mockserver.js'; +import * as npmRegistry from './helpers/npm-registry.js'; + +const {readJson, writeJson} = fsExtra; /* eslint camelcase: ["error", {properties: "never"}] */ @@ -47,10 +50,10 @@ const npmTestEnv = { LEGACY_TOKEN: Buffer.from(`${env.NPM_USERNAME}:${env.NPM_PASSWORD}`, 'utf8').toString('base64'), }; -const cli = require.resolve('../bin/semantic-release'); -const pluginError = require.resolve('./fixtures/plugin-error'); -const pluginInheritedError = require.resolve('./fixtures/plugin-error-inherited'); -const pluginLogEnv = require.resolve('./fixtures/plugin-log-env'); +const cli = path.resolve('./bin/semantic-release.js'); +const pluginError = path.resolve('./test/fixtures/plugin-error'); +const pluginInheritedError = path.resolve('./test/fixtures/plugin-error-inherited'); +const pluginLogEnv = path.resolve('./test/fixtures/plugin-log-env'); test.before(async () => { await Promise.all([gitbox.start(), npmRegistry.start(), mockServer.start()]); @@ -509,7 +512,7 @@ test('Pass options via CLI arguments', async (t) => { test('Run via JS API', async (t) => { td.replace('../lib/logger', {log: () => {}, error: () => {}, stdout: () => {}}); td.replace('env-ci', () => ({isCi: true, branch: 'master', isPr: false})); - const semanticRelease = require('..'); + const semanticRelease = (await import('../index.js')).default; const packageName = 'test-js-api'; const owner = 'git'; // Create a git repository, set the current working directory at the root of the repo @@ -656,6 +659,8 @@ test('Hide sensitive environment variable values from the logs', async (t) => { extendEnv: false, }); + console.log({stderr}) + t.regex(stdout, new RegExp(`Console: Exposing token ${escapeRegExp(SECRET_REPLACEMENT)}`)); t.regex(stdout, new RegExp(`Log: Exposing token ${escapeRegExp(SECRET_REPLACEMENT)}`)); t.regex(stderr, new RegExp(`Error: Console token ${escapeRegExp(SECRET_REPLACEMENT)}`)); diff --git a/test/plugins/normalize.test.js b/test/plugins/normalize.test.js index 65a7350b20..3dc03f9aef 100644 --- a/test/plugins/normalize.test.js +++ b/test/plugins/normalize.test.js @@ -1,7 +1,7 @@ -const test = require('ava'); -const {noop} = require('lodash'); -const {stub} = require('sinon'); -const normalize = require('../../lib/plugins/normalize'); +import test from 'ava'; +import {noop} from 'lodash-es'; +import {stub} from 'sinon'; +import normalize from '../../lib/plugins/normalize.js'; const cwd = process.cwd(); @@ -23,37 +23,37 @@ test('Normalize and load plugin from string', async (t) => { const plugin = await normalize( {cwd, options: {}, logger: t.context.logger}, 'verifyConditions', - './test/fixtures/plugin-noop', + './test/fixtures/plugin-noop.cjs', {} ); - t.is(plugin.pluginName, './test/fixtures/plugin-noop'); + t.is(plugin.pluginName, './test/fixtures/plugin-noop.cjs'); t.is(typeof plugin, 'function'); - t.deepEqual(t.context.success.args[0], ['Loaded plugin "verifyConditions" from "./test/fixtures/plugin-noop"']); + t.deepEqual(t.context.success.args[0], ['Loaded plugin "verifyConditions" from "./test/fixtures/plugin-noop.cjs"']); }); test('Normalize and load plugin from object', async (t) => { const plugin = await normalize( {cwd, options: {}, logger: t.context.logger}, 'publish', - {path: './test/fixtures/plugin-noop'}, + {path: './test/fixtures/plugin-noop.cjs'}, {} ); - t.is(plugin.pluginName, './test/fixtures/plugin-noop'); + t.is(plugin.pluginName, './test/fixtures/plugin-noop.cjs'); t.is(typeof plugin, 'function'); - t.deepEqual(t.context.success.args[0], ['Loaded plugin "publish" from "./test/fixtures/plugin-noop"']); + t.deepEqual(t.context.success.args[0], ['Loaded plugin "publish" from "./test/fixtures/plugin-noop.cjs"']); }); test('Normalize and load plugin from a base file path', async (t) => { - const plugin = await normalize({cwd, options: {}, logger: t.context.logger}, 'verifyConditions', './plugin-noop', { - './plugin-noop': './test/fixtures', + const plugin = await normalize({cwd, options: {}, logger: t.context.logger}, 'verifyConditions', './plugin-noop.cjs', { + './plugin-noop.cjs': './test/fixtures', }); - t.is(plugin.pluginName, './plugin-noop'); + t.is(plugin.pluginName, './plugin-noop.cjs'); t.is(typeof plugin, 'function'); t.deepEqual(t.context.success.args[0], [ - 'Loaded plugin "verifyConditions" from "./plugin-noop" in shareable config "./test/fixtures"', + 'Loaded plugin "verifyConditions" from "./plugin-noop.cjs" in shareable config "./test/fixtures"', ]); }); @@ -72,7 +72,7 @@ test('Wrap plugin in a function that add the "pluginName" to multiple errors"', './plugin-errors': './test/fixtures', }); - const errors = [...(await t.throwsAsync(plugin({options: {}})))]; + const errors = [...(await t.throwsAsync(plugin({options: {}}))).errors]; for (const error of errors) { t.is(error.pluginName, './plugin-errors'); } @@ -90,12 +90,12 @@ test('Normalize and load plugin that retuns multiple functions', async (t) => { const plugin = await normalize( {cwd, options: {}, logger: t.context.logger}, 'verifyConditions', - './test/fixtures/multi-plugin', + './test/fixtures/multi-plugin.cjs', {} ); t.is(typeof plugin, 'function'); - t.deepEqual(t.context.success.args[0], ['Loaded plugin "verifyConditions" from "./test/fixtures/multi-plugin"']); + t.deepEqual(t.context.success.args[0], ['Loaded plugin "verifyConditions" from "./test/fixtures/multi-plugin.cjs"']); }); test('Wrap "analyzeCommits" plugin in a function that validate the output of the plugin', async (t) => { @@ -258,7 +258,7 @@ test('Always pass a defined "pluginConfig" for plugin defined with path', async test('Throws an error if the plugin return an object without the expected plugin function', async (t) => { const error = await t.throwsAsync(() => - normalize({cwd, options: {}, logger: t.context.logger}, 'inexistantPlugin', './test/fixtures/multi-plugin', {}) + normalize({cwd, options: {}, logger: t.context.logger}, 'nonExistentPlugin', './test/fixtures/multi-plugin.cjs', {}) ); t.is(error.code, 'EPLUGIN'); @@ -269,7 +269,7 @@ test('Throws an error if the plugin return an object without the expected plugin test('Throws an error if the plugin is not found', async (t) => { await t.throwsAsync( - () => normalize({cwd, options: {}, logger: t.context.logger}, 'inexistantPlugin', 'non-existing-path', {}), + () => normalize({cwd, options: {}, logger: t.context.logger}, 'nonExistentPlugin', 'non-existing-path', {}), { message: /Cannot find module 'non-existing-path'/, code: 'MODULE_NOT_FOUND', diff --git a/test/plugins/pipeline.test.js b/test/plugins/pipeline.test.js index 5af2a6c26d..70766f0740 100644 --- a/test/plugins/pipeline.test.js +++ b/test/plugins/pipeline.test.js @@ -1,7 +1,7 @@ -const test = require('ava'); -const {stub} = require('sinon'); -const AggregateError = require('aggregate-error'); -const pipeline = require('../../lib/plugins/pipeline'); +import test from 'ava'; +import {stub} from 'sinon'; +import AggregateError from 'aggregate-error'; +import pipeline from '../../lib/plugins/pipeline.js'; test('Execute each function in series passing the same input', async (t) => { const step1 = stub().resolves(1); @@ -116,9 +116,9 @@ test('Throw all errors from the first step throwing an AggregateError', async (t const step2 = stub().rejects(new AggregateError([error1, error2])); const step3 = stub().resolves(3); - const errors = await t.throwsAsync(pipeline([step1, step2, step3])(0)); + const error = await t.throwsAsync(pipeline([step1, step2, step3])(0)); - t.deepEqual([...errors], [error1, error2]); + t.deepEqual([...error.errors], [error1, error2]); t.true(step1.calledWith(0)); t.true(step2.calledWith(0)); t.true(step3.notCalled); @@ -131,9 +131,9 @@ test('Execute all even if a Promise rejects', async (t) => { const step2 = stub().rejects(error1); const step3 = stub().rejects(error2); - const errors = await t.throwsAsync(pipeline([step1, step2, step3], {settleAll: true})(0)); + const error = await t.throwsAsync(pipeline([step1, step2, step3], {settleAll: true})(0)); - t.deepEqual([...errors], [error1, error2]); + t.deepEqual([...error.errors], [error1, error2]); t.true(step1.calledWith(0)); t.true(step2.calledWith(0)); t.true(step3.calledWith(0)); @@ -147,9 +147,9 @@ test('Throw all errors from all steps throwing an AggregateError', async (t) => const step1 = stub().rejects(new AggregateError([error1, error2])); const step2 = stub().rejects(new AggregateError([error3, error4])); - const errors = await t.throwsAsync(pipeline([step1, step2], {settleAll: true})(0)); + const error = await t.throwsAsync(pipeline([step1, step2], {settleAll: true})(0)); - t.deepEqual([...errors], [error1, error2, error3, error4]); + t.deepEqual([...error.errors], [error1, error2, error3, error4]); t.true(step1.calledWith(0)); t.true(step2.calledWith(0)); }); @@ -163,9 +163,9 @@ test('Execute each function in series passing a transformed input even if a step const step4 = stub().resolves(4); const getNextInput = (previousResult, result) => previousResult + result; - const errors = await t.throwsAsync(pipeline([step1, step2, step3, step4], {settleAll: true, getNextInput})(0)); + const error = await t.throwsAsync(pipeline([step1, step2, step3, step4], {settleAll: true, getNextInput})(0)); - t.deepEqual([...errors], [error2, error3]); + t.deepEqual([...error.errors], [error2, error3]); t.true(step1.calledWith(0)); t.true(step2.calledWith(0 + 1)); t.true(step3.calledWith(0 + 1 + error2)); diff --git a/test/plugins/plugins.test.js b/test/plugins/plugins.test.js index 435459a267..6b10883034 100644 --- a/test/plugins/plugins.test.js +++ b/test/plugins/plugins.test.js @@ -1,11 +1,11 @@ -const path = require('path'); -const test = require('ava'); -const {copy, outputFile} = require('fs-extra'); -const {stub} = require('sinon'); -const tempy = require('tempy'); -const getPlugins = require('../../lib/plugins'); - -// Save the current working diretory +import path from 'path'; +import test from 'ava'; +import {copy, outputFile} from 'fs-extra'; +import {stub} from 'sinon'; +import {temporaryDirectory} from 'tempy'; +import getPlugins from '../../lib/plugins/index.js'; + +// Save the current working directory const cwd = process.cwd(); test.beforeEach((t) => { @@ -35,9 +35,9 @@ test('Export plugins based on steps config', async (t) => { cwd, logger: t.context.logger, options: { - verifyConditions: ['./test/fixtures/plugin-noop', {path: './test/fixtures/plugin-noop'}], - generateNotes: './test/fixtures/plugin-noop', - analyzeCommits: {path: './test/fixtures/plugin-noop'}, + verifyConditions: ['./test/fixtures/plugin-noop.cjs', {path: './test/fixtures/plugin-noop.cjs'}], + generateNotes: './test/fixtures/plugin-noop.cjs', + analyzeCommits: {path: './test/fixtures/plugin-noop.cjs'}, verifyRelease: () => {}, }, }, @@ -137,9 +137,9 @@ test('Unknown steps of plugins configured in "plugins" are ignored', async (t) = }); test('Export plugins loaded from the dependency of a shareable config module', async (t) => { - const cwd = tempy.directory(); + const cwd = temporaryDirectory(); await copy( - './test/fixtures/plugin-noop.js', + './test/fixtures/plugin-noop.cjs', path.resolve(cwd, 'node_modules/shareable-config/node_modules/custom-plugin/index.js') ); await outputFile(path.resolve(cwd, 'node_modules/shareable-config/index.js'), ''); @@ -170,8 +170,8 @@ test('Export plugins loaded from the dependency of a shareable config module', a }); test('Export plugins loaded from the dependency of a shareable config file', async (t) => { - const cwd = tempy.directory(); - await copy('./test/fixtures/plugin-noop.js', path.resolve(cwd, 'plugin/plugin-noop.js')); + const cwd = temporaryDirectory(); + await copy('./test/fixtures/plugin-noop.cjs', path.resolve(cwd, 'plugin/plugin-noop.cjs')); await outputFile(path.resolve(cwd, 'shareable-config.js'), ''); const plugins = await getPlugins( @@ -179,9 +179,9 @@ test('Export plugins loaded from the dependency of a shareable config file', asy cwd, logger: t.context.logger, options: { - verifyConditions: ['./plugin/plugin-noop', {path: './plugin/plugin-noop'}], - generateNotes: './plugin/plugin-noop', - analyzeCommits: {path: './plugin/plugin-noop'}, + verifyConditions: ['./plugin/plugin-noop.cjs', {path: './plugin/plugin-noop.cjs'}], + generateNotes: './plugin/plugin-noop.cjs', + analyzeCommits: {path: './plugin/plugin-noop.cjs'}, verifyRelease: () => {}, }, }, @@ -269,7 +269,7 @@ test('Throw an error for each invalid plugin configuration', async (t) => { }, {} ) - )), + )).errors, ]; t.is(errors[0].name, 'SemanticReleaseError'); @@ -289,11 +289,11 @@ test('Throw EPLUGINSCONF error if the "plugins" option contains an old plugin de { cwd, logger: t.context.logger, - options: {plugins: ['./test/fixtures/multi-plugin', './test/fixtures/plugin-noop', () => {}]}, + options: {plugins: ['./test/fixtures/multi-plugin.cjs', './test/fixtures/plugin-noop.cjs', () => {}]}, }, {} ) - )), + )).errors, ]; t.is(errors[0].name, 'SemanticReleaseError'); @@ -306,7 +306,7 @@ test('Throw EPLUGINSCONF error for each invalid definition if the "plugins" opti const errors = [ ...(await t.throwsAsync(() => getPlugins({cwd, logger: t.context.logger, options: {plugins: [1, {path: 1}, [() => {}, {}, {}]]}}, {}) - )), + )).errors, ]; t.is(errors[0].name, 'SemanticReleaseError'); diff --git a/test/plugins/utils.test.js b/test/plugins/utils.test.js index e9f14dc765..2e9bfd95b1 100644 --- a/test/plugins/utils.test.js +++ b/test/plugins/utils.test.js @@ -1,5 +1,5 @@ -const test = require('ava'); -const {validatePlugin, validateStep, loadPlugin, parseConfig} = require('../../lib/plugins/utils'); +import test from 'ava'; +import {loadPlugin, parseConfig, validatePlugin, validateStep} from '../../lib/plugins/utils.js'; test('validatePlugin', (t) => { const path = 'plugin-module'; @@ -193,10 +193,10 @@ test('loadPlugin', async (t) => { const cwd = process.cwd(); const func = () => {}; - t.is(require('../fixtures/plugin-noop'), await loadPlugin({cwd: './test/fixtures'}, './plugin-noop', {}), 'From cwd'); + t.is((await import('../fixtures/plugin-noop.cjs')).default, await loadPlugin({cwd: './test/fixtures'}, './plugin-noop.cjs', {}), 'From cwd'); t.is( - require('../fixtures/plugin-noop'), - await loadPlugin({cwd}, './plugin-noop', {'./plugin-noop': './test/fixtures'}), + (await import('../fixtures/plugin-noop.cjs')).default, + await loadPlugin({cwd}, './plugin-noop.cjs', {'./plugin-noop.cjs': './test/fixtures'}), 'From a shareable config context' ); t.is(func, await loadPlugin({cwd}, func, {}), 'Defined as a function'); diff --git a/test/utils.test.js b/test/utils.test.js index 7ff6d2429c..037727e752 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -1,21 +1,21 @@ -const test = require('ava'); -const AggregateError = require('aggregate-error'); -const { +import test from 'ava'; +import AggregateError from 'aggregate-error'; +import { extractErrors, - tagsToVersions, - isMajorRange, - isMaintenanceRange, - getUpperBound, - getLowerBound, - highest, - lowest, - getLatestVersion, getEarliestVersion, getFirstVersion, + getLatestVersion, + getLowerBound, getRange, - makeTag, + getUpperBound, + highest, + isMaintenanceRange, + isMajorRange, isSameChannel, -} = require('../lib/utils'); + lowest, + makeTag, + tagsToVersions +} from '../lib/utils.js'; test('extractErrors', (t) => { const errors = [new Error('Error 1'), new Error('Error 2')]; diff --git a/test/verify.test.js b/test/verify.test.js index c200025676..0157fb7f31 100644 --- a/test/verify.test.js +++ b/test/verify.test.js @@ -1,13 +1,13 @@ -const test = require('ava'); -const tempy = require('tempy'); -const verify = require('../lib/verify'); -const {gitRepo} = require('./helpers/git-utils'); +import test from 'ava'; +import {temporaryDirectory} from 'tempy'; +import verify from '../lib/verify.js'; +import {gitRepo} from './helpers/git-utils.js'; test('Throw a AggregateError', async (t) => { const {cwd} = await gitRepo(); const options = {branches: [{name: 'master'}, {name: ''}]}; - const errors = [...(await t.throwsAsync(verify({cwd, options})))]; + const errors = [...(await t.throwsAsync(verify({cwd, options}))).errors]; t.is(errors[0].name, 'SemanticReleaseError'); t.is(errors[0].code, 'ENOREPOURL'); @@ -28,10 +28,10 @@ test('Throw a AggregateError', async (t) => { }); test('Throw a SemanticReleaseError if does not run on a git repository', async (t) => { - const cwd = tempy.directory(); + const cwd = temporaryDirectory(); const options = {branches: []}; - const errors = [...(await t.throwsAsync(verify({cwd, options})))]; + const errors = [...(await t.throwsAsync(verify({cwd, options}))).errors]; t.is(errors[0].name, 'SemanticReleaseError'); t.is(errors[0].code, 'ENOGITREPO'); @@ -43,7 +43,7 @@ test('Throw a SemanticReleaseError if the "tagFormat" is not valid', async (t) = const {cwd, repositoryUrl} = await gitRepo(true); const options = {repositoryUrl, tagFormat: `?\${version}`, branches: []}; - const errors = [...(await t.throwsAsync(verify({cwd, options})))]; + const errors = [...(await t.throwsAsync(verify({cwd, options}))).errors]; t.is(errors[0].name, 'SemanticReleaseError'); t.is(errors[0].code, 'EINVALIDTAGFORMAT'); @@ -55,7 +55,7 @@ test('Throw a SemanticReleaseError if the "tagFormat" does not contains the "ver const {cwd, repositoryUrl} = await gitRepo(true); const options = {repositoryUrl, tagFormat: 'test', branches: []}; - const errors = [...(await t.throwsAsync(verify({cwd, options})))]; + const errors = [...(await t.throwsAsync(verify({cwd, options}))).errors]; t.is(errors[0].name, 'SemanticReleaseError'); t.is(errors[0].code, 'ETAGNOVERSION'); @@ -67,7 +67,7 @@ test('Throw a SemanticReleaseError if the "tagFormat" contains multiple "version const {cwd, repositoryUrl} = await gitRepo(true); const options = {repositoryUrl, tagFormat: `\${version}v\${version}`, branches: []}; - const errors = [...(await t.throwsAsync(verify({cwd, options})))]; + const errors = [...(await t.throwsAsync(verify({cwd, options}))).errors]; t.is(errors[0].name, 'SemanticReleaseError'); t.is(errors[0].code, 'ETAGNOVERSION'); @@ -83,7 +83,7 @@ test('Throw a SemanticReleaseError for each invalid branch', async (t) => { branches: [{name: ''}, {name: ' '}, {name: 1}, {}, {name: ''}, 1, 'master'], }; - const errors = [...(await t.throwsAsync(verify({cwd, options})))]; + const errors = [...(await t.throwsAsync(verify({cwd, options}))).errors]; t.is(errors[0].name, 'SemanticReleaseError'); t.is(errors[0].code, 'EINVALIDBRANCH');