diff --git a/.eslintrc.js b/.eslintrc.js index 0aa2c07e2..d0e2276af 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -31,6 +31,7 @@ module.exports = { tsx: 'never' } ], + 'import/prefer-default-export': 'off', 'import/no-namespace': 'off', 'import/no-named-export': 'off', 'no-redeclare': 'off', diff --git a/package.json b/package.json index 3edcbd7da..e908d7ae9 100644 --- a/package.json +++ b/package.json @@ -26,13 +26,12 @@ "@ava/babel": "^1.0.1", "@typescript-eslint/eslint-plugin": "^4.9.0", "@typescript-eslint/parser": "^4.9.0", - "ava": "^3.13.0", + "ava": "^3.15.0", "chalk": "^4.1.0", "codecov-lite": "^1.0.3", "del-cli": "^3.0.1", "eslint-config-rollup": "^1.0.0", "esm": "^3.2.25", - "execa": "^4.0.3", "globby": "^11.0.1", "husky": "^4.2.5", "lint-staged": "^10.5.2", @@ -42,7 +41,6 @@ "prettier-plugin-package": "^1.3.0", "ts-node": "^8.10.2", "tsconfig-paths": "^3.9.0", - "tslib": "^2.0.0", "typescript": "^3.9.7", "yaml": "^1.10.0" }, diff --git a/packages/typescript/src/index.ts b/packages/typescript/src/index.ts index c39e9f6da..31df35b37 100644 --- a/packages/typescript/src/index.ts +++ b/packages/typescript/src/index.ts @@ -1,13 +1,13 @@ import * as path from 'path'; -import { Plugin, SourceDescription } from 'rollup'; +import { Plugin, RollupOptions, SourceDescription } from 'rollup'; import type { Watch } from 'typescript'; import { RollupTypescriptOptions } from '../types'; import createFormattingHost from './diagnostics/host'; import createModuleResolver from './moduleResolution'; -import getPluginOptions from './options/plugin'; +import { getPluginOptions } from './options/plugin'; import { emitParsedOptionsErrors, parseTypescriptConfig } from './options/tsconfig'; import { validatePaths, validateSourceMap } from './options/validate'; import findTypescriptOutput, { getEmittedFile } from './outputFile'; @@ -44,10 +44,10 @@ export default function typescript(options: RollupTypescriptOptions = {}): Plugi return { name: 'typescript', - buildStart() { + buildStart(rollupOptions: RollupOptions) { emitParsedOptionsErrors(ts, this, parsedOptions); - preflight(parsedOptions, this); + preflight({ config: parsedOptions, context: this, rollupOptions, tslib }); // Fixes a memory leak https://github.com/rollup/plugins/issues/322 if (!program) { diff --git a/packages/typescript/src/options/plugin.ts b/packages/typescript/src/options/plugin.ts index b1215d115..8719e62ba 100644 --- a/packages/typescript/src/options/plugin.ts +++ b/packages/typescript/src/options/plugin.ts @@ -2,7 +2,7 @@ import { createFilter } from '@rollup/pluginutils'; import * as defaultTs from 'typescript'; import { RollupTypescriptOptions, PartialCompilerOptions } from '../../types'; -import getTsLibPath from '../tslib'; +import { getTsLibPath } from '../tslib'; /** * Separate the Rollup plugin options from the Typescript compiler options, @@ -14,7 +14,7 @@ import getTsLibPath from '../tslib'; * - `typescript`: Instance of Typescript library (possibly custom). * - `tslib`: ESM code from the tslib helper library (possibly custom). */ -export default function getPluginOptions(options: RollupTypescriptOptions) { +export const getPluginOptions = (options: RollupTypescriptOptions) => { const { cacheDir, exclude, @@ -37,4 +37,4 @@ export default function getPluginOptions(options: RollupTypescriptOptions) { tslib: tslib || getTsLibPath(), transformers }; -} +}; diff --git a/packages/typescript/src/preflight.ts b/packages/typescript/src/preflight.ts index 07db1fe97..3b7e70e2d 100644 --- a/packages/typescript/src/preflight.ts +++ b/packages/typescript/src/preflight.ts @@ -1,19 +1,34 @@ -import { PluginContext } from 'rollup'; +import { PluginContext, RollupOptions } from 'rollup'; import { ModuleKind } from 'typescript'; import { TypeScriptConfig } from './options/tsconfig'; +// import { resolveIdAsync } from './tslib'; -const moduleError = ` -Rollup requires that TypeScript produces ES Modules. Unfortunately your configuration specifies a +interface PreflightOptions { + config: TypeScriptConfig; + context: PluginContext; + rollupOptions: RollupOptions; + tslib: any; +} + +const pluginName = '@rollup/plugin-typescript'; +const moduleErrorMessage = ` +${pluginName}: Rollup requires that TypeScript produces ES Modules. Unfortunately your configuration specifies a "module" other than "esnext". Unless you know what you're doing, please change "module" to "esnext" in the target tsconfig.json file or plugin options.`.replace(/\n/g, ''); +const tsLibErrorMessage = `${pluginName}: Could not find module 'tslib', which is required by this plugin. Is it installed?`; + let undef; const validModules = [ModuleKind.ES2015, ModuleKind.ES2020, ModuleKind.ESNext, undef]; // eslint-disable-next-line import/prefer-default-export -export const preflight = (config: TypeScriptConfig, context: PluginContext) => { +export const preflight = ({ config, context, rollupOptions, tslib }: PreflightOptions) => { if (!validModules.includes(config.options.module)) { - context.warn(`@rollup/plugin-typescript: ${moduleError}`); + context.warn(moduleErrorMessage); + } + + if (!rollupOptions.preserveModules && tslib === null) { + context.error(tsLibErrorMessage); } }; diff --git a/packages/typescript/src/tslib.ts b/packages/typescript/src/tslib.ts index 13752aa64..6f44db35e 100644 --- a/packages/typescript/src/tslib.ts +++ b/packages/typescript/src/tslib.ts @@ -1,13 +1,27 @@ -import resolveId, { AsyncOpts } from 'resolve'; +import resolve, { SyncOpts } from 'resolve'; -const resolveIdAsync = (file: string, opts: AsyncOpts) => - new Promise((fulfil, reject) => - resolveId(file, opts, (err, contents) => (err || typeof contents === 'undefined' ? reject(err) : fulfil(contents))) - ); +// const resolveIdAsync = (file: string, opts: AsyncOpts) => +// new Promise((fulfil, reject) => +// resolveId(file, opts, (err, contents) => +// err || typeof contents === 'undefined' ? reject(err) : fulfil(contents) +// ) +// ); + +const resolveId = (file: string, opts: SyncOpts) => resolve.sync(file, opts); /** * Returns code asynchronously for the tslib helper library. */ -export default function getTsLibPath() { - return resolveIdAsync('tslib/tslib.es6.js', { basedir: __dirname }); -} +export const getTsLibPath = () => { + // Note: This isn't preferable, but we've no other way to test this bit. Removing the tslib devDep + // during the test run doesn't work due to the nature of the pnpm flat node_modules, and + // other workspace dependencies that depenend upon tslib. + try { + // eslint-disable-next-line no-underscore-dangle + return resolveId(process.env.__TSLIB_TEST_PATH__ || 'tslib/tslib.es6.js', { + basedir: __dirname + }); + } catch (_) { + return null; + } +}; diff --git a/packages/typescript/test/snapshots/tslib.ts.md b/packages/typescript/test/snapshots/tslib.ts.md new file mode 100644 index 000000000..1eba17d65 --- /dev/null +++ b/packages/typescript/test/snapshots/tslib.ts.md @@ -0,0 +1,32 @@ +# Snapshot report for `test/tslib.ts` + +The actual snapshot is saved in `tslib.ts.snap`. + +Generated by [AVA](https://avajs.dev). + +## fails on bad tslib path + +> Snapshot 1 + + Error { + code: 'ENOENT', + errno: -2, + path: 'fixtures/joker/tslib.js', + syscall: 'open', + watchFiles: [ + 'packages/typescript/test/fixtures/overriding-tslib/main.ts', + 'fixtures/joker/tslib.js', + ], + message: 'Could not load fixtures/joker/tslib.js (imported by fixtures/overriding-tslib/main.ts): ENOENT: no such file or directory, open \'fixtures/joker/tslib.js\'', + } + +## fails without tslib installed + +> Snapshot 1 + + Error { + code: 'PLUGIN_ERROR', + hook: 'buildStart', + plugin: 'typescript', + message: '@rollup/plugin-typescript: Could not find module \'tslib\', which is required by this plugin. Is it installed?', + } diff --git a/packages/typescript/test/snapshots/tslib.ts.snap b/packages/typescript/test/snapshots/tslib.ts.snap new file mode 100644 index 000000000..5ed88f245 Binary files /dev/null and b/packages/typescript/test/snapshots/tslib.ts.snap differ diff --git a/packages/typescript/test/test.js b/packages/typescript/test/test.js index 07d975769..55bfb158e 100644 --- a/packages/typescript/test/test.js +++ b/packages/typescript/test/test.js @@ -6,7 +6,7 @@ const test = require('ava'); const { rollup, watch } = require('rollup'); const ts = require('typescript'); -const { getCode, testBundle } = require('../../../util/test'); +const { evaluateBundle, getCode, onwarn } = require('../../../util/test'); const typescript = require('..'); @@ -14,16 +14,6 @@ test.beforeEach(() => process.chdir(__dirname)); const outputOptions = { format: 'esm' }; -async function evaluateBundle(bundle) { - const { module } = await testBundle(null, bundle); - return module.exports; -} - -function onwarn(warning) { - // eslint-disable-next-line no-console - console.warn(warning.toString()); -} - test.serial('runs code through typescript', async (t) => { const bundle = await rollup({ input: 'fixtures/basic/main.ts', @@ -263,7 +253,7 @@ test.serial('ignore type errors if noEmitOnError is false', async (t) => { t.true(code.includes(`console.log('hello world')`)); - t.is(warnings.length, 1); + t.is(warnings.length, 2); t.is(warnings[0].code, 'PLUGIN_WARNING'); t.is(warnings[0].plugin, 'typescript'); @@ -333,38 +323,6 @@ test.serial('supports overriding the TypeScript version', async (t) => { t.is(result, 1337); }); -test.serial('supports overriding tslib with a custom path', async (t) => { - const bundle = await rollup({ - input: 'fixtures/overriding-tslib/main.ts', - plugins: [ - typescript({ - tsconfig: 'fixtures/overriding-tslib/tsconfig.json', - tslib: 'fixtures/overriding-tslib/tslib.js' - }) - ], - onwarn - }); - const code = await evaluateBundle(bundle); - - t.is(code.myParent.baseMethod(), 'base method'); -}); - -test.serial('supports overriding tslib with a custom path in a promise', async (t) => { - const bundle = await rollup({ - input: 'fixtures/overriding-tslib/main.ts', - plugins: [ - typescript({ - tsconfig: 'fixtures/overriding-tslib/tsconfig.json', - tslib: Promise.resolve('fixtures/overriding-tslib/tslib.js') - }) - ], - onwarn - }); - const code = await evaluateBundle(bundle); - - t.is(code.myParent.baseMethod(), 'base method'); -}); - test.serial('should not resolve .d.ts files', async (t) => { const bundle = await rollup({ input: 'fixtures/dts/main.ts', @@ -521,19 +479,6 @@ test.serial('should throw on bad options', async (t) => { ]); }); -test.serial('creates _tslib.js file when preserveModules is used', async (t) => { - const bundle = await rollup({ - input: 'fixtures/preserve-modules/main.ts', - plugins: [typescript({ tsconfig: 'fixtures/preserve-modules/tsconfig.json' })], - preserveModules: true, - onwarn - }); - - const files = await getCode(bundle, { format: 'es' }, true); - t.true(files[0].fileName.includes('main.js'), files[0].fileName); - t.true(files[1].fileName.includes('tslib.es6.js'), files[1].fileName); -}); - test.serial('should handle re-exporting types', async (t) => { const bundle = await rollup({ input: 'fixtures/reexport-type/main.ts', diff --git a/packages/typescript/test/tsconfig.json b/packages/typescript/test/tsconfig.json new file mode 100644 index 000000000..379a994d8 --- /dev/null +++ b/packages/typescript/test/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../tsconfig.json", + "include": ["."] +} diff --git a/packages/typescript/test/tslib.ts b/packages/typescript/test/tslib.ts new file mode 100644 index 000000000..1c4c5b7c0 --- /dev/null +++ b/packages/typescript/test/tslib.ts @@ -0,0 +1,103 @@ +import { platform } from 'os'; + +import test from 'ava'; +import { rollup, RollupError } from 'rollup'; + +import typescript from '..'; + +import { evaluateBundle, getCode, onwarn } from '../../../util/test'; + +test.beforeEach(() => process.chdir(__dirname)); + +test.serial('supports overriding tslib with a custom path', async (t) => { + const bundle = await rollup({ + input: 'fixtures/overriding-tslib/main.ts', + plugins: [ + typescript({ + tsconfig: 'fixtures/overriding-tslib/tsconfig.json', + tslib: 'fixtures/overriding-tslib/tslib.js' + }) + ], + onwarn + }); + const code = await evaluateBundle(bundle); + + t.is((code as any).myParent.baseMethod(), 'base method'); +}); + +test.serial('supports overriding tslib with a custom path in a promise', async (t) => { + const options = { + tsconfig: 'fixtures/overriding-tslib/tsconfig.json', + tslib: Promise.resolve('fixtures/overriding-tslib/tslib.js') + }; + const bundle = await rollup({ + input: 'fixtures/overriding-tslib/main.ts', + plugins: [typescript(options)], + onwarn + }); + const code = await evaluateBundle(bundle); + + t.is((code as any).myParent.baseMethod(), 'base method'); +}); + +test.serial('fails on bad tslib path', async (t) => { + const fail = () => + rollup({ + input: 'fixtures/overriding-tslib/main.ts', + plugins: [ + typescript({ + tsconfig: 'fixtures/overriding-tslib/tsconfig.json', + tslib: 'fixtures/joker/tslib.js' + }) + ], + onwarn + }); + + const error = (await t.throwsAsync(fail)) as RollupError; + + // Note: I'm done fucking around with Windows paths + if (platform() === 'win32') { + t.pass(); + return; + } + + if (error.watchFiles) { + let [filePath] = error.watchFiles; + filePath = filePath.substring(filePath.indexOf('packages')); + error.watchFiles[0] = filePath; + } + + t.snapshot(error); +}); + +test.serial('fails without tslib installed', async (t) => { + const fail = () => + rollup({ + input: 'fixtures/overriding-tslib/main.ts', + plugins: [typescript({ tsconfig: 'fixtures/overriding-tslib/tsconfig.json' })], + onwarn + }); + + // eslint-disable-next-line no-underscore-dangle + process.env.__TSLIB_TEST_PATH__ = 'badtslib/tslib.es6.js'; + + const error = await t.throwsAsync(fail); + + // eslint-disable-next-line no-underscore-dangle, no-undefined + process.env.__TSLIB_TEST_PATH__ = ''; + + t.snapshot(error); +}); + +test.serial('creates _tslib.js file when preserveModules is used', async (t) => { + const bundle = await rollup({ + input: 'fixtures/preserve-modules/main.ts', + plugins: [typescript({ tsconfig: 'fixtures/preserve-modules/tsconfig.json' })], + preserveModules: true, + onwarn + }); + + const files = await getCode(bundle, { format: 'es' }, true); + t.true(files[0].fileName.includes('main.js'), files[0].fileName); + t.true(files[1].fileName.includes('tslib.es6.js'), files[1].fileName); +}); diff --git a/packages/typescript/types/index.d.ts b/packages/typescript/types/index.d.ts index c43991017..d1d3909cc 100644 --- a/packages/typescript/types/index.d.ts +++ b/packages/typescript/types/index.d.ts @@ -1,6 +1,38 @@ import { FilterPattern } from '@rollup/pluginutils'; import { Plugin } from 'rollup'; -import { CompilerOptions, CustomTransformers, Program, TypeChecker } from 'typescript'; +import { + CompilerOptions, + CompilerOptionsValue, + CustomTransformers, + Program, + TsConfigSourceFile, + TypeChecker +} from 'typescript'; + +type ElementType | undefined> = T extends (infer U)[] ? U : never; + +export type TransformerStage = keyof CustomTransformers; +type StagedTransformerFactory = ElementType; +type TransformerFactory = + | StagedTransformerFactory + | ProgramTransformerFactory + | TypeCheckerTransformerFactory; + +export type CustomTransformerFactories = { + [stage in TransformerStage]?: Array>; +}; + +interface ProgramTransformerFactory { + type: 'program'; + + factory(program: Program): StagedTransformerFactory; +} + +interface TypeCheckerTransformerFactory { + type: 'typeChecker'; + + factory(typeChecker: TypeChecker): StagedTransformerFactory; +} export interface RollupTypescriptPluginOptions { /** @@ -38,40 +70,21 @@ export interface RollupTypescriptPluginOptions { transformers?: CustomTransformerFactories; } -type ElementType | undefined> = T extends (infer U)[] ? U : never; - -export type TransformerStage = keyof CustomTransformers; -type StagedTransformerFactory = ElementType; -type TransformerFactory = - | StagedTransformerFactory - | ProgramTransformerFactory - | TypeCheckerTransformerFactory; - -export type CustomTransformerFactories = { - [stage in TransformerStage]?: Array>; -}; - -interface ProgramTransformerFactory { - type: 'program'; - - factory(program: Program): StagedTransformerFactory; -} - -interface TypeCheckerTransformerFactory { - type: 'typeChecker'; - - factory(typeChecker: TypeChecker): StagedTransformerFactory; +export interface FlexibleCompilerOptions extends CompilerOptions { + [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined | any; } /** Properties of `CompilerOptions` that are normally enums */ export type EnumCompilerOptions = 'module' | 'moduleResolution' | 'newLine' | 'jsx' | 'target'; /** JSON representation of Typescript compiler options */ -export type JsonCompilerOptions = Omit & +export type JsonCompilerOptions = Omit & Record; /** Compiler options set by the plugin user. */ -export type PartialCompilerOptions = Partial | Partial; +export type PartialCompilerOptions = + | Partial + | Partial; export type RollupTypescriptOptions = RollupTypescriptPluginOptions & PartialCompilerOptions; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4adcf52b5..3c6ebe244 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,13 +8,12 @@ importers: '@ava/babel': 1.0.1 '@typescript-eslint/eslint-plugin': 4.9.0_303e5374dd1870bb900303fa6b093324 '@typescript-eslint/parser': 4.9.0_typescript@3.9.7 - ava: 3.13.0 + ava: 3.15.0 chalk: 4.1.0 codecov-lite: 1.0.3 del-cli: 3.0.1 eslint-config-rollup: 1.0.0_typescript@3.9.7 esm: 3.2.25 - execa: 4.0.3 globby: 11.0.1 husky: 4.3.0 lint-staged: 10.5.2 @@ -24,21 +23,19 @@ importers: prettier-plugin-package: 1.3.0_prettier@2.2.1 ts-node: 8.10.2_typescript@3.9.7 tsconfig-paths: 3.9.0 - tslib: 2.0.3 typescript: 3.9.7 yaml: 1.10.0 specifiers: '@ava/babel': ^1.0.1 '@typescript-eslint/eslint-plugin': ^4.9.0 '@typescript-eslint/parser': ^4.9.0 - ava: ^3.13.0 + ava: ^3.15.0 chalk: ^4.1.0 codecov-lite: ^1.0.3 conventional-commits-parser: ^3.1.0 del-cli: ^3.0.1 eslint-config-rollup: ^1.0.0 esm: ^3.2.25 - execa: ^4.0.3 globby: ^11.0.1 husky: ^4.2.5 lint-staged: ^10.5.2 @@ -49,7 +46,6 @@ importers: semver: ^7.3.2 ts-node: ^8.10.2 tsconfig-paths: ^3.9.0 - tslib: ^2.0.0 typescript: ^3.9.7 write-pkg: ^4.0.0 yaml: ^1.10.0 @@ -462,7 +458,7 @@ importers: '@rollup/pluginutils': 3.1.0_rollup@2.32.1 resolve: 1.18.1 devDependencies: - '@rollup/plugin-buble': 0.21.3_rollup@2.32.1 + '@rollup/plugin-buble': 'link:../buble' '@rollup/plugin-commonjs': 11.1.0_rollup@2.32.1 '@rollup/plugin-typescript': 5.0.2_rollup@2.32.1+typescript@4.1.2 '@types/node': 10.17.48 @@ -576,6 +572,11 @@ packages: '@babel/highlight': 7.10.4 resolution: integrity: sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== + /@babel/code-frame/7.12.13: + dependencies: + '@babel/highlight': 7.12.13 + resolution: + integrity: sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== /@babel/compat-data/7.12.1: dev: true resolution: @@ -773,6 +774,9 @@ packages: /@babel/helper-validator-identifier/7.10.4: resolution: integrity: sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== + /@babel/helper-validator-identifier/7.12.11: + resolution: + integrity: sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== /@babel/helper-validator-option/7.12.1: dev: true resolution: @@ -801,6 +805,13 @@ packages: js-tokens: 4.0.0 resolution: integrity: sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== + /@babel/highlight/7.12.13: + dependencies: + '@babel/helper-validator-identifier': 7.12.11 + chalk: 2.4.2 + js-tokens: 4.0.0 + resolution: + integrity: sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww== /@babel/parser/7.12.3: dev: true engines: @@ -2264,12 +2275,12 @@ packages: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 resolution: integrity: sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== - /acorn-walk/8.0.0: + /acorn-walk/8.0.2: dev: true engines: node: '>=0.4.0' resolution: - integrity: sha512-oZRad/3SMOI/pxbbmqyurIx7jHw1wZDcR9G44L8pUVFEomX/0dH89SrM1KaDXuv1NpzAXz6Op/Xu/Qd5XXzdEA== + integrity: sha512-+bpA9MJsHdZ4bgfDcpk0ozQyhhVct7rzOmO0s1IIr0AGGgKBljss8n2zp11rRP2wid5VGeh04CgeKzgat5/25A== /acorn/6.4.2: engines: node: '>=0.4.0' @@ -2289,6 +2300,13 @@ packages: hasBin: true resolution: integrity: sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ== + /acorn/8.0.5: + dev: true + engines: + node: '>=0.4.0' + hasBin: true + resolution: + integrity: sha512-v+DieK/HJkJOpFBETDJioequtc3PfxsWMaxIdIwujtF7FEV/MAyDQLlm6/zPvr7Mix07mLh6ccVwIsloceodlg== /aggregate-error/3.1.0: dependencies: clean-stack: 2.2.0 @@ -2335,12 +2353,6 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - /ansi-regex/3.0.0: - dev: true - engines: - node: '>=4' - resolution: - integrity: sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= /ansi-regex/4.1.0: engines: node: '>=6' @@ -2371,6 +2383,12 @@ packages: node: '>=8' resolution: integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + /ansi-styles/5.1.0: + dev: true + engines: + node: '>=10' + resolution: + integrity: sha512-osxifZo3ar56+e8tdYreU6p8FZGciBHo5O0JoDAxMUqZuyNUb+yHEwYtJZ+Z32R459jEgtwVf1u8D7qYwU0l6w== /any-promise/1.3.0: dev: false resolution: @@ -2463,17 +2481,17 @@ packages: node: '>=8' resolution: integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - /ava/3.13.0: + /ava/3.15.0: dependencies: '@concordance/react': 2.0.0 - acorn: 8.0.4 - acorn-walk: 8.0.0 - ansi-styles: 4.3.0 + acorn: 8.0.5 + acorn-walk: 8.0.2 + ansi-styles: 5.1.0 arrgv: 1.0.2 arrify: 2.0.1 callsites: 3.1.0 chalk: 4.1.0 - chokidar: 3.4.3 + chokidar: 3.5.1 chunkd: 2.0.1 ci-info: 2.0.0 ci-parallel-vars: 1.0.1 @@ -2485,9 +2503,9 @@ packages: concordance: 5.0.1 convert-source-map: 1.7.0 currently-unhandled: 0.4.1 - debug: 4.2.0 + debug: 4.3.1 del: 6.0.0 - emittery: 0.7.2 + emittery: 0.8.1 equal-length: 1.0.1 figures: 3.2.0 globby: 11.0.1 @@ -2500,9 +2518,9 @@ packages: lodash: 4.17.20 matcher: 3.0.0 md5-hex: 3.0.1 - mem: 6.1.1 - ms: 2.1.2 - ora: 5.1.0 + mem: 8.0.0 + ms: 2.1.3 + ora: 5.3.0 p-event: 4.2.0 p-map: 4.0.0 picomatch: 2.2.2 @@ -2513,20 +2531,20 @@ packages: resolve-cwd: 3.0.0 slash: 3.0.0 source-map-support: 0.5.19 - stack-utils: 2.0.2 + stack-utils: 2.0.3 strip-ansi: 6.0.0 - supertap: 1.0.0 + supertap: 2.0.0 temp-dir: 2.0.0 trim-off-newlines: 1.0.1 - update-notifier: 4.1.3 + update-notifier: 5.1.0 write-file-atomic: 3.0.3 - yargs: 16.1.0 + yargs: 16.2.0 dev: true engines: - node: '>=10.18.0 <11 || >=12.14.0 <12.17.0 || >=12.17.0 <13 || >=14.0.0' + node: '>=10.18.0 <11 || >=12.14.0 <12.17.0 || >=12.17.0 <13 || >=14.0.0 <15 || >=15' hasBin: true resolution: - integrity: sha512-yzky+gark5PdsFFlZ4CnBVxm/OgBUWtn9vAsSSnuooVJNOk5ER17HJXVeUzy63LIt06Zy34oThcn+2ZqgMs7SA== + integrity: sha512-HGAnk1SHPk4Sx6plFAUkzV/XC1j9+iQhOzt4vBly18/yo0AV8Oytx7mtJd/CR8igCJ5p160N/Oo/cNJi2uSeWA== /babel-plugin-dynamic-import-node/2.3.3: dependencies: object.assign: 4.1.1 @@ -2548,16 +2566,28 @@ packages: /balanced-match/1.0.0: resolution: integrity: sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + /base64-js/1.5.1: + dev: true + resolution: + integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== /big.js/5.2.2: dev: true resolution: integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== - /binary-extensions/2.1.0: + /binary-extensions/2.2.0: dev: true engines: node: '>=8' resolution: - integrity: sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + /bl/4.0.4: + dependencies: + buffer: 5.7.1 + inherits: 2.0.4 + readable-stream: 3.6.0 + dev: true + resolution: + integrity: sha512-7tdr4EpSd7jJ6tuQ21vu2ke8w7pNEstzj1O8wwq6sNNzO3UDi5MA8Gny/gquCj7r2C6fHudg8tKRGyjRgmvNxQ== /blueimp-md5/2.18.0: dev: true resolution: @@ -2566,21 +2596,21 @@ packages: dev: true resolution: integrity: sha1-aN/1++YMUes3cl6p4+0xDcwed24= - /boxen/4.2.0: + /boxen/5.0.0: dependencies: ansi-align: 3.0.0 - camelcase: 5.3.1 - chalk: 3.0.0 + camelcase: 6.2.0 + chalk: 4.1.0 cli-boxes: 2.2.1 string-width: 4.2.0 - term-size: 2.2.1 - type-fest: 0.8.1 + type-fest: 0.20.2 widest-line: 3.1.0 + wrap-ansi: 7.0.0 dev: true engines: - node: '>=8' + node: '>=10' resolution: - integrity: sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== + integrity: sha512-5bvsqw+hhgUi3oYGK0Vf4WpIkyemp60WBInn7+WNfoISzAqk/HX4L7WNROq38E6UR/y3YADpv6pEm4BfkeEAdA== /brace-expansion/1.1.11: dependencies: balanced-match: 1.0.0 @@ -2622,6 +2652,13 @@ packages: dev: true resolution: integrity: sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + /buffer/5.7.1: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: true + resolution: + integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== /builtin-modules/3.1.0: engines: node: '>=6' @@ -2731,6 +2768,12 @@ packages: node: '>=6' resolution: integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + /camelcase/6.2.0: + dev: true + engines: + node: '>=10' + resolution: + integrity: sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== /caniuse-api/3.0.0: dependencies: browserslist: 4.14.5 @@ -2765,15 +2808,6 @@ packages: node: '>=4' resolution: integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - /chalk/3.0.0: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - dev: true - engines: - node: '>=8' - resolution: - integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== /chalk/4.1.0: dependencies: ansi-styles: 4.3.0 @@ -2782,7 +2816,7 @@ packages: node: '>=10' resolution: integrity: sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== - /chokidar/3.4.3: + /chokidar/3.5.1: dependencies: anymatch: 3.1.1 braces: 3.0.2 @@ -2795,9 +2829,9 @@ packages: engines: node: '>= 8.10.0' optionalDependencies: - fsevents: 2.1.3 + fsevents: 2.3.1 resolution: - integrity: sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== + integrity: sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== /chunkd/2.0.1: dev: true resolution: @@ -2859,14 +2893,14 @@ packages: dev: true resolution: integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - /cliui/7.0.3: + /cliui/7.0.4: dependencies: string-width: 4.2.0 strip-ansi: 6.0.0 wrap-ansi: 7.0.0 dev: true resolution: - integrity: sha512-Gj3QHTkVMPKqwP3f7B4KPkBZRMR9r4rfi5bXFpg1a+Svvj8l7q5CnkBkVQzfxT5DFSsGk2+PascOgL0JYkL2kw== + integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== /clone-response/1.0.2: dependencies: mimic-response: 1.0.1 @@ -3324,6 +3358,19 @@ packages: optional: true resolution: integrity: sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== + /debug/4.3.1: + dependencies: + ms: 2.1.2 + dev: true + engines: + node: '>=6.0' + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + resolution: + integrity: sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== /decamelize-keys/1.1.0: dependencies: decamelize: 1.2.0 @@ -3531,12 +3578,12 @@ packages: dev: true resolution: integrity: sha512-L9BwLwJohjZW9mQESI79HRzhicPk1DFgM+8hOCfGgGCFEcA3Otpv7QK6SGtYoZvfQfE3wKLh0Hd5ptqUFv3gvQ== - /emittery/0.7.2: + /emittery/0.8.1: dev: true engines: node: '>=10' resolution: - integrity: sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ== + integrity: sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== /emoji-regex/7.0.3: resolution: integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== @@ -3902,22 +3949,6 @@ packages: dev: true resolution: integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - /execa/4.0.3: - dependencies: - cross-spawn: 7.0.3 - get-stream: 5.2.0 - human-signals: 1.1.1 - 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 - dev: true - engines: - node: '>=10' - resolution: - integrity: sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A== /execa/4.1.0: dependencies: cross-spawn: 7.0.3 @@ -4075,6 +4106,15 @@ packages: - darwin resolution: integrity: sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + /fsevents/2.3.1: + dev: true + engines: + node: ^8.16.0 || ^10.6.0 || >=11.0.0 + optional: true + os: + - darwin + resolution: + integrity: sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw== /function-bind/1.1.1: resolution: integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== @@ -4142,14 +4182,14 @@ packages: path-is-absolute: 1.0.1 resolution: integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - /global-dirs/2.0.1: + /global-dirs/3.0.0: dependencies: - ini: 1.3.7 + ini: 2.0.0 dev: true engines: - node: '>=8' + node: '>=10' resolution: - integrity: sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A== + integrity: sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA== /globals/11.12.0: dev: true engines: @@ -4370,6 +4410,10 @@ packages: dev: true resolution: integrity: sha1-Bupvg2ead0njhs/h/oEq5dsiPe0= + /ieee754/1.2.1: + dev: true + resolution: + integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== /ignore-by-default/2.0.0: dev: true engines: @@ -4456,12 +4500,6 @@ packages: node: '>=0.8.19' resolution: integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o= - /indent-string/3.2.0: - dev: true - engines: - node: '>=4' - resolution: - integrity: sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= /indent-string/4.0.0: engines: node: '>=8' @@ -4480,10 +4518,16 @@ packages: /inherits/2.0.4: resolution: integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - /ini/1.3.7: + /ini/1.3.8: dev: true resolution: - integrity: sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== + integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== + /ini/2.0.0: + dev: true + engines: + node: '>=10' + resolution: + integrity: sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== /interpret/1.4.0: dev: true engines: @@ -4517,7 +4561,7 @@ packages: integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== /is-binary-path/2.1.0: dependencies: - binary-extensions: 2.1.0 + binary-extensions: 2.2.0 dev: true engines: node: '>=8' @@ -4596,15 +4640,15 @@ packages: node: '>=0.10.0' resolution: integrity: sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - /is-installed-globally/0.3.2: + /is-installed-globally/0.4.0: dependencies: - global-dirs: 2.0.1 + global-dirs: 3.0.0 is-path-inside: 3.0.2 dev: true engines: - node: '>=8' + node: '>=10' resolution: - integrity: sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g== + integrity: sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== /is-interactive/1.0.0: dev: true engines: @@ -4620,12 +4664,12 @@ packages: node: '>= 0.4' resolution: integrity: sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= - /is-npm/4.0.0: + /is-npm/5.0.0: dev: true engines: - node: '>=8' + node: '>=10' resolution: - integrity: sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== + integrity: sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA== /is-number/7.0.0: engines: node: '>=0.12.0' @@ -4855,6 +4899,14 @@ packages: hasBin: true resolution: integrity: sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== + /js-yaml/3.14.1: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + dev: true + hasBin: true + resolution: + integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== /jsesc/0.5.0: hasBin: true resolution: @@ -5116,6 +5168,14 @@ packages: node: '>=8' resolution: integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + /lru-cache/6.0.0: + dependencies: + yallist: 4.0.0 + dev: true + engines: + node: '>=10' + resolution: + integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== /magic-string/0.25.7: dependencies: sourcemap-codec: 1.4.8 @@ -5204,15 +5264,15 @@ packages: dev: true resolution: integrity: sha512-rQvjv71olwNHgiTbfPZFkJtjNMciWgswYeciZhtvWLO8bmX3TnhyA62I6sTWOyZssWHJJjY6/KiWwqQsWWsqOA== - /mem/6.1.1: + /mem/8.0.0: dependencies: map-age-cleaner: 0.1.3 mimic-fn: 3.1.0 dev: true engines: - node: '>=8' + node: '>=10' resolution: - integrity: sha512-Ci6bIfq/UgcxPTYa8dQQ5FY3BzKkT894bwXWXxC/zqs0XgMO2cT20CGkOqda7gZNkmK5VP4x89IGZ6K7hfbn3Q== + integrity: sha512-qrcJOe6uD+EW8Wrci1Vdiua/15Xw3n/QnaNXE7varnB6InxSk7nu3/i5jfy3S6kWxr8WYJ6R1o0afMUtvorTsA== /meow/6.1.1: dependencies: '@types/minimist': 1.2.0 @@ -5336,10 +5396,10 @@ packages: /ms/2.1.2: resolution: integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - /mute-stream/0.0.8: + /ms/2.1.3: dev: true resolution: - integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== /mz/2.7.0: dependencies: any-promise: 1.3.0 @@ -5548,21 +5608,21 @@ packages: node: '>= 0.8.0' resolution: integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== - /ora/5.1.0: + /ora/5.3.0: dependencies: + bl: 4.0.4 chalk: 4.1.0 cli-cursor: 3.1.0 cli-spinners: 2.5.0 is-interactive: 1.0.0 log-symbols: 4.0.0 - mute-stream: 0.0.8 strip-ansi: 6.0.0 wcwidth: 1.0.1 dev: true engines: node: '>=10' resolution: - integrity: sha512-9tXIMPvjZ7hPTbk8DFq1f7Kow/HU/pQYB60JbNq+QnGwcyhWVZaQ4hM9zQDEsPxw/muLpgiHSaumUZxCAmod/w== + integrity: sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g== /p-cancelable/1.1.0: dev: true engines: @@ -5691,7 +5751,7 @@ packages: /package-json/6.5.0: dependencies: got: 9.6.0 - registry-auth-token: 4.2.0 + registry-auth-token: 4.2.1 registry-url: 5.1.0 semver: 6.3.0 dev: true @@ -5729,10 +5789,21 @@ packages: error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.1.6 + dev: true engines: node: '>=8' resolution: integrity: sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ== + /parse-json/5.2.0: + dependencies: + '@babel/code-frame': 7.12.13 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.1.6 + engines: + node: '>=8' + resolution: + integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== /parse-ms/2.1.0: dev: true engines: @@ -6334,7 +6405,7 @@ packages: /rc/1.2.8: dependencies: deep-extend: 0.6.0 - ini: 1.3.7 + ini: 1.3.8 minimist: 1.2.5 strip-json-comments: 2.0.1 dev: true @@ -6373,7 +6444,7 @@ packages: dependencies: '@types/normalize-package-data': 2.4.0 normalize-package-data: 2.5.0 - parse-json: 5.1.0 + parse-json: 5.2.0 type-fest: 0.6.0 engines: node: '>=8' @@ -6396,7 +6467,6 @@ packages: inherits: 2.0.4 string_decoder: 1.3.0 util-deprecate: 1.0.2 - dev: false engines: node: '>= 6' resolution: @@ -6484,14 +6554,14 @@ packages: node: '>=4' resolution: integrity: sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ== - /registry-auth-token/4.2.0: + /registry-auth-token/4.2.1: dependencies: rc: 1.2.8 dev: true engines: node: '>=6.0.0' resolution: - integrity: sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w== + integrity: sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw== /registry-url/5.1.0: dependencies: rc: 1.2.8 @@ -6671,7 +6741,6 @@ packages: resolution: integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== /safe-buffer/5.2.1: - dev: false resolution: integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== /safe-identifier/0.4.2: @@ -6723,12 +6792,23 @@ packages: hasBin: true resolution: integrity: sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== - /serialize-error/2.1.0: + /semver/7.3.4: + dependencies: + lru-cache: 6.0.0 dev: true engines: - node: '>=0.10.0' + node: '>=10' + hasBin: true + resolution: + integrity: sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== + /serialize-error/7.0.1: + dependencies: + type-fest: 0.13.1 + dev: true + engines: + node: '>=10' resolution: - integrity: sha1-ULZ51WNc34Rme9yOWa9OW4HV9go= + integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw== /set-blocking/2.0.0: dev: true resolution: @@ -6873,7 +6953,7 @@ packages: /spdx-correct/3.1.1: dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.6 + spdx-license-ids: 3.0.7 resolution: integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== /spdx-exceptions/2.3.0: @@ -6882,12 +6962,12 @@ packages: /spdx-expression-parse/3.0.1: dependencies: spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.6 + spdx-license-ids: 3.0.7 resolution: integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - /spdx-license-ids/3.0.6: + /spdx-license-ids/3.0.7: resolution: - integrity: sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw== + integrity: sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ== /split2/2.2.0: dependencies: through2: 2.0.5 @@ -6901,14 +6981,14 @@ packages: dev: true resolution: integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== - /stack-utils/2.0.2: + /stack-utils/2.0.3: dependencies: escape-string-regexp: 2.0.0 dev: true engines: node: '>=10' resolution: - integrity: sha512-0H7QK2ECz3fyZMzQ8rH0j2ykpfbnd20BFtfg/SqVC2+sCTtcw0aDTGB7dk+de4U4uUeuz6nOtJcrkFFLG1B0Rg== + integrity: sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw== /string-argv/0.3.1: dev: true engines: @@ -6965,7 +7045,6 @@ packages: /string_decoder/1.3.0: dependencies: safe-buffer: 5.2.1 - dev: false resolution: integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== /stringify-object/3.3.0: @@ -6986,14 +7065,6 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - /strip-ansi/4.0.0: - dependencies: - ansi-regex: 3.0.0 - dev: true - engines: - node: '>=4' - resolution: - integrity: sha1-qEeQIusaw2iocTibY1JixQXuNo8= /strip-ansi/5.2.0: dependencies: ansi-regex: 4.1.0 @@ -7080,18 +7151,18 @@ packages: hasBin: true resolution: integrity: sha512-ovVuswxV5TayCPXfTk8bgBgk6uNRvsinIkEpq0J6zS1xXCx5N/LLGcbsKdRhqn/ToZylMX6+yXaR1LSn1I42Pg== - /supertap/1.0.0: + /supertap/2.0.0: dependencies: - arrify: 1.0.1 - indent-string: 3.2.0 - js-yaml: 3.14.0 - serialize-error: 2.1.0 - strip-ansi: 4.0.0 + arrify: 2.0.1 + indent-string: 4.0.0 + js-yaml: 3.14.1 + serialize-error: 7.0.1 + strip-ansi: 6.0.0 dev: true engines: - node: '>=4' + node: '>=10' resolution: - integrity: sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA== + integrity: sha512-jRzcXlCeDYvKoZGA5oRhYyR3jUIYu0enkSxtmAgHRlD7HwrovTpH4bDSi0py9FtuA8si9cW/fKommJHuaoDHJA== /supports-color/2.0.0: dev: true engines: @@ -7165,12 +7236,6 @@ packages: node: '>=8' resolution: integrity: sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg== - /term-size/2.2.1: - dev: true - engines: - node: '>=8' - resolution: - integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== /test-exclude/6.0.0: dependencies: '@istanbuljs/schema': 0.1.2 @@ -7304,10 +7369,6 @@ packages: dev: true resolution: integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - /tslib/2.0.3: - dev: true - resolution: - integrity: sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== /tsutils/3.17.1_typescript@3.9.7: dependencies: tslib: 1.14.1 @@ -7349,6 +7410,12 @@ packages: node: '>=10' resolution: integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== + /type-fest/0.20.2: + dev: true + engines: + node: '>=10' + resolution: + integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== /type-fest/0.3.1: dev: true engines: @@ -7442,26 +7509,27 @@ packages: dev: true resolution: integrity: sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ= - /update-notifier/4.1.3: + /update-notifier/5.1.0: dependencies: - boxen: 4.2.0 - chalk: 3.0.0 + boxen: 5.0.0 + chalk: 4.1.0 configstore: 5.0.1 has-yarn: 2.1.0 import-lazy: 2.1.0 is-ci: 2.0.0 - is-installed-globally: 0.3.2 - is-npm: 4.0.0 + is-installed-globally: 0.4.0 + is-npm: 5.0.0 is-yarn-global: 0.3.0 latest-version: 5.1.0 pupa: 2.1.1 + semver: 7.3.4 semver-diff: 3.1.1 xdg-basedir: 4.0.0 dev: true engines: - node: '>=8' + node: '>=10' resolution: - integrity: sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A== + integrity: sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw== /uri-js/4.4.0: dependencies: punycode: 2.1.1 @@ -7637,6 +7705,10 @@ packages: node: '>=10' resolution: integrity: sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== + /yallist/4.0.0: + dev: true + resolution: + integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== /yaml/1.10.0: dev: true engines: @@ -7651,12 +7723,12 @@ packages: node: '>=6' resolution: integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - /yargs-parser/20.2.3: + /yargs-parser/20.2.4: dev: true engines: node: '>=10' resolution: - integrity: sha512-emOFRT9WVHw03QSvN5qor9QQT9+sw5vwxfYweivSMHTcAXPefwVae2FjO7JJjj8hCE4CzPOPeFM83VwT29HCww== + integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== /yargs/15.4.1: dependencies: cliui: 6.0.0 @@ -7675,20 +7747,20 @@ packages: node: '>=8' resolution: integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - /yargs/16.1.0: + /yargs/16.2.0: dependencies: - cliui: 7.0.3 + cliui: 7.0.4 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.3 + yargs-parser: 20.2.4 dev: true engines: node: '>=10' resolution: - integrity: sha512-upWFJOmDdHN0syLuESuvXDmrRcWd1QafJolHskzaw79uZa7/x53gxQKiR07W59GWY1tFhhU/Th9DrtSfpS782g== + integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== /yn/3.1.1: dev: true engines: diff --git a/util/test.d.ts b/util/test.d.ts index a528fc829..4bce4b0b6 100644 --- a/util/test.d.ts +++ b/util/test.d.ts @@ -15,10 +15,14 @@ interface GetCode { export const getCode: GetCode; +export function evaluateBundle(bundle: RollupBuild): Promise>; + export function getImports(bundle: RollupBuild): Promise; export function getResolvedModules(bundle: RollupBuild): Promise>; +export function onwarn(warning: string | any): void; + export function testBundle( t: Assertions, bundle: RollupBuild, diff --git a/util/test.js b/util/test.js index ed79ca3fc..d6b6693e7 100644 --- a/util/test.js +++ b/util/test.js @@ -30,6 +30,9 @@ const getResolvedModules = async (bundle) => { return modules; }; +// eslint-disable-next-line no-console +const onwarn = (warning) => console.warn(warning.toString()); + /** * @param {import('ava').Assertions} t * @param {import('rollup').RollupBuild} bundle @@ -59,9 +62,16 @@ const testBundle = async (t, bundle, args = {}) => { return { code, error, module, result }; }; +const evaluateBundle = async (bundle) => { + const { module } = await testBundle(null, bundle); + return module.exports; +}; + module.exports = { + evaluateBundle, getCode, getImports, getResolvedModules, + onwarn, testBundle };