From 3d181f458b2c678828294ff14a42d0993bfa3e81 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sat, 1 Oct 2022 12:18:07 +0200 Subject: [PATCH 01/33] feat: add typechecking functionality --- packages/ui/client/composables/summary.ts | 8 +- packages/vitest/package.json | 2 + packages/vitest/src/defaults.ts | 4 + packages/vitest/src/node/cli-api.ts | 2 +- packages/vitest/src/node/cli-wrapper.ts | 2 +- packages/vitest/src/node/cli.ts | 9 + packages/vitest/src/node/config.ts | 5 + packages/vitest/src/node/core.ts | 61 +++++- packages/vitest/src/node/error.ts | 11 +- packages/vitest/src/node/logger.ts | 13 ++ packages/vitest/src/node/plugins/mock.ts | 2 +- packages/vitest/src/node/reporters/base.ts | 6 +- packages/vitest/src/types/config.ts | 13 +- packages/vitest/src/types/index.ts | 2 + packages/vitest/src/types/tasks.ts | 6 +- packages/vitest/src/typescript/assertType.ts | 7 + packages/vitest/src/typescript/constants.ts | 2 + .../vitest/src/typescript/expectTypeOf.ts | 190 ++++++++++++++++++ packages/vitest/src/typescript/parse.ts | 126 ++++++++++++ packages/vitest/src/typescript/parser.ts | 130 ++++++++++++ packages/vitest/src/typescript/types.ts | 25 +++ packages/vitest/src/typescript/utils.ts | 157 +++++++++++++++ packages/vitest/src/utils/tasks.ts | 8 +- pnpm-lock.yaml | 80 ++++++++ test/typescript/package.json | 13 ++ test/typescript/test.test-d.ts | 33 +++ test/typescript/tsconfig.tmp.json | 80 ++++++++ 27 files changed, 977 insertions(+), 20 deletions(-) create mode 100644 packages/vitest/src/typescript/assertType.ts create mode 100644 packages/vitest/src/typescript/constants.ts create mode 100644 packages/vitest/src/typescript/expectTypeOf.ts create mode 100644 packages/vitest/src/typescript/parse.ts create mode 100644 packages/vitest/src/typescript/parser.ts create mode 100644 packages/vitest/src/typescript/types.ts create mode 100644 packages/vitest/src/typescript/utils.ts create mode 100644 test/typescript/package.json create mode 100644 test/typescript/test.test-d.ts create mode 100644 test/typescript/tsconfig.tmp.json diff --git a/packages/ui/client/composables/summary.ts b/packages/ui/client/composables/summary.ts index aa8eab5e86ad..198f4bfc2ea2 100644 --- a/packages/ui/client/composables/summary.ts +++ b/packages/ui/client/composables/summary.ts @@ -1,5 +1,5 @@ import { hasFailedSnapshot } from '@vitest/ws-client' -import type { Benchmark, Task, Test } from 'vitest/src' +import type { Benchmark, Task, Test, TypeCheck } from 'vitest/src' import { files, testRunState } from '~/composables/client' type Nullable = T | null | undefined @@ -52,9 +52,9 @@ function toArray(array?: Nullable>): Array { return array return [array] } -function isAtomTest(s: Task): s is Test | Benchmark { - return (s.type === 'test' || s.type === 'benchmark') +function isAtomTest(s: Task): s is Test | Benchmark | TypeCheck { + return (s.type === 'test' || s.type === 'benchmark' || s.type === 'typecheck') } -function getTests(suite: Arrayable): (Test | Benchmark)[] { +function getTests(suite: Arrayable): (Test | Benchmark | TypeCheck)[] { return toArray(suite).flatMap(s => isAtomTest(s) ? [s] : s.tasks.flatMap(c => isAtomTest(c) ? [c] : getTests(c))) } diff --git a/packages/vitest/package.json b/packages/vitest/package.json index 660f621ff5f9..cc85a32fda1b 100644 --- a/packages/vitest/package.json +++ b/packages/vitest/package.json @@ -108,6 +108,7 @@ "@types/chai": "^4.3.3", "@types/chai-subset": "^1.3.3", "@types/node": "*", + "acorn": "^8.8.0", "chai": "^4.3.6", "debug": "^4.3.4", "local-pkg": "^0.4.2", @@ -138,6 +139,7 @@ "fast-glob": "^3.2.12", "find-up": "^6.3.0", "flatted": "^3.2.7", + "get-tsconfig": "^4.2.0", "happy-dom": "^6.0.4", "jsdom": "^20.0.1", "log-update": "^5.0.1", diff --git a/packages/vitest/src/defaults.ts b/packages/vitest/src/defaults.ts index 881bc0c3aee5..eef094aebfa7 100644 --- a/packages/vitest/src/defaults.ts +++ b/packages/vitest/src/defaults.ts @@ -88,6 +88,10 @@ const config = { fakeTimers: fakeTimersDefaults, maxConcurrency: 5, dangerouslyIgnoreUnhandledErrors: false, + typecheck: { + checker: 'tsc' as const, + include: ['**/*.test-d.ts'], + }, } export const configDefaults: Required> = Object.freeze(config) diff --git a/packages/vitest/src/node/cli-api.ts b/packages/vitest/src/node/cli-api.ts index 2058902e8c5d..bf453e3eccbc 100644 --- a/packages/vitest/src/node/cli-api.ts +++ b/packages/vitest/src/node/cli-api.ts @@ -38,7 +38,7 @@ export async function startVitest(mode: VitestRunMode, cliFilters: string[], opt const ctx = await createVitest(mode, options, viteOverrides) - if (mode !== 'benchmark' && ctx.config.coverage.enabled) { + if (mode === 'test' && ctx.config.coverage.enabled) { const provider = ctx.config.coverage.provider || 'c8' if (typeof provider === 'string') { const requiredPackages = CoverageProviderMap[provider] diff --git a/packages/vitest/src/node/cli-wrapper.ts b/packages/vitest/src/node/cli-wrapper.ts index f218f51689cd..e7b867cb3b2f 100644 --- a/packages/vitest/src/node/cli-wrapper.ts +++ b/packages/vitest/src/node/cli-wrapper.ts @@ -112,7 +112,7 @@ async function start(preArgs: string[], postArgs: string[]) { ], { reject: false, - stderr: 'pipe', + stderr: 'inherit', // TODO stdout: 'inherit', stdin: 'inherit', env: { diff --git a/packages/vitest/src/node/cli.ts b/packages/vitest/src/node/cli.ts index 2650ca6481c5..2e8f245fa181 100644 --- a/packages/vitest/src/node/cli.ts +++ b/packages/vitest/src/node/cli.ts @@ -65,6 +65,10 @@ cli .command('bench [...filters]') .action(benchmark) +cli + .command('typecheck') + .action(typecheck) + cli .command('[...filters]') .action((filters, options) => start('test', filters, options)) @@ -92,6 +96,11 @@ async function benchmark(cliFilters: string[], options: CliOptions): Promise { try { if (await startVitest(mode, cliFilters, options) === false) diff --git a/packages/vitest/src/node/config.ts b/packages/vitest/src/node/config.ts index eb5f486ea95a..9974195fafa7 100644 --- a/packages/vitest/src/node/config.ts +++ b/packages/vitest/src/node/config.ts @@ -229,5 +229,10 @@ export function resolveConfig( : BaseSequencer } + resolved.typecheck = { + ...configDefaults.typecheck, + ...resolved.typecheck, + } + return resolved } diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index f9076022e2e9..07394151568b 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -7,10 +7,11 @@ import mm from 'micromatch' import c from 'picocolors' import { ViteNodeRunner } from 'vite-node/client' import { ViteNodeServer } from 'vite-node/server' -import type { ArgumentsType, CoverageProvider, OnServerRestartHandler, Reporter, ResolvedConfig, UserConfig, VitestRunMode } from '../types' +import type { ArgumentsType, CoverageProvider, File, OnServerRestartHandler, Reporter, ResolvedConfig, Task, UserConfig, VitestRunMode } from '../types' import { SnapshotManager } from '../integrations/snapshot/manager' import { clearTimeout, deepMerge, hasFailed, noop, setTimeout, slash, toArray } from '../utils' import { getCoverageProvider } from '../integrations/coverage' +import { Typechecker } from '../typescript/parser' import { createPool } from './pool' import type { WorkerPool } from './pool' import { createBenchmarkReporters, createReporters } from './reporters/utils' @@ -151,7 +152,65 @@ export class Vitest { ) as ResolvedConfig } + async typecheck() { + const checker = new Typechecker({ + root: this.config.root, + watch: this.config.watch, + ...this.config.typecheck, + }) + checker.onParseEnd(async (errors) => { + const testErrors = errors.filter(({ error }) => error.getOrigin() === 'test') + const sourceErrors = errors.filter(({ error }) => error.getOrigin() === 'source') + const testFiles = testErrors.reduce((acc, { path, error }, idx) => { + if (!acc[path]) { + // TODO parse code to constuct actual suite, + // currently doesn't support describe and test + acc[path] = { + type: 'suite', + filepath: path, + tasks: [], + id: path, + name: path, + mode: 'run', + result: { + state: 'fail', + }, + } + } + const task: Task = { + type: 'typecheck', + id: idx.toString(), + name: `error expect ${idx + 1}`, + mode: 'run', + file: acc[path], + result: { + state: 'fail', + error, + }, + } + acc[path].tasks.push(task) + return acc + }, {} as Record) + await this.report('onFinished', Object.values(testFiles)) // TODO optimize without map -> array -> obj -> array + if (sourceErrors.length) // TODO move on top of summary + await this.logger.printSourceTypeErrors(sourceErrors.map(({ error }) => error)) + }) + checker.onParseStart(async () => { + await this.report('onInit', this) + // TODO start spinner "Typechecking..." + }) + // checker.onWatcherRerun(() => { + // console.log('reruning watcher') + // }) + await checker.start() + } + async start(filters?: string[]) { + if (this.mode === 'typecheck') { + await this.typecheck() + return + } + try { await this.initCoverageProvider() await this.coverageProvider?.clean(this.config.coverage.clean) diff --git a/packages/vitest/src/node/error.ts b/packages/vitest/src/node/error.ts index aea8b0c4dd5b..a8d4670761ae 100644 --- a/packages/vitest/src/node/error.ts +++ b/packages/vitest/src/node/error.ts @@ -7,6 +7,7 @@ import type { ErrorWithDiff, ParsedStack, Position } from '../types' import { interpretSourcePos, lineSplitRE, parseStacktrace, posToNumber } from '../utils/source-map' import { F_POINTER } from '../utils/figures' import { stringify } from '../integrations/chai/jest-matcher-utils' +import { TypeCheckError } from '../typescript/parser' import type { Vitest } from './core' import { type DiffOptions, unifiedDiff } from './diff' import { divider } from './reporters/renderers/utils' @@ -47,10 +48,12 @@ export async function printError(error: unknown, ctx: Vitest, options: PrintErro await interpretSourcePos(stacks, ctx) - const nearest = stacks.find(stack => - ctx.server.moduleGraph.getModuleById(stack.file) + const nearest = error instanceof TypeCheckError + ? error.stacks[0] + : stacks.find(stack => + ctx.server.moduleGraph.getModuleById(stack.file) && existsSync(stack.file), - ) + ) const errorProperties = getErrorProperties(e) @@ -63,7 +66,7 @@ export async function printError(error: unknown, ctx: Vitest, options: PrintErro const file = fileFromParsedStack(nearest) // could point to non-existing original file // for example, when there is a source map file, but no source in node_modules - if (existsSync(file)) { + if (nearest.file === file || existsSync(file)) { const sourceCode = readFileSync(file, 'utf-8') ctx.logger.log(c.yellow(generateCodeFrame(sourceCode, 4, pos))) } diff --git a/packages/vitest/src/node/logger.ts b/packages/vitest/src/node/logger.ts index a651f1256ad8..1a6a859378f5 100644 --- a/packages/vitest/src/node/logger.ts +++ b/packages/vitest/src/node/logger.ts @@ -2,6 +2,7 @@ import { createLogUpdate } from 'log-update' import c from 'picocolors' import { version } from '../../../../package.json' import type { ErrorWithDiff } from '../types' +import type { TypeCheckError } from '../typescript/parser' import { divider } from './reporters/renderers/utils' import type { Vitest } from './core' import { printError } from './error' @@ -120,4 +121,16 @@ export class Logger { })) this.log(c.red(divider())) } + + async printSourceTypeErrors(errors: TypeCheckError[]) { + const errorMessage = c.red(c.bold( + `\nVitest found ${errors.length} error${errors.length > 1 ? 's' : ''} not related to your test files.`, + )) + this.log(c.red(divider(c.bold(c.inverse(' Source Errors '))))) + this.log(errorMessage) + await Promise.all(errors.map(async (err) => { + await this.printError(err, true) + })) + this.log(c.red(divider())) + } } diff --git a/packages/vitest/src/node/plugins/mock.ts b/packages/vitest/src/node/plugins/mock.ts index 1267ac548fee..c41c7c65c420 100644 --- a/packages/vitest/src/node/plugins/mock.ts +++ b/packages/vitest/src/node/plugins/mock.ts @@ -125,7 +125,7 @@ function getIndexStatus(code: string, from: number) { } } - beforeChar = code[index] + beforeChar = char index++ } diff --git a/packages/vitest/src/node/reporters/base.ts b/packages/vitest/src/node/reporters/base.ts index 9df552f9408e..15be85749009 100644 --- a/packages/vitest/src/node/reporters/base.ts +++ b/packages/vitest/src/node/reporters/base.ts @@ -55,7 +55,7 @@ export abstract class BaseReporter implements Reporter { if (errors.length) { if (!this.ctx.config.dangerouslyIgnoreUnhandledErrors) process.exitCode = 1 - this.ctx.logger.printUnhandledErrors(errors) + await this.ctx.logger.printUnhandledErrors(errors) } } @@ -241,6 +241,8 @@ export abstract class BaseReporter implements Reporter { logger.log(padTitle('Start at'), formatTimeString(this._timeStart)) if (this.watchFilters) logger.log(padTitle('Duration'), time(threadTime)) + else if (this.mode === 'typecheck') + logger.log(padTitle('Duration'), time(executionTime)) else logger.log(padTitle('Duration'), time(executionTime) + c.dim(` (transform ${time(transformTime)}, setup ${time(setupTime)}, collect ${time(collectTime)}, tests ${time(testsTime)})`)) @@ -284,6 +286,8 @@ export abstract class BaseReporter implements Reporter { logger.log(`\n${c.cyan(c.inverse(c.bold(' BENCH ')))} ${c.cyan('Summary')}\n`) for (const bench of topBenchs) { const group = bench.suite + if (!group) + continue const groupName = getFullName(group) logger.log(` ${bench.name}${c.dim(` - ${groupName}`)}`) const siblings = group.tasks diff --git a/packages/vitest/src/types/config.ts b/packages/vitest/src/types/config.ts index 933efc961e99..b33ef28dbc9e 100644 --- a/packages/vitest/src/types/config.ts +++ b/packages/vitest/src/types/config.ts @@ -27,7 +27,7 @@ export interface EnvironmentOptions { [x: string]: unknown } -export type VitestRunMode = 'test' | 'benchmark' +export type VitestRunMode = 'test' | 'benchmark' | 'typecheck' export interface InlineConfig { /** @@ -443,6 +443,13 @@ export interface InlineConfig { * Ignore any unhandled errors that occur */ dangerouslyIgnoreUnhandledErrors?: boolean + + typecheck?: Partial +} + +export interface TypecheckConfig { + checker: 'tsc' | 'vue-tsc' + include: string[] } export interface UserConfig extends InlineConfig { @@ -489,7 +496,7 @@ export interface UserConfig extends InlineConfig { shard?: string } -export interface ResolvedConfig extends Omit, 'config' | 'filters' | 'coverage' | 'testNamePattern' | 'related' | 'api' | 'reporters' | 'resolveSnapshotPath' | 'benchmark' | 'shard' | 'cache' | 'sequence'> { +export interface ResolvedConfig extends Omit, 'config' | 'filters' | 'coverage' | 'testNamePattern' | 'related' | 'api' | 'reporters' | 'resolveSnapshotPath' | 'benchmark' | 'shard' | 'cache' | 'sequence' | 'typecheck'> { mode: VitestRunMode base?: string @@ -526,4 +533,6 @@ export interface ResolvedConfig extends Omit, 'config' | 'f shuffle?: boolean seed?: number } + + typecheck: TypecheckConfig } diff --git a/packages/vitest/src/types/index.ts b/packages/vitest/src/types/index.ts index 5eaeef90cd0d..ad84bf16f373 100644 --- a/packages/vitest/src/types/index.ts +++ b/packages/vitest/src/types/index.ts @@ -1,6 +1,8 @@ import './vite' import './global' +export { expectTypeOf, type ExpectTypeOf } from '../typescript/expectTypeOf' +export * from '../typescript/types' export * from './config' export * from './tasks' export * from './reporter' diff --git a/packages/vitest/src/types/tasks.ts b/packages/vitest/src/types/tasks.ts index c7bab516322e..2b6440bd6e6c 100644 --- a/packages/vitest/src/types/tasks.ts +++ b/packages/vitest/src/types/tasks.ts @@ -54,7 +54,11 @@ export interface Test extends TaskBase { context: TestContext & ExtraContext } -export type Task = Test | Suite | File | Benchmark +export interface TypeCheck extends TaskBase { + type: 'typecheck' +} + +export type Task = Test | Suite | File | Benchmark | TypeCheck export type DoneCallback = (error?: any) => void export type TestFunction = (context: TestContext & ExtraContext) => Awaitable | void diff --git a/packages/vitest/src/typescript/assertType.ts b/packages/vitest/src/typescript/assertType.ts new file mode 100644 index 000000000000..5da53e69788a --- /dev/null +++ b/packages/vitest/src/typescript/assertType.ts @@ -0,0 +1,7 @@ +const noop = () => {} + +interface AssertType { + (value: T): void +} + +export const assertType: AssertType = noop diff --git a/packages/vitest/src/typescript/constants.ts b/packages/vitest/src/typescript/constants.ts new file mode 100644 index 000000000000..9b894c7cadd6 --- /dev/null +++ b/packages/vitest/src/typescript/constants.ts @@ -0,0 +1,2 @@ +export const EXPECT_TYPEOF_MATCHERS = Symbol('vitest:expect-typeof-matchers') +export const TYPECHECK_ERROR = Symbol('vitest:typecheck-error') diff --git a/packages/vitest/src/typescript/expectTypeOf.ts b/packages/vitest/src/typescript/expectTypeOf.ts new file mode 100644 index 000000000000..5f91692dd54e --- /dev/null +++ b/packages/vitest/src/typescript/expectTypeOf.ts @@ -0,0 +1,190 @@ +/** + * https://github.com/mmkal/expect-type/blob/14cd7e2262ca99b793b6cfedd18015103614393f/src/index.ts + */ + +import { EXPECT_TYPEOF_MATCHERS } from './constants' +import type { + ConstructorParams, + Equal, + Extends, + IsAny, + IsNever, + IsUnknown, + MismatchArgs, + Not, + Params, +} from './utils' + +export interface ExpectTypeOf { + toBeAny: (...MISMATCH: MismatchArgs, B>) => true + toBeUnknown: (...MISMATCH: MismatchArgs, B>) => true + toBeNever: (...MISMATCH: MismatchArgs, B>) => true + toBeFunction: (...MISMATCH: MismatchArgs any>, B>) => true + toBeObject: (...MISMATCH: MismatchArgs, B>) => true + toBeArray: (...MISMATCH: MismatchArgs, B>) => true + toBeNumber: (...MISMATCH: MismatchArgs, B>) => true + toBeString: (...MISMATCH: MismatchArgs, B>) => true + toBeBoolean: (...MISMATCH: MismatchArgs, B>) => true + toBeVoid: (...MISMATCH: MismatchArgs, B>) => true + toBeSymbol: (...MISMATCH: MismatchArgs, B>) => true + toBeNull: (...MISMATCH: MismatchArgs, B>) => true + toBeUndefined: (...MISMATCH: MismatchArgs, B>) => true + toBeNullable: (...MISMATCH: MismatchArgs>>, B>) => true + toMatch: { + (...MISMATCH: MismatchArgs, B>): true + (expected: Expected, ...MISMATCH: MismatchArgs, B>): true + } + toBe: { + (...MISMATCH: MismatchArgs, B>): true + (expected: Expected, ...MISMATCH: MismatchArgs, B>): true + } + toBeCallableWith: B extends true ? (...args: Params) => true : never + toBeConstructibleWith: B extends true ? (...args: ConstructorParams) => true : never + toHaveProperty: ( + key: K, + ...MISMATCH: MismatchArgs, B> + ) => K extends keyof Actual ? ExpectTypeOf : true + extract: (v?: V) => ExpectTypeOf, B> + exclude: (v?: V) => ExpectTypeOf, B> + parameter: >(number: K) => ExpectTypeOf[K], B> + parameters: ExpectTypeOf, B> + constructorParameters: ExpectTypeOf, B> + instance: Actual extends new (...args: any[]) => infer I ? ExpectTypeOf : never + returns: Actual extends (...args: any[]) => infer R ? ExpectTypeOf : never + resolves: Actual extends PromiseLike ? ExpectTypeOf : never + items: Actual extends ArrayLike ? ExpectTypeOf : never + guards: Actual extends (v: any, ...args: any[]) => v is infer T ? ExpectTypeOf : never + asserts: Actual extends (v: any, ...args: any[]) => asserts v is infer T + ? // Guard methods `(v: any) => asserts v is T` does not actually defines a return type. Thus, any function taking 1 argument matches the signature before. + // In case the inferred assertion type `R` could not be determined (so, `unknown`), consider the function as a non-guard, and return a `never` type. + // See https://github.com/microsoft/TypeScript/issues/34636 + unknown extends T + ? never + : ExpectTypeOf + : never + not: ExpectTypeOf> +} +const fn: any = () => true + +export interface _ExpectTypeOf { + (actual: Actual): ExpectTypeOf + (): ExpectTypeOf + extend(matchers: Record): void +} + +interface MatcherConfiguration { + message: string +} + +const matchersConfiguration: Record = { + toBeAny: { + message: 'expected type to be any', + }, + toBeNull: { + message: 'expected type to be null', + }, + toBeNever: { + message: 'expected type to be never', + }, + toBe: { + message: 'expected two types to be equal', + }, + toBeUnknown: { + message: 'expected type to be unknown', + }, + toBeFunction: { + message: 'expected type to be a function', + }, + toBeObject: { + message: 'expected type to be an object', + }, + toBeArray: { + message: 'expected type to be an array', + }, + toBeString: { + message: 'expected type to be a string', + }, + toBeNumber: { + message: 'expected type to be a number', + }, + toBeBoolean: { + message: 'expected type to be boolean', + }, + toBeVoid: { + message: 'expected type to be void', + }, + toBeSymbol: { + message: 'expected type to be a symbol', + }, + toBeUndefined: { + message: 'expected type to be undefined', + }, + toBeNullable: { + message: 'expected type to be nullable', + }, + toMatch: { + message: 'expected types to extend one another', + }, + toBeCallableWith: { + message: 'expected type to be callable with given arguments', + }, + toBeConstructibleWith: { + message: 'expected type to be constructible with given arguments', + }, +} + +export const expectTypeOf: _ExpectTypeOf = ((_actual?: Actual): ExpectTypeOf => { + const nonFunctionProperties = [ + 'parameters', + 'returns', + 'resolves', + 'not', + 'items', + 'constructorParameters', + 'instance', + 'guards', + 'asserts', + ] as const + type Keys = keyof ExpectTypeOf + + type FunctionsDict = Record, any> + const obj: FunctionsDict = { + toBeAny: fn, + toBeUnknown: fn, + toBeNever: fn, + toBeFunction: fn, + toBeObject: fn, + toBeArray: fn, + toBeString: fn, + toBeNumber: fn, + toBeBoolean: fn, + toBeVoid: fn, + toBeSymbol: fn, + toBeNull: fn, + toBeUndefined: fn, + toBeNullable: fn, + toMatch: fn, + toBe: fn, + toBeCallableWith: fn, + toBeConstructibleWith: fn, + extract: expectTypeOf, + exclude: expectTypeOf, + toHaveProperty: expectTypeOf, + parameter: expectTypeOf, + } + + const getterProperties: readonly Keys[] = nonFunctionProperties + getterProperties.forEach((prop: Keys) => Object.defineProperty(obj, prop, { get: () => expectTypeOf({}) })) + + return obj as ExpectTypeOf +}) as _ExpectTypeOf + +// extend by calling setupFiles +expectTypeOf.extend = (matchers) => { + for (const matcher in matchers) + matchersConfiguration[matcher] = matchers[matcher] +} + +Object.defineProperty(expectTypeOf, EXPECT_TYPEOF_MATCHERS, { + value: matchersConfiguration, +}) diff --git a/packages/vitest/src/typescript/parse.ts b/packages/vitest/src/typescript/parse.ts new file mode 100644 index 000000000000..71da7783cf1f --- /dev/null +++ b/packages/vitest/src/typescript/parse.ts @@ -0,0 +1,126 @@ +// tsc --noEmit --pretty false +// include - show like regular errors +// exclude - show like tsc errors + +import path from 'node:path' +import url from 'node:url' +import { writeFile } from 'node:fs/promises' +import { getTsconfig } from 'get-tsconfig' +import type { RawErrsMap, TscErrorInfo } from './types' + +const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) +const newLineRegExp = /\r?\n/ +const errCodeRegExp = /error TS(?\d+)/ + +export async function makeTscErrorInfo( + errInfo: string, +): Promise<[string, TscErrorInfo | null]> { + const [errFilePathPos = '', ...errMsgRawArr] = errInfo.split(':') + if ( + !errFilePathPos + || errMsgRawArr.length === 0 + || errMsgRawArr.join('').length === 0 + ) + return ['unknown filepath', null] + + const errMsgRaw = errMsgRawArr.join('').trim() + + // get filePath, line, col + const [errFilePath, errPos] = errFilePathPos + .slice(0, -1) // removes the ')' + .split('(') + if (!errFilePath || !errPos) + return ['unknown filepath', null] + + const [errLine, errCol] = errPos.split(',') + if (!errLine || !errCol) + return [errFilePath, null] + + // get errCode, errMsg + const execArr = errCodeRegExp.exec(errMsgRaw) + if (!execArr) + return [errFilePath, null] + + const errCodeStr = execArr.groups?.errCode ?? '' + if (!errCodeStr) + return [errFilePath, null] + + const line = Number(errLine) + const col = Number(errCol) + const errCode = Number(errCodeStr) + return [ + errFilePath, + { + filePath: errFilePath, + errCode, + line, + column: col, + errMsg: errMsgRaw.slice(`error TS${errCode} `.length), + }, + ] +} + +export async function getTsconfigPath(root: string) { + const tmpConfigPath = path.join(root, 'tsconfig.tmp.json') // TODO put into tmp dir + // TODO delete after use + + const tsconfig = getTsconfig(root) + + if (!tsconfig) + throw new Error('no tsconfig.json found') + + try { + const tmpTsConfig: Record = { ...tsconfig.config } + + tmpTsConfig.compilerOptions ??= {} + tmpTsConfig.compilerOptions.emitDeclarationOnly = false + tmpTsConfig.compilerOptions.incremental = true + tmpTsConfig.compilerOptions.tsBuildInfoFile = path.join( + __dirname, + 'tsconfig.tmp.tsbuildinfo', + ) + + const tsconfigFinalContent = JSON.stringify(tmpTsConfig, null, 2) + await writeFile(tmpConfigPath, tsconfigFinalContent) + return tmpConfigPath + } + catch (err) { + throw new Error('failed to write tsconfig.tmp.json', { cause: err }) + } +} + +export async function getRawErrsMapFromTsCompile( + tscErrorStdout: string, +) { + const rawErrsMap: RawErrsMap = new Map() + + // Merge details line with main line (i.e. which contains file path) + const infos = await Promise.all( + tscErrorStdout + .split(newLineRegExp) + .reduce((prev, next) => { + if (!next) + return prev + + else if (!next.startsWith(' ')) + prev.push(next) + + else + prev[prev.length - 1] += `\n${next}` + + return prev + }, []) + .map(errInfoLine => makeTscErrorInfo(errInfoLine)), + ) + infos.forEach(([errFilePath, errInfo]) => { + if (!errInfo) + return + + if (!rawErrsMap.has(errFilePath)) + rawErrsMap.set(errFilePath, [errInfo]) + + else + rawErrsMap.get(errFilePath)?.push(errInfo) + }) + return rawErrsMap +} diff --git a/packages/vitest/src/typescript/parser.ts b/packages/vitest/src/typescript/parser.ts new file mode 100644 index 000000000000..72d0926debcf --- /dev/null +++ b/packages/vitest/src/typescript/parser.ts @@ -0,0 +1,130 @@ +import { execaCommand } from 'execa' +import mm from 'micromatch' +import { resolve } from 'pathe' +import type { Awaitable, ParsedStack, TscErrorInfo } from '../types' +import { TYPECHECK_ERROR } from './constants' +import { getRawErrsMapFromTsCompile, getTsconfigPath } from './parse' + +interface OutputOptions { + watch: boolean + root: string + include: string[] + checker: 'tsc' | 'vue-tsc' +} + +const originSymbol = Symbol('typechecker:origin') + +export class TypeCheckError extends Error { + [TYPECHECK_ERROR] = true; + [originSymbol] = 'test' + stacks: ParsedStack[] = [] + + constructor(public message: string, origin: 'test' | 'source') { + super(message) + this[originSymbol] = origin + } + + getOrigin() { + return this[originSymbol] + } +} + +interface SuiteError { + path: string + originalError: TscErrorInfo + error: TypeCheckError +} + +type Callback = []> = (...args: Args) => Awaitable // TODO + +export class Typechecker { + private _onParseStart?: Callback + private _onParseEnd?: Callback<[SuiteError[]]> + private _onWatcherRerun?: Callback + + constructor(private options: OutputOptions) {} + + public onParseStart(fn: Callback) { + this._onParseStart = fn + } + + public onParseEnd(fn: Callback<[SuiteError[]]>) { + this._onParseEnd = fn + } + + public onWatcherRerun(fn: Callback) { + this._onWatcherRerun = fn + } + + private async parse(output: string): Promise { + // check tsc or vue-tsc installed + const errorsMap = await getRawErrsMapFromTsCompile(output) + const errorsList: SuiteError[] = [] + const pattern = ['**/*.test-d.ts'] + const testFiles = new Set(mm([...errorsMap.keys()], pattern)) + errorsMap.forEach((errors, path) => { + const filepath = resolve(this.options.root, path) + const suiteErrors = errors.map((info) => { + const limit = Error.stackTraceLimit + Error.stackTraceLimit = 0 + const origin = testFiles.has(path) ? 'test' : 'source' + const error = new TypeCheckError(info.errMsg, origin) + Error.stackTraceLimit = limit + error.stacks = [ + { + file: filepath, + line: info.line, + column: info.column, + method: '', // TODO, build error based on method + sourcePos: { + line: info.line, + column: info.column, + }, + }, + ] + return { + error, + path, + originalError: info, + } + }) + errorsList.push(...suiteErrors) + }) + return errorsList + } + + public async start() { + const tmpConfigPath = await getTsconfigPath(this.options.root) + let cmd = `${this.options.checker} --noEmit --pretty false -p ${tmpConfigPath}` + if (this.options.watch) + cmd += ' --watch' + let output = '' + const stdout = execaCommand(cmd, { + cwd: this.options.root, + stdout: 'pipe', + reject: false, + }) + await this._onParseStart?.() + let rerunTriggered = false + stdout.stdout?.on('data', (chunk) => { + output += chunk + if (!this.options.watch) + return + if (output.includes('File change detected') && !rerunTriggered) { + this._onWatcherRerun?.() + rerunTriggered = true + } + if (/Found \w+ errors. Watching for/.test(output)) { + rerunTriggered = false + this.parse(output).then((errors) => { + this._onParseEnd?.(errors) + }) + output = '' + } + }) + if (!this.options.watch) { + await stdout + await this._onParseEnd?.(await this.parse(output)) + } + } +} diff --git a/packages/vitest/src/typescript/types.ts b/packages/vitest/src/typescript/types.ts new file mode 100644 index 000000000000..0ba25f5f1139 --- /dev/null +++ b/packages/vitest/src/typescript/types.ts @@ -0,0 +1,25 @@ +export type RawErrsMap = Map +export interface TscErrorInfo { + filePath: string + errCode: number + errMsg: string + line: number + column: number +} +export interface CollectLineNumbers { + target: number + next: number + prev?: number +} +export type CollectLines = { + [key in keyof CollectLineNumbers]: string +} +export interface RootAndTarget { + root: string + targetAbsPath: string +} +export type Context = RootAndTarget & { + rawErrsMap: RawErrsMap + openedDirs: Set + lastActivePath?: string +} diff --git a/packages/vitest/src/typescript/utils.ts b/packages/vitest/src/typescript/utils.ts new file mode 100644 index 000000000000..88a0c7e9a557 --- /dev/null +++ b/packages/vitest/src/typescript/utils.ts @@ -0,0 +1,157 @@ +/** + * https://github.com/mmkal/expect-type/blob/14cd7e2262ca99b793b6cfedd18015103614393f/src/index.ts + */ + +export type Not = T extends true ? false : true +export type Or = Types[number] extends false ? false : true +export type And = Types[number] extends true ? true : false +export type Eq = Left extends true ? Right : Not +export type Xor = Not> + +const secret = Symbol('secret') +type Secret = typeof secret + +export type IsNever = [T] extends [never] ? true : false +export type IsAny = [T] extends [Secret] ? Not> : false +export type IsUnknown = [unknown] extends [T] ? Not> : false +export type IsNeverOrAny = Or<[IsNever, IsAny]> + +/** + * Recursively walk a type and replace it with a branded type related to the original. This is useful for + * equality-checking stricter than `A extends B ? B extends A ? true : false : false`, because it detects + * the difference between a few edge-case types that vanilla typescript doesn't by default: + * - `any` vs `unknown` + * - `{ readonly a: string }` vs `{ a: string }` + * - `{ a?: string }` vs `{ a: string | undefined }` + */ +export type DeepBrand = IsNever extends true + ? { type: 'never' } + : IsAny extends true + ? { type: 'any' } + : IsUnknown extends true + ? { type: 'unknown' } + : T extends string | number | boolean | symbol | bigint | null | undefined | void + ? { + type: 'primitive' + value: T + } + : T extends new (...args: any[]) => any + ? { + type: 'constructor' + params: ConstructorParams + instance: DeepBrand any>>> + } + : T extends (...args: infer P) => infer R // avoid functions with different params/return values matching + ? { + type: 'function' + params: DeepBrand

+ return: DeepBrand + } + : T extends any[] + ? { + type: 'array' + items: { [K in keyof T]: T[K] } + } + : { + type: 'object' + properties: { [K in keyof T]: DeepBrand } + readonly: ReadonlyKeys + required: RequiredKeys + optional: OptionalKeys + constructorParams: DeepBrand> + } + +export type RequiredKeys = Extract< + { + [K in keyof T]-?: {} extends Pick ? never : K + }[keyof T], + keyof T +> +export type OptionalKeys = Exclude> + +// adapted from some answers to https://github.com/type-challenges/type-challenges/issues?q=label%3A5+label%3Aanswer +// prettier-ignore +export type ReadonlyKeys = Extract<{ + [K in keyof T]-?: ReadonlyEquivalent< + { [_K in K]: T[K] }, + { -readonly [_K in K]: T[K] } + > extends true ? never : K; +}[keyof T], keyof T> + +// prettier-ignore +type ReadonlyEquivalent = Extends< + (() => T extends X ? true : false), + (() => T extends Y ? true : false) +> + +export type Extends = IsNever extends true ? IsNever : L extends R ? true : false +export type StrictExtends = Extends, DeepBrand> + +export type Equal = And<[StrictExtends, StrictExtends]> + +export type Params = Actual extends (...args: infer P) => any ? P : never +export type ConstructorParams = Actual extends new (...args: infer P) => any + ? Actual extends new () => any + ? P | [] + : P + : never + +export type MismatchArgs = Eq extends true ? [] : [never] + +// const createIndexMap = (source: string) => { +// const map = new Map() +// let index = 0 +// let line = 1 +// let column = 1 +// for (const char of source) { +// map.set(`${line}:${column}`, index++) +// if (char === '\n' || char === '\r\n') { +// line++ +// column = 0 +// } +// else { +// column++ +// } +// } +// return map +// } + +// const getTockenChar = (source: string, index: number, offset: number) => { +// let char = source[index += offset] +// while (index >= 0 && /\s/.test(char)) { +// index += offset +// char = source[index] +// } +// return char +// } + +// const getTockenIndex = (source: string, index: number, offset: number, char: string) => { +// let currentChar = source[index] +// while (index >= 0 && currentChar !== char) { +// index += offset +// currentChar = source[index] +// } +// return index +// } + +// const getMethod = (source: string, index: number): string | null => { +// if (index == null) +// return null +// const prevChar = getTockenChar(source, index, -1) +// // .toBe() +// // ^~~~~~ +// if (prevChar === '.') { +// const [method] = source.slice(index).match(/[^<(]+/) || [] +// return method +// } +// // .toBe(value) +// // ^~~~~~ +// const startIndex = getTockenIndex(source, index, -1, '.') +// const [method] = source.slice(startIndex + 1).replace(/\s*/, '').match(/[^<(]+/) || [] +// // toBe(value) case -> method = Some> +// // toBe(value) case -> method = Some> +// if (!method.includes('>')) +// return method +// const closestNonTypeDot = getTockenIndex(source, startIndex, -1, '<') +// return getMethod(source, closestNonTypeDot) +// } diff --git a/packages/vitest/src/utils/tasks.ts b/packages/vitest/src/utils/tasks.ts index ee56ef0aac31..3e9677334395 100644 --- a/packages/vitest/src/utils/tasks.ts +++ b/packages/vitest/src/utils/tasks.ts @@ -1,11 +1,11 @@ -import type { Arrayable, Benchmark, Suite, Task, Test } from '../types' +import type { Arrayable, Benchmark, Suite, Task, Test, TypeCheck } from '../types' import { toArray } from './base' -function isAtomTest(s: Task): s is Test | Benchmark { - return (s.type === 'test' || s.type === 'benchmark') +function isAtomTest(s: Task): s is Test | Benchmark | TypeCheck { + return (s.type === 'test' || s.type === 'benchmark' || s.type === 'typecheck') } -export function getTests(suite: Arrayable): (Test | Benchmark)[] { +export function getTests(suite: Arrayable): (Test | Benchmark | TypeCheck)[] { return toArray(suite).flatMap(s => isAtomTest(s) ? [s] : s.tasks.flatMap(c => isAtomTest(c) ? [c] : getTests(c))) } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 099e324c4e39..6e5b552505aa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -779,6 +779,7 @@ importers: '@types/prompts': ^2.4.1 '@types/sinonjs__fake-timers': ^8.1.2 '@vitest/ui': workspace:* + acorn: ^8.8.0 birpc: ^0.2.3 cac: ^6.7.14 chai: ^4.3.6 @@ -791,6 +792,7 @@ importers: fast-glob: ^3.2.12 find-up: ^6.3.0 flatted: ^3.2.7 + get-tsconfig: ^4.2.0 happy-dom: ^6.0.4 jsdom: ^20.0.1 local-pkg: ^0.4.2 @@ -820,6 +822,7 @@ importers: '@types/chai': 4.3.3 '@types/chai-subset': 1.3.3 '@types/node': 18.7.13 + acorn: 8.8.0 chai: 4.3.6 debug: 4.3.4 local-pkg: 0.4.2 @@ -849,6 +852,7 @@ importers: fast-glob: 3.2.12 find-up: 6.3.0 flatted: 3.2.7 + get-tsconfig: 4.2.0 happy-dom: 6.0.4 jsdom: 20.0.1 log-update: 5.0.1 @@ -1078,6 +1082,17 @@ importers: execa: 6.1.0 vitest: link:../../packages/vitest + test/typescript: + specifiers: + typescript: ^4.8.4 + vitest: workspace:* + vue-tsc: ^0.40.13 + dependencies: + vitest: link:../../packages/vitest + devDependencies: + typescript: 4.8.4 + vue-tsc: 0.40.13_typescript@4.8.4 + test/vite-config: specifiers: pathe: ^0.2.0 @@ -6524,6 +6539,44 @@ packages: vue: 2.7.10 dev: true + /@volar/code-gen/0.40.13: + resolution: {integrity: sha512-4gShBWuMce868OVvgyA1cU5WxHbjfEme18Tw6uVMfweZCF5fB2KECG0iPrA9D54vHk3FeHarODNwgIaaFfUBlA==} + dependencies: + '@volar/source-map': 0.40.13 + dev: true + + /@volar/source-map/0.40.13: + resolution: {integrity: sha512-dbdkAB2Nxb0wLjAY5O64o3ywVWlAGONnBIoKAkXSf6qkGZM+nJxcizsoiI66K+RHQG0XqlyvjDizfnTxr+6PWg==} + dependencies: + '@vue/reactivity': 3.2.38 + dev: true + + /@volar/typescript-faster/0.40.13: + resolution: {integrity: sha512-uy+TlcFkKoNlKEnxA4x5acxdxLyVDIXGSc8cYDNXpPKjBKXrQaetzCzlO3kVBqu1VLMxKNGJMTKn35mo+ILQmw==} + dependencies: + semver: 7.3.7 + dev: true + + /@volar/vue-language-core/0.40.13: + resolution: {integrity: sha512-QkCb8msi2KUitTdM6Y4kAb7/ZlEvuLcbBFOC2PLBlFuoZwyxvSP7c/dBGmKGtJlEvMX0LdCyrg5V2aBYxD38/Q==} + dependencies: + '@volar/code-gen': 0.40.13 + '@volar/source-map': 0.40.13 + '@vue/compiler-core': 3.2.39 + '@vue/compiler-dom': 3.2.39 + '@vue/compiler-sfc': 3.2.39 + '@vue/reactivity': 3.2.39 + '@vue/shared': 3.2.39 + dev: true + + /@volar/vue-typescript/0.40.13: + resolution: {integrity: sha512-o7bNztwjs8JmbQjVkrnbZUOfm7q4B8ZYssETISN1tRaBdun6cfNqgpkvDYd+VUBh1O4CdksvN+5BUNnwAz4oCQ==} + dependencies: + '@volar/code-gen': 0.40.13 + '@volar/typescript-faster': 0.40.13 + '@volar/vue-language-core': 0.40.13 + dev: true + /@vue/babel-helper-vue-transform-on/1.0.2: resolution: {integrity: sha512-hz4R8tS5jMn8lDq6iD+yWL6XNB699pGIVLk7WSJnn1dbpjaazsjZQkieJoRX6gW5zpYSCFqQ7jUquPNY65tQYA==} dev: true @@ -6646,6 +6699,12 @@ packages: estree-walker: 2.0.2 magic-string: 0.25.9 + /@vue/reactivity/3.2.38: + resolution: {integrity: sha512-6L4myYcH9HG2M25co7/BSo0skKFHpAN8PhkNPM4xRVkyGl1K5M3Jx4rp5bsYhvYze2K4+l+pioN4e6ZwFLUVtw==} + dependencies: + '@vue/shared': 3.2.38 + dev: true + /@vue/reactivity/3.2.39: resolution: {integrity: sha512-vlaYX2a3qMhIZfrw3Mtfd+BuU+TZmvDrPMa+6lpfzS9k/LnGxkSuf0fhkP0rMGfiOHPtyKoU9OJJJFGm92beVQ==} dependencies: @@ -6700,6 +6759,10 @@ packages: '@vue/shared': 3.2.41 vue: 3.2.41 + /@vue/shared/3.2.38: + resolution: {integrity: sha512-dTyhTIRmGXBjxJE+skC8tTWCGLCVc4wQgRRLt8+O9p5ewBAjoBwtCAkLPrtToSr1xltoe3st21Pv953aOZ7alg==} + dev: true + /@vue/shared/3.2.39: resolution: {integrity: sha512-D3dl2ZB9qE6mTuWPk9RlhDeP1dgNRUKC3NJxji74A4yL8M2MwlhLKUC/49WHjrNzSPug58fWx/yFbaTzGAQSBw==} @@ -18347,6 +18410,12 @@ packages: hasBin: true dev: true + /typescript/4.8.4: + resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + /ufo/0.8.5: resolution: {integrity: sha512-e4+UtA5IRO+ha6hYklwj6r7BjiGMxS0O+UaSg9HbaTefg4kMkzj4tXzEBajRR+wkxf+golgAWKzLbytCUDMJAA==} @@ -19204,6 +19273,17 @@ packages: vue: 2.7.10 dev: true + /vue-tsc/0.40.13_typescript@4.8.4: + resolution: {integrity: sha512-xzuN3g5PnKfJcNrLv4+mAjteMd5wLm5fRhW0034OfNJZY4WhB07vhngea/XeGn7wNYt16r7syonzvW/54dcNiA==} + hasBin: true + peerDependencies: + typescript: '*' + dependencies: + '@volar/vue-language-core': 0.40.13 + '@volar/vue-typescript': 0.40.13 + typescript: 4.8.4 + dev: true + /vue/2.7.10: resolution: {integrity: sha512-HmFC70qarSHPXcKtW8U8fgIkF6JGvjEmDiVInTkKZP0gIlEPhlVlcJJLkdGIDiNkIeA2zJPQTWJUI4iWe+AVfg==} dependencies: diff --git a/test/typescript/package.json b/test/typescript/package.json new file mode 100644 index 000000000000..e719b6132d68 --- /dev/null +++ b/test/typescript/package.json @@ -0,0 +1,13 @@ +{ + "scripts": { + "test": "vitest typecheck", + "tsc": "vue-tsc --watch --pretty false --noEmit" + }, + "dependencies": { + "vitest": "workspace:*" + }, + "devDependencies": { + "typescript": "^4.8.4", + "vue-tsc": "^0.40.13" + } +} \ No newline at end of file diff --git a/test/typescript/test.test-d.ts b/test/typescript/test.test-d.ts new file mode 100644 index 000000000000..9d799a087ea8 --- /dev/null +++ b/test/typescript/test.test-d.ts @@ -0,0 +1,33 @@ +import { expectTypeOf } from 'vitest' + +namespace Test { + export type Some = 'some' +} + +interface Thor { + 'name.first': string + 'name.first.second.third': string +} + +expectTypeOf(45).toBe(60) +expectTypeOf(45).toBe(80) +expectTypeOf(45).toBe(80) + +const test = { + 'name.first': { + name: 'Thor', + }, +} + +expectTypeOf(45) + // test + .toBe(45) + +expectTypeOf(45).toBeNever() +expectTypeOf('hren').toBe(45) +expectTypeOf({ wolk: 'true' }).toHaveProperty('wol') +expectTypeOf({ wolk: 'true' }).not.toHaveProperty('wol') +expectTypeOf((v): v is boolean => true).asserts.toBe() +expectTypeOf({ wlk: 'true' }).toMatch({ msg: '' }) +expectTypeOf((tut: string) => tut).toBeCallableWith(45) +expectTypeOf(Error).toBeConstructibleWith(test['name.first'].name, { tut: 'hamon' }) diff --git a/test/typescript/tsconfig.tmp.json b/test/typescript/tsconfig.tmp.json new file mode 100644 index 000000000000..de7a8cf37951 --- /dev/null +++ b/test/typescript/tsconfig.tmp.json @@ -0,0 +1,80 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "lib": [ + "esnext", + "dom" + ], + "moduleResolution": "node", + "esModuleInterop": true, + "strict": true, + "strictNullChecks": true, + "resolveJsonModule": true, + "skipDefaultLibCheck": true, + "skipLibCheck": true, + "outDir": "./dist", + "declaration": true, + "inlineSourceMap": true, + "paths": { + "@vitest/ws-client": [ + "./packages/ws-client/src/index.ts" + ], + "@vitest/ui": [ + "./packages/ui/node/index.ts" + ], + "@vitest/browser": [ + "./packages/browser/node/index.ts" + ], + "#types": [ + "./packages/vitest/src/index.ts" + ], + "~/*": [ + "./packages/ui/client/*" + ], + "vitest": [ + "./packages/vitest/src/index.ts" + ], + "vitest/globals": [ + "./packages/vitest/globals.d.ts" + ], + "vitest/node": [ + "./packages/vitest/src/node/index.ts" + ], + "vitest/config": [ + "./packages/vitest/src/config.ts" + ], + "vitest/browser": [ + "./packages/vitest/src/browser.ts" + ], + "vite-node": [ + "./packages/vite-node/src/index.ts" + ], + "vite-node/client": [ + "./packages/vite-node/src/client.ts" + ], + "vite-node/server": [ + "./packages/vite-node/src/server.ts" + ], + "vite-node/utils": [ + "./packages/vite-node/src/utils.ts" + ] + }, + "types": [ + "node", + "vite/client" + ], + "emitDeclarationOnly": false, + "incremental": true, + "tsBuildInfoFile": "/Users/sheremet/local-git/vitest/packages/vitest/dist/tsconfig.tmp.tsbuildinfo" + }, + "exclude": [ + "**/dist/**", + "./packages/vitest/dist/**", + "./packages/vitest/*.d.ts", + "./packages/ui/client/**", + "./examples/**/*.*", + "./bench/**", + "./dist" + ] +} \ No newline at end of file From 85cfd30161dba29762346dffcf638f4f2faea9d0 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sat, 1 Oct 2022 15:00:14 +0200 Subject: [PATCH 02/33] chore: cleanup --- packages/vitest/src/defaults.ts | 1 + packages/vitest/src/node/config.ts | 5 + packages/vitest/src/node/core.ts | 63 +++----- packages/vitest/src/node/reporters/base.ts | 4 +- packages/vitest/src/node/reporters/default.ts | 4 +- packages/vitest/src/types/config.ts | 1 + packages/vitest/src/types/reporter.ts | 2 +- packages/vitest/src/typescript/parser.ts | 138 +++++++++++++----- test/typescript/some-type.ts | 2 + test/typescript/test.test-d.ts | 8 +- test/typescript/vitest.config.ts | 9 ++ 11 files changed, 144 insertions(+), 93 deletions(-) create mode 100644 test/typescript/some-type.ts create mode 100644 test/typescript/vitest.config.ts diff --git a/packages/vitest/src/defaults.ts b/packages/vitest/src/defaults.ts index eef094aebfa7..8bb4d43ad9f3 100644 --- a/packages/vitest/src/defaults.ts +++ b/packages/vitest/src/defaults.ts @@ -91,6 +91,7 @@ const config = { typecheck: { checker: 'tsc' as const, include: ['**/*.test-d.ts'], + exclude: defaultExclude, }, } diff --git a/packages/vitest/src/node/config.ts b/packages/vitest/src/node/config.ts index 9974195fafa7..c12c7ad29dcb 100644 --- a/packages/vitest/src/node/config.ts +++ b/packages/vitest/src/node/config.ts @@ -234,5 +234,10 @@ export function resolveConfig( ...resolved.typecheck, } + if (mode === 'typecheck') { + resolved.include = resolved.typecheck.include + resolved.exclude = resolved.typecheck.exclude + } + return resolved } diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 07394151568b..1af34208d607 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -7,7 +7,7 @@ import mm from 'micromatch' import c from 'picocolors' import { ViteNodeRunner } from 'vite-node/client' import { ViteNodeServer } from 'vite-node/server' -import type { ArgumentsType, CoverageProvider, File, OnServerRestartHandler, Reporter, ResolvedConfig, Task, UserConfig, VitestRunMode } from '../types' +import type { ArgumentsType, CoverageProvider, OnServerRestartHandler, Reporter, ResolvedConfig, UserConfig, VitestRunMode } from '../types' import { SnapshotManager } from '../integrations/snapshot/manager' import { clearTimeout, deepMerge, hasFailed, noop, setTimeout, slash, toArray } from '../utils' import { getCoverageProvider } from '../integrations/coverage' @@ -153,55 +153,34 @@ export class Vitest { } async typecheck() { + const testsFilesList = await this.globTestFiles() const checker = new Typechecker({ root: this.config.root, watch: this.config.watch, - ...this.config.typecheck, + files: testsFilesList, + checker: this.config.typecheck.checker, }) - checker.onParseEnd(async (errors) => { - const testErrors = errors.filter(({ error }) => error.getOrigin() === 'test') - const sourceErrors = errors.filter(({ error }) => error.getOrigin() === 'source') - const testFiles = testErrors.reduce((acc, { path, error }, idx) => { - if (!acc[path]) { - // TODO parse code to constuct actual suite, - // currently doesn't support describe and test - acc[path] = { - type: 'suite', - filepath: path, - tasks: [], - id: path, - name: path, - mode: 'run', - result: { - state: 'fail', - }, - } - } - const task: Task = { - type: 'typecheck', - id: idx.toString(), - name: `error expect ${idx + 1}`, - mode: 'run', - file: acc[path], - result: { - state: 'fail', - error, - }, - } - acc[path].tasks.push(task) - return acc - }, {} as Record) - await this.report('onFinished', Object.values(testFiles)) // TODO optimize without map -> array -> obj -> array - if (sourceErrors.length) // TODO move on top of summary - await this.logger.printSourceTypeErrors(sourceErrors.map(({ error }) => error)) + checker.onParseEnd(async ({ files, sourceErrors }) => { + await this.report('onFinished', files) + if (sourceErrors.length) { + process.exitCode = 1 + await this.logger.printSourceTypeErrors(sourceErrors) + } + if (this.config.watch) { + await this.report('onWatcherStart', files, [ + ...sourceErrors, + this.state.getUnhandledErrors(), + ]) + } }) checker.onParseStart(async () => { await this.report('onInit', this) - // TODO start spinner "Typechecking..." + this.logger.log(c.cyan('Typechecking...')) // TODO show list of test files? + }) + checker.onWatcherRerun(async () => { + const { files } = checker.getResult() + this.report('onWatcherRerun', files.map(f => f.filepath), 'File change detected. Triggering rerun.') }) - // checker.onWatcherRerun(() => { - // console.log('reruning watcher') - // }) await checker.start() } diff --git a/packages/vitest/src/node/reporters/base.ts b/packages/vitest/src/node/reporters/base.ts index 15be85749009..5ee5499b141d 100644 --- a/packages/vitest/src/node/reporters/base.ts +++ b/packages/vitest/src/node/reporters/base.ts @@ -93,11 +93,9 @@ export abstract class BaseReporter implements Reporter { } } - async onWatcherStart() { + async onWatcherStart(files = this.ctx.state.getFiles(), errors = this.ctx.state.getUnhandledErrors()) { this.resetLastRunLog() - const files = this.ctx.state.getFiles() - const errors = this.ctx.state.getUnhandledErrors() const failed = errors.length > 0 || hasFailed(files) const failedSnap = hasFailedSnapshot(files) if (failed) diff --git a/packages/vitest/src/node/reporters/default.ts b/packages/vitest/src/node/reporters/default.ts index 403610916197..2947033432ed 100644 --- a/packages/vitest/src/node/reporters/default.ts +++ b/packages/vitest/src/node/reporters/default.ts @@ -36,9 +36,9 @@ export class DefaultReporter extends BaseReporter { await super.onFinished(files, errors) } - async onWatcherStart() { + async onWatcherStart(files = this.ctx.state.getFiles(), errors = this.ctx.state.getUnhandledErrors()) { await this.stopListRender() - await super.onWatcherStart() + await super.onWatcherStart(files, errors) } async stopListRender() { diff --git a/packages/vitest/src/types/config.ts b/packages/vitest/src/types/config.ts index b33ef28dbc9e..d648d3224ccf 100644 --- a/packages/vitest/src/types/config.ts +++ b/packages/vitest/src/types/config.ts @@ -450,6 +450,7 @@ export interface InlineConfig { export interface TypecheckConfig { checker: 'tsc' | 'vue-tsc' include: string[] + exclude: string[] } export interface UserConfig extends InlineConfig { diff --git a/packages/vitest/src/types/reporter.ts b/packages/vitest/src/types/reporter.ts index f2edcf31f65e..9eb6b2b1292a 100644 --- a/packages/vitest/src/types/reporter.ts +++ b/packages/vitest/src/types/reporter.ts @@ -10,7 +10,7 @@ export interface Reporter { onTaskUpdate?: (packs: TaskResultPack[]) => Awaitable onTestRemoved?: (trigger?: string) => Awaitable - onWatcherStart?: () => Awaitable + onWatcherStart?: (files?: File[], errors?: unknown[]) => Awaitable onWatcherRerun?: (files: string[], trigger?: string) => Awaitable onServerRestart?: (reason?: string) => Awaitable diff --git a/packages/vitest/src/typescript/parser.ts b/packages/vitest/src/typescript/parser.ts index 72d0926debcf..2aceb3fd82f6 100644 --- a/packages/vitest/src/typescript/parser.ts +++ b/packages/vitest/src/typescript/parser.ts @@ -1,54 +1,50 @@ import { execaCommand } from 'execa' -import mm from 'micromatch' -import { resolve } from 'pathe' -import type { Awaitable, ParsedStack, TscErrorInfo } from '../types' +import { relative, resolve } from 'pathe' +import type { Awaitable, File, ParsedStack, TypeCheck } from '../types' import { TYPECHECK_ERROR } from './constants' import { getRawErrsMapFromTsCompile, getTsconfigPath } from './parse' interface OutputOptions { watch: boolean root: string - include: string[] - checker: 'tsc' | 'vue-tsc' + checker: string + files: string[] } -const originSymbol = Symbol('typechecker:origin') - export class TypeCheckError extends Error { - [TYPECHECK_ERROR] = true; - [originSymbol] = 'test' + [TYPECHECK_ERROR] = true stacks: ParsedStack[] = [] + name = 'TypeCheckError' - constructor(public message: string, origin: 'test' | 'source') { + constructor(public message: string) { super(message) - this[originSymbol] = origin - } - - getOrigin() { - return this[originSymbol] } } -interface SuiteError { - path: string - originalError: TscErrorInfo - error: TypeCheckError +interface ErrorsCache { + files: File[] + sourceErrors: TypeCheckError[] } -type Callback = []> = (...args: Args) => Awaitable // TODO +type Callback = []> = (...args: Args) => Awaitable export class Typechecker { private _onParseStart?: Callback - private _onParseEnd?: Callback<[SuiteError[]]> + private _onParseEnd?: Callback<[ErrorsCache]> private _onWatcherRerun?: Callback + private _result: ErrorsCache = { + files: [], + sourceErrors: [], + } + constructor(private options: OutputOptions) {} public onParseStart(fn: Callback) { this._onParseStart = fn } - public onParseEnd(fn: Callback<[SuiteError[]]>) { + public onParseEnd(fn: Callback<[ErrorsCache]>) { this._onParseEnd = fn } @@ -56,19 +52,76 @@ export class Typechecker { this._onWatcherRerun = fn } - private async parse(output: string): Promise { - // check tsc or vue-tsc installed + protected async prepareResults(output: string) { + const typeErrors = await this.parseTscLikeOutput(output) + const testFiles = new Set(this.options.files.map(f => relative(this.options.root, f))) + + const files: File[] = [] + + testFiles.forEach((path) => { // TODO parse files to create tasks + const errors = typeErrors.get(path) + const suite: File = { + type: 'suite', + filepath: path, + tasks: [], + id: path, + name: path, + mode: 'run', + } + if (!errors) { + return files.push({ + ...suite, + result: { + state: 'pass', + }, + }) + } + const tasks = errors.map((error, idx) => { + const task: TypeCheck = { + type: 'typecheck', + id: idx.toString(), + name: `error expect ${idx + 1}`, + mode: 'run', + file: suite, + suite, + result: { + state: 'fail', + error, + }, + } + return task + }) + suite.tasks = tasks + files.push({ + ...suite, + result: { + state: 'fail', + }, + }) + }) + + const sourceErrors: TypeCheckError[] = [] + + typeErrors.forEach((errors, path) => { + if (!testFiles.has(path)) + sourceErrors.push(...errors) + }) + + return { + files, + sourceErrors, + } + } + + protected async parseTscLikeOutput(output: string) { const errorsMap = await getRawErrsMapFromTsCompile(output) - const errorsList: SuiteError[] = [] - const pattern = ['**/*.test-d.ts'] - const testFiles = new Set(mm([...errorsMap.keys()], pattern)) + const typesErrors = new Map() errorsMap.forEach((errors, path) => { const filepath = resolve(this.options.root, path) const suiteErrors = errors.map((info) => { const limit = Error.stackTraceLimit Error.stackTraceLimit = 0 - const origin = testFiles.has(path) ? 'test' : 'source' - const error = new TypeCheckError(info.errMsg, origin) + const error = new TypeCheckError(info.errMsg) Error.stackTraceLimit = limit error.stacks = [ { @@ -82,18 +135,15 @@ export class Typechecker { }, }, ] - return { - error, - path, - originalError: info, - } + return error }) - errorsList.push(...suiteErrors) + typesErrors.set(path, suiteErrors) }) - return errorsList + return typesErrors } public async start() { + // check tsc or vue-tsc installed const tmpConfigPath = await getTsconfigPath(this.options.root) let cmd = `${this.options.checker} --noEmit --pretty false -p ${tmpConfigPath}` if (this.options.watch) @@ -112,11 +162,16 @@ export class Typechecker { return if (output.includes('File change detected') && !rerunTriggered) { this._onWatcherRerun?.() + this._result = { + sourceErrors: [], + files: [], + } rerunTriggered = true } - if (/Found \w+ errors. Watching for/.test(output)) { + if (/Found \w+ errors*. Watching for/.test(output)) { rerunTriggered = false - this.parse(output).then((errors) => { + this.prepareResults(output).then((errors) => { + this._result = errors this._onParseEnd?.(errors) }) output = '' @@ -124,7 +179,12 @@ export class Typechecker { }) if (!this.options.watch) { await stdout - await this._onParseEnd?.(await this.parse(output)) + this._result = await this.prepareResults(output) + await this._onParseEnd?.(this._result) } } + + public getResult() { + return this._result + } } diff --git a/test/typescript/some-type.ts b/test/typescript/some-type.ts new file mode 100644 index 000000000000..7d865a838c39 --- /dev/null +++ b/test/typescript/some-type.ts @@ -0,0 +1,2 @@ +const variable: () => number = () => 'some stirng' +variable() diff --git a/test/typescript/test.test-d.ts b/test/typescript/test.test-d.ts index 9d799a087ea8..8a45fc52e020 100644 --- a/test/typescript/test.test-d.ts +++ b/test/typescript/test.test-d.ts @@ -1,15 +1,11 @@ import { expectTypeOf } from 'vitest' -namespace Test { - export type Some = 'some' -} - interface Thor { 'name.first': string 'name.first.second.third': string } -expectTypeOf(45).toBe(60) +expectTypeOf(45).toBe(45) expectTypeOf(45).toBe(80) expectTypeOf(45).toBe(80) @@ -23,7 +19,7 @@ expectTypeOf(45) // test .toBe(45) -expectTypeOf(45).toBeNever() +expectTypeOf().toBeNever() expectTypeOf('hren').toBe(45) expectTypeOf({ wolk: 'true' }).toHaveProperty('wol') expectTypeOf({ wolk: 'true' }).not.toHaveProperty('wol') diff --git a/test/typescript/vitest.config.ts b/test/typescript/vitest.config.ts new file mode 100644 index 000000000000..7e7835d9c80e --- /dev/null +++ b/test/typescript/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + typecheck: { + checker: 'vue-tsc', + }, + }, +}) From 0545617e293a0a8affa456a983de88ec5154709f Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sat, 1 Oct 2022 15:15:52 +0200 Subject: [PATCH 03/33] chore: cleanup --- packages/vitest/src/node/core.ts | 7 +----- packages/vitest/src/node/reporters/base.ts | 5 +++- packages/vitest/src/node/stdin.ts | 11 ++++++--- packages/vitest/src/typescript/parse.ts | 4 ---- packages/vitest/src/typescript/parser.ts | 27 ++++++++-------------- 5 files changed, 23 insertions(+), 31 deletions(-) diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 1af34208d607..6c5b7179926e 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -154,12 +154,7 @@ export class Vitest { async typecheck() { const testsFilesList = await this.globTestFiles() - const checker = new Typechecker({ - root: this.config.root, - watch: this.config.watch, - files: testsFilesList, - checker: this.config.typecheck.checker, - }) + const checker = new Typechecker(this, testsFilesList) checker.onParseEnd(async ({ files, sourceErrors }) => { await this.report('onFinished', files) if (sourceErrors.length) { diff --git a/packages/vitest/src/node/reporters/base.ts b/packages/vitest/src/node/reporters/base.ts index 5ee5499b141d..6c2e54f4b44a 100644 --- a/packages/vitest/src/node/reporters/base.ts +++ b/packages/vitest/src/node/reporters/base.ts @@ -103,7 +103,10 @@ export abstract class BaseReporter implements Reporter { else this.ctx.logger.log(WAIT_FOR_CHANGE_PASS) - const hints = [HELP_HINT] + const hints = [] + // TODO typecheck doesn't support these for now + if (this.mode !== 'typecheck') + hints.push(HELP_HINT) if (failedSnap) hints.unshift(HELP_UPDATE_SNAP) else diff --git a/packages/vitest/src/node/stdin.ts b/packages/vitest/src/node/stdin.ts index b4bd5e3d7d5f..6ffccf9355bc 100644 --- a/packages/vitest/src/node/stdin.ts +++ b/packages/vitest/src/node/stdin.ts @@ -36,6 +36,14 @@ export function registerConsoleShortcuts(ctx: Vitest) { const name = key?.name + // quit + if (name === 'q') + return ctx.exit(true) + + // TODO typechecking doesn't shortcuts this yet + if (ctx.mode === 'typecheck') + return + // help if (name === 'h') return printShortcutsHelp() @@ -54,9 +62,6 @@ export function registerConsoleShortcuts(ctx: Vitest) { // change fileNamePattern if (name === 'p') return inputFilePattern() - // quit - if (name === 'q') - return ctx.exit(true) } async function keypressHandler(str: string, key: any) { diff --git a/packages/vitest/src/typescript/parse.ts b/packages/vitest/src/typescript/parse.ts index 71da7783cf1f..33d99b7bb483 100644 --- a/packages/vitest/src/typescript/parse.ts +++ b/packages/vitest/src/typescript/parse.ts @@ -1,7 +1,3 @@ -// tsc --noEmit --pretty false -// include - show like regular errors -// exclude - show like tsc errors - import path from 'node:path' import url from 'node:url' import { writeFile } from 'node:fs/promises' diff --git a/packages/vitest/src/typescript/parser.ts b/packages/vitest/src/typescript/parser.ts index 2aceb3fd82f6..0f0f1c1349d6 100644 --- a/packages/vitest/src/typescript/parser.ts +++ b/packages/vitest/src/typescript/parser.ts @@ -1,16 +1,9 @@ import { execaCommand } from 'execa' import { relative, resolve } from 'pathe' -import type { Awaitable, File, ParsedStack, TypeCheck } from '../types' +import type { Awaitable, File, ParsedStack, TypeCheck, Vitest } from '../types' import { TYPECHECK_ERROR } from './constants' import { getRawErrsMapFromTsCompile, getTsconfigPath } from './parse' -interface OutputOptions { - watch: boolean - root: string - checker: string - files: string[] -} - export class TypeCheckError extends Error { [TYPECHECK_ERROR] = true stacks: ParsedStack[] = [] @@ -38,7 +31,7 @@ export class Typechecker { sourceErrors: [], } - constructor(private options: OutputOptions) {} + constructor(protected ctx: Vitest, protected files: string[]) {} public onParseStart(fn: Callback) { this._onParseStart = fn @@ -54,7 +47,7 @@ export class Typechecker { protected async prepareResults(output: string) { const typeErrors = await this.parseTscLikeOutput(output) - const testFiles = new Set(this.options.files.map(f => relative(this.options.root, f))) + const testFiles = new Set(this.files.map(f => relative(this.ctx.config.root, f))) const files: File[] = [] @@ -117,7 +110,7 @@ export class Typechecker { const errorsMap = await getRawErrsMapFromTsCompile(output) const typesErrors = new Map() errorsMap.forEach((errors, path) => { - const filepath = resolve(this.options.root, path) + const filepath = resolve(this.ctx.config.root, path) const suiteErrors = errors.map((info) => { const limit = Error.stackTraceLimit Error.stackTraceLimit = 0 @@ -144,13 +137,13 @@ export class Typechecker { public async start() { // check tsc or vue-tsc installed - const tmpConfigPath = await getTsconfigPath(this.options.root) - let cmd = `${this.options.checker} --noEmit --pretty false -p ${tmpConfigPath}` - if (this.options.watch) + const tmpConfigPath = await getTsconfigPath(this.ctx.config.root) + let cmd = `${this.ctx.config.typecheck.checker} --noEmit --pretty false -p ${tmpConfigPath}` + if (this.ctx.config.watch) cmd += ' --watch' let output = '' const stdout = execaCommand(cmd, { - cwd: this.options.root, + cwd: this.ctx.config.root, stdout: 'pipe', reject: false, }) @@ -158,7 +151,7 @@ export class Typechecker { let rerunTriggered = false stdout.stdout?.on('data', (chunk) => { output += chunk - if (!this.options.watch) + if (!this.ctx.config.watch) return if (output.includes('File change detected') && !rerunTriggered) { this._onWatcherRerun?.() @@ -177,7 +170,7 @@ export class Typechecker { output = '' } }) - if (!this.options.watch) { + if (!this.ctx.config.watch) { await stdout this._result = await this.prepareResults(output) await this._onParseEnd?.(this._result) From dce747378ed64032d2b947a26df69c68929b7b05 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sat, 1 Oct 2022 19:05:20 +0200 Subject: [PATCH 04/33] chore: parse test file to build suite tree --- packages/vitest/package.json | 1 + packages/vitest/src/node/core.ts | 2 +- .../src/node/reporters/benchmark/json.ts | 2 +- packages/vitest/src/node/stdin.ts | 2 +- packages/vitest/src/typescript/parser.ts | 231 +++++++++++++++--- packages/vitest/src/typescript/utils.ts | 34 +-- pnpm-lock.yaml | 3 +- test/typescript/some-type.ts | 4 +- test/typescript/test.test-d.ts | 53 ++-- 9 files changed, 248 insertions(+), 84 deletions(-) diff --git a/packages/vitest/package.json b/packages/vitest/package.json index cc85a32fda1b..44b0652b6836 100644 --- a/packages/vitest/package.json +++ b/packages/vitest/package.json @@ -109,6 +109,7 @@ "@types/chai-subset": "^1.3.3", "@types/node": "*", "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", "chai": "^4.3.6", "debug": "^4.3.4", "local-pkg": "^0.4.2", diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 6c5b7179926e..6cc1e9f87339 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -164,7 +164,7 @@ export class Vitest { if (this.config.watch) { await this.report('onWatcherStart', files, [ ...sourceErrors, - this.state.getUnhandledErrors(), + ...this.state.getUnhandledErrors(), ]) } }) diff --git a/packages/vitest/src/node/reporters/benchmark/json.ts b/packages/vitest/src/node/reporters/benchmark/json.ts index 7f9af4376e0d..35eeaf0a0322 100644 --- a/packages/vitest/src/node/reporters/benchmark/json.ts +++ b/packages/vitest/src/node/reporters/benchmark/json.ts @@ -34,7 +34,7 @@ export class JsonReporter implements Reporter { continue if (!outputFile) res.samples = 'ignore on terminal' as any - testResults[test.suite.name] = (testResults[test.suite.name] || []).concat(res) + testResults[test.suite!.name] = (testResults[test.suite!.name] || []).concat(res) } if (tests.some(t => t.result?.state === 'run')) { diff --git a/packages/vitest/src/node/stdin.ts b/packages/vitest/src/node/stdin.ts index 6ffccf9355bc..667157fe76da 100644 --- a/packages/vitest/src/node/stdin.ts +++ b/packages/vitest/src/node/stdin.ts @@ -40,7 +40,7 @@ export function registerConsoleShortcuts(ctx: Vitest) { if (name === 'q') return ctx.exit(true) - // TODO typechecking doesn't shortcuts this yet + // TODO typechecking doesn't support shortcuts this yet if (ctx.mode === 'typecheck') return diff --git a/packages/vitest/src/typescript/parser.ts b/packages/vitest/src/typescript/parser.ts index 0f0f1c1349d6..de37dfb21751 100644 --- a/packages/vitest/src/typescript/parser.ts +++ b/packages/vitest/src/typescript/parser.ts @@ -1,8 +1,14 @@ +import { readFile } from 'fs/promises' import { execaCommand } from 'execa' -import { relative, resolve } from 'pathe' -import type { Awaitable, File, ParsedStack, TypeCheck, Vitest } from '../types' +import { resolve } from 'pathe' +import { parse as parseAst } from 'acorn' +import { ancestor as walkAst } from 'acorn-walk' +import type { RawSourceMap } from 'vite-node' +import { SourceMapConsumer } from 'source-map-js' +import type { Awaitable, File, ParsedStack, Suite, TscErrorInfo, Vitest } from '../types' import { TYPECHECK_ERROR } from './constants' import { getRawErrsMapFromTsCompile, getTsconfigPath } from './parse' +import { createIndexMap } from './utils' export class TypeCheckError extends Error { [TYPECHECK_ERROR] = true @@ -19,6 +25,34 @@ interface ErrorsCache { sourceErrors: TypeCheckError[] } +interface ParsedFile extends File { + start: number + end: number +} + +interface ParsedSuite extends Suite { + start: number + end: number +} + +interface LocalCallDefinition { + start: number + end: number + name: string + type: string + mode: 'run' | 'skip' | 'only' | 'todo' + task: ParsedSuite | ParsedFile +} + +interface FileInformation { + file: ParsedFile + content: string + filepath: string + parsed: string + map: RawSourceMap | null + definitions: LocalCallDefinition[] +} + type Callback = []> = (...args: Args) => Awaitable export class Typechecker { @@ -45,51 +79,171 @@ export class Typechecker { this._onWatcherRerun = fn } + protected async parseTestFile(filepath: string): Promise { + const [request, content] = await Promise.all([ + this.ctx.vitenode.transformRequest(filepath), + readFile(filepath, 'utf-8'), + ]) + if (!request) + return null + const ast = parseAst(request.code, { + ecmaVersion: 'latest', + allowAwaitOutsideFunction: true, + }) + const file: ParsedFile = { + filepath, + type: 'suite', + id: '-1', + name: filepath, + mode: 'run', + tasks: [], + start: ast.start, + end: ast.end, + result: { + state: 'pass', + }, + } + const definitions: LocalCallDefinition[] = [] + const getName = (callee: any): string | null => { + if (!callee) + return null + if (callee.type === 'Identifier') + return callee.name + if (callee.type === 'MemberExpression') { + // direct call as `__vite_ssr__.test()` + if (callee.object?.name?.startsWith('__vite_ssr_')) + return getName(callee.property) + return getName(callee.object?.property) + } + return null + } + walkAst(ast, { + CallExpression(node) { + const { callee } = node as any + const name = getName(callee) + if (!name) + return + if (!['it', 'test', 'describe', 'suite'].includes(name)) + return + const { arguments: [{ value: message }] } = node as any + const property = callee?.property?.name + const mode = !property || property === name ? 'run' : property + if (mode === 'each') + throw new Error(`${name}.each syntax is not supported when testing types`) + definitions.push({ + start: node.start, + end: node.end, + name: message, + type: name, + mode, + } as LocalCallDefinition) + }, + }) + let lastSuite: ParsedSuite = file + const getLatestSuite = (index: number) => { + const suite = lastSuite + while (lastSuite !== file && lastSuite.end < index) + lastSuite = suite.suite as ParsedSuite + return lastSuite + } + definitions.sort((a, b) => a.start - b.start).forEach((definition, idx) => { + const latestSuite = getLatestSuite(definition.start) + const state = definition.mode === 'run' ? 'pass' : definition.mode + if (definition.type === 'describe' || definition.type === 'suite') { + const suite: ParsedSuite = { + type: 'suite', + id: idx.toString(), + mode: definition.mode, + name: definition.name, + suite: latestSuite, + tasks: [], + result: { + state, + }, + start: definition.start, + end: definition.end, + } + definition.task = suite + latestSuite.tasks.push(suite) + lastSuite = suite + return + } + const task: ParsedSuite = { + type: 'suite', + id: idx.toString(), + suite: latestSuite, + file, + tasks: [], + mode: definition.mode, + name: definition.name, + end: definition.end, + result: { + state, + }, + start: definition.start, + } + definition.task = task + latestSuite.tasks.push(task) + }) + return { + file, + parsed: request.code, + content, + filepath, + map: request.map as RawSourceMap | null, + definitions, + } + } + protected async prepareResults(output: string) { const typeErrors = await this.parseTscLikeOutput(output) - const testFiles = new Set(this.files.map(f => relative(this.ctx.config.root, f))) + const testFiles = new Set(this.files) + + const sourceDefinitions = (await Promise.all( + this.files.map(filepath => this.parseTestFile(filepath)), + )).reduce((acc, data) => { + if (!data) + return acc + acc[data.filepath] = data + return acc + }, {} as Record) const files: File[] = [] - testFiles.forEach((path) => { // TODO parse files to create tasks + testFiles.forEach((path) => { + const { file, definitions, map, parsed } = sourceDefinitions[path] const errors = typeErrors.get(path) - const suite: File = { - type: 'suite', - filepath: path, - tasks: [], - id: path, - name: path, - mode: 'run', - } - if (!errors) { - return files.push({ - ...suite, - result: { - state: 'pass', - }, - }) - } - const tasks = errors.map((error, idx) => { - const task: TypeCheck = { + files.push(file) + if (!errors) + return files.push(file) + const sortedDefinitions = [...definitions.sort((a, b) => b.start - a.start)] + const mapConsumer = map && new SourceMapConsumer(map) + const indexMap = createIndexMap(parsed) + errors.forEach(({ error, originalError }, idx) => { + const originalPos = mapConsumer?.generatedPositionFor({ + line: originalError.line, + column: originalError.column, + source: path, + }) || originalError + const index = indexMap.get(`${originalPos.line}:${originalPos.column}`) + const definition = index != null && sortedDefinitions.find(def => def.start <= index && def.end >= index) + if (!definition) + return + definition.task.result = { + state: 'fail', + } + definition.task.tasks.push({ type: 'typecheck', id: idx.toString(), name: `error expect ${idx + 1}`, mode: 'run', - file: suite, - suite, + file, + suite: definition.task, result: { state: 'fail', error, }, - } - return task - }) - suite.tasks = tasks - files.push({ - ...suite, - result: { - state: 'fail', - }, + }) }) }) @@ -97,7 +251,7 @@ export class Typechecker { typeErrors.forEach((errors, path) => { if (!testFiles.has(path)) - sourceErrors.push(...errors) + sourceErrors.push(...errors.map(({ error }) => error)) }) return { @@ -108,7 +262,7 @@ export class Typechecker { protected async parseTscLikeOutput(output: string) { const errorsMap = await getRawErrsMapFromTsCompile(output) - const typesErrors = new Map() + const typesErrors = new Map() errorsMap.forEach((errors, path) => { const filepath = resolve(this.ctx.config.root, path) const suiteErrors = errors.map((info) => { @@ -128,9 +282,12 @@ export class Typechecker { }, }, ] - return error + return { + originalError: info, + error, + } }) - typesErrors.set(path, suiteErrors) + typesErrors.set(filepath, suiteErrors) }) return typesErrors } diff --git a/packages/vitest/src/typescript/utils.ts b/packages/vitest/src/typescript/utils.ts index 88a0c7e9a557..5d2ac93684b8 100644 --- a/packages/vitest/src/typescript/utils.ts +++ b/packages/vitest/src/typescript/utils.ts @@ -98,23 +98,23 @@ export type ConstructorParams = Actual extends new (...args: infer P) => export type MismatchArgs = Eq extends true ? [] : [never] -// const createIndexMap = (source: string) => { -// const map = new Map() -// let index = 0 -// let line = 1 -// let column = 1 -// for (const char of source) { -// map.set(`${line}:${column}`, index++) -// if (char === '\n' || char === '\r\n') { -// line++ -// column = 0 -// } -// else { -// column++ -// } -// } -// return map -// } +export const createIndexMap = (source: string) => { + const map = new Map() + let index = 0 + let line = 1 + let column = 1 + for (const char of source) { + map.set(`${line}:${column}`, index++) + if (char === '\n' || char === '\r\n') { + line++ + column = 0 + } + else { + column++ + } + } + return map +} // const getTockenChar = (source: string, index: number, offset: number) => { // let char = source[index += offset] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e5b552505aa..e728ba8183cd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -780,6 +780,7 @@ importers: '@types/sinonjs__fake-timers': ^8.1.2 '@vitest/ui': workspace:* acorn: ^8.8.0 + acorn-walk: ^8.2.0 birpc: ^0.2.3 cac: ^6.7.14 chai: ^4.3.6 @@ -823,6 +824,7 @@ importers: '@types/chai-subset': 1.3.3 '@types/node': 18.7.13 acorn: 8.8.0 + acorn-walk: 8.2.0 chai: 4.3.6 debug: 4.3.4 local-pkg: 0.4.2 @@ -7283,7 +7285,6 @@ packages: /acorn-walk/8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} - dev: true /acorn/6.4.2: resolution: {integrity: sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==} diff --git a/test/typescript/some-type.ts b/test/typescript/some-type.ts index 7d865a838c39..2b4beefad4fd 100644 --- a/test/typescript/some-type.ts +++ b/test/typescript/some-type.ts @@ -1,2 +1,2 @@ -const variable: () => number = () => 'some stirng' -variable() +// const variable: () => number = () => 'some stirng' +// variable() diff --git a/test/typescript/test.test-d.ts b/test/typescript/test.test-d.ts index 8a45fc52e020..bf3657a6d884 100644 --- a/test/typescript/test.test-d.ts +++ b/test/typescript/test.test-d.ts @@ -1,29 +1,34 @@ -import { expectTypeOf } from 'vitest' +import { describe, expectTypeOf, test } from 'vitest' -interface Thor { - 'name.first': string - 'name.first.second.third': string -} +describe('test', () => { + test('some-test', () => { + expectTypeOf(45).toBe('22') + }) -expectTypeOf(45).toBe(45) -expectTypeOf(45).toBe(80) -expectTypeOf(45).toBe(80) + describe('test2', () => { + test('some-test 2', () => { + expectTypeOf(45).toBe(45) + }) + }) +}) -const test = { - 'name.first': { - name: 'Thor', - }, -} +// interface Thor { +// 'name.first': string +// 'name.first.second.third': string +// } -expectTypeOf(45) - // test - .toBe(45) +// expectTypeOf(45).toBe(45) +// expectTypeOf(45).toBe(80) +// expectTypeOf(45).toBe(80) -expectTypeOf().toBeNever() -expectTypeOf('hren').toBe(45) -expectTypeOf({ wolk: 'true' }).toHaveProperty('wol') -expectTypeOf({ wolk: 'true' }).not.toHaveProperty('wol') -expectTypeOf((v): v is boolean => true).asserts.toBe() -expectTypeOf({ wlk: 'true' }).toMatch({ msg: '' }) -expectTypeOf((tut: string) => tut).toBeCallableWith(45) -expectTypeOf(Error).toBeConstructibleWith(test['name.first'].name, { tut: 'hamon' }) +// expectTypeOf(45) +// // test +// .toBe(45) + +// expectTypeOf().toBeNever() +// expectTypeOf('hren').toBe(45) +// expectTypeOf({ wolk: 'true' }).toHaveProperty('wol') +// expectTypeOf({ wolk: 'true' }).not.toHaveProperty('wol') +// expectTypeOf((v): v is boolean => true).asserts.toBe() +// expectTypeOf({ wlk: 'true' }).toMatch({ msg: '' }) +// expectTypeOf((tut: string) => tut).toBeCallableWith(45) From f3da2bf06bd8d0b7015ef033c49998384f06f83c Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sat, 1 Oct 2022 19:34:27 +0200 Subject: [PATCH 05/33] feat: allow checking against js errors --- packages/vitest/src/node/cli.ts | 2 +- packages/vitest/src/node/core.ts | 3 ++- packages/vitest/src/types/config.ts | 1 + packages/vitest/src/typescript/parser.ts | 32 +++++++++++++++--------- test/typescript/js.test-d.js | 5 ++++ test/typescript/package.json | 2 +- test/typescript/test.test-d.ts | 2 +- test/typescript/vitest.config.ts | 5 ++++ 8 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 test/typescript/js.test-d.js diff --git a/packages/vitest/src/node/cli.ts b/packages/vitest/src/node/cli.ts index 2e8f245fa181..cac68e00b67b 100644 --- a/packages/vitest/src/node/cli.ts +++ b/packages/vitest/src/node/cli.ts @@ -97,7 +97,7 @@ async function benchmark(cliFilters: string[], options: CliOptions): Promise { const { files } = checker.getResult() - this.report('onWatcherRerun', files.map(f => f.filepath), 'File change detected. Triggering rerun.') + await this.report('onWatcherRerun', files.map(f => f.filepath), 'File change detected. Triggering rerun.') + this.logger.log(c.cyan('Typechecking...')) // TODO show list of test files? }) await checker.start() } diff --git a/packages/vitest/src/types/config.ts b/packages/vitest/src/types/config.ts index d648d3224ccf..8d1644544ae1 100644 --- a/packages/vitest/src/types/config.ts +++ b/packages/vitest/src/types/config.ts @@ -451,6 +451,7 @@ export interface TypecheckConfig { checker: 'tsc' | 'vue-tsc' include: string[] exclude: string[] + allowJs?: boolean } export interface UserConfig extends InlineConfig { diff --git a/packages/vitest/src/typescript/parser.ts b/packages/vitest/src/typescript/parser.ts index de37dfb21751..b15a8de891e6 100644 --- a/packages/vitest/src/typescript/parser.ts +++ b/packages/vitest/src/typescript/parser.ts @@ -1,11 +1,11 @@ import { readFile } from 'fs/promises' import { execaCommand } from 'execa' -import { resolve } from 'pathe' +import { relative, resolve } from 'pathe' import { parse as parseAst } from 'acorn' import { ancestor as walkAst } from 'acorn-walk' import type { RawSourceMap } from 'vite-node' import { SourceMapConsumer } from 'source-map-js' -import type { Awaitable, File, ParsedStack, Suite, TscErrorInfo, Vitest } from '../types' +import type { Awaitable, File, ParsedStack, Suite, Task, TscErrorInfo, Vitest } from '../types' import { TYPECHECK_ERROR } from './constants' import { getRawErrsMapFromTsCompile, getTsconfigPath } from './parse' import { createIndexMap } from './utils' @@ -94,7 +94,7 @@ export class Typechecker { filepath, type: 'suite', id: '-1', - name: filepath, + name: relative(this.ctx.config.root, filepath), mode: 'run', tasks: [], start: ast.start, @@ -168,6 +168,8 @@ export class Typechecker { lastSuite = suite return } + // expectTypeOf and any type error is actually a "test" ("typecheck"), + // and all "test"s should be inside a "suite" const task: ParsedSuite = { type: 'suite', id: idx.toString(), @@ -208,6 +210,7 @@ export class Typechecker { return acc }, {} as Record) + const sourceErrors: TypeCheckError[] = [] const files: File[] = [] testFiles.forEach((path) => { @@ -226,29 +229,32 @@ export class Typechecker { source: path, }) || originalError const index = indexMap.get(`${originalPos.line}:${originalPos.column}`) - const definition = index != null && sortedDefinitions.find(def => def.start <= index && def.end >= index) - if (!definition) + const definition = (index != null && sortedDefinitions.find(def => def.start <= index && def.end >= index)) || file + if (!definition) { + // to still show even if we messed up + sourceErrors.push(error) return - definition.task.result = { - state: 'fail', } - definition.task.tasks.push({ + const suite = 'task' in definition ? definition.task : definition + const task: Task = { type: 'typecheck', id: idx.toString(), name: `error expect ${idx + 1}`, mode: 'run', file, - suite: definition.task, + suite, result: { state: 'fail', error, }, - }) + } + suite.result = { + state: 'fail', + } + suite.tasks.push(task) }) }) - const sourceErrors: TypeCheckError[] = [] - typeErrors.forEach((errors, path) => { if (!testFiles.has(path)) sourceErrors.push(...errors.map(({ error }) => error)) @@ -298,6 +304,8 @@ export class Typechecker { let cmd = `${this.ctx.config.typecheck.checker} --noEmit --pretty false -p ${tmpConfigPath}` if (this.ctx.config.watch) cmd += ' --watch' + if (this.ctx.config.typecheck.allowJs) + cmd += ' --allowJs --checkJs' let output = '' const stdout = execaCommand(cmd, { cwd: this.ctx.config.root, diff --git a/test/typescript/js.test-d.js b/test/typescript/js.test-d.js new file mode 100644 index 000000000000..91804350107b --- /dev/null +++ b/test/typescript/js.test-d.js @@ -0,0 +1,5 @@ +// @ts-check + +import { expectTypeOf } from 'vitest' + +expectTypeOf(1).toBe('string') diff --git a/test/typescript/package.json b/test/typescript/package.json index e719b6132d68..081ae147731a 100644 --- a/test/typescript/package.json +++ b/test/typescript/package.json @@ -1,7 +1,7 @@ { "scripts": { "test": "vitest typecheck", - "tsc": "vue-tsc --watch --pretty false --noEmit" + "tsc": "tsc --watch --pretty false --noEmit" }, "dependencies": { "vitest": "workspace:*" diff --git a/test/typescript/test.test-d.ts b/test/typescript/test.test-d.ts index bf3657a6d884..555b50c90683 100644 --- a/test/typescript/test.test-d.ts +++ b/test/typescript/test.test-d.ts @@ -2,7 +2,7 @@ import { describe, expectTypeOf, test } from 'vitest' describe('test', () => { test('some-test', () => { - expectTypeOf(45).toBe('22') + expectTypeOf(45).toBe(22) }) describe('test2', () => { diff --git a/test/typescript/vitest.config.ts b/test/typescript/vitest.config.ts index 7e7835d9c80e..a6d7461ba645 100644 --- a/test/typescript/vitest.config.ts +++ b/test/typescript/vitest.config.ts @@ -4,6 +4,11 @@ export default defineConfig({ test: { typecheck: { checker: 'vue-tsc', + include: [ + '**/*.test-d.ts', + '**/*.test-d.js', + ], + allowJs: true, }, }, }) From 434cd38dbb6c475a1414c2c420d80650d3feee75 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 2 Oct 2022 09:23:20 +0200 Subject: [PATCH 06/33] chore: improve test summary, skip only/skip tests --- packages/vitest/src/node/core.ts | 2 +- packages/vitest/src/node/reporters/base.ts | 14 +- .../src/node/reporters/renderers/utils.ts | 4 +- packages/vitest/src/types/config.ts | 20 ++ packages/vitest/src/typescript/collect.ts | 151 +++++++++++ packages/vitest/src/typescript/constants.ts | 2 +- packages/vitest/src/typescript/parser.ts | 235 ++++-------------- packages/vitest/src/utils/tasks.ts | 9 + test/typescript/js.test-d.js | 2 +- test/typescript/test.test-d.ts | 11 +- 10 files changed, 252 insertions(+), 198 deletions(-) create mode 100644 packages/vitest/src/typescript/collect.ts diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index b264d3f68c70..b669b9e87372 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -157,7 +157,7 @@ export class Vitest { const checker = new Typechecker(this, testsFilesList) checker.onParseEnd(async ({ files, sourceErrors }) => { await this.report('onFinished', files) - if (sourceErrors.length) { + if (sourceErrors.length && !this.config.typecheck.ignoreSourceErrors) { process.exitCode = 1 await this.logger.printSourceTypeErrors(sourceErrors) } diff --git a/packages/vitest/src/node/reporters/base.ts b/packages/vitest/src/node/reporters/base.ts index 6c2e54f4b44a..7df2574a46a8 100644 --- a/packages/vitest/src/node/reporters/base.ts +++ b/packages/vitest/src/node/reporters/base.ts @@ -1,7 +1,7 @@ import { performance } from 'perf_hooks' import c from 'picocolors' import type { ErrorWithDiff, File, Reporter, Task, TaskResultPack, UserConsoleLog } from '../../types' -import { clearInterval, getFullName, getSuites, getTests, hasFailed, hasFailedSnapshot, isNode, relativePath, setInterval } from '../../utils' +import { clearInterval, getFullName, getSuites, getTests, getTypecheckTests, hasFailed, hasFailedSnapshot, isNode, relativePath, setInterval } from '../../utils' import type { Vitest } from '../../node' import { F_RIGHT } from '../../utils/figures' import { divider, formatTimeString, getStateString, getStateSymbol, pointer, renderSnapshotSummary } from './renderers/utils' @@ -202,7 +202,7 @@ export abstract class BaseReporter implements Reporter { } async reportTestSummary(files: File[]) { - const tests = getTests(files) + const tests = this.mode === 'typecheck' ? getTypecheckTests(files) : getTests(files) const logger = this.ctx.logger const executionTime = this.end - this.start @@ -212,7 +212,7 @@ export abstract class BaseReporter implements Reporter { const transformTime = Array.from(this.ctx.vitenode.fetchCache.values()).reduce((a, b) => a + (b?.duration || 0), 0) const threadTime = collectTime + testsTime + setupTime - const padTitle = (str: string) => c.dim(`${str.padStart(10)} `) + const padTitle = (str: string) => c.dim(`${str.padStart(11)} `) const time = (time: number) => { if (time > 1000) return `${(time / 1000).toFixed(2)}s` @@ -239,6 +239,11 @@ export abstract class BaseReporter implements Reporter { logger.log(padTitle('Test Files'), getStateString(files)) logger.log(padTitle('Tests'), getStateString(tests)) + if (this.mode === 'typecheck') { + // has only failed types + const typechecks = getTests(tests).filter(t => t.type === 'typecheck') + logger.log(padTitle('Type Errors'), getStateString(typechecks, 'typechecks', false)) + } logger.log(padTitle('Start at'), formatTimeString(this._timeStart)) if (this.watchFilters) logger.log(padTitle('Duration'), time(threadTime)) @@ -270,7 +275,8 @@ export abstract class BaseReporter implements Reporter { } if (failedTests.length) { - logger.error(c.red(divider(c.bold(c.inverse(` Failed Tests ${failedTests.length} `))))) + const type = this.mode === 'typecheck' ? 'Typechecks' : 'Tests' + logger.error(c.red(divider(c.bold(c.inverse(` Failed ${type} ${failedTests.length} `))))) logger.error() await this.printTaskErrors(failedTests, errorDivider) diff --git a/packages/vitest/src/node/reporters/renderers/utils.ts b/packages/vitest/src/node/reporters/renderers/utils.ts index 469e37dfe666..39f0cbf9c784 100644 --- a/packages/vitest/src/node/reporters/renderers/utils.ts +++ b/packages/vitest/src/node/reporters/renderers/utils.ts @@ -91,7 +91,7 @@ export function renderSnapshotSummary(rootDir: string, snapshots: SnapshotSummar return summary } -export function getStateString(tasks: Task[], name = 'tests') { +export function getStateString(tasks: Task[], name = 'tests', showTotal = true) { if (tasks.length === 0) return c.dim(`no ${name}`) @@ -105,7 +105,7 @@ export function getStateString(tasks: Task[], name = 'tests') { passed.length ? c.bold(c.green(`${passed.length} passed`)) : null, skipped.length ? c.yellow(`${skipped.length} skipped`) : null, todo.length ? c.gray(`${todo.length} todo`) : null, - ].filter(Boolean).join(c.dim(' | ')) + c.gray(` (${tasks.length})`) + ].filter(Boolean).join(c.dim(' | ')) + (showTotal ? c.gray(` (${tasks.length})`) : '') } export function getStateSymbol(task: Task) { diff --git a/packages/vitest/src/types/config.ts b/packages/vitest/src/types/config.ts index 8d1644544ae1..e43da2ebb4df 100644 --- a/packages/vitest/src/types/config.ts +++ b/packages/vitest/src/types/config.ts @@ -444,14 +444,34 @@ export interface InlineConfig { */ dangerouslyIgnoreUnhandledErrors?: boolean + /** + * Options for configuring typechecking test environment. + */ typecheck?: Partial } export interface TypecheckConfig { + /** + * What tool to use for type checking. + */ checker: 'tsc' | 'vue-tsc' + /** + * Pattern for files that should be treated as test files + */ include: string[] + /** + * Pattern for files that should not be treated as test files + */ exclude: string[] + /** + * Check JS files that have `@ts-check` comment. + * If you have it enabled in tsconfig, this will not overwrite it. + */ allowJs?: boolean + /** + * Do not fail, if Vitest found errors not inside the test files. + */ + ignoreSourceErrors?: boolean } export interface UserConfig extends InlineConfig { diff --git a/packages/vitest/src/typescript/collect.ts b/packages/vitest/src/typescript/collect.ts new file mode 100644 index 000000000000..1c7c01ccf610 --- /dev/null +++ b/packages/vitest/src/typescript/collect.ts @@ -0,0 +1,151 @@ +import { relative } from 'pathe' +import { parse as parseAst } from 'acorn' +import { ancestor as walkAst } from 'acorn-walk' +import type { RawSourceMap } from 'vite-node' + +import type { File, Suite, Vitest } from '../types' +import { TYPECHECK_SUITE } from './constants' + +interface ParsedFile extends File { + start: number + end: number +} + +interface ParsedSuite extends Suite { + start: number + end: number +} + +interface LocalCallDefinition { + start: number + end: number + name: string + type: string + mode: 'run' | 'skip' | 'only' | 'todo' + task: ParsedSuite | ParsedFile +} + +export interface FileInformation { + file: ParsedFile + filepath: string + parsed: string + map: RawSourceMap | null + definitions: LocalCallDefinition[] +} + +export async function collectTests(ctx: Vitest, filepath: string): Promise { + const request = await ctx.vitenode.transformRequest(filepath) + if (!request) + return null + const ast = parseAst(request.code, { + ecmaVersion: 'latest', + allowAwaitOutsideFunction: true, + }) + const file: ParsedFile = { + filepath, + type: 'suite', + id: '-1', + name: relative(ctx.config.root, filepath), + mode: 'run', + tasks: [], + start: ast.start, + end: ast.end, + result: { + state: 'pass', + }, + } + const definitions: LocalCallDefinition[] = [] + const getName = (callee: any): string | null => { + if (!callee) + return null + if (callee.type === 'Identifier') + return callee.name + if (callee.type === 'MemberExpression') { + // direct call as `__vite_ssr__.test()` + if (callee.object?.name?.startsWith('__vite_ssr_')) + return getName(callee.property) + return getName(callee.object?.property) + } + return null + } + walkAst(ast, { + CallExpression(node) { + const { callee } = node as any + const name = getName(callee) + if (!name) + return + if (!['it', 'test', 'describe', 'suite'].includes(name)) + return + const { arguments: [{ value: message }] } = node as any + const property = callee?.property?.name + const mode = !property || property === name ? 'run' : property + if (mode === 'each') + throw new Error(`${name}.each syntax is not supported when testing types`) + definitions.push({ + start: node.start, + end: node.end, + name: message, + type: name, + mode, + } as LocalCallDefinition) + }, + }) + let lastSuite: ParsedSuite = file + const getLatestSuite = (index: number) => { + const suite = lastSuite + while (lastSuite !== file && lastSuite.end < index) + lastSuite = suite.suite as ParsedSuite + return lastSuite + } + definitions.sort((a, b) => a.start - b.start).forEach((definition, idx) => { + const latestSuite = getLatestSuite(definition.start) + let mode = definition.mode + if (latestSuite.mode !== 'run') // inherit suite mode, if it's set + mode = latestSuite.mode + const state = mode === 'run' ? 'pass' : mode + // expectTypeOf and any type error is actually a "test" ("typecheck"), + // and all "test"s should be inside a "suite" + const task: ParsedSuite = { + type: 'suite', + id: idx.toString(), + suite: latestSuite, + file, + tasks: [], + mode, + name: definition.name, + end: definition.end, + start: definition.start, + result: { + state, + }, + } + definition.task = task + latestSuite.tasks.push(task) + if (definition.type === 'describe' || definition.type === 'suite') + lastSuite = task + else + // to show correct amount of "tests" in summary, we mark this with a special symbol + Object.defineProperty(task, TYPECHECK_SUITE, { value: true }) + }) + const markSkippedTests = (suite: Suite) => { + const hasOnly = suite.tasks.some(task => task.mode === 'only') + suite.tasks.forEach((task) => { + if ((hasOnly && task.mode !== 'only') || suite.mode === 'skip') { + task.mode = 'skip' + task.result = { + state: 'skip', + } + } + if (task.type === 'suite') + markSkippedTests(task) + }) + } + markSkippedTests(file) + return { + file, + parsed: request.code, + filepath, + map: request.map as RawSourceMap | null, + definitions, + } +} diff --git a/packages/vitest/src/typescript/constants.ts b/packages/vitest/src/typescript/constants.ts index 9b894c7cadd6..c52d92249ff7 100644 --- a/packages/vitest/src/typescript/constants.ts +++ b/packages/vitest/src/typescript/constants.ts @@ -1,2 +1,2 @@ export const EXPECT_TYPEOF_MATCHERS = Symbol('vitest:expect-typeof-matchers') -export const TYPECHECK_ERROR = Symbol('vitest:typecheck-error') +export const TYPECHECK_SUITE = Symbol('vitest:typecheck-suite') diff --git a/packages/vitest/src/typescript/parser.ts b/packages/vitest/src/typescript/parser.ts index b15a8de891e6..010753f0e0ba 100644 --- a/packages/vitest/src/typescript/parser.ts +++ b/packages/vitest/src/typescript/parser.ts @@ -1,21 +1,18 @@ -import { readFile } from 'fs/promises' +import { rm } from 'fs/promises' import { execaCommand } from 'execa' -import { relative, resolve } from 'pathe' -import { parse as parseAst } from 'acorn' -import { ancestor as walkAst } from 'acorn-walk' -import type { RawSourceMap } from 'vite-node' +import { resolve } from 'pathe' import { SourceMapConsumer } from 'source-map-js' -import type { Awaitable, File, ParsedStack, Suite, Task, TscErrorInfo, Vitest } from '../types' -import { TYPECHECK_ERROR } from './constants' +import { ensurePackageInstalled } from '../utils' +import type { Awaitable, File, ParsedStack, Task, TscErrorInfo, Vitest } from '../types' import { getRawErrsMapFromTsCompile, getTsconfigPath } from './parse' import { createIndexMap } from './utils' +import type { FileInformation } from './collect' +import { collectTests } from './collect' export class TypeCheckError extends Error { - [TYPECHECK_ERROR] = true - stacks: ParsedStack[] = [] name = 'TypeCheckError' - constructor(public message: string) { + constructor(public message: string, public stacks: ParsedStack[]) { super(message) } } @@ -25,34 +22,6 @@ interface ErrorsCache { sourceErrors: TypeCheckError[] } -interface ParsedFile extends File { - start: number - end: number -} - -interface ParsedSuite extends Suite { - start: number - end: number -} - -interface LocalCallDefinition { - start: number - end: number - name: string - type: string - mode: 'run' | 'skip' | 'only' | 'todo' - task: ParsedSuite | ParsedFile -} - -interface FileInformation { - file: ParsedFile - content: string - filepath: string - parsed: string - map: RawSourceMap | null - definitions: LocalCallDefinition[] -} - type Callback = []> = (...args: Args) => Awaitable export class Typechecker { @@ -65,6 +34,8 @@ export class Typechecker { sourceErrors: [], } + private tmpConfigPath?: string + constructor(protected ctx: Vitest, protected files: string[]) {} public onParseStart(fn: Callback) { @@ -79,122 +50,8 @@ export class Typechecker { this._onWatcherRerun = fn } - protected async parseTestFile(filepath: string): Promise { - const [request, content] = await Promise.all([ - this.ctx.vitenode.transformRequest(filepath), - readFile(filepath, 'utf-8'), - ]) - if (!request) - return null - const ast = parseAst(request.code, { - ecmaVersion: 'latest', - allowAwaitOutsideFunction: true, - }) - const file: ParsedFile = { - filepath, - type: 'suite', - id: '-1', - name: relative(this.ctx.config.root, filepath), - mode: 'run', - tasks: [], - start: ast.start, - end: ast.end, - result: { - state: 'pass', - }, - } - const definitions: LocalCallDefinition[] = [] - const getName = (callee: any): string | null => { - if (!callee) - return null - if (callee.type === 'Identifier') - return callee.name - if (callee.type === 'MemberExpression') { - // direct call as `__vite_ssr__.test()` - if (callee.object?.name?.startsWith('__vite_ssr_')) - return getName(callee.property) - return getName(callee.object?.property) - } - return null - } - walkAst(ast, { - CallExpression(node) { - const { callee } = node as any - const name = getName(callee) - if (!name) - return - if (!['it', 'test', 'describe', 'suite'].includes(name)) - return - const { arguments: [{ value: message }] } = node as any - const property = callee?.property?.name - const mode = !property || property === name ? 'run' : property - if (mode === 'each') - throw new Error(`${name}.each syntax is not supported when testing types`) - definitions.push({ - start: node.start, - end: node.end, - name: message, - type: name, - mode, - } as LocalCallDefinition) - }, - }) - let lastSuite: ParsedSuite = file - const getLatestSuite = (index: number) => { - const suite = lastSuite - while (lastSuite !== file && lastSuite.end < index) - lastSuite = suite.suite as ParsedSuite - return lastSuite - } - definitions.sort((a, b) => a.start - b.start).forEach((definition, idx) => { - const latestSuite = getLatestSuite(definition.start) - const state = definition.mode === 'run' ? 'pass' : definition.mode - if (definition.type === 'describe' || definition.type === 'suite') { - const suite: ParsedSuite = { - type: 'suite', - id: idx.toString(), - mode: definition.mode, - name: definition.name, - suite: latestSuite, - tasks: [], - result: { - state, - }, - start: definition.start, - end: definition.end, - } - definition.task = suite - latestSuite.tasks.push(suite) - lastSuite = suite - return - } - // expectTypeOf and any type error is actually a "test" ("typecheck"), - // and all "test"s should be inside a "suite" - const task: ParsedSuite = { - type: 'suite', - id: idx.toString(), - suite: latestSuite, - file, - tasks: [], - mode: definition.mode, - name: definition.name, - end: definition.end, - result: { - state, - }, - start: definition.start, - } - definition.task = task - latestSuite.tasks.push(task) - }) - return { - file, - parsed: request.code, - content, - filepath, - map: request.map as RawSourceMap | null, - definitions, - } + protected async collectTests(filepath: string): Promise { + return collectTests(this.ctx, filepath) } protected async prepareResults(output: string) { @@ -202,7 +59,7 @@ export class Typechecker { const testFiles = new Set(this.files) const sourceDefinitions = (await Promise.all( - this.files.map(filepath => this.parseTestFile(filepath)), + this.files.map(filepath => this.collectTests(filepath)), )).reduce((acc, data) => { if (!data) return acc @@ -218,10 +75,18 @@ export class Typechecker { const errors = typeErrors.get(path) files.push(file) if (!errors) - return files.push(file) + return const sortedDefinitions = [...definitions.sort((a, b) => b.start - a.start)] + // has no map for ".js" files that use // @ts-check const mapConsumer = map && new SourceMapConsumer(map) const indexMap = createIndexMap(parsed) + const markFailed = (task: Task) => { + task.result = { + state: task.mode === 'run' || task.mode === 'only' ? 'fail' : task.mode, + } + if (task.suite) + markFailed(task.suite) + } errors.forEach(({ error, originalError }, idx) => { const originalPos = mapConsumer?.generatedPositionFor({ line: originalError.line, @@ -230,27 +95,22 @@ export class Typechecker { }) || originalError const index = indexMap.get(`${originalPos.line}:${originalPos.column}`) const definition = (index != null && sortedDefinitions.find(def => def.start <= index && def.end >= index)) || file - if (!definition) { - // to still show even if we messed up - sourceErrors.push(error) - return - } const suite = 'task' in definition ? definition.task : definition + const state = suite.mode === 'run' || suite.mode === 'only' ? 'fail' : suite.mode const task: Task = { type: 'typecheck', id: idx.toString(), - name: `error expect ${idx + 1}`, - mode: 'run', + name: `error expect ${idx + 1}`, // TODO naming + mode: suite.mode, file, suite, result: { - state: 'fail', - error, + state, + error: state === 'fail' ? error : undefined, }, } - suite.result = { - state: 'fail', - } + if (state === 'fail') + markFailed(suite) suite.tasks.push(task) }) }) @@ -274,9 +134,7 @@ export class Typechecker { const suiteErrors = errors.map((info) => { const limit = Error.stackTraceLimit Error.stackTraceLimit = 0 - const error = new TypeCheckError(info.errMsg) - Error.stackTraceLimit = limit - error.stacks = [ + const error = new TypeCheckError(info.errMsg, [ { file: filepath, line: info.line, @@ -287,7 +145,8 @@ export class Typechecker { column: info.column, }, }, - ] + ]) + Error.stackTraceLimit = limit return { originalError: info, error, @@ -298,17 +157,27 @@ export class Typechecker { return typesErrors } + // TODO call before exiting process + public async clean() { + if (this.tmpConfigPath) + await rm(this.tmpConfigPath) + } + public async start() { - // check tsc or vue-tsc installed - const tmpConfigPath = await getTsconfigPath(this.ctx.config.root) - let cmd = `${this.ctx.config.typecheck.checker} --noEmit --pretty false -p ${tmpConfigPath}` - if (this.ctx.config.watch) + const { root, watch, typecheck } = this.ctx.config + const packageName = typecheck.checker === 'tsc' ? 'typescript' : 'vue-tsc' + await ensurePackageInstalled(packageName, root) + + this.tmpConfigPath = await getTsconfigPath(root) + let cmd = `${typecheck.checker} --noEmit --pretty false -p ${this.tmpConfigPath}` + // use builtin watcher, because it's faster + if (watch) cmd += ' --watch' - if (this.ctx.config.typecheck.allowJs) + if (typecheck.allowJs) cmd += ' --allowJs --checkJs' let output = '' const stdout = execaCommand(cmd, { - cwd: this.ctx.config.root, + cwd: root, stdout: 'pipe', reject: false, }) @@ -316,7 +185,7 @@ export class Typechecker { let rerunTriggered = false stdout.stdout?.on('data', (chunk) => { output += chunk - if (!this.ctx.config.watch) + if (!watch) return if (output.includes('File change detected') && !rerunTriggered) { this._onWatcherRerun?.() @@ -328,14 +197,14 @@ export class Typechecker { } if (/Found \w+ errors*. Watching for/.test(output)) { rerunTriggered = false - this.prepareResults(output).then((errors) => { - this._result = errors - this._onParseEnd?.(errors) + this.prepareResults(output).then((result) => { + this._result = result + this._onParseEnd?.(result) }) output = '' } }) - if (!this.ctx.config.watch) { + if (!watch) { await stdout this._result = await this.prepareResults(output) await this._onParseEnd?.(this._result) diff --git a/packages/vitest/src/utils/tasks.ts b/packages/vitest/src/utils/tasks.ts index 3e9677334395..0bbad101c019 100644 --- a/packages/vitest/src/utils/tasks.ts +++ b/packages/vitest/src/utils/tasks.ts @@ -1,4 +1,5 @@ import type { Arrayable, Benchmark, Suite, Task, Test, TypeCheck } from '../types' +import { TYPECHECK_SUITE } from '../typescript/constants' import { toArray } from './base' function isAtomTest(s: Task): s is Test | Benchmark | TypeCheck { @@ -9,6 +10,14 @@ export function getTests(suite: Arrayable): (Test | Benchmark | TypeCheck) return toArray(suite).flatMap(s => isAtomTest(s) ? [s] : s.tasks.flatMap(c => isAtomTest(c) ? [c] : getTests(c))) } +export function getTypecheckTests(suite: Arrayable): Suite[] { + return toArray(suite).flatMap((s) => { + if (s.type !== 'suite') + return [] + return TYPECHECK_SUITE in s ? [s, ...getTypecheckTests(s.tasks)] : getTypecheckTests(s.tasks) + }) +} + export function getTasks(tasks: Arrayable = []): Task[] { return toArray(tasks).flatMap(s => isAtomTest(s) ? [s] : [s, ...getTasks(s.tasks)]) } diff --git a/test/typescript/js.test-d.js b/test/typescript/js.test-d.js index 91804350107b..338f2d767b08 100644 --- a/test/typescript/js.test-d.js +++ b/test/typescript/js.test-d.js @@ -2,4 +2,4 @@ import { expectTypeOf } from 'vitest' -expectTypeOf(1).toBe('string') +expectTypeOf(1).toBe(2) diff --git a/test/typescript/test.test-d.ts b/test/typescript/test.test-d.ts index 555b50c90683..4523b077f945 100644 --- a/test/typescript/test.test-d.ts +++ b/test/typescript/test.test-d.ts @@ -2,12 +2,15 @@ import { describe, expectTypeOf, test } from 'vitest' describe('test', () => { test('some-test', () => { - expectTypeOf(45).toBe(22) + expectTypeOf(45).toBe(45) + // expectTypeOf(45).toBe(80) + // expectTypeOf(45).toBe(80) + // expectTypeOf(45).toBe('22') }) describe('test2', () => { test('some-test 2', () => { - expectTypeOf(45).toBe(45) + expectTypeOf(45).toBe('45') }) }) }) @@ -17,10 +20,6 @@ describe('test', () => { // 'name.first.second.third': string // } -// expectTypeOf(45).toBe(45) -// expectTypeOf(45).toBe(80) -// expectTypeOf(45).toBe(80) - // expectTypeOf(45) // // test // .toBe(45) From 8db349e94297a9907de77f307f2f102eedef6ede Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 2 Oct 2022 09:48:34 +0200 Subject: [PATCH 07/33] chore: render type tests tree --- packages/vitest/src/node/core.ts | 7 +++- packages/vitest/src/node/reporters/default.ts | 8 ++-- .../node/reporters/renderers/listRenderer.ts | 11 +++-- packages/vitest/src/typescript/parser.ts | 41 +++++++++++++------ packages/vitest/src/utils/tasks.ts | 4 ++ 5 files changed, 50 insertions(+), 21 deletions(-) diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index b669b9e87372..49a1fe7b16bc 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -156,6 +156,7 @@ export class Vitest { const testsFilesList = await this.globTestFiles() const checker = new Typechecker(this, testsFilesList) checker.onParseEnd(async ({ files, sourceErrors }) => { + await this.report('onCollected', files) await this.report('onFinished', files) if (sourceErrors.length && !this.config.typecheck.ignoreSourceErrors) { process.exitCode = 1 @@ -170,13 +171,15 @@ export class Vitest { }) checker.onParseStart(async () => { await this.report('onInit', this) - this.logger.log(c.cyan('Typechecking...')) // TODO show list of test files? + await this.report('onCollected', checker.getTestFiles()) }) checker.onWatcherRerun(async () => { const { files } = checker.getResult() await this.report('onWatcherRerun', files.map(f => f.filepath), 'File change detected. Triggering rerun.') - this.logger.log(c.cyan('Typechecking...')) // TODO show list of test files? + await checker.collectTests() + await this.report('onCollected', checker.getTestFiles()) }) + await checker.collectTests() await checker.start() } diff --git a/packages/vitest/src/node/reporters/default.ts b/packages/vitest/src/node/reporters/default.ts index 2947033432ed..1a2fa9b93bf0 100644 --- a/packages/vitest/src/node/reporters/default.ts +++ b/packages/vitest/src/node/reporters/default.ts @@ -1,5 +1,5 @@ import c from 'picocolors' -import type { UserConsoleLog } from '../../types' +import type { File, UserConsoleLog } from '../../types' import { BaseReporter } from './base' import type { ListRendererOptions } from './renderers/listRenderer' import { createListRenderer } from './renderers/listRenderer' @@ -18,11 +18,13 @@ export class DefaultReporter extends BaseReporter { super.onWatcherStart() } - onCollected() { + onCollected(files?: File[]) { if (this.isTTY) { this.rendererOptions.logger = this.ctx.logger this.rendererOptions.showHeap = this.ctx.config.logHeapUsage - const files = this.ctx.state.getFiles(this.watchFilters) + this.rendererOptions.mode = this.mode + if (!files) + files = this.ctx.state.getFiles(this.watchFilters) if (!this.renderer) this.renderer = createListRenderer(files, this.rendererOptions).start() else diff --git a/packages/vitest/src/node/reporters/renderers/listRenderer.ts b/packages/vitest/src/node/reporters/renderers/listRenderer.ts index ec4c2593a9a0..d1e94013ea94 100644 --- a/packages/vitest/src/node/reporters/renderers/listRenderer.ts +++ b/packages/vitest/src/node/reporters/renderers/listRenderer.ts @@ -1,8 +1,8 @@ import c from 'picocolors' import cliTruncate from 'cli-truncate' import stripAnsi from 'strip-ansi' -import type { Benchmark, BenchmarkResult, SuiteHooks, Task } from '../../../types' -import { clearInterval, getTests, notNullish, setInterval } from '../../../utils' +import type { Benchmark, BenchmarkResult, SuiteHooks, Task, VitestRunMode } from '../../../types' +import { clearInterval, getTests, getTypecheckTests, isTypecheckTest, notNullish, setInterval } from '../../../utils' import { F_RIGHT } from '../../../utils/figures' import type { Logger } from '../../logger' import { getCols, getHookStateSymbol, getStateSymbol } from './utils' @@ -11,6 +11,7 @@ export interface ListRendererOptions { renderSucceed?: boolean logger: Logger showHeap: boolean + mode: VitestRunMode } const DURATION_LONG = 300 @@ -95,8 +96,10 @@ export function renderTree(tasks: Task[], options: ListRendererOptions, level = if (task.type === 'test' && task.result?.retryCount && task.result.retryCount > 1) suffix += c.yellow(` (retry x${task.result.retryCount})`) - if (task.type === 'suite') - suffix += c.dim(` (${getTests(task).length})`) + if (task.type === 'suite' && !isTypecheckTest(task)) { + const tests = options.mode === 'typecheck' ? getTypecheckTests(task) : getTests(task) + suffix += c.dim(` (${tests.length})`) + } if (task.mode === 'skip' || task.mode === 'todo') suffix += ` ${c.dim(c.gray('[skipped]'))}` diff --git a/packages/vitest/src/typescript/parser.ts b/packages/vitest/src/typescript/parser.ts index 010753f0e0ba..ef3644131400 100644 --- a/packages/vitest/src/typescript/parser.ts +++ b/packages/vitest/src/typescript/parser.ts @@ -34,6 +34,8 @@ export class Typechecker { sourceErrors: [], } + private _tests: Record | null = {} + private tmpConfigPath?: string constructor(protected ctx: Vitest, protected files: string[]) {} @@ -50,28 +52,37 @@ export class Typechecker { this._onWatcherRerun = fn } - protected async collectTests(filepath: string): Promise { + protected async collectFileTests(filepath: string): Promise { return collectTests(this.ctx, filepath) } - protected async prepareResults(output: string) { - const typeErrors = await this.parseTscLikeOutput(output) - const testFiles = new Set(this.files) - - const sourceDefinitions = (await Promise.all( - this.files.map(filepath => this.collectTests(filepath)), + public async collectTests() { + const tests = (await Promise.all( + this.files.map(filepath => this.collectFileTests(filepath)), )).reduce((acc, data) => { if (!data) return acc acc[data.filepath] = data return acc }, {} as Record) + this._tests = tests + return tests + } + + protected async prepareResults(output: string) { + const typeErrors = await this.parseTscLikeOutput(output) + const testFiles = new Set(this.files) + + let tests = this._tests + + if (!tests) + tests = await this.collectTests() const sourceErrors: TypeCheckError[] = [] const files: File[] = [] testFiles.forEach((path) => { - const { file, definitions, map, parsed } = sourceDefinitions[path] + const { file, definitions, map, parsed } = tests![path] const errors = typeErrors.get(path) files.push(file) if (!errors) @@ -189,10 +200,9 @@ export class Typechecker { return if (output.includes('File change detected') && !rerunTriggered) { this._onWatcherRerun?.() - this._result = { - sourceErrors: [], - files: [], - } + this._result.sourceErrors = [] + this._result.files = [] + this._tests = null // test structure migh've changed rerunTriggered = true } if (/Found \w+ errors*. Watching for/.test(output)) { @@ -214,4 +224,11 @@ export class Typechecker { public getResult() { return this._result } + + public getTestFiles() { + return Object.values(this._tests || {}).map(({ file }) => ({ + ...file, + result: undefined, + })) + } } diff --git a/packages/vitest/src/utils/tasks.ts b/packages/vitest/src/utils/tasks.ts index 0bbad101c019..0479f6e07fd1 100644 --- a/packages/vitest/src/utils/tasks.ts +++ b/packages/vitest/src/utils/tasks.ts @@ -10,6 +10,10 @@ export function getTests(suite: Arrayable): (Test | Benchmark | TypeCheck) return toArray(suite).flatMap(s => isAtomTest(s) ? [s] : s.tasks.flatMap(c => isAtomTest(c) ? [c] : getTests(c))) } +export function isTypecheckTest(suite: Task): suite is Suite { + return TYPECHECK_SUITE in suite +} + export function getTypecheckTests(suite: Arrayable): Suite[] { return toArray(suite).flatMap((s) => { if (s.type !== 'suite') From 4aa0409832aa690fe2ed2338c139af78a4a8fb86 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 2 Oct 2022 10:08:25 +0200 Subject: [PATCH 08/33] chore: remove tmp, add expectTypeOf to globals, fix type errors count --- packages/vitest/globals.d.ts | 1 + packages/vitest/src/constants.ts | 2 + packages/vitest/src/node/core.ts | 23 +++++-- packages/vitest/src/node/reporters/base.ts | 6 +- test/typescript/test.test-d.ts | 6 +- test/typescript/tsconfig.json | 6 ++ test/typescript/tsconfig.tmp.json | 80 ---------------------- test/typescript/vitest.config.ts | 8 +-- 8 files changed, 37 insertions(+), 95 deletions(-) create mode 100644 test/typescript/tsconfig.json delete mode 100644 test/typescript/tsconfig.tmp.json diff --git a/packages/vitest/globals.d.ts b/packages/vitest/globals.d.ts index dbeb9fca262b..d9e8f3c3fc48 100644 --- a/packages/vitest/globals.d.ts +++ b/packages/vitest/globals.d.ts @@ -3,6 +3,7 @@ declare global { const test: typeof import('vitest')['test'] const describe: typeof import('vitest')['describe'] const it: typeof import('vitest')['it'] + const expectTypeOf: typeof import('vitest')['expectTypeOf'] const expect: typeof import('vitest')['expect'] const assert: typeof import('vitest')['assert'] const vitest: typeof import('vitest')['vitest'] diff --git a/packages/vitest/src/constants.ts b/packages/vitest/src/constants.ts index 5201b877a72b..a9ee1617487a 100644 --- a/packages/vitest/src/constants.ts +++ b/packages/vitest/src/constants.ts @@ -37,6 +37,8 @@ export const globalApis = [ 'chai', 'expect', 'assert', + // typecheck + 'expectTypeOf', // utils 'vitest', 'vi', diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 49a1fe7b16bc..744a601dccb0 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -34,6 +34,7 @@ export class Vitest { coverageProvider: CoverageProvider | null | undefined logger: Logger pool: WorkerPool | undefined + typechecker: Typechecker | undefined vitenode: ViteNodeServer = undefined! @@ -155,13 +156,21 @@ export class Vitest { async typecheck() { const testsFilesList = await this.globTestFiles() const checker = new Typechecker(this, testsFilesList) + this.typechecker = checker checker.onParseEnd(async ({ files, sourceErrors }) => { await this.report('onCollected', files) - await this.report('onFinished', files) + if (!files.length) + this.logger.printNoTestFound() + else + await this.report('onFinished', files) if (sourceErrors.length && !this.config.typecheck.ignoreSourceErrors) { process.exitCode = 1 await this.logger.printSourceTypeErrors(sourceErrors) } + if (!files.length) { + const exitCode = this.config.passWithNoTests ? 0 : 1 + process.exit(exitCode) + } if (this.config.watch) { await this.report('onWatcherStart', files, [ ...sourceErrors, @@ -171,13 +180,16 @@ export class Vitest { }) checker.onParseStart(async () => { await this.report('onInit', this) - await this.report('onCollected', checker.getTestFiles()) + const files = checker.getTestFiles() + if (files) + await this.report('onCollected', checker.getTestFiles()) }) checker.onWatcherRerun(async () => { - const { files } = checker.getResult() - await this.report('onWatcherRerun', files.map(f => f.filepath), 'File change detected. Triggering rerun.') + await this.report('onWatcherRerun', testsFilesList, 'File change detected. Triggering rerun.') await checker.collectTests() - await this.report('onCollected', checker.getTestFiles()) + const files = checker.getTestFiles() + if (files) + await this.report('onCollected', checker.getTestFiles()) }) await checker.collectTests() await checker.start() @@ -507,6 +519,7 @@ export class Vitest { this.closingPromise = Promise.allSettled([ this.pool?.close(), this.server.close(), + this.typechecker?.clean(), ].filter(Boolean)).then((results) => { results.filter(r => r.status === 'rejected').forEach((err) => { this.logger.error('error during close', (err as PromiseRejectedResult).reason) diff --git a/packages/vitest/src/node/reporters/base.ts b/packages/vitest/src/node/reporters/base.ts index 7df2574a46a8..16bf410ea21a 100644 --- a/packages/vitest/src/node/reporters/base.ts +++ b/packages/vitest/src/node/reporters/base.ts @@ -240,9 +240,9 @@ export abstract class BaseReporter implements Reporter { logger.log(padTitle('Test Files'), getStateString(files)) logger.log(padTitle('Tests'), getStateString(tests)) if (this.mode === 'typecheck') { - // has only failed types - const typechecks = getTests(tests).filter(t => t.type === 'typecheck') - logger.log(padTitle('Type Errors'), getStateString(typechecks, 'typechecks', false)) + // has only failed checks + const typechecks = getTests(files).filter(t => t.type === 'typecheck') + logger.log(padTitle('Type Errors'), getStateString(typechecks, 'errors', false)) } logger.log(padTitle('Start at'), formatTimeString(this._timeStart)) if (this.watchFilters) diff --git a/test/typescript/test.test-d.ts b/test/typescript/test.test-d.ts index 4523b077f945..21511b1e0179 100644 --- a/test/typescript/test.test-d.ts +++ b/test/typescript/test.test-d.ts @@ -1,4 +1,4 @@ -import { describe, expectTypeOf, test } from 'vitest' +// import { describe, expectTypeOf, test } from 'vitest' describe('test', () => { test('some-test', () => { @@ -10,7 +10,7 @@ describe('test', () => { describe('test2', () => { test('some-test 2', () => { - expectTypeOf(45).toBe('45') + expectTypeOf(45).toBe(45) }) }) }) @@ -25,7 +25,7 @@ describe('test', () => { // .toBe(45) // expectTypeOf().toBeNever() -// expectTypeOf('hren').toBe(45) +expectTypeOf('hren').toBe(45) // expectTypeOf({ wolk: 'true' }).toHaveProperty('wol') // expectTypeOf({ wolk: 'true' }).not.toHaveProperty('wol') // expectTypeOf((v): v is boolean => true).asserts.toBe() diff --git a/test/typescript/tsconfig.json b/test/typescript/tsconfig.json new file mode 100644 index 000000000000..fdf529387c4c --- /dev/null +++ b/test/typescript/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["vitest/globals"] + } +} \ No newline at end of file diff --git a/test/typescript/tsconfig.tmp.json b/test/typescript/tsconfig.tmp.json deleted file mode 100644 index de7a8cf37951..000000000000 --- a/test/typescript/tsconfig.tmp.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "module": "esnext", - "lib": [ - "esnext", - "dom" - ], - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "strictNullChecks": true, - "resolveJsonModule": true, - "skipDefaultLibCheck": true, - "skipLibCheck": true, - "outDir": "./dist", - "declaration": true, - "inlineSourceMap": true, - "paths": { - "@vitest/ws-client": [ - "./packages/ws-client/src/index.ts" - ], - "@vitest/ui": [ - "./packages/ui/node/index.ts" - ], - "@vitest/browser": [ - "./packages/browser/node/index.ts" - ], - "#types": [ - "./packages/vitest/src/index.ts" - ], - "~/*": [ - "./packages/ui/client/*" - ], - "vitest": [ - "./packages/vitest/src/index.ts" - ], - "vitest/globals": [ - "./packages/vitest/globals.d.ts" - ], - "vitest/node": [ - "./packages/vitest/src/node/index.ts" - ], - "vitest/config": [ - "./packages/vitest/src/config.ts" - ], - "vitest/browser": [ - "./packages/vitest/src/browser.ts" - ], - "vite-node": [ - "./packages/vite-node/src/index.ts" - ], - "vite-node/client": [ - "./packages/vite-node/src/client.ts" - ], - "vite-node/server": [ - "./packages/vite-node/src/server.ts" - ], - "vite-node/utils": [ - "./packages/vite-node/src/utils.ts" - ] - }, - "types": [ - "node", - "vite/client" - ], - "emitDeclarationOnly": false, - "incremental": true, - "tsBuildInfoFile": "/Users/sheremet/local-git/vitest/packages/vitest/dist/tsconfig.tmp.tsbuildinfo" - }, - "exclude": [ - "**/dist/**", - "./packages/vitest/dist/**", - "./packages/vitest/*.d.ts", - "./packages/ui/client/**", - "./examples/**/*.*", - "./bench/**", - "./dist" - ] -} \ No newline at end of file diff --git a/test/typescript/vitest.config.ts b/test/typescript/vitest.config.ts index a6d7461ba645..a17ca29fb05c 100644 --- a/test/typescript/vitest.config.ts +++ b/test/typescript/vitest.config.ts @@ -4,10 +4,10 @@ export default defineConfig({ test: { typecheck: { checker: 'vue-tsc', - include: [ - '**/*.test-d.ts', - '**/*.test-d.js', - ], + // include: [ + // // '**/*.test-d.ts', + // // '**/*.test-d.js', + // ], allowJs: true, }, }, From 35f3c64d9c82b9160dd69a24611aeb74711a5e2e Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 2 Oct 2022 10:10:53 +0200 Subject: [PATCH 09/33] chore: lockfile --- pnpm-lock.yaml | 555 ++++++++++++++++++++++++++++++------------------- 1 file changed, 338 insertions(+), 217 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e728ba8183cd..8f86aad7470d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,8 +74,8 @@ importers: fast-glob: 3.2.12 if-node-version: 1.1.1 lint-staged: 13.0.3 - magic-string: 0.26.7 - node-fetch-native: 0.1.8 + magic-string: 0.26.5 + node-fetch-native: 0.1.7 npm-run-all: 4.1.5 ohmyfetch: 0.4.20 pathe: 0.2.0 @@ -114,17 +114,17 @@ importers: jiti: 1.16.0 vue: 3.2.41 devDependencies: - '@iconify-json/carbon': 1.1.9 - '@unocss/reset': 0.46.0 - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@iconify-json/carbon': 1.1.8 + '@unocss/reset': 0.45.26 + '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 esno: 0.16.3 fast-glob: 3.2.12 https-localhost: 4.7.1 - unocss: 0.46.0_vite@3.1.0 - unplugin-vue-components: 0.22.9_vue@3.2.41 + unocss: 0.45.26_vite@3.1.0 + unplugin-vue-components: 0.22.7_vite@3.1.0+vue@3.2.40 vite: 3.1.0 vite-plugin-pwa: 0.13.1_zp7t6aa2r77waajuyr5zt63phe - vitepress: 1.0.0-alpha.22 + vitepress: 1.0.0-alpha.18 workbox-window: 6.5.4 examples/basic: @@ -290,7 +290,7 @@ importers: '@types/react-test-renderer': 17.0.2 '@vitejs/plugin-react': 2.1.0_vite@3.1.0 '@vitest/ui': link:../../packages/ui - happy-dom: 7.6.3 + happy-dom: 6.0.4 jsdom: 20.0.1 react-test-renderer: 17.0.2_react@17.0.2 vite: 3.1.0 @@ -495,8 +495,8 @@ importers: vitest: workspace:* vue: latest devDependencies: - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 - '@vue/test-utils': 2.2.0_vue@3.2.41 + '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 + '@vue/test-utils': 2.1.0_vue@3.2.40 jsdom: 20.0.1 vite: 3.1.0 vite-plugin-ruby: 3.1.2_vite@3.1.0 @@ -549,8 +549,8 @@ importers: dependencies: vue: 3.2.41 devDependencies: - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 - '@vue/test-utils': 2.0.2_vue@3.2.41 + '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 + '@vue/test-utils': 2.0.2_vue@3.2.40 jsdom: 20.0.1 unplugin-auto-import: 0.11.2_vite@3.1.0 unplugin-vue-components: 0.22.4_vite@3.1.0+vue@3.2.41 @@ -568,8 +568,8 @@ importers: dependencies: vue: 3.2.41 devDependencies: - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 - '@vue/test-utils': 2.0.0_vue@3.2.41 + '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 + '@vue/test-utils': 2.0.0_vue@3.2.40 jsdom: 20.0.1 vite: 3.1.0 vitest: link:../../packages/vitest @@ -584,9 +584,9 @@ importers: vitest: workspace:* vue: latest devDependencies: - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 - '@vitejs/plugin-vue-jsx': 2.0.1_vite@3.1.0+vue@3.2.41 - '@vue/test-utils': 2.2.0_vue@3.2.41 + '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 + '@vitejs/plugin-vue-jsx': 2.0.1_vite@3.1.0+vue@3.2.40 + '@vue/test-utils': 2.1.0_vue@3.2.40 jsdom: 20.0.1 vite: 3.1.0 vitest: link:../../packages/vitest @@ -719,25 +719,25 @@ importers: '@types/d3-force': 3.0.3 '@types/d3-selection': 3.0.3 '@types/ws': 8.5.3 - '@unocss/reset': 0.46.0 - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 - '@vitejs/plugin-vue-jsx': 2.0.1_vite@3.1.0+vue@3.2.41 + '@unocss/reset': 0.45.26 + '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 + '@vitejs/plugin-vue-jsx': 2.0.1_vite@3.1.0+vue@3.2.40 '@vitest/ws-client': link:../ws-client '@vueuse/core': 9.3.1_vue@3.2.41 ansi-to-html: 0.7.2 birpc: 0.2.3 codemirror: 5.65.9 codemirror-theme-vars: 0.1.1 - cypress: 10.10.0 - d3-graph-controller: 2.3.19 + cypress: 10.9.0 + d3-graph-controller: 2.3.17 flatted: 3.2.7 floating-vue: 2.0.0-y.0_vue@3.2.41 picocolors: 1.0.0 rollup: 2.79.0 splitpanes: 3.1.1 - unocss: 0.46.0_rollup@2.79.0+vite@3.1.0 - unplugin-auto-import: 0.11.3_6u46jplwha2mhx7sqors5yy6v4 - unplugin-vue-components: 0.22.9_rollup@2.79.0+vue@3.2.41 + unocss: 0.45.26_vite@3.1.0 + unplugin-auto-import: 0.11.2_4pcjj2znrm3t3euqrnres74v3q + unplugin-vue-components: 0.22.7_bvhm6vbarnztnbcyiesgeukfyu vite: 3.1.0 vite-plugin-pages: 0.27.1_vite@3.1.0 vue: 3.2.41 @@ -858,7 +858,7 @@ importers: happy-dom: 6.0.4 jsdom: 20.0.1 log-update: 5.0.1 - magic-string: 0.26.7 + magic-string: 0.26.5 micromatch: 4.0.5 mlly: 0.5.16 natural-compare: 1.4.0 @@ -3174,8 +3174,25 @@ packages: requiresBuild: true optional: true - /@eslint/eslintrc/1.3.3: - resolution: {integrity: sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==} + /@eslint/eslintrc/1.3.1: + resolution: {integrity: sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.4.0 + globals: 13.17.0 + ignore: 5.2.0 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/eslintrc/1.3.2: + resolution: {integrity: sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 @@ -3238,8 +3255,8 @@ packages: graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dev: false - /@humanwhocodes/config-array/0.11.6: - resolution: {integrity: sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg==} + /@humanwhocodes/config-array/0.10.7: + resolution: {integrity: sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -3350,7 +3367,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.5 + '@types/node': 18.7.18 '@types/yargs': 15.0.14 chalk: 4.1.2 dev: true @@ -3362,7 +3379,7 @@ packages: '@jest/schemas': 29.0.0 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.5 + '@types/node': 18.7.18 '@types/yargs': 17.0.12 chalk: 4.1.2 dev: true @@ -3375,7 +3392,7 @@ packages: dependencies: glob: 7.2.3 glob-promise: 4.2.2_glob@7.2.3 - magic-string: 0.26.7 + magic-string: 0.26.3 react-docgen-typescript: 2.2.2_typescript@4.8.2 typescript: 4.8.2 vite: 3.1.0 @@ -3875,7 +3892,7 @@ packages: engines: {node: '>=14'} hasBin: true dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 playwright-core: 1.25.1 dev: true @@ -4913,7 +4930,7 @@ packages: util-deprecate: 1.0.2 watchpack: 2.4.0 webpack: 4.46.0 - ws: 8.10.0 + ws: 8.8.1 x-default-browser: 0.4.0 transitivePeerDependencies: - '@storybook/mdx2-csf' @@ -5097,7 +5114,7 @@ packages: '@babel/preset-env': 7.18.10_@babel+core@7.18.13 '@babel/types': 7.18.13 '@mdx-js/mdx': 1.6.22 - '@types/lodash': 4.14.186 + '@types/lodash': 4.14.184 js-string-escape: 1.0.1 loader-utils: 2.0.2 lodash: 4.17.21 @@ -5117,7 +5134,7 @@ packages: '@babel/types': 7.18.13 '@mdx-js/mdx': 1.6.22 '@mdx-js/react': 1.6.22_react@17.0.2 - '@types/lodash': 4.14.186 + '@types/lodash': 4.14.184 js-string-escape: 1.0.1 loader-utils: 2.0.2 lodash: 4.17.21 @@ -5674,7 +5691,7 @@ packages: /@types/cheerio/0.22.31: resolution: {integrity: sha512-Kt7Cdjjdi2XWSfrZ53v4Of0wG3ZcmaegFXjMmz9tfNrZSkzzo36G0AL1YqSdcIA78Etjt6E609pt5h1xnQkPUw==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true /@types/codemirror/5.60.5: @@ -5686,7 +5703,7 @@ packages: /@types/concat-stream/1.6.1: resolution: {integrity: sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true /@types/cookie/0.4.1: @@ -5715,7 +5732,7 @@ packages: resolution: {integrity: sha512-xryQlOEIe1TduDWAOphR0ihfebKFSWOXpIsk+70JskCfRfW+xALdnJ0r1ZOTo85F9Qsjk6vtlU7edTYHbls9tA==} dependencies: '@types/cheerio': 0.22.31 - '@types/react': 18.0.22 + '@types/react': 18.0.20 dev: true /@types/eslint-scope/3.7.4: @@ -5746,33 +5763,33 @@ packages: /@types/form-data/0.0.33: resolution: {integrity: sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.1 - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true /@types/glob/8.0.0: resolution: {integrity: sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==} dependencies: '@types/minimatch': 5.1.1 - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true /@types/graceful-fs/4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true /@types/hast/2.3.4: @@ -5833,7 +5850,7 @@ packages: /@types/jsdom/20.0.0: resolution: {integrity: sha512-YfAchFs0yM1QPDrLm2VHe+WHGtqms3NXnXAMolrgrVP6fgBHHXy1ozAbo/dFtPNtZC/m66bPiCTWYmqp1F14gA==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 '@types/tough-cookie': 4.0.2 parse5: 7.0.0 dev: true @@ -5846,6 +5863,10 @@ packages: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} dev: true + /@types/lodash/4.14.184: + resolution: {integrity: sha512-RoZphVtHbxPZizt4IcILciSWiC6dcn+eZ8oX9IWEYfDMcocdd42f7NPI6fQj+6zI8y4E0L7gu2pcZKLGTRaV9Q==} + dev: true + /@types/lodash/4.14.186: resolution: {integrity: sha512-eHcVlLXP0c2FlMPm56ITode2AgLMSa6aJ05JTTbYbI+7EMkCEE5qk2E41d5g2lCVTqRe0GnnRFurmlCsDODrPw==} dev: true @@ -5877,7 +5898,7 @@ packages: /@types/node-fetch/2.6.2: resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 form-data: 3.0.1 dev: true @@ -5901,6 +5922,18 @@ packages: resolution: {integrity: sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==} dev: false + /@types/node/18.7.16: + resolution: {integrity: sha512-EQHhixfu+mkqHMZl1R2Ovuvn47PUw18azMJOTwSZr9/fhzHNGXAJ0ma0dayRVchprpCj0Kc1K1xKoWaATWF1qg==} + dev: true + + /@types/node/18.7.18: + resolution: {integrity: sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==} + dev: true + + /@types/node/18.7.23: + resolution: {integrity: sha512-DWNcCHolDq0ZKGizjx2DZjR/PqsYwAcYUJmfMWqtVU2MBMG5Mo+xFZrhGId5r/O5HOuMPyQEcM6KUBp5lBZZBg==} + dev: true + /@types/node/8.10.66: resolution: {integrity: sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==} dev: true @@ -5956,7 +5989,7 @@ packages: /@types/react-is/17.0.3: resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==} dependencies: - '@types/react': 18.0.22 + '@types/react': 18.0.20 dev: false /@types/react-test-renderer/17.0.2: @@ -5968,7 +6001,7 @@ packages: /@types/react-transition-group/4.4.5: resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==} dependencies: - '@types/react': 18.0.22 + '@types/react': 18.0.20 dev: false /@types/react/17.0.49: @@ -5979,17 +6012,25 @@ packages: csstype: 3.1.0 dev: true - /@types/react/18.0.22: - resolution: {integrity: sha512-4yWc5PyCkZN8ke8K9rQHkTXxHIWHxLzzW6RI1kXVoepkD3vULpKzC2sDtAMKn78h92BRYuzf+7b/ms7ajE6hFw==} + /@types/react/18.0.20: + resolution: {integrity: sha512-MWul1teSPxujEHVwZl4a5HxQ9vVNsjTchVA+xRqv/VYGCuKGAU6UhfrTdF5aBefwD1BHUD8i/zq+O/vyCm/FrA==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 csstype: 3.1.0 + /@types/react/18.0.21: + resolution: {integrity: sha512-7QUCOxvFgnD5Jk8ZKlUAhVcRj7GuJRjnjjiY/IUBWKgOlnvDvTMLD4RTF7NPyVmbRhNrbomZiOepg7M/2Kj1mA==} + dependencies: + '@types/prop-types': 15.7.5 + '@types/scheduler': 0.16.2 + csstype: 3.1.0 + dev: true + /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true /@types/scheduler/0.16.2: @@ -5998,7 +6039,7 @@ packages: /@types/set-cookie-parser/2.4.2: resolution: {integrity: sha512-fBZgytwhYAUkj/jC/FAV4RQ5EerRup1YQsXQCh8rZfiHkc4UahC192oH0smGwsXol3cL3A5oETuAHeQHmhXM4w==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true /@types/sinonjs__fake-timers/8.1.1: @@ -6068,7 +6109,7 @@ packages: /@types/webpack-sources/3.2.0: resolution: {integrity: sha512-Ft7YH3lEVRQ6ls8k4Ff1oB4jN6oy/XmU6tQISKdhfh+1mR+viZFphS6WL0IrtDOzvefmJg5a0s7ZQoRXwqTEFg==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 '@types/source-list-map': 0.1.2 source-map: 0.7.4 dev: true @@ -6076,7 +6117,7 @@ packages: /@types/webpack/4.41.32: resolution: {integrity: sha512-cb+0ioil/7oz5//7tZUSwbrSAN/NWHrQylz5cW8G0dWTcF/g+/dSdMlKVZspBYuMAN1+WnwHrkxiRrLcwd0Heg==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 '@types/tapable': 1.0.8 '@types/uglify-js': 3.17.0 '@types/webpack-sources': 3.2.0 @@ -6087,7 +6128,7 @@ packages: /@types/ws/8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true /@types/yargs-parser/21.0.0: @@ -6110,7 +6151,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 dev: true optional: true @@ -6241,193 +6282,160 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@unocss/astro/0.46.0_rollup@2.79.0+vite@3.1.0: - resolution: {integrity: sha512-IHUQ5JpNjc2szW4Y+Vau6QpoZLc+4109R6QMFwjOXwFa88GVmh510GKKmNTIP0f3V/knPdlhu5TWzORNhQUhMw==} - dependencies: - '@unocss/core': 0.46.0 - '@unocss/reset': 0.46.0 - '@unocss/vite': 0.46.0_rollup@2.79.0+vite@3.1.0 - transitivePeerDependencies: - - rollup - - vite - dev: true - - /@unocss/astro/0.46.0_vite@3.1.0: - resolution: {integrity: sha512-IHUQ5JpNjc2szW4Y+Vau6QpoZLc+4109R6QMFwjOXwFa88GVmh510GKKmNTIP0f3V/knPdlhu5TWzORNhQUhMw==} + /@unocss/astro/0.45.26_vite@3.1.0: + resolution: {integrity: sha512-jAdbYNwjyzh05B4B7lhuHYmkNfmIZsQGhRNXogOx0t1BMzRZg9jID5xsJiujaElQL6ll53pbuRRyGV80o75n0Q==} dependencies: - '@unocss/core': 0.46.0 - '@unocss/reset': 0.46.0 - '@unocss/vite': 0.46.0_vite@3.1.0 + '@unocss/core': 0.45.26 + '@unocss/reset': 0.45.26 + '@unocss/vite': 0.45.26_vite@3.1.0 transitivePeerDependencies: - rollup - vite dev: true - /@unocss/cli/0.46.0: - resolution: {integrity: sha512-WFd+atNlrnPCDwBOTw1wH6MJDt75SObQZbO47RJzR7Ek9mcwrEO+fll3K3oy18ftBUA1keZysNYLiRgExudqfA==} + /@unocss/cli/0.45.26: + resolution: {integrity: sha512-pev56gZRYow+/38TfSVMVWmtgl4UGNrgJULqHhfXxHn/CjiG+wJ95/PLYbY/GIZRXy4ttpsVU/iF/5uRvvJ3RA==} engines: {node: '>=14'} hasBin: true dependencies: '@ampproject/remapping': 2.2.0 - '@rollup/pluginutils': 5.0.2 - '@unocss/config': 0.46.0 - '@unocss/core': 0.46.0 - '@unocss/preset-uno': 0.46.0 - cac: 6.7.14 - chokidar: 3.5.3 - colorette: 2.0.19 - consola: 2.15.3 - fast-glob: 3.2.12 - magic-string: 0.26.7 - pathe: 0.3.9 - perfect-debounce: 0.1.3 - transitivePeerDependencies: - - rollup - dev: true - - /@unocss/cli/0.46.0_rollup@2.79.0: - resolution: {integrity: sha512-WFd+atNlrnPCDwBOTw1wH6MJDt75SObQZbO47RJzR7Ek9mcwrEO+fll3K3oy18ftBUA1keZysNYLiRgExudqfA==} - engines: {node: '>=14'} - hasBin: true - dependencies: - '@ampproject/remapping': 2.2.0 - '@rollup/pluginutils': 5.0.2_rollup@2.79.0 - '@unocss/config': 0.46.0 - '@unocss/core': 0.46.0 - '@unocss/preset-uno': 0.46.0 + '@rollup/pluginutils': 4.2.1 + '@unocss/config': 0.45.26 + '@unocss/core': 0.45.26 + '@unocss/preset-uno': 0.45.26 cac: 6.7.14 chokidar: 3.5.3 colorette: 2.0.19 consola: 2.15.3 fast-glob: 3.2.12 - magic-string: 0.26.7 - pathe: 0.3.9 + magic-string: 0.26.5 + pathe: 0.3.8 perfect-debounce: 0.1.3 transitivePeerDependencies: - rollup dev: true - /@unocss/config/0.46.0: - resolution: {integrity: sha512-pZOUtuepJ6Wkj5KTVTKJkM6S5ma0dcNdvvWQyECU77eLq7/luO0sDzQ+o16SyZWXTS9paN92nwekvQzFeJ6Pmw==} + /@unocss/config/0.45.26: + resolution: {integrity: sha512-bmNlYoGl4oHdmrb6TwuiVbVShuT3TsYJQ6MPXnVipPkAJpyJ47uU6ZAfDMqwCU0AqsLah3hSDQpDIJL5j+9tug==} engines: {node: '>=14'} dependencies: - '@unocss/core': 0.46.0 - unconfig: 0.3.7 + '@unocss/core': 0.45.26 + unconfig: 0.3.6 dev: true - /@unocss/core/0.46.0: - resolution: {integrity: sha512-Y3i35qUc5/EwxsgYGb1E/2va1KiDXQ0s0mvZkYGAb28nfv5OH+6PnaKdzJDTBEDawFIJZ0vkd1c8/lJzNqx8pQ==} + /@unocss/core/0.45.26: + resolution: {integrity: sha512-V7lNAXy1Ou2+UsD8n8a0ynE7BPuMtZSn6dQtrhNvtkstEBZtBAvlGM07wnSqwZfYeKs8k/MA6Z7S0yJKQzcl1Q==} dev: true - /@unocss/inspector/0.46.0: - resolution: {integrity: sha512-g+MoRHrKwYaEVlB8tVVAn1jzcwiZke2b0EIHaY+6c+gJ2LOqw3vh2HcQtYRuypiH4grQtTf11z8p+J38h12Ttw==} + /@unocss/inspector/0.45.26: + resolution: {integrity: sha512-rteTaMVWstGlCG5+k744kFzQLYAWgCf2ys2CRfm6SX7YC2JGBmELCwSABGrylkyItTnH50ayZcDk21GKEfC/Mw==} dependencies: gzip-size: 6.0.0 sirv: 2.0.2 dev: true - /@unocss/preset-attributify/0.46.0: - resolution: {integrity: sha512-TY4XO3DrMkGC4+j/GUd7vfNPQlQyr1WmOxQfE9Tanec5QhN4R7JYjucNpp9lI+j7S5jRIyGdiwTppSYC/t7KPA==} + /@unocss/preset-attributify/0.45.26: + resolution: {integrity: sha512-+BA27/d+IEJtt/P7+fHUl/OYJNhSVBoCRxIO6JiQhEw36n821UMVd9CdnfxPBEBIaS2fXQvNF4yO5jnr4Wj5Qw==} dependencies: - '@unocss/core': 0.46.0 + '@unocss/core': 0.45.26 dev: true - /@unocss/preset-icons/0.46.0: - resolution: {integrity: sha512-nEmGCxbFbidr6GdeJrnstwypXTElNvbj4Pbl/8QKuFxyQmLhQbV1hLPyMX9BuaUkttWzo8zS/hDQ6LaiaQOMJw==} + /@unocss/preset-icons/0.45.26: + resolution: {integrity: sha512-PL2Fi6KGYZAY9vNyEC+EBDqSYaiXEuUaTkPOaCVrEsig0E5DOm62A5FmJ/0vHmNSXEOVqV17jiDKp+fNM/h61g==} dependencies: - '@iconify/utils': 2.0.1 - '@unocss/core': 0.46.0 - ohmyfetch: 0.4.20 + '@iconify/utils': 2.0.0 + '@unocss/core': 0.45.26 + ohmyfetch: 0.4.19 transitivePeerDependencies: - supports-color dev: true - /@unocss/preset-mini/0.46.0: - resolution: {integrity: sha512-qe3iw1GUHf1S+qt58mghlmxkeO7z67Eda9QiM4LyQ1fSxsSd4J1CFCMczTRe4HoZHnnzZ6dMr98Fab1ZPH3Mdw==} + /@unocss/preset-mini/0.45.26: + resolution: {integrity: sha512-Kab6F2pZHzJudGene6NwGMYA96fuU8gNjCVouSd6oqFF1ZhEBxkQOR56TRjppyCi0MU89hciV5T6kcVZDquGUw==} dependencies: - '@unocss/core': 0.46.0 + '@unocss/core': 0.45.26 dev: true - /@unocss/preset-tagify/0.46.0: - resolution: {integrity: sha512-EQVKWRMUbLKFvERmQVF+EnjCi8aAUCJH6OigSL4Zr2kTe0rh5Zmt1TttHNPI0mKSSqz8xqNBluUOVJVqicsg0g==} + /@unocss/preset-tagify/0.45.26: + resolution: {integrity: sha512-4zhdD/EKW5BYsiKO8PQdUXU4I5riJNM9ykEyhESFaCM6/+3a8GRvrnON57cRuiqX5LvJeXfbtGXQCOdMGEIi4Q==} dependencies: - '@unocss/core': 0.46.0 + '@unocss/core': 0.45.26 dev: true - /@unocss/preset-typography/0.46.0: - resolution: {integrity: sha512-i/Sr4xGaaKa1KXwIZpdS6l67uz/0OS10J+ctfYUKyL66Bv0YWeW2w1uaGVmq8KSnw6rv3hZQ8UGR40AClwyFcw==} + /@unocss/preset-typography/0.45.26: + resolution: {integrity: sha512-HBkox5t1AKQ3SwMbvDhHDaWBOsP3Z1RW67oyVpEgipZHL5SYN9YwGkveaj6J0SJDJMtYRwFkKD5Zvd4KvnzSfQ==} dependencies: - '@unocss/core': 0.46.0 + '@unocss/core': 0.45.26 dev: true - /@unocss/preset-uno/0.46.0: - resolution: {integrity: sha512-eDe7xeGlom1Ym3c07INb4z0IMw/F81Iqi9X1RFF3iendLRa0gnndPj/LAmaS23etCsaQ4zIuV2kw5qle7NHBFA==} + /@unocss/preset-uno/0.45.26: + resolution: {integrity: sha512-Am4Ymz7tKwufm6QP2GxT8oIQ1Qez+ikk5miZ94K5IpMguVqMP1FwAu8aFtoItH5jVuDb4JxyZyo66oSFd4+h8g==} dependencies: - '@unocss/core': 0.46.0 - '@unocss/preset-mini': 0.46.0 - '@unocss/preset-wind': 0.46.0 + '@unocss/core': 0.45.26 + '@unocss/preset-mini': 0.45.26 + '@unocss/preset-wind': 0.45.26 dev: true - /@unocss/preset-web-fonts/0.46.0: - resolution: {integrity: sha512-bdnaOJHJoCToZOTjymXKEZA2L9cSj8hG73HaW9T5kiIOisxfddD7Ajy0rUvvvRd9nvSupiEAeDeJGf4Ep1HIng==} + /@unocss/preset-web-fonts/0.45.26: + resolution: {integrity: sha512-6J3VjrYcYGwVDzdcKE0NYQhvuXkS/Fo54ZlEWScVOSygvBYOEsObo+6Vs9Q1yMbVuVnNrt3R38/KMQFqPEWXKw==} dependencies: - '@unocss/core': 0.46.0 - ohmyfetch: 0.4.20 + '@unocss/core': 0.45.26 + ohmyfetch: 0.4.19 dev: true - /@unocss/preset-wind/0.46.0: - resolution: {integrity: sha512-tyde6wKcqiYRNoQa7oeInObbTKToz4cIu7Qzcvg9LrcROEKhxa3JE9rAZjxZZa4JUNqdcd8ndFhipy8uNszrrg==} + /@unocss/preset-wind/0.45.26: + resolution: {integrity: sha512-/7YnUIXBkakeNzDpxsOzoHgVKL/nH9kyKHT1hSLj60IlAoN+YfoOwpCOn+taysovjiGmLIKdeEuOAN3HuEi1aw==} dependencies: - '@unocss/core': 0.46.0 - '@unocss/preset-mini': 0.46.0 + '@unocss/core': 0.45.26 + '@unocss/preset-mini': 0.45.26 dev: true - /@unocss/reset/0.46.0: - resolution: {integrity: sha512-+zbdk4nlfIvSooDwyhuXxbgYOnrDMDskIXz+Jn/FzPooEpwNoOryKc+lzaP6YZdJ1bFK8oeF/lCNha8kbTBDpQ==} + /@unocss/reset/0.45.26: + resolution: {integrity: sha512-9X0cSvGPXdZ1KAuiWzFWtcoyfC7b8j4GYHr4lDXRkPC5oI3CJhw4WcdvzTHVPqOX2CKqq731H4GhcQ5c5LBuHA==} dev: true - /@unocss/scope/0.46.0: - resolution: {integrity: sha512-IJ1T912M/oOH1KLmec/6i90KEbXVNT9FjoKOSBMrtLPHu24CVBnYBDQV1cCv0HqseW8PntzZ1sLgZT329rqowA==} + /@unocss/scope/0.45.26: + resolution: {integrity: sha512-t5ADmEW9Rhf4Ku0DHwgPoy2mTU0eRrpx6QfXFWtWC+ZtHsjOcC9RXgWYXKZmINtiY+FzQ8A+v/k0wlIuvhJF7g==} dev: true - /@unocss/transformer-attributify-jsx/0.46.0: - resolution: {integrity: sha512-lSuqkAKDyx+eA9JlU/LTjQNc/HWockUdP4NTiSc3gp/boYt6xaagQaC+6RKvKCgarR7EVI+Dxfy5DUjCDPi/tQ==} + /@unocss/transformer-attributify-jsx/0.45.26: + resolution: {integrity: sha512-fuNnbqe/Ld07fZLZhNtJb6HpSNf6Lw+HlPGdDNzKdbOVUkJwCmBuRifySLkx4HMCn+ld/iniZvyqUgRDLOVanA==} dependencies: - '@unocss/core': 0.46.0 + '@unocss/core': 0.45.26 dev: true - /@unocss/transformer-compile-class/0.46.0: - resolution: {integrity: sha512-iF6KUTRzhsYCNn6FAGpL68IDew63N2xfBwr4v/dH1pWLqUTZlvQKDQnKvZGf5Fnlzvb2i3TwbliV/670rigPow==} + /@unocss/transformer-compile-class/0.45.26: + resolution: {integrity: sha512-cuDUnNrXcqMezuHcT74tBWdbA55hKTS+g8iESaREnRbdCfnmxTSO/GyrRPsQB5ULL465ENwiOaXJhKkLSfTQqw==} dependencies: - '@unocss/core': 0.46.0 + '@unocss/core': 0.45.26 dev: true - /@unocss/transformer-directives/0.46.0: - resolution: {integrity: sha512-qq/A6Q/N3kwIN/XwMRtsVIlvVh1xNVDNN1ryOR+m7GHIS4iNrwomBmRRZfIoK7jKybLNEqROf/uFuepA/b+5xg==} + /@unocss/transformer-directives/0.45.26: + resolution: {integrity: sha512-9Ypquxnsp2gAAlEPhQwXIfaEVqWsLyryd0VttQy0+kzxG8koPiMkKtYsiw6vN8tsEzklVQiydLct4HCONaMzHQ==} dependencies: - '@unocss/core': 0.46.0 + '@unocss/core': 0.45.26 css-tree: 2.2.1 dev: true - /@unocss/transformer-variant-group/0.46.0: - resolution: {integrity: sha512-Hu+A0ywLvXk8VRFXcmWPRjTTuIKsrWZ0bhQATwZJfpsEjxYivrBQUXKngkbBYJYBz1bn+kEgBlxaybzRhdmznw==} + /@unocss/transformer-variant-group/0.45.26: + resolution: {integrity: sha512-MUManbGNe1q5/dm4QLW1SbegeH/06ZbYyREfJEy7U5Ze5Npe67a1eZ4EA4b6el5Y8Bd+wpJ4xj1D+fxC6NVWJQ==} dependencies: - '@unocss/core': 0.46.0 + '@unocss/core': 0.45.26 dev: true - /@unocss/vite/0.46.0_rollup@2.79.0+vite@3.1.0: - resolution: {integrity: sha512-VF/GwY5aQFnUSWZBfTibOuqs0HR1HUWFyharVJf2ru1c7WE00hHKhLlaBbU41agTyTZUY1l3xVIg6coTEYHC6A==} + /@unocss/vite/0.45.26_vite@3.1.0: + resolution: {integrity: sha512-9BNJXBN0UG+olMbfIcVcrJgBetyO3HOP6Wx3r5Oc8iwfYSxrWQlHFF+yVJi/+oxsENfsjAgCRH7O+nF4FrXceA==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 dependencies: '@ampproject/remapping': 2.2.0 - '@rollup/pluginutils': 5.0.2_rollup@2.79.0 - '@unocss/config': 0.46.0 - '@unocss/core': 0.46.0 - '@unocss/inspector': 0.46.0 - '@unocss/scope': 0.46.0 - '@unocss/transformer-directives': 0.46.0 - magic-string: 0.26.7 + '@rollup/pluginutils': 4.2.1 + '@unocss/config': 0.45.26 + '@unocss/core': 0.45.26 + '@unocss/inspector': 0.45.26 + '@unocss/scope': 0.45.26 + '@unocss/transformer-directives': 0.45.26 + magic-string: 0.26.5 vite: 3.1.0 transitivePeerDependencies: - rollup @@ -6478,7 +6486,7 @@ packages: '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.18.13 '@babel/plugin-transform-react-jsx-self': 7.18.6_@babel+core@7.18.13 '@babel/plugin-transform-react-jsx-source': 7.18.6_@babel+core@7.18.13 - magic-string: 0.26.7 + magic-string: 0.26.3 react-refresh: 0.14.0 transitivePeerDependencies: - supports-color @@ -6495,7 +6503,7 @@ packages: '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.18.13 '@babel/plugin-transform-react-jsx-self': 7.18.6_@babel+core@7.18.13 '@babel/plugin-transform-react-jsx-source': 7.18.6_@babel+core@7.18.13 - magic-string: 0.26.7 + magic-string: 0.26.3 react-refresh: 0.14.0 vite: 3.1.0 transitivePeerDependencies: @@ -6683,6 +6691,10 @@ packages: resolution: {integrity: sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ==} dev: true + /@vue/devtools-api/6.4.2: + resolution: {integrity: sha512-6hNZ23h1M2Llky+SIAmVhL7s6BjLtZBCzjIz9iRSBUsysjE7kC39ulW0dH4o/eZtycmSt4qEr6RDVGTIuWu+ow==} + dev: true + /@vue/reactivity-transform/3.2.39: resolution: {integrity: sha512-HGuWu864zStiWs9wBC6JYOP1E00UjMdDWIG5W+FpUx28hV3uz9ODOKVNm/vdOy/Pvzg8+OcANxAVC85WFBbl3A==} dependencies: @@ -9370,8 +9382,8 @@ packages: engines: {node: '>=12'} dev: false - /d3-graph-controller/2.3.19: - resolution: {integrity: sha512-NEUDJIyY+YzWEVel31Hm6K8TAZ2gFH75NJcbO7Y0tLN+7eJrlb6CQcCe4p2DvWAKEapj6msSA9Tn5wA6nYk2ig==} + /d3-graph-controller/2.3.17: + resolution: {integrity: sha512-M2ydlsf8Et3MyqS5rwqIErvJ70fQdovxPN7Al8FH6cU+z0yZXq2axrYEG6VIrETgCyPpDbBohddQwPVUOSiiSA==} dependencies: '@yeger/debounce': 1.0.48 d3-drag: 3.0.0 @@ -10034,6 +10046,11 @@ packages: engines: {node: '>=0.12'} dev: true + /entities/4.4.0: + resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==} + engines: {node: '>=0.12'} + dev: true + /enzyme-shallow-equal/1.0.4: resolution: {integrity: sha512-MttIwB8kKxypwHvRynuC3ahyNc+cFbR8mjVIltnmzQ0uKGqmsfO4bfBuLxb0beLNPhjblUEYvEbsg+VSygvF1Q==} dependencies: @@ -10671,8 +10688,9 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint/eslintrc': 1.3.3 - '@humanwhocodes/config-array': 0.11.6 + '@eslint/eslintrc': 1.3.2 + '@humanwhocodes/config-array': 0.10.7 + '@humanwhocodes/gitignore-to-minimatch': 1.0.2 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 @@ -10719,7 +10737,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint/eslintrc': 1.3.3 + '@eslint/eslintrc': 1.3.1 '@humanwhocodes/config-array': 0.9.5 ajv: 6.12.6 chalk: 4.1.2 @@ -13119,7 +13137,7 @@ packages: dependencies: '@jest/types': 26.6.2 '@types/graceful-fs': 4.1.5 - '@types/node': 18.11.5 + '@types/node': 18.7.18 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.10 @@ -13187,7 +13205,7 @@ packages: resolution: {integrity: sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==} engines: {node: '>= 10.14.2'} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 graceful-fs: 4.2.10 dev: true @@ -13196,7 +13214,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 18.11.5 + '@types/node': 18.7.18 chalk: 4.1.2 graceful-fs: 4.2.10 is-ci: 2.0.0 @@ -13208,7 +13226,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.0.1 - '@types/node': 18.11.5 + '@types/node': 18.7.18 chalk: 4.1.2 ci-info: 3.3.2 graceful-fs: 4.2.10 @@ -13219,7 +13237,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -13228,7 +13246,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.7.18 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -13376,6 +13394,47 @@ packages: - utf-8-validate dev: true + /jsdom/20.0.1: + resolution: {integrity: sha512-pksjj7Rqoa+wdpkKcLzQRHhJCEE42qQhl/xLMUKHgoSejaKOdaXEAnqs6uDNwMl/fciHTzKeR8Wm8cw7N+g98A==} + engines: {node: '>=14'} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + dependencies: + abab: 2.0.6 + acorn: 8.8.0 + acorn-globals: 7.0.1 + cssom: 0.5.0 + cssstyle: 2.3.0 + data-urls: 3.0.2 + decimal.js: 10.4.1 + domexception: 4.0.0 + escodegen: 2.0.0 + form-data: 4.0.0 + html-encoding-sniffer: 3.0.0 + http-proxy-agent: 5.0.0 + https-proxy-agent: 5.0.1 + is-potential-custom-element-name: 1.0.1 + nwsapi: 2.2.2 + parse5: 7.1.1 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 4.1.2 + w3c-xmlserializer: 3.0.0 + webidl-conversions: 7.0.0 + whatwg-encoding: 2.0.0 + whatwg-mimetype: 3.0.0 + whatwg-url: 11.0.0 + ws: 8.9.0 + xml-name-validator: 4.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /jsesc/0.5.0: resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} hasBin: true @@ -13865,8 +13924,8 @@ packages: sourcemap-codec: 1.4.8 dev: true - /magic-string/0.26.7: - resolution: {integrity: sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==} + /magic-string/0.26.5: + resolution: {integrity: sha512-yXUIYOOQnEHKHOftp5shMWpB9ImfgfDJpapa38j/qMtTj5QHWucvxP4lUtuRmHT9vAzvtpHkWKXW9xBwimXeNg==} engines: {node: '>=12'} dependencies: sourcemap-codec: 1.4.8 @@ -14271,6 +14330,15 @@ packages: hasBin: true dev: true + /mlly/0.5.14: + resolution: {integrity: sha512-DgRgNUSX9NIxxCxygX4Xeg9C7GX7OUx1wuQ8cXx9o9LE0e9wrH+OZ9fcnrlEedsC/rtqry3ZhUddC759XD/L0w==} + dependencies: + acorn: 8.8.0 + pathe: 0.3.5 + pkg-types: 0.3.4 + ufo: 0.8.5 + dev: true + /mlly/0.5.16: resolution: {integrity: sha512-LaJ8yuh4v0zEmge/g3c7jjFlhoCPfQn6RCjXgm9A0Qiuochq4BcuOxVfWmdnCoLTlg2MV+hqhOek+W2OhG0Lwg==} dependencies: @@ -15122,6 +15190,12 @@ packages: entities: 4.4.0 dev: true + /parse5/7.1.1: + resolution: {integrity: sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg==} + dependencies: + entities: 4.4.0 + dev: true + /parseurl/1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} @@ -15376,6 +15450,14 @@ packages: find-up: 5.0.0 dev: true + /pkg-types/0.3.4: + resolution: {integrity: sha512-s214f/xkRpwlwVBToWq9Mu0XlU3HhZMYCnr2var8+jjbavBHh/VCh4pBLsJW29rJ//B1jb4HlpMIaNIMH+W2/w==} + dependencies: + jsonc-parser: 3.2.0 + mlly: 0.5.14 + pathe: 0.3.5 + dev: true + /pkg-types/0.3.5: resolution: {integrity: sha512-VkxCBFVgQhNHYk9subx+HOhZ4jzynH11ah63LZsprTKwPCWG9pfWBlkElWFbvkP9BVR0dP1jS9xPdhaHQNK74Q==} dependencies: @@ -16641,7 +16723,7 @@ packages: rollup: ^2.55 typescript: ^4.1 dependencies: - magic-string: 0.26.7 + magic-string: 0.26.5 rollup: 2.79.0 typescript: 4.8.4 optionalDependencies: @@ -16684,7 +16766,7 @@ packages: commenting: 1.1.0 glob: 7.2.3 lodash: 4.17.21 - magic-string: 0.26.7 + magic-string: 0.26.5 mkdirp: 1.0.4 moment: 2.29.4 package-name-regex: 2.0.6 @@ -18411,12 +18493,6 @@ packages: hasBin: true dev: true - /typescript/4.8.4: - resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} - engines: {node: '>=4.2.0'} - hasBin: true - dev: true - /ufo/0.8.5: resolution: {integrity: sha512-e4+UtA5IRO+ha6hYklwj6r7BjiGMxS0O+UaSg9HbaTefg4kMkzj4tXzEBajRR+wkxf+golgAWKzLbytCUDMJAA==} @@ -18507,6 +18583,26 @@ packages: vfile: 4.2.1 dev: true + /unimport/0.6.7_rollup@2.79.0+vite@3.1.0: + resolution: {integrity: sha512-EMoVqDjswHkU+nD098QYHXH7Mkw7KwGDQAyeRF2lgairJnuO+wpkhIcmCqrD1OPJmsjkTbJ2tW6Ap8St0PuWZA==} + dependencies: + '@rollup/pluginutils': 4.2.1 + escape-string-regexp: 5.0.0 + fast-glob: 3.2.12 + local-pkg: 0.4.2 + magic-string: 0.26.3 + mlly: 0.5.14 + pathe: 0.3.5 + scule: 0.3.2 + strip-literal: 0.4.2 + unplugin: 0.9.5_rollup@2.79.0+vite@3.1.0 + transitivePeerDependencies: + - esbuild + - rollup + - vite + - webpack + dev: true + /unimport/0.6.7_vite@3.1.0: resolution: {integrity: sha512-EMoVqDjswHkU+nD098QYHXH7Mkw7KwGDQAyeRF2lgairJnuO+wpkhIcmCqrD1OPJmsjkTbJ2tW6Ap8St0PuWZA==} dependencies: @@ -18514,8 +18610,8 @@ packages: escape-string-regexp: 5.0.0 fast-glob: 3.2.12 local-pkg: 0.4.2 - magic-string: 0.26.7 - mlly: 0.5.16 + magic-string: 0.26.3 + mlly: 0.5.14 pathe: 0.3.5 scule: 0.3.2 strip-literal: 0.4.2 @@ -18637,32 +18733,32 @@ packages: detect-node: 2.1.0 dev: false - /unocss/0.46.0_rollup@2.79.0+vite@3.1.0: - resolution: {integrity: sha512-AWO47Cgl0KdP+zUHEs3SXfPB7dyx/LhXtu5mSPxA3xjfXzuUOeVvJCjL7vPLFy8XEzhiP9iWmUVuj520R+hFUQ==} + /unocss/0.45.26_vite@3.1.0: + resolution: {integrity: sha512-d8mDD6YewHfSCA2uGbBzKY/UnQRSrIDgP7gI61Ll6XY+DcLCVMn0vc1BubQGEL2K0wP9wDsI8HDR6VzDI/0w9w==} engines: {node: '>=14'} peerDependencies: - '@unocss/webpack': 0.46.0 + '@unocss/webpack': 0.45.26 peerDependenciesMeta: '@unocss/webpack': optional: true dependencies: - '@unocss/astro': 0.46.0_rollup@2.79.0+vite@3.1.0 - '@unocss/cli': 0.46.0_rollup@2.79.0 - '@unocss/core': 0.46.0 - '@unocss/preset-attributify': 0.46.0 - '@unocss/preset-icons': 0.46.0 - '@unocss/preset-mini': 0.46.0 - '@unocss/preset-tagify': 0.46.0 - '@unocss/preset-typography': 0.46.0 - '@unocss/preset-uno': 0.46.0 - '@unocss/preset-web-fonts': 0.46.0 - '@unocss/preset-wind': 0.46.0 - '@unocss/reset': 0.46.0 - '@unocss/transformer-attributify-jsx': 0.46.0 - '@unocss/transformer-compile-class': 0.46.0 - '@unocss/transformer-directives': 0.46.0 - '@unocss/transformer-variant-group': 0.46.0 - '@unocss/vite': 0.46.0_rollup@2.79.0+vite@3.1.0 + '@unocss/astro': 0.45.26_vite@3.1.0 + '@unocss/cli': 0.45.26 + '@unocss/core': 0.45.26 + '@unocss/preset-attributify': 0.45.26 + '@unocss/preset-icons': 0.45.26 + '@unocss/preset-mini': 0.45.26 + '@unocss/preset-tagify': 0.45.26 + '@unocss/preset-typography': 0.45.26 + '@unocss/preset-uno': 0.45.26 + '@unocss/preset-web-fonts': 0.45.26 + '@unocss/preset-wind': 0.45.26 + '@unocss/reset': 0.45.26 + '@unocss/transformer-attributify-jsx': 0.45.26 + '@unocss/transformer-compile-class': 0.45.26 + '@unocss/transformer-directives': 0.45.26 + '@unocss/transformer-variant-group': 0.45.26 + '@unocss/vite': 0.45.26_vite@3.1.0 transitivePeerDependencies: - rollup - supports-color @@ -19165,15 +19261,15 @@ packages: optionalDependencies: fsevents: 2.3.2 - /vitepress/1.0.0-alpha.22: - resolution: {integrity: sha512-IWqnAxMDNaiyl6Bz+/79l40Ho6xsjrqxRp/WZw0+5BXR0BTZbmHyhGtI3XrH6oSn8MisLPjCccikaj3mcmCoWg==} + /vitepress/1.0.0-alpha.18: + resolution: {integrity: sha512-6Co3/t+oeF6vxJxG7/uy5/wIr+P/8szeFjn3gu/dpJ1aOGA0gnQ+61P8J52b2VTFSDpFC63adLvUFacdCJXywg==} hasBin: true dependencies: '@docsearch/css': 3.2.1 '@docsearch/js': 3.2.1 - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 - '@vue/devtools-api': 6.4.4 - '@vueuse/core': 9.3.1_vue@3.2.41 + '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 + '@vue/devtools-api': 6.4.2 + '@vueuse/core': 9.3.0_vue@3.2.40 body-scroll-lock: 4.0.0-beta.0 shiki: 0.11.1 vite: 3.1.0 @@ -19855,6 +19951,31 @@ packages: optional: true dev: true + /ws/8.8.1: + resolution: {integrity: sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /ws/8.9.0: + resolution: {integrity: sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + /x-default-browser/0.4.0: resolution: {integrity: sha512-7LKo7RtWfoFN/rHx1UELv/2zHGMx8MkZKDq1xENmOCTkfIqZJ0zZ26NEJX8czhnPXVcqS0ARjjfJB+eJ0/5Cvw==} hasBin: true From 64a74a9e1134cc6e9c3719397fef6b2f4027bb01 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 2 Oct 2022 10:34:53 +0200 Subject: [PATCH 10/33] chore: fix filters --- packages/vitest/src/node/cli.ts | 2 +- packages/vitest/src/node/core.ts | 6 ++-- packages/vitest/src/types/config.ts | 10 +++--- packages/vitest/src/typescript/parse.ts | 12 ++++--- packages/vitest/src/typescript/parser.ts | 2 +- packages/vitest/src/typescript/utils.ts | 40 ------------------------ test/typescript/package.json | 4 +-- test/typescript/test.test-d.ts | 19 ++--------- test/typescript/tsconfig.json | 6 ---- test/typescript/vitest.config.ts | 14 --------- 10 files changed, 22 insertions(+), 93 deletions(-) delete mode 100644 test/typescript/tsconfig.json delete mode 100644 test/typescript/vitest.config.ts diff --git a/packages/vitest/src/node/cli.ts b/packages/vitest/src/node/cli.ts index cac68e00b67b..582526457f27 100644 --- a/packages/vitest/src/node/cli.ts +++ b/packages/vitest/src/node/cli.ts @@ -66,7 +66,7 @@ cli .action(benchmark) cli - .command('typecheck') + .command('typecheck [...filters]') .action(typecheck) cli diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 744a601dccb0..248af83edc41 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -153,8 +153,8 @@ export class Vitest { ) as ResolvedConfig } - async typecheck() { - const testsFilesList = await this.globTestFiles() + async typecheck(filters?: string[]) { + const testsFilesList = await this.globTestFiles(filters) const checker = new Typechecker(this, testsFilesList) this.typechecker = checker checker.onParseEnd(async ({ files, sourceErrors }) => { @@ -197,7 +197,7 @@ export class Vitest { async start(filters?: string[]) { if (this.mode === 'typecheck') { - await this.typecheck() + await this.typecheck(filters) return } diff --git a/packages/vitest/src/types/config.ts b/packages/vitest/src/types/config.ts index e43da2ebb4df..23b120a8aaf5 100644 --- a/packages/vitest/src/types/config.ts +++ b/packages/vitest/src/types/config.ts @@ -472,17 +472,17 @@ export interface TypecheckConfig { * Do not fail, if Vitest found errors not inside the test files. */ ignoreSourceErrors?: boolean + /** + * Path to tsconfig, relative to the project root. + */ + tsconfig?: string } export interface UserConfig extends InlineConfig { /** * Path to the config file. * - * Default resolving to one of: - * - `vitest.config.js` - * - `vitest.config.ts` - * - `vite.config.js` - * - `vite.config.ts` + * Default resolving to `vitest.config.*`, `vite.config.*` */ config?: string | undefined diff --git a/packages/vitest/src/typescript/parse.ts b/packages/vitest/src/typescript/parse.ts index 33d99b7bb483..83e97957eff2 100644 --- a/packages/vitest/src/typescript/parse.ts +++ b/packages/vitest/src/typescript/parse.ts @@ -2,6 +2,7 @@ import path from 'node:path' import url from 'node:url' import { writeFile } from 'node:fs/promises' import { getTsconfig } from 'get-tsconfig' +import type { TypecheckConfig } from '../types' import type { RawErrsMap, TscErrorInfo } from './types' const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) @@ -56,11 +57,14 @@ export async function makeTscErrorInfo( ] } -export async function getTsconfigPath(root: string) { - const tmpConfigPath = path.join(root, 'tsconfig.tmp.json') // TODO put into tmp dir - // TODO delete after use +export async function getTsconfigPath(root: string, config: TypecheckConfig) { + const tmpConfigPath = path.join(root, 'tsconfig.tmp.json') - const tsconfig = getTsconfig(root) + const configName = config.tsconfig?.includes('jsconfig.json') + ? 'jsconfig.json' + : undefined + + const tsconfig = getTsconfig(config.tsconfig || root, configName) if (!tsconfig) throw new Error('no tsconfig.json found') diff --git a/packages/vitest/src/typescript/parser.ts b/packages/vitest/src/typescript/parser.ts index ef3644131400..d24f95030c3a 100644 --- a/packages/vitest/src/typescript/parser.ts +++ b/packages/vitest/src/typescript/parser.ts @@ -179,7 +179,7 @@ export class Typechecker { const packageName = typecheck.checker === 'tsc' ? 'typescript' : 'vue-tsc' await ensurePackageInstalled(packageName, root) - this.tmpConfigPath = await getTsconfigPath(root) + this.tmpConfigPath = await getTsconfigPath(root, typecheck) let cmd = `${typecheck.checker} --noEmit --pretty false -p ${this.tmpConfigPath}` // use builtin watcher, because it's faster if (watch) diff --git a/packages/vitest/src/typescript/utils.ts b/packages/vitest/src/typescript/utils.ts index 5d2ac93684b8..c993921be418 100644 --- a/packages/vitest/src/typescript/utils.ts +++ b/packages/vitest/src/typescript/utils.ts @@ -115,43 +115,3 @@ export const createIndexMap = (source: string) => { } return map } - -// const getTockenChar = (source: string, index: number, offset: number) => { -// let char = source[index += offset] -// while (index >= 0 && /\s/.test(char)) { -// index += offset -// char = source[index] -// } -// return char -// } - -// const getTockenIndex = (source: string, index: number, offset: number, char: string) => { -// let currentChar = source[index] -// while (index >= 0 && currentChar !== char) { -// index += offset -// currentChar = source[index] -// } -// return index -// } - -// const getMethod = (source: string, index: number): string | null => { -// if (index == null) -// return null -// const prevChar = getTockenChar(source, index, -1) -// // .toBe() -// // ^~~~~~ -// if (prevChar === '.') { -// const [method] = source.slice(index).match(/[^<(]+/) || [] -// return method -// } -// // .toBe(value) -// // ^~~~~~ -// const startIndex = getTockenIndex(source, index, -1, '.') -// const [method] = source.slice(startIndex + 1).replace(/\s*/, '').match(/[^<(]+/) || [] -// // toBe(value) case -> method = Some> -// // toBe(value) case -> method = Some> -// if (!method.includes('>')) -// return method -// const closestNonTypeDot = getTockenIndex(source, startIndex, -1, '<') -// return getMethod(source, closestNonTypeDot) -// } diff --git a/test/typescript/package.json b/test/typescript/package.json index 081ae147731a..6ea57579aed3 100644 --- a/test/typescript/package.json +++ b/test/typescript/package.json @@ -1,6 +1,6 @@ { "scripts": { - "test": "vitest typecheck", + "test": "vitest typecheck --run", "tsc": "tsc --watch --pretty false --noEmit" }, "dependencies": { @@ -10,4 +10,4 @@ "typescript": "^4.8.4", "vue-tsc": "^0.40.13" } -} \ No newline at end of file +} diff --git a/test/typescript/test.test-d.ts b/test/typescript/test.test-d.ts index 21511b1e0179..ef2bc662e114 100644 --- a/test/typescript/test.test-d.ts +++ b/test/typescript/test.test-d.ts @@ -1,4 +1,4 @@ -// import { describe, expectTypeOf, test } from 'vitest' +import { describe, expectTypeOf, test } from 'vitest' describe('test', () => { test('some-test', () => { @@ -15,19 +15,4 @@ describe('test', () => { }) }) -// interface Thor { -// 'name.first': string -// 'name.first.second.third': string -// } - -// expectTypeOf(45) -// // test -// .toBe(45) - -// expectTypeOf().toBeNever() -expectTypeOf('hren').toBe(45) -// expectTypeOf({ wolk: 'true' }).toHaveProperty('wol') -// expectTypeOf({ wolk: 'true' }).not.toHaveProperty('wol') -// expectTypeOf((v): v is boolean => true).asserts.toBe() -// expectTypeOf({ wlk: 'true' }).toMatch({ msg: '' }) -// expectTypeOf((tut: string) => tut).toBeCallableWith(45) +expectTypeOf({ wolk: 'true' }).toHaveProperty('wolk') diff --git a/test/typescript/tsconfig.json b/test/typescript/tsconfig.json deleted file mode 100644 index fdf529387c4c..000000000000 --- a/test/typescript/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "types": ["vitest/globals"] - } -} \ No newline at end of file diff --git a/test/typescript/vitest.config.ts b/test/typescript/vitest.config.ts deleted file mode 100644 index a17ca29fb05c..000000000000 --- a/test/typescript/vitest.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineConfig } from 'vitest/config' - -export default defineConfig({ - test: { - typecheck: { - checker: 'vue-tsc', - // include: [ - // // '**/*.test-d.ts', - // // '**/*.test-d.js', - // ], - allowJs: true, - }, - }, -}) From ba4daac0391a160be24803c0ef1e98812784f2c4 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 2 Oct 2022 11:02:50 +0200 Subject: [PATCH 11/33] chore: cleanup --- packages/vitest/globals.d.ts | 1 + packages/vitest/src/constants.ts | 1 + packages/vitest/src/node/cli-wrapper.ts | 2 +- packages/vitest/src/types/index.ts | 1 + packages/vitest/src/typescript/assertType.ts | 2 +- packages/vitest/src/typescript/collect.ts | 3 ++- packages/vitest/src/typescript/parser.ts | 3 +-- 7 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/vitest/globals.d.ts b/packages/vitest/globals.d.ts index d9e8f3c3fc48..c1096c5501ec 100644 --- a/packages/vitest/globals.d.ts +++ b/packages/vitest/globals.d.ts @@ -4,6 +4,7 @@ declare global { const describe: typeof import('vitest')['describe'] const it: typeof import('vitest')['it'] const expectTypeOf: typeof import('vitest')['expectTypeOf'] + const assertType: typeof import('vitest')['assertType'] const expect: typeof import('vitest')['expect'] const assert: typeof import('vitest')['assert'] const vitest: typeof import('vitest')['vitest'] diff --git a/packages/vitest/src/constants.ts b/packages/vitest/src/constants.ts index a9ee1617487a..548c8880eb86 100644 --- a/packages/vitest/src/constants.ts +++ b/packages/vitest/src/constants.ts @@ -39,6 +39,7 @@ export const globalApis = [ 'assert', // typecheck 'expectTypeOf', + 'assertType', // utils 'vitest', 'vi', diff --git a/packages/vitest/src/node/cli-wrapper.ts b/packages/vitest/src/node/cli-wrapper.ts index e7b867cb3b2f..f218f51689cd 100644 --- a/packages/vitest/src/node/cli-wrapper.ts +++ b/packages/vitest/src/node/cli-wrapper.ts @@ -112,7 +112,7 @@ async function start(preArgs: string[], postArgs: string[]) { ], { reject: false, - stderr: 'inherit', // TODO + stderr: 'pipe', stdout: 'inherit', stdin: 'inherit', env: { diff --git a/packages/vitest/src/types/index.ts b/packages/vitest/src/types/index.ts index ad84bf16f373..1f07bb3be174 100644 --- a/packages/vitest/src/types/index.ts +++ b/packages/vitest/src/types/index.ts @@ -2,6 +2,7 @@ import './vite' import './global' export { expectTypeOf, type ExpectTypeOf } from '../typescript/expectTypeOf' +export { assertType, type AssertType } from '../typescript/assertType' export * from '../typescript/types' export * from './config' export * from './tasks' diff --git a/packages/vitest/src/typescript/assertType.ts b/packages/vitest/src/typescript/assertType.ts index 5da53e69788a..b588f7a6ce9f 100644 --- a/packages/vitest/src/typescript/assertType.ts +++ b/packages/vitest/src/typescript/assertType.ts @@ -1,6 +1,6 @@ const noop = () => {} -interface AssertType { +export interface AssertType { (value: T): void } diff --git a/packages/vitest/src/typescript/collect.ts b/packages/vitest/src/typescript/collect.ts index 1c7c01ccf610..3ed0ae9e5b88 100644 --- a/packages/vitest/src/typescript/collect.ts +++ b/packages/vitest/src/typescript/collect.ts @@ -104,7 +104,8 @@ export async function collectTests(ctx: Vitest, filepath: string): Promise Date: Sun, 2 Oct 2022 11:06:42 +0200 Subject: [PATCH 12/33] chore: kill stdout tsc --- packages/vitest/src/node/core.ts | 4 ++-- packages/vitest/src/node/error.ts | 2 +- packages/vitest/src/node/logger.ts | 2 +- .../vitest/src/typescript/{parser.ts => typechecker.ts} | 8 +++++--- 4 files changed, 9 insertions(+), 7 deletions(-) rename packages/vitest/src/typescript/{parser.ts => typechecker.ts} (97%) diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 248af83edc41..2f281121ab15 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -11,7 +11,7 @@ import type { ArgumentsType, CoverageProvider, OnServerRestartHandler, Reporter, import { SnapshotManager } from '../integrations/snapshot/manager' import { clearTimeout, deepMerge, hasFailed, noop, setTimeout, slash, toArray } from '../utils' import { getCoverageProvider } from '../integrations/coverage' -import { Typechecker } from '../typescript/parser' +import { Typechecker } from '../typescript/typechecker' import { createPool } from './pool' import type { WorkerPool } from './pool' import { createBenchmarkReporters, createReporters } from './reporters/utils' @@ -519,7 +519,7 @@ export class Vitest { this.closingPromise = Promise.allSettled([ this.pool?.close(), this.server.close(), - this.typechecker?.clean(), + this.typechecker?.stop(), ].filter(Boolean)).then((results) => { results.filter(r => r.status === 'rejected').forEach((err) => { this.logger.error('error during close', (err as PromiseRejectedResult).reason) diff --git a/packages/vitest/src/node/error.ts b/packages/vitest/src/node/error.ts index a8d4670761ae..873a3f01ee8b 100644 --- a/packages/vitest/src/node/error.ts +++ b/packages/vitest/src/node/error.ts @@ -7,7 +7,7 @@ import type { ErrorWithDiff, ParsedStack, Position } from '../types' import { interpretSourcePos, lineSplitRE, parseStacktrace, posToNumber } from '../utils/source-map' import { F_POINTER } from '../utils/figures' import { stringify } from '../integrations/chai/jest-matcher-utils' -import { TypeCheckError } from '../typescript/parser' +import { TypeCheckError } from '../typescript/typechecker' import type { Vitest } from './core' import { type DiffOptions, unifiedDiff } from './diff' import { divider } from './reporters/renderers/utils' diff --git a/packages/vitest/src/node/logger.ts b/packages/vitest/src/node/logger.ts index 1a6a859378f5..b7aa037ed633 100644 --- a/packages/vitest/src/node/logger.ts +++ b/packages/vitest/src/node/logger.ts @@ -2,7 +2,7 @@ import { createLogUpdate } from 'log-update' import c from 'picocolors' import { version } from '../../../../package.json' import type { ErrorWithDiff } from '../types' -import type { TypeCheckError } from '../typescript/parser' +import type { TypeCheckError } from '../typescript/typechecker' import { divider } from './reporters/renderers/utils' import type { Vitest } from './core' import { printError } from './error' diff --git a/packages/vitest/src/typescript/parser.ts b/packages/vitest/src/typescript/typechecker.ts similarity index 97% rename from packages/vitest/src/typescript/parser.ts rename to packages/vitest/src/typescript/typechecker.ts index 9d496ce3dbeb..86c3768c58d7 100644 --- a/packages/vitest/src/typescript/parser.ts +++ b/packages/vitest/src/typescript/typechecker.ts @@ -1,4 +1,5 @@ import { rm } from 'fs/promises' +import type { ExecaChildProcess } from 'execa' import { execaCommand } from 'execa' import { resolve } from 'pathe' import { SourceMapConsumer } from 'source-map-js' @@ -28,15 +29,14 @@ export class Typechecker { private _onParseStart?: Callback private _onParseEnd?: Callback<[ErrorsCache]> private _onWatcherRerun?: Callback - private _result: ErrorsCache = { files: [], sourceErrors: [], } private _tests: Record | null = {} - private tmpConfigPath?: string + private process!: ExecaChildProcess constructor(protected ctx: Vitest, protected files: string[]) {} @@ -168,9 +168,10 @@ export class Typechecker { return typesErrors } - public async clean() { + public async stop() { if (this.tmpConfigPath) await rm(this.tmpConfigPath) + this.process?.kill() } public async start() { @@ -191,6 +192,7 @@ export class Typechecker { stdout: 'pipe', reject: false, }) + this.process = stdout await this._onParseStart?.() let rerunTriggered = false stdout.stdout?.on('data', (chunk) => { From 35f1b19604f6cc6a69b00f7f6d9d8d662bf6859f Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 2 Oct 2022 11:12:52 +0200 Subject: [PATCH 13/33] chore: cleanup --- packages/vitest/src/typescript/collect.ts | 1 + packages/vitest/src/typescript/typechecker.ts | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/vitest/src/typescript/collect.ts b/packages/vitest/src/typescript/collect.ts index 3ed0ae9e5b88..b6ba32fc05fd 100644 --- a/packages/vitest/src/typescript/collect.ts +++ b/packages/vitest/src/typescript/collect.ts @@ -64,6 +64,7 @@ export async function collectTests(ctx: Vitest, filepath: string): Promise { - const { file, definitions, map, parsed } = tests![path] + const { file, definitions, map, parsed } = this._tests![path] const errors = typeErrors.get(path) files.push(file) if (!errors) From d70ec2e68b6ad8ad26b7bf5de3cd0d5517f8bb77 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 2 Oct 2022 11:17:22 +0200 Subject: [PATCH 14/33] chore: cleanup --- packages/vitest/src/node/core.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 2f281121ab15..34074f68ec69 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -167,8 +167,9 @@ export class Vitest { process.exitCode = 1 await this.logger.printSourceTypeErrors(sourceErrors) } + // if there are source errors, we are showing it, and then terminating process if (!files.length) { - const exitCode = this.config.passWithNoTests ? 0 : 1 + const exitCode = this.config.passWithNoTests ? (process.exitCode ?? 0) : 1 process.exit(exitCode) } if (this.config.watch) { From c66082fcb07b3b977b3e5c43deb8a14ec09c4853 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 2 Oct 2022 15:47:14 +0200 Subject: [PATCH 15/33] refactor: cleanup --- packages/vitest/src/node/core.ts | 8 ++------ packages/vitest/src/node/reporters/base.ts | 4 ++-- packages/vitest/src/typescript/collect.ts | 4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 34074f68ec69..1b2be8c5aab4 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -181,16 +181,12 @@ export class Vitest { }) checker.onParseStart(async () => { await this.report('onInit', this) - const files = checker.getTestFiles() - if (files) - await this.report('onCollected', checker.getTestFiles()) + await this.report('onCollected', checker.getTestFiles()) }) checker.onWatcherRerun(async () => { await this.report('onWatcherRerun', testsFilesList, 'File change detected. Triggering rerun.') await checker.collectTests() - const files = checker.getTestFiles() - if (files) - await this.report('onCollected', checker.getTestFiles()) + await this.report('onCollected', checker.getTestFiles()) }) await checker.collectTests() await checker.start() diff --git a/packages/vitest/src/node/reporters/base.ts b/packages/vitest/src/node/reporters/base.ts index 16bf410ea21a..b9d4129f4763 100644 --- a/packages/vitest/src/node/reporters/base.ts +++ b/packages/vitest/src/node/reporters/base.ts @@ -275,8 +275,8 @@ export abstract class BaseReporter implements Reporter { } if (failedTests.length) { - const type = this.mode === 'typecheck' ? 'Typechecks' : 'Tests' - logger.error(c.red(divider(c.bold(c.inverse(` Failed ${type} ${failedTests.length} `))))) + const message = this.mode === 'typecheck' ? 'Type Errors' : 'Failed Tests' + logger.error(c.red(divider(c.bold(c.inverse(` ${message} ${failedTests.length} `))))) logger.error() await this.printTaskErrors(failedTests, errorDivider) diff --git a/packages/vitest/src/typescript/collect.ts b/packages/vitest/src/typescript/collect.ts index b6ba32fc05fd..d985e618cf56 100644 --- a/packages/vitest/src/typescript/collect.ts +++ b/packages/vitest/src/typescript/collect.ts @@ -92,14 +92,14 @@ export async function collectTests(ctx: Vitest, filepath: string): Promise { + const updateLatestSuite = (index: number) => { const suite = lastSuite while (lastSuite !== file && lastSuite.end < index) lastSuite = suite.suite as ParsedSuite return lastSuite } definitions.sort((a, b) => a.start - b.start).forEach((definition, idx) => { - const latestSuite = getLatestSuite(definition.start) + const latestSuite = updateLatestSuite(definition.start) let mode = definition.mode if (latestSuite.mode !== 'run') // inherit suite mode, if it's set mode = latestSuite.mode From 9ea09f103fde9c0322ca29dccac41fa4392a54a0 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Sun, 2 Oct 2022 16:47:13 +0200 Subject: [PATCH 16/33] chore: more docs and cleanup --- docs/.vitepress/config.ts | 4 ++ docs/api/index.md | 59 ++++++++++++++++++- docs/config/index.md | 55 +++++++++++++++++ docs/guide/testing-types.md | 28 +++++++++ packages/vitest/src/defaults.ts | 2 +- packages/vitest/src/types/config.ts | 6 +- packages/vitest/src/typescript/collect.ts | 4 +- packages/vitest/src/typescript/typechecker.ts | 10 +++- 8 files changed, 157 insertions(+), 11 deletions(-) create mode 100644 docs/guide/testing-types.md diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 1193810fdf88..f93633767e36 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -115,6 +115,10 @@ export default defineConfig({ text: 'Features', link: '/guide/features', }, + { + text: 'Testing Types', + link: '/guide/testing-types', + }, { text: 'CLI', link: '/guide/cli', diff --git a/docs/api/index.md b/docs/api/index.md index b6196f688c07..a931c0ff1d1b 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -72,6 +72,10 @@ In Jest, `TestFunction` can also be of type `(done: DoneCallback) => void`. If t }) ``` +::: warning +You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types). +::: + ### test.runIf - **Type:** `(condition: any) => Test` @@ -89,6 +93,10 @@ In Jest, `TestFunction` can also be of type `(done: DoneCallback) => void`. If t }) ``` +::: warning +You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types). +::: + ### test.only - **Type:** `(name: string, fn: TestFunction, timeout?: number) => void` @@ -152,6 +160,10 @@ In Jest, `TestFunction` can also be of type `(done: DoneCallback) => void`. If t }) ``` +::: warning +You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types). +::: + ### test.todo - **Type:** `(name: string) => void` @@ -179,6 +191,10 @@ In Jest, `TestFunction` can also be of type `(done: DoneCallback) => void`. If t }) ``` +::: warning +You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types). +::: + ### test.each - **Type:** `(cases: ReadonlyArray) => void` - **Alias:** `it.each` @@ -210,8 +226,29 @@ In Jest, `TestFunction` can also be of type `(done: DoneCallback) => void`. If t // ✓ add(2, 1) -> 3 ``` + You can also access object properties with `$` prefix, if you are using objects as arguments: + + ```ts + test.each([ + { a: 1, b: 1, expected: 2 }, + { a: 1, b: 2, expected: 3 }, + { a: 2, b: 1, expected: 3 }, + ])('add($a, $b) -> $expected', ({ a, b, expected }) => { + expect(a + b).toBe(expected) + }) + + // this will return + // ✓ add(1, 1) -> 2 + // ✓ add(1, 2) -> 3 + // ✓ add(2, 1) -> 3 + ``` + If you want to have access to `TestContext`, use `describe.each` with a single test. +::: warning +You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types). +::: + ## bench - **Type:** `(name: string, fn: BenchFunction, options?: BenchOptions) => void` @@ -472,6 +509,10 @@ When you use `test` or `bench` in the top level of file, they are collected as p describe.todo.concurrent(/* ... */) // or describe.concurrent.todo(/* ... */) ``` +::: warning +You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types). +::: + ### describe.shuffle - **Type:** `(name: string, fn: TestFunction, options?: number | TestOptions) => void` @@ -489,6 +530,10 @@ When you use `test` or `bench` in the top level of file, they are collected as p `.skip`, `.only`, and `.todo` works with random suites. +::: warning +You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types). +::: + ### describe.todo - **Type:** `(name: string) => void` @@ -526,6 +571,10 @@ When you use `test` or `bench` in the top level of file, they are collected as p }) ``` +::: warning +You cannot use this syntax, when using Vitest as [type checker](/guide/testing-types). +::: + ## expect - **Type:** `ExpectStatic & (actual: any) => Assertions` @@ -547,6 +596,10 @@ When you use `test` or `bench` in the top level of file, they are collected as p Also, `expect` can be used statically to access matchers functions, described later, and more. +::: warning +`expect` has no effect on testing types, if expression doesn't have a type error. If you want to use Vitest as [type checker](/guide/testing-types), use [`expectTypeOf`](#expecttypeof) or [`assertType`](#asserttype). +::: + ### not Using `not` will negate the assertion. For example, this code asserts that an `input` value is not equal to `2`. If it's equal, assertion will throw an error, and the test will fail. @@ -1778,7 +1831,7 @@ When you use `test` or `bench` in the top level of file, they are collected as p ## Setup and Teardown -These functions allow you to hook into the life cycle of tests to avoid repeating setup and teardown code. They apply to the current context: the file if they are used at the top-level or the current suite if they are inside a `describe` block. +These functions allow you to hook into the life cycle of tests to avoid repeating setup and teardown code. They apply to the current context: the file if they are used at the top-level or the current suite if they are inside a `describe` block. These hooks are not called, when you are running Vitest as type checker. ### beforeEach @@ -1970,9 +2023,9 @@ Vitest provides utility functions to help you out through it's **vi** helper. Yo - **Type**: `(path: string, factory?: () => unknown) => void` - Makes all `imports` to passed module to be mocked. Inside a path you _can_ use configured Vite aliases. + Makes all `imports` to passed module to be mocked. Inside a path you _can_ use configured Vite aliases. The call to `vi.mock` is hoisted, so it doesn't matter where you call it. It will always be executed before all imports. - - If `factory` is defined, will return its result. Factory function can be asynchronous. You may call [`vi.importActual`](#vi-importactual) inside to get the original module. The call to `vi.mock` is hoisted to the top of the file, so you don't have access to variables declared in the global file scope! + - If `factory` is defined, will return its result. Factory function can be asynchronous. You may call [`vi.importActual`](#vi-importactual) inside to get the original module. Since the call to `vi.mock` is hoisted, you don't have access to variables declared in the global file scope! - If mocking a module with a default export, you'll need to provide a `default` key within the returned factory function object. This is an ES modules specific caveat, therefore `jest` documentation may differ as `jest` uses commonJS modules. *Example:* ```ts diff --git a/docs/config/index.md b/docs/config/index.md index 64bcd6069b36..a8353de12700 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -849,3 +849,58 @@ Vitest usually uses cache to sort tests, so long running tests start earlier - t - **Default**: `Date.now()` Sets the randomization seed, if tests are running in random order. + +### typechecker + +Options for configuring [typechecking](/guide/testing-types) test environment. + +#### typechecker.checker + +- **Type**: `'tsc' | 'vue-tsc' | string` +- **Default**: `tsc` + +What tools to use for type checking. Vitest will spawn a process with certain parameters for easier parsing, depending on the type. Checker should implement the same output format as `tsc`. + +You need to have a package installed to use typecheker: + +- `tsc` requires `typescript` package +- `vue-tsc` requires `vue-tsc` package + +You can also pass down a path to custom binary or command name that produces the same output as `tsc --noEmit --pretty false`. + +#### typechecker.include + +- **Type**: `string[]` +- **Default**: `['**/*.{test,spec}-d.{ts,js}']` + +Glob pattern for files that should be treated as test files + +#### typechecker.exclude + +- **Type**: `string[]` +- **Default**: `['**/node_modules/**', '**/dist/**', '**/cypress/**', '**/.{idea,git,cache,output,temp}/**']` + +Glob pattern for files that should not be treated as test files + +#### typechecker.allowJs + +- **Type**: `boolean` +- **Default**: `false` + +Check JS files that have `@ts-check` comment. If you have it enabled in tsconfig, this will not overwrite it. + +#### typechecker.ignoreSourceErrors + +- **Type**: `boolean` +- **Default**: `false` + +Do not fail, if Vitest found errors outside the test files. This will not show you non-test errors at all. + +By default, if Vitest finds source error, it will fail test suite. + +#### typechecker.tsconfig + +- **Type**: `string` +- **Default**: _tries to find closest tsconfig.json_ + +Path to custom tsconfig, relative to the project root. diff --git a/docs/guide/testing-types.md b/docs/guide/testing-types.md new file mode 100644 index 000000000000..989cc7a4f01f --- /dev/null +++ b/docs/guide/testing-types.md @@ -0,0 +1,28 @@ +--- +title: Testing Types | Guide +--- + +# Testing Types + +Vitest allows you to write tests for your types. + +Under the hood Vitest calls `tsc` or `vue-tsc`, depending on your config, and parses results. + +```ts +// TODO write normal tests examples +import { describe, expectTypeOf, test } from 'vitest' + +describe('test', () => { + test('some-test', () => { + expectTypeOf(45).toBe(45) + }) + + describe('test2', () => { + test('some-test 2', () => { + expectTypeOf(45).toBe(45) + }) + }) +}) + +expectTypeOf({ wolk: 'true' }).toHaveProperty('wolk') +``` \ No newline at end of file diff --git a/packages/vitest/src/defaults.ts b/packages/vitest/src/defaults.ts index 8bb4d43ad9f3..30f4c4c0769c 100644 --- a/packages/vitest/src/defaults.ts +++ b/packages/vitest/src/defaults.ts @@ -90,7 +90,7 @@ const config = { dangerouslyIgnoreUnhandledErrors: false, typecheck: { checker: 'tsc' as const, - include: ['**/*.test-d.ts'], + include: ['**/*.{test,spec}-d.{ts,js}'], exclude: defaultExclude, }, } diff --git a/packages/vitest/src/types/config.ts b/packages/vitest/src/types/config.ts index 23b120a8aaf5..38df04792bbb 100644 --- a/packages/vitest/src/types/config.ts +++ b/packages/vitest/src/types/config.ts @@ -452,9 +452,9 @@ export interface InlineConfig { export interface TypecheckConfig { /** - * What tool to use for type checking. + * What tools to use for type checking. */ - checker: 'tsc' | 'vue-tsc' + checker: 'tsc' | 'vue-tsc' | (string & Record) /** * Pattern for files that should be treated as test files */ @@ -469,7 +469,7 @@ export interface TypecheckConfig { */ allowJs?: boolean /** - * Do not fail, if Vitest found errors not inside the test files. + * Do not fail, if Vitest found errors outside the test files. */ ignoreSourceErrors?: boolean /** diff --git a/packages/vitest/src/typescript/collect.ts b/packages/vitest/src/typescript/collect.ts index d985e618cf56..4caa8e8db489 100644 --- a/packages/vitest/src/typescript/collect.ts +++ b/packages/vitest/src/typescript/collect.ts @@ -80,8 +80,8 @@ export async function collectTests(ctx: Vitest, filepath: string): Promise Date: Wed, 26 Oct 2022 14:11:12 +0200 Subject: [PATCH 17/33] chore: rename typecheck --- packages/vitest/src/runtime/collect.ts | 4 +- .../{typescript => typecheck}/assertType.ts | 0 .../src/{typescript => typecheck}/collect.ts | 17 +- .../{typescript => typecheck}/constants.ts | 0 .../{typescript => typecheck}/expectTypeOf.ts | 0 .../src/{typescript => typecheck}/parse.ts | 0 .../{typescript => typecheck}/typechecker.ts | 0 .../src/{typescript => typecheck}/types.ts | 0 .../src/{typescript => typecheck}/utils.ts | 0 pnpm-lock.yaml | 689 ++++++++---------- 10 files changed, 298 insertions(+), 412 deletions(-) rename packages/vitest/src/{typescript => typecheck}/assertType.ts (100%) rename packages/vitest/src/{typescript => typecheck}/collect.ts (90%) rename packages/vitest/src/{typescript => typecheck}/constants.ts (100%) rename packages/vitest/src/{typescript => typecheck}/expectTypeOf.ts (100%) rename packages/vitest/src/{typescript => typecheck}/parse.ts (100%) rename packages/vitest/src/{typescript => typecheck}/typechecker.ts (100%) rename packages/vitest/src/{typescript => typecheck}/types.ts (100%) rename packages/vitest/src/{typescript => typecheck}/utils.ts (100%) diff --git a/packages/vitest/src/runtime/collect.ts b/packages/vitest/src/runtime/collect.ts index 1c18abd6aaf3..d149ed92b419 100644 --- a/packages/vitest/src/runtime/collect.ts +++ b/packages/vitest/src/runtime/collect.ts @@ -102,7 +102,7 @@ export async function collectTests(paths: string[], config: ResolvedConfig): Pro /** * If any tasks been marked as `only`, mark all other tasks as `skip`. */ -function interpretTaskModes(suite: Suite, namePattern?: string | RegExp, onlyMode?: boolean, parentIsOnly?: boolean, allowOnly?: boolean) { +export function interpretTaskModes(suite: Suite, namePattern?: string | RegExp, onlyMode?: boolean, parentIsOnly?: boolean, allowOnly?: boolean) { const suiteIsOnly = parentIsOnly || suite.mode === 'only' suite.tasks.forEach((t) => { @@ -145,7 +145,7 @@ function getTaskFullName(task: TaskBase): string { return `${task.suite ? `${getTaskFullName(task.suite)} ` : ''}${task.name}` } -function someTasksAreOnly(suite: Suite): boolean { +export function someTasksAreOnly(suite: Suite): boolean { return suite.tasks.some(t => t.mode === 'only' || (t.type === 'suite' && someTasksAreOnly(t))) } diff --git a/packages/vitest/src/typescript/assertType.ts b/packages/vitest/src/typecheck/assertType.ts similarity index 100% rename from packages/vitest/src/typescript/assertType.ts rename to packages/vitest/src/typecheck/assertType.ts diff --git a/packages/vitest/src/typescript/collect.ts b/packages/vitest/src/typecheck/collect.ts similarity index 90% rename from packages/vitest/src/typescript/collect.ts rename to packages/vitest/src/typecheck/collect.ts index 4caa8e8db489..1909587005ba 100644 --- a/packages/vitest/src/typescript/collect.ts +++ b/packages/vitest/src/typecheck/collect.ts @@ -4,6 +4,7 @@ import { ancestor as walkAst } from 'acorn-walk' import type { RawSourceMap } from 'vite-node' import type { File, Suite, Vitest } from '../types' +import { interpretTaskModes, someTasksAreOnly } from '../runtime/collect' import { TYPECHECK_SUITE } from './constants' interface ParsedFile extends File { @@ -129,20 +130,8 @@ export async function collectTests(ctx: Vitest, filepath: string): Promise { - const hasOnly = suite.tasks.some(task => task.mode === 'only') - suite.tasks.forEach((task) => { - if ((hasOnly && task.mode !== 'only') || suite.mode === 'skip') { - task.mode = 'skip' - task.result = { - state: 'skip', - } - } - if (task.type === 'suite') - markSkippedTests(task) - }) - } - markSkippedTests(file) + const hasOnly = someTasksAreOnly(file) + interpretTaskModes(file, ctx.config.testNamePattern, hasOnly, false, ctx.config.allowOnly) return { file, parsed: request.code, diff --git a/packages/vitest/src/typescript/constants.ts b/packages/vitest/src/typecheck/constants.ts similarity index 100% rename from packages/vitest/src/typescript/constants.ts rename to packages/vitest/src/typecheck/constants.ts diff --git a/packages/vitest/src/typescript/expectTypeOf.ts b/packages/vitest/src/typecheck/expectTypeOf.ts similarity index 100% rename from packages/vitest/src/typescript/expectTypeOf.ts rename to packages/vitest/src/typecheck/expectTypeOf.ts diff --git a/packages/vitest/src/typescript/parse.ts b/packages/vitest/src/typecheck/parse.ts similarity index 100% rename from packages/vitest/src/typescript/parse.ts rename to packages/vitest/src/typecheck/parse.ts diff --git a/packages/vitest/src/typescript/typechecker.ts b/packages/vitest/src/typecheck/typechecker.ts similarity index 100% rename from packages/vitest/src/typescript/typechecker.ts rename to packages/vitest/src/typecheck/typechecker.ts diff --git a/packages/vitest/src/typescript/types.ts b/packages/vitest/src/typecheck/types.ts similarity index 100% rename from packages/vitest/src/typescript/types.ts rename to packages/vitest/src/typecheck/types.ts diff --git a/packages/vitest/src/typescript/utils.ts b/packages/vitest/src/typecheck/utils.ts similarity index 100% rename from packages/vitest/src/typescript/utils.ts rename to packages/vitest/src/typecheck/utils.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8f86aad7470d..d81afd47ec91 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,8 +74,8 @@ importers: fast-glob: 3.2.12 if-node-version: 1.1.1 lint-staged: 13.0.3 - magic-string: 0.26.5 - node-fetch-native: 0.1.7 + magic-string: 0.26.7 + node-fetch-native: 0.1.8 npm-run-all: 4.1.5 ohmyfetch: 0.4.20 pathe: 0.2.0 @@ -114,17 +114,17 @@ importers: jiti: 1.16.0 vue: 3.2.41 devDependencies: - '@iconify-json/carbon': 1.1.8 - '@unocss/reset': 0.45.26 - '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 + '@iconify-json/carbon': 1.1.9 + '@unocss/reset': 0.46.0 + '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 esno: 0.16.3 fast-glob: 3.2.12 https-localhost: 4.7.1 - unocss: 0.45.26_vite@3.1.0 - unplugin-vue-components: 0.22.7_vite@3.1.0+vue@3.2.40 + unocss: 0.46.0_vite@3.1.0 + unplugin-vue-components: 0.22.9_vue@3.2.41 vite: 3.1.0 vite-plugin-pwa: 0.13.1_zp7t6aa2r77waajuyr5zt63phe - vitepress: 1.0.0-alpha.18 + vitepress: 1.0.0-alpha.25 workbox-window: 6.5.4 examples/basic: @@ -239,7 +239,7 @@ importers: devDependencies: '@testing-library/react': 13.3.0_zpnidt7m3osuk7shl3s4oenomq '@types/node': 18.11.5 - '@types/react': 18.0.22 + '@types/react': 18.0.23 '@vitejs/plugin-react': 2.1.0 jsdom: 20.0.1 typescript: 4.6.3 @@ -290,7 +290,7 @@ importers: '@types/react-test-renderer': 17.0.2 '@vitejs/plugin-react': 2.1.0_vite@3.1.0 '@vitest/ui': link:../../packages/ui - happy-dom: 6.0.4 + happy-dom: 7.6.6 jsdom: 20.0.1 react-test-renderer: 17.0.2_react@17.0.2 vite: 3.1.0 @@ -495,8 +495,8 @@ importers: vitest: workspace:* vue: latest devDependencies: - '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 - '@vue/test-utils': 2.1.0_vue@3.2.40 + '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vue/test-utils': 2.2.0_vue@3.2.41 jsdom: 20.0.1 vite: 3.1.0 vite-plugin-ruby: 3.1.2_vite@3.1.0 @@ -549,8 +549,8 @@ importers: dependencies: vue: 3.2.41 devDependencies: - '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 - '@vue/test-utils': 2.0.2_vue@3.2.40 + '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vue/test-utils': 2.0.2_vue@3.2.41 jsdom: 20.0.1 unplugin-auto-import: 0.11.2_vite@3.1.0 unplugin-vue-components: 0.22.4_vite@3.1.0+vue@3.2.41 @@ -568,8 +568,8 @@ importers: dependencies: vue: 3.2.41 devDependencies: - '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 - '@vue/test-utils': 2.0.0_vue@3.2.40 + '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vue/test-utils': 2.0.0_vue@3.2.41 jsdom: 20.0.1 vite: 3.1.0 vitest: link:../../packages/vitest @@ -584,9 +584,9 @@ importers: vitest: workspace:* vue: latest devDependencies: - '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 - '@vitejs/plugin-vue-jsx': 2.0.1_vite@3.1.0+vue@3.2.40 - '@vue/test-utils': 2.1.0_vue@3.2.40 + '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vitejs/plugin-vue-jsx': 2.0.1_vite@3.1.0+vue@3.2.41 + '@vue/test-utils': 2.2.0_vue@3.2.41 jsdom: 20.0.1 vite: 3.1.0 vitest: link:../../packages/vitest @@ -719,25 +719,25 @@ importers: '@types/d3-force': 3.0.3 '@types/d3-selection': 3.0.3 '@types/ws': 8.5.3 - '@unocss/reset': 0.45.26 - '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 - '@vitejs/plugin-vue-jsx': 2.0.1_vite@3.1.0+vue@3.2.40 + '@unocss/reset': 0.46.0 + '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vitejs/plugin-vue-jsx': 2.0.1_vite@3.1.0+vue@3.2.41 '@vitest/ws-client': link:../ws-client '@vueuse/core': 9.3.1_vue@3.2.41 ansi-to-html: 0.7.2 birpc: 0.2.3 codemirror: 5.65.9 codemirror-theme-vars: 0.1.1 - cypress: 10.9.0 - d3-graph-controller: 2.3.17 + cypress: 10.10.0 + d3-graph-controller: 2.3.19 flatted: 3.2.7 floating-vue: 2.0.0-y.0_vue@3.2.41 picocolors: 1.0.0 rollup: 2.79.0 splitpanes: 3.1.1 - unocss: 0.45.26_vite@3.1.0 - unplugin-auto-import: 0.11.2_4pcjj2znrm3t3euqrnres74v3q - unplugin-vue-components: 0.22.7_bvhm6vbarnztnbcyiesgeukfyu + unocss: 0.46.0_rollup@2.79.0+vite@3.1.0 + unplugin-auto-import: 0.11.4_6u46jplwha2mhx7sqors5yy6v4 + unplugin-vue-components: 0.22.9_rollup@2.79.0+vue@3.2.41 vite: 3.1.0 vite-plugin-pages: 0.27.1_vite@3.1.0 vue: 3.2.41 @@ -858,7 +858,7 @@ importers: happy-dom: 6.0.4 jsdom: 20.0.1 log-update: 5.0.1 - magic-string: 0.26.5 + magic-string: 0.26.7 micromatch: 4.0.5 mlly: 0.5.16 natural-compare: 1.4.0 @@ -964,7 +964,7 @@ importers: devDependencies: '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 '@vue/test-utils': 2.2.0_vue@3.2.41 - happy-dom: 7.6.3 + happy-dom: 7.6.6 vite: 3.1.0 vitest: link:../../packages/vitest vue: 3.2.41 @@ -1127,24 +1127,24 @@ packages: resolution: {integrity: sha512-+u76oB43nOHrF4DDWRLWDCtci7f3QJoEBigemIdIeTi1ODqjx6Tad9NCVnPRwewWlKkVab5PlK8DCtPTyX7S8g==} dev: true - /@algolia/autocomplete-core/1.7.1: - resolution: {integrity: sha512-eiZw+fxMzNQn01S8dA/hcCpoWCOCwcIIEUtHHdzN5TGB3IpzLbuhqFeTfh2OUhhgkE8Uo17+wH+QJ/wYyQmmzg==} + /@algolia/autocomplete-core/1.7.2: + resolution: {integrity: sha512-eclwUDC6qfApNnEfu1uWcL/rudQsn59tjEoUYZYE2JSXZrHLRjBUGMxiCoknobU2Pva8ejb0eRxpIYDtVVqdsw==} dependencies: - '@algolia/autocomplete-shared': 1.7.1 + '@algolia/autocomplete-shared': 1.7.2 dev: true - /@algolia/autocomplete-preset-algolia/1.7.1_algoliasearch@4.14.2: - resolution: {integrity: sha512-pJwmIxeJCymU1M6cGujnaIYcY3QPOVYZOXhFkWVM7IxKzy272BwCvMFMyc5NpG/QmiObBxjo7myd060OeTNJXg==} + /@algolia/autocomplete-preset-algolia/1.7.2_algoliasearch@4.14.2: + resolution: {integrity: sha512-+RYEG6B0QiGGfRb2G3MtPfyrl0dALF3cQNTWBzBX6p5o01vCCGTTinAm2UKG3tfc2CnOMAtnPLkzNZyJUpnVJw==} peerDependencies: - '@algolia/client-search': ^4.9.1 - algoliasearch: ^4.9.1 + '@algolia/client-search': '>= 4.9.1 < 6' + algoliasearch: '>= 4.9.1 < 6' dependencies: - '@algolia/autocomplete-shared': 1.7.1 + '@algolia/autocomplete-shared': 1.7.2 algoliasearch: 4.14.2 dev: true - /@algolia/autocomplete-shared/1.7.1: - resolution: {integrity: sha512-eTmGVqY3GeyBTT8IWiB2K5EuURAqhnumfktAEoHxfDY2o7vg2rSnO16ZtIG0fMgt3py28Vwgq42/bVEuaQV7pg==} + /@algolia/autocomplete-shared/1.7.2: + resolution: {integrity: sha512-QCckjiC7xXHIUaIL3ektBtjJ0w7tTA3iqKcAE/Hjn1lZ5omp7i3Y4e09rAr9ZybqirL7AbxCLLq0Ra5DDPKeug==} dev: true /@algolia/cache-browser-local-storage/4.14.2: @@ -2964,14 +2964,14 @@ packages: engines: {node: '>=10.0.0'} dev: true - /@docsearch/css/3.2.1: - resolution: {integrity: sha512-gaP6TxxwQC+K8D6TRx5WULUWKrcbzECOPA2KCVMuI+6C7dNiGUk5yXXzVhc5sld79XKYLnO9DRTI4mjXDYkh+g==} + /@docsearch/css/3.3.0: + resolution: {integrity: sha512-rODCdDtGyudLj+Va8b6w6Y85KE85bXRsps/R4Yjwt5vueXKXZQKYw0aA9knxLBT6a/bI/GMrAcmCR75KYOM6hg==} dev: true - /@docsearch/js/3.2.1: - resolution: {integrity: sha512-H1PekEtSeS0msetR2YGGey2w7jQ2wAKfGODJvQTygSwMgUZ+2DHpzUgeDyEBIXRIfaBcoQneqrzsljM62pm6Xg==} + /@docsearch/js/3.3.0: + resolution: {integrity: sha512-oFXWRPNvPxAzBhnFJ9UCFIYZiQNc3Yrv6912nZHw/UIGxsyzKpNRZgHq8HDk1niYmOSoLKtVFcxkccpQmYGFyg==} dependencies: - '@docsearch/react': 3.2.1 + '@docsearch/react': 3.3.0 preact: 10.10.6 transitivePeerDependencies: - '@algolia/client-search' @@ -2980,8 +2980,8 @@ packages: - react-dom dev: true - /@docsearch/react/3.2.1: - resolution: {integrity: sha512-EzTQ/y82s14IQC5XVestiK/kFFMe2aagoYFuTAIfIb/e+4FU7kSMKonRtLwsCiLQHmjvNQq+HO+33giJ5YVtaQ==} + /@docsearch/react/3.3.0: + resolution: {integrity: sha512-fhS5adZkae2SSdMYEMVg6pxI5a/cE+tW16ki1V0/ur4Fdok3hBRkmN/H8VvlXnxzggkQIIRIVvYPn00JPjen3A==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' react: '>= 16.8.0 < 19.0.0' @@ -2994,9 +2994,9 @@ packages: react-dom: optional: true dependencies: - '@algolia/autocomplete-core': 1.7.1 - '@algolia/autocomplete-preset-algolia': 1.7.1_algoliasearch@4.14.2 - '@docsearch/css': 3.2.1 + '@algolia/autocomplete-core': 1.7.2 + '@algolia/autocomplete-preset-algolia': 1.7.2_algoliasearch@4.14.2 + '@docsearch/css': 3.3.0 algoliasearch: 4.14.2 transitivePeerDependencies: - '@algolia/client-search' @@ -3174,25 +3174,8 @@ packages: requiresBuild: true optional: true - /@eslint/eslintrc/1.3.1: - resolution: {integrity: sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - ajv: 6.12.6 - debug: 4.3.4 - espree: 9.4.0 - globals: 13.17.0 - ignore: 5.2.0 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - - /@eslint/eslintrc/1.3.2: - resolution: {integrity: sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ==} + /@eslint/eslintrc/1.3.3: + resolution: {integrity: sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 @@ -3255,8 +3238,8 @@ packages: graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dev: false - /@humanwhocodes/config-array/0.10.7: - resolution: {integrity: sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w==} + /@humanwhocodes/config-array/0.11.6: + resolution: {integrity: sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -3367,7 +3350,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.7.18 + '@types/node': 18.11.5 '@types/yargs': 15.0.14 chalk: 4.1.2 dev: true @@ -3379,7 +3362,7 @@ packages: '@jest/schemas': 29.0.0 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.7.18 + '@types/node': 18.11.5 '@types/yargs': 17.0.12 chalk: 4.1.2 dev: true @@ -3392,7 +3375,7 @@ packages: dependencies: glob: 7.2.3 glob-promise: 4.2.2_glob@7.2.3 - magic-string: 0.26.3 + magic-string: 0.26.7 react-docgen-typescript: 2.2.2_typescript@4.8.2 typescript: 4.8.2 vite: 3.1.0 @@ -3892,7 +3875,7 @@ packages: engines: {node: '>=14'} hasBin: true dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 playwright-core: 1.25.1 dev: true @@ -4930,7 +4913,7 @@ packages: util-deprecate: 1.0.2 watchpack: 2.4.0 webpack: 4.46.0 - ws: 8.8.1 + ws: 8.10.0 x-default-browser: 0.4.0 transitivePeerDependencies: - '@storybook/mdx2-csf' @@ -5114,7 +5097,7 @@ packages: '@babel/preset-env': 7.18.10_@babel+core@7.18.13 '@babel/types': 7.18.13 '@mdx-js/mdx': 1.6.22 - '@types/lodash': 4.14.184 + '@types/lodash': 4.14.186 js-string-escape: 1.0.1 loader-utils: 2.0.2 lodash: 4.17.21 @@ -5134,7 +5117,7 @@ packages: '@babel/types': 7.18.13 '@mdx-js/mdx': 1.6.22 '@mdx-js/react': 1.6.22_react@17.0.2 - '@types/lodash': 4.14.184 + '@types/lodash': 4.14.186 js-string-escape: 1.0.1 loader-utils: 2.0.2 lodash: 4.17.21 @@ -5691,7 +5674,7 @@ packages: /@types/cheerio/0.22.31: resolution: {integrity: sha512-Kt7Cdjjdi2XWSfrZ53v4Of0wG3ZcmaegFXjMmz9tfNrZSkzzo36G0AL1YqSdcIA78Etjt6E609pt5h1xnQkPUw==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true /@types/codemirror/5.60.5: @@ -5703,7 +5686,7 @@ packages: /@types/concat-stream/1.6.1: resolution: {integrity: sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true /@types/cookie/0.4.1: @@ -5732,7 +5715,7 @@ packages: resolution: {integrity: sha512-xryQlOEIe1TduDWAOphR0ihfebKFSWOXpIsk+70JskCfRfW+xALdnJ0r1ZOTo85F9Qsjk6vtlU7edTYHbls9tA==} dependencies: '@types/cheerio': 0.22.31 - '@types/react': 18.0.20 + '@types/react': 18.0.23 dev: true /@types/eslint-scope/3.7.4: @@ -5763,33 +5746,33 @@ packages: /@types/form-data/0.0.33: resolution: {integrity: sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.1 - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true /@types/glob/8.0.0: resolution: {integrity: sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==} dependencies: '@types/minimatch': 5.1.1 - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true /@types/graceful-fs/4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true /@types/hast/2.3.4: @@ -5850,7 +5833,7 @@ packages: /@types/jsdom/20.0.0: resolution: {integrity: sha512-YfAchFs0yM1QPDrLm2VHe+WHGtqms3NXnXAMolrgrVP6fgBHHXy1ozAbo/dFtPNtZC/m66bPiCTWYmqp1F14gA==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 '@types/tough-cookie': 4.0.2 parse5: 7.0.0 dev: true @@ -5863,10 +5846,6 @@ packages: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} dev: true - /@types/lodash/4.14.184: - resolution: {integrity: sha512-RoZphVtHbxPZizt4IcILciSWiC6dcn+eZ8oX9IWEYfDMcocdd42f7NPI6fQj+6zI8y4E0L7gu2pcZKLGTRaV9Q==} - dev: true - /@types/lodash/4.14.186: resolution: {integrity: sha512-eHcVlLXP0c2FlMPm56ITode2AgLMSa6aJ05JTTbYbI+7EMkCEE5qk2E41d5g2lCVTqRe0GnnRFurmlCsDODrPw==} dev: true @@ -5898,7 +5877,7 @@ packages: /@types/node-fetch/2.6.2: resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 form-data: 3.0.1 dev: true @@ -5922,18 +5901,6 @@ packages: resolution: {integrity: sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==} dev: false - /@types/node/18.7.16: - resolution: {integrity: sha512-EQHhixfu+mkqHMZl1R2Ovuvn47PUw18azMJOTwSZr9/fhzHNGXAJ0ma0dayRVchprpCj0Kc1K1xKoWaATWF1qg==} - dev: true - - /@types/node/18.7.18: - resolution: {integrity: sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==} - dev: true - - /@types/node/18.7.23: - resolution: {integrity: sha512-DWNcCHolDq0ZKGizjx2DZjR/PqsYwAcYUJmfMWqtVU2MBMG5Mo+xFZrhGId5r/O5HOuMPyQEcM6KUBp5lBZZBg==} - dev: true - /@types/node/8.10.66: resolution: {integrity: sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==} dev: true @@ -5983,13 +5950,13 @@ packages: /@types/react-dom/18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: - '@types/react': 18.0.22 + '@types/react': 18.0.23 dev: true /@types/react-is/17.0.3: resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==} dependencies: - '@types/react': 18.0.20 + '@types/react': 18.0.23 dev: false /@types/react-test-renderer/17.0.2: @@ -6001,7 +5968,7 @@ packages: /@types/react-transition-group/4.4.5: resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==} dependencies: - '@types/react': 18.0.20 + '@types/react': 18.0.23 dev: false /@types/react/17.0.49: @@ -6012,25 +5979,17 @@ packages: csstype: 3.1.0 dev: true - /@types/react/18.0.20: - resolution: {integrity: sha512-MWul1teSPxujEHVwZl4a5HxQ9vVNsjTchVA+xRqv/VYGCuKGAU6UhfrTdF5aBefwD1BHUD8i/zq+O/vyCm/FrA==} + /@types/react/18.0.23: + resolution: {integrity: sha512-R1wTULtCiJkudAN2DJGoYYySbGtOdzZyUWAACYinKdiQC8auxso4kLDUhQ7AJ2kh3F6A6z4v69U6tNY39hihVQ==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 csstype: 3.1.0 - /@types/react/18.0.21: - resolution: {integrity: sha512-7QUCOxvFgnD5Jk8ZKlUAhVcRj7GuJRjnjjiY/IUBWKgOlnvDvTMLD4RTF7NPyVmbRhNrbomZiOepg7M/2Kj1mA==} - dependencies: - '@types/prop-types': 15.7.5 - '@types/scheduler': 0.16.2 - csstype: 3.1.0 - dev: true - /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true /@types/scheduler/0.16.2: @@ -6039,7 +5998,7 @@ packages: /@types/set-cookie-parser/2.4.2: resolution: {integrity: sha512-fBZgytwhYAUkj/jC/FAV4RQ5EerRup1YQsXQCh8rZfiHkc4UahC192oH0smGwsXol3cL3A5oETuAHeQHmhXM4w==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true /@types/sinonjs__fake-timers/8.1.1: @@ -6109,7 +6068,7 @@ packages: /@types/webpack-sources/3.2.0: resolution: {integrity: sha512-Ft7YH3lEVRQ6ls8k4Ff1oB4jN6oy/XmU6tQISKdhfh+1mR+viZFphS6WL0IrtDOzvefmJg5a0s7ZQoRXwqTEFg==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 '@types/source-list-map': 0.1.2 source-map: 0.7.4 dev: true @@ -6117,7 +6076,7 @@ packages: /@types/webpack/4.41.32: resolution: {integrity: sha512-cb+0ioil/7oz5//7tZUSwbrSAN/NWHrQylz5cW8G0dWTcF/g+/dSdMlKVZspBYuMAN1+WnwHrkxiRrLcwd0Heg==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 '@types/tapable': 1.0.8 '@types/uglify-js': 3.17.0 '@types/webpack-sources': 3.2.0 @@ -6128,7 +6087,7 @@ packages: /@types/ws/8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true /@types/yargs-parser/21.0.0: @@ -6151,7 +6110,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 dev: true optional: true @@ -6282,160 +6241,193 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@unocss/astro/0.45.26_vite@3.1.0: - resolution: {integrity: sha512-jAdbYNwjyzh05B4B7lhuHYmkNfmIZsQGhRNXogOx0t1BMzRZg9jID5xsJiujaElQL6ll53pbuRRyGV80o75n0Q==} + /@unocss/astro/0.46.0_rollup@2.79.0+vite@3.1.0: + resolution: {integrity: sha512-IHUQ5JpNjc2szW4Y+Vau6QpoZLc+4109R6QMFwjOXwFa88GVmh510GKKmNTIP0f3V/knPdlhu5TWzORNhQUhMw==} dependencies: - '@unocss/core': 0.45.26 - '@unocss/reset': 0.45.26 - '@unocss/vite': 0.45.26_vite@3.1.0 + '@unocss/core': 0.46.0 + '@unocss/reset': 0.46.0 + '@unocss/vite': 0.46.0_rollup@2.79.0+vite@3.1.0 transitivePeerDependencies: - rollup - vite dev: true - /@unocss/cli/0.45.26: - resolution: {integrity: sha512-pev56gZRYow+/38TfSVMVWmtgl4UGNrgJULqHhfXxHn/CjiG+wJ95/PLYbY/GIZRXy4ttpsVU/iF/5uRvvJ3RA==} + /@unocss/astro/0.46.0_vite@3.1.0: + resolution: {integrity: sha512-IHUQ5JpNjc2szW4Y+Vau6QpoZLc+4109R6QMFwjOXwFa88GVmh510GKKmNTIP0f3V/knPdlhu5TWzORNhQUhMw==} + dependencies: + '@unocss/core': 0.46.0 + '@unocss/reset': 0.46.0 + '@unocss/vite': 0.46.0_vite@3.1.0 + transitivePeerDependencies: + - rollup + - vite + dev: true + + /@unocss/cli/0.46.0: + resolution: {integrity: sha512-WFd+atNlrnPCDwBOTw1wH6MJDt75SObQZbO47RJzR7Ek9mcwrEO+fll3K3oy18ftBUA1keZysNYLiRgExudqfA==} engines: {node: '>=14'} hasBin: true dependencies: '@ampproject/remapping': 2.2.0 - '@rollup/pluginutils': 4.2.1 - '@unocss/config': 0.45.26 - '@unocss/core': 0.45.26 - '@unocss/preset-uno': 0.45.26 + '@rollup/pluginutils': 5.0.2 + '@unocss/config': 0.46.0 + '@unocss/core': 0.46.0 + '@unocss/preset-uno': 0.46.0 cac: 6.7.14 chokidar: 3.5.3 colorette: 2.0.19 consola: 2.15.3 fast-glob: 3.2.12 - magic-string: 0.26.5 - pathe: 0.3.8 + magic-string: 0.26.7 + pathe: 0.3.9 + perfect-debounce: 0.1.3 + transitivePeerDependencies: + - rollup + dev: true + + /@unocss/cli/0.46.0_rollup@2.79.0: + resolution: {integrity: sha512-WFd+atNlrnPCDwBOTw1wH6MJDt75SObQZbO47RJzR7Ek9mcwrEO+fll3K3oy18ftBUA1keZysNYLiRgExudqfA==} + engines: {node: '>=14'} + hasBin: true + dependencies: + '@ampproject/remapping': 2.2.0 + '@rollup/pluginutils': 5.0.2_rollup@2.79.0 + '@unocss/config': 0.46.0 + '@unocss/core': 0.46.0 + '@unocss/preset-uno': 0.46.0 + cac: 6.7.14 + chokidar: 3.5.3 + colorette: 2.0.19 + consola: 2.15.3 + fast-glob: 3.2.12 + magic-string: 0.26.7 + pathe: 0.3.9 perfect-debounce: 0.1.3 transitivePeerDependencies: - rollup dev: true - /@unocss/config/0.45.26: - resolution: {integrity: sha512-bmNlYoGl4oHdmrb6TwuiVbVShuT3TsYJQ6MPXnVipPkAJpyJ47uU6ZAfDMqwCU0AqsLah3hSDQpDIJL5j+9tug==} + /@unocss/config/0.46.0: + resolution: {integrity: sha512-pZOUtuepJ6Wkj5KTVTKJkM6S5ma0dcNdvvWQyECU77eLq7/luO0sDzQ+o16SyZWXTS9paN92nwekvQzFeJ6Pmw==} engines: {node: '>=14'} dependencies: - '@unocss/core': 0.45.26 - unconfig: 0.3.6 + '@unocss/core': 0.46.0 + unconfig: 0.3.7 dev: true - /@unocss/core/0.45.26: - resolution: {integrity: sha512-V7lNAXy1Ou2+UsD8n8a0ynE7BPuMtZSn6dQtrhNvtkstEBZtBAvlGM07wnSqwZfYeKs8k/MA6Z7S0yJKQzcl1Q==} + /@unocss/core/0.46.0: + resolution: {integrity: sha512-Y3i35qUc5/EwxsgYGb1E/2va1KiDXQ0s0mvZkYGAb28nfv5OH+6PnaKdzJDTBEDawFIJZ0vkd1c8/lJzNqx8pQ==} dev: true - /@unocss/inspector/0.45.26: - resolution: {integrity: sha512-rteTaMVWstGlCG5+k744kFzQLYAWgCf2ys2CRfm6SX7YC2JGBmELCwSABGrylkyItTnH50ayZcDk21GKEfC/Mw==} + /@unocss/inspector/0.46.0: + resolution: {integrity: sha512-g+MoRHrKwYaEVlB8tVVAn1jzcwiZke2b0EIHaY+6c+gJ2LOqw3vh2HcQtYRuypiH4grQtTf11z8p+J38h12Ttw==} dependencies: gzip-size: 6.0.0 sirv: 2.0.2 dev: true - /@unocss/preset-attributify/0.45.26: - resolution: {integrity: sha512-+BA27/d+IEJtt/P7+fHUl/OYJNhSVBoCRxIO6JiQhEw36n821UMVd9CdnfxPBEBIaS2fXQvNF4yO5jnr4Wj5Qw==} + /@unocss/preset-attributify/0.46.0: + resolution: {integrity: sha512-TY4XO3DrMkGC4+j/GUd7vfNPQlQyr1WmOxQfE9Tanec5QhN4R7JYjucNpp9lI+j7S5jRIyGdiwTppSYC/t7KPA==} dependencies: - '@unocss/core': 0.45.26 + '@unocss/core': 0.46.0 dev: true - /@unocss/preset-icons/0.45.26: - resolution: {integrity: sha512-PL2Fi6KGYZAY9vNyEC+EBDqSYaiXEuUaTkPOaCVrEsig0E5DOm62A5FmJ/0vHmNSXEOVqV17jiDKp+fNM/h61g==} + /@unocss/preset-icons/0.46.0: + resolution: {integrity: sha512-nEmGCxbFbidr6GdeJrnstwypXTElNvbj4Pbl/8QKuFxyQmLhQbV1hLPyMX9BuaUkttWzo8zS/hDQ6LaiaQOMJw==} dependencies: - '@iconify/utils': 2.0.0 - '@unocss/core': 0.45.26 - ohmyfetch: 0.4.19 + '@iconify/utils': 2.0.1 + '@unocss/core': 0.46.0 + ohmyfetch: 0.4.20 transitivePeerDependencies: - supports-color dev: true - /@unocss/preset-mini/0.45.26: - resolution: {integrity: sha512-Kab6F2pZHzJudGene6NwGMYA96fuU8gNjCVouSd6oqFF1ZhEBxkQOR56TRjppyCi0MU89hciV5T6kcVZDquGUw==} + /@unocss/preset-mini/0.46.0: + resolution: {integrity: sha512-qe3iw1GUHf1S+qt58mghlmxkeO7z67Eda9QiM4LyQ1fSxsSd4J1CFCMczTRe4HoZHnnzZ6dMr98Fab1ZPH3Mdw==} dependencies: - '@unocss/core': 0.45.26 + '@unocss/core': 0.46.0 dev: true - /@unocss/preset-tagify/0.45.26: - resolution: {integrity: sha512-4zhdD/EKW5BYsiKO8PQdUXU4I5riJNM9ykEyhESFaCM6/+3a8GRvrnON57cRuiqX5LvJeXfbtGXQCOdMGEIi4Q==} + /@unocss/preset-tagify/0.46.0: + resolution: {integrity: sha512-EQVKWRMUbLKFvERmQVF+EnjCi8aAUCJH6OigSL4Zr2kTe0rh5Zmt1TttHNPI0mKSSqz8xqNBluUOVJVqicsg0g==} dependencies: - '@unocss/core': 0.45.26 + '@unocss/core': 0.46.0 dev: true - /@unocss/preset-typography/0.45.26: - resolution: {integrity: sha512-HBkox5t1AKQ3SwMbvDhHDaWBOsP3Z1RW67oyVpEgipZHL5SYN9YwGkveaj6J0SJDJMtYRwFkKD5Zvd4KvnzSfQ==} + /@unocss/preset-typography/0.46.0: + resolution: {integrity: sha512-i/Sr4xGaaKa1KXwIZpdS6l67uz/0OS10J+ctfYUKyL66Bv0YWeW2w1uaGVmq8KSnw6rv3hZQ8UGR40AClwyFcw==} dependencies: - '@unocss/core': 0.45.26 + '@unocss/core': 0.46.0 dev: true - /@unocss/preset-uno/0.45.26: - resolution: {integrity: sha512-Am4Ymz7tKwufm6QP2GxT8oIQ1Qez+ikk5miZ94K5IpMguVqMP1FwAu8aFtoItH5jVuDb4JxyZyo66oSFd4+h8g==} + /@unocss/preset-uno/0.46.0: + resolution: {integrity: sha512-eDe7xeGlom1Ym3c07INb4z0IMw/F81Iqi9X1RFF3iendLRa0gnndPj/LAmaS23etCsaQ4zIuV2kw5qle7NHBFA==} dependencies: - '@unocss/core': 0.45.26 - '@unocss/preset-mini': 0.45.26 - '@unocss/preset-wind': 0.45.26 + '@unocss/core': 0.46.0 + '@unocss/preset-mini': 0.46.0 + '@unocss/preset-wind': 0.46.0 dev: true - /@unocss/preset-web-fonts/0.45.26: - resolution: {integrity: sha512-6J3VjrYcYGwVDzdcKE0NYQhvuXkS/Fo54ZlEWScVOSygvBYOEsObo+6Vs9Q1yMbVuVnNrt3R38/KMQFqPEWXKw==} + /@unocss/preset-web-fonts/0.46.0: + resolution: {integrity: sha512-bdnaOJHJoCToZOTjymXKEZA2L9cSj8hG73HaW9T5kiIOisxfddD7Ajy0rUvvvRd9nvSupiEAeDeJGf4Ep1HIng==} dependencies: - '@unocss/core': 0.45.26 - ohmyfetch: 0.4.19 + '@unocss/core': 0.46.0 + ohmyfetch: 0.4.20 dev: true - /@unocss/preset-wind/0.45.26: - resolution: {integrity: sha512-/7YnUIXBkakeNzDpxsOzoHgVKL/nH9kyKHT1hSLj60IlAoN+YfoOwpCOn+taysovjiGmLIKdeEuOAN3HuEi1aw==} + /@unocss/preset-wind/0.46.0: + resolution: {integrity: sha512-tyde6wKcqiYRNoQa7oeInObbTKToz4cIu7Qzcvg9LrcROEKhxa3JE9rAZjxZZa4JUNqdcd8ndFhipy8uNszrrg==} dependencies: - '@unocss/core': 0.45.26 - '@unocss/preset-mini': 0.45.26 + '@unocss/core': 0.46.0 + '@unocss/preset-mini': 0.46.0 dev: true - /@unocss/reset/0.45.26: - resolution: {integrity: sha512-9X0cSvGPXdZ1KAuiWzFWtcoyfC7b8j4GYHr4lDXRkPC5oI3CJhw4WcdvzTHVPqOX2CKqq731H4GhcQ5c5LBuHA==} + /@unocss/reset/0.46.0: + resolution: {integrity: sha512-+zbdk4nlfIvSooDwyhuXxbgYOnrDMDskIXz+Jn/FzPooEpwNoOryKc+lzaP6YZdJ1bFK8oeF/lCNha8kbTBDpQ==} dev: true - /@unocss/scope/0.45.26: - resolution: {integrity: sha512-t5ADmEW9Rhf4Ku0DHwgPoy2mTU0eRrpx6QfXFWtWC+ZtHsjOcC9RXgWYXKZmINtiY+FzQ8A+v/k0wlIuvhJF7g==} + /@unocss/scope/0.46.0: + resolution: {integrity: sha512-IJ1T912M/oOH1KLmec/6i90KEbXVNT9FjoKOSBMrtLPHu24CVBnYBDQV1cCv0HqseW8PntzZ1sLgZT329rqowA==} dev: true - /@unocss/transformer-attributify-jsx/0.45.26: - resolution: {integrity: sha512-fuNnbqe/Ld07fZLZhNtJb6HpSNf6Lw+HlPGdDNzKdbOVUkJwCmBuRifySLkx4HMCn+ld/iniZvyqUgRDLOVanA==} + /@unocss/transformer-attributify-jsx/0.46.0: + resolution: {integrity: sha512-lSuqkAKDyx+eA9JlU/LTjQNc/HWockUdP4NTiSc3gp/boYt6xaagQaC+6RKvKCgarR7EVI+Dxfy5DUjCDPi/tQ==} dependencies: - '@unocss/core': 0.45.26 + '@unocss/core': 0.46.0 dev: true - /@unocss/transformer-compile-class/0.45.26: - resolution: {integrity: sha512-cuDUnNrXcqMezuHcT74tBWdbA55hKTS+g8iESaREnRbdCfnmxTSO/GyrRPsQB5ULL465ENwiOaXJhKkLSfTQqw==} + /@unocss/transformer-compile-class/0.46.0: + resolution: {integrity: sha512-iF6KUTRzhsYCNn6FAGpL68IDew63N2xfBwr4v/dH1pWLqUTZlvQKDQnKvZGf5Fnlzvb2i3TwbliV/670rigPow==} dependencies: - '@unocss/core': 0.45.26 + '@unocss/core': 0.46.0 dev: true - /@unocss/transformer-directives/0.45.26: - resolution: {integrity: sha512-9Ypquxnsp2gAAlEPhQwXIfaEVqWsLyryd0VttQy0+kzxG8koPiMkKtYsiw6vN8tsEzklVQiydLct4HCONaMzHQ==} + /@unocss/transformer-directives/0.46.0: + resolution: {integrity: sha512-qq/A6Q/N3kwIN/XwMRtsVIlvVh1xNVDNN1ryOR+m7GHIS4iNrwomBmRRZfIoK7jKybLNEqROf/uFuepA/b+5xg==} dependencies: - '@unocss/core': 0.45.26 + '@unocss/core': 0.46.0 css-tree: 2.2.1 dev: true - /@unocss/transformer-variant-group/0.45.26: - resolution: {integrity: sha512-MUManbGNe1q5/dm4QLW1SbegeH/06ZbYyREfJEy7U5Ze5Npe67a1eZ4EA4b6el5Y8Bd+wpJ4xj1D+fxC6NVWJQ==} + /@unocss/transformer-variant-group/0.46.0: + resolution: {integrity: sha512-Hu+A0ywLvXk8VRFXcmWPRjTTuIKsrWZ0bhQATwZJfpsEjxYivrBQUXKngkbBYJYBz1bn+kEgBlxaybzRhdmznw==} dependencies: - '@unocss/core': 0.45.26 + '@unocss/core': 0.46.0 dev: true - /@unocss/vite/0.45.26_vite@3.1.0: - resolution: {integrity: sha512-9BNJXBN0UG+olMbfIcVcrJgBetyO3HOP6Wx3r5Oc8iwfYSxrWQlHFF+yVJi/+oxsENfsjAgCRH7O+nF4FrXceA==} + /@unocss/vite/0.46.0_rollup@2.79.0+vite@3.1.0: + resolution: {integrity: sha512-VF/GwY5aQFnUSWZBfTibOuqs0HR1HUWFyharVJf2ru1c7WE00hHKhLlaBbU41agTyTZUY1l3xVIg6coTEYHC6A==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 dependencies: '@ampproject/remapping': 2.2.0 - '@rollup/pluginutils': 4.2.1 - '@unocss/config': 0.45.26 - '@unocss/core': 0.45.26 - '@unocss/inspector': 0.45.26 - '@unocss/scope': 0.45.26 - '@unocss/transformer-directives': 0.45.26 - magic-string: 0.26.5 + '@rollup/pluginutils': 5.0.2_rollup@2.79.0 + '@unocss/config': 0.46.0 + '@unocss/core': 0.46.0 + '@unocss/inspector': 0.46.0 + '@unocss/scope': 0.46.0 + '@unocss/transformer-directives': 0.46.0 + magic-string: 0.26.7 vite: 3.1.0 transitivePeerDependencies: - rollup @@ -6486,7 +6478,7 @@ packages: '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.18.13 '@babel/plugin-transform-react-jsx-self': 7.18.6_@babel+core@7.18.13 '@babel/plugin-transform-react-jsx-source': 7.18.6_@babel+core@7.18.13 - magic-string: 0.26.3 + magic-string: 0.26.7 react-refresh: 0.14.0 transitivePeerDependencies: - supports-color @@ -6503,7 +6495,7 @@ packages: '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.18.13 '@babel/plugin-transform-react-jsx-self': 7.18.6_@babel+core@7.18.13 '@babel/plugin-transform-react-jsx-source': 7.18.6_@babel+core@7.18.13 - magic-string: 0.26.3 + magic-string: 0.26.7 react-refresh: 0.14.0 vite: 3.1.0 transitivePeerDependencies: @@ -6572,11 +6564,11 @@ packages: dependencies: '@volar/code-gen': 0.40.13 '@volar/source-map': 0.40.13 - '@vue/compiler-core': 3.2.39 - '@vue/compiler-dom': 3.2.39 - '@vue/compiler-sfc': 3.2.39 - '@vue/reactivity': 3.2.39 - '@vue/shared': 3.2.39 + '@vue/compiler-core': 3.2.41 + '@vue/compiler-dom': 3.2.41 + '@vue/compiler-sfc': 3.2.41 + '@vue/reactivity': 3.2.41 + '@vue/shared': 3.2.41 dev: true /@volar/vue-typescript/0.40.13: @@ -6683,18 +6675,10 @@ packages: '@vue/compiler-dom': 3.2.41 '@vue/shared': 3.2.41 - /@vue/devtools-api/6.4.4: - resolution: {integrity: sha512-Ku31WzpOV/8cruFaXaEZKF81WkNnvCSlBY4eOGtz5WMSdJvX1v1WWlSMGZeqUwPtQ27ZZz7B62erEMq8JDjcXw==} - dev: true - /@vue/devtools-api/6.4.5: resolution: {integrity: sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ==} dev: true - /@vue/devtools-api/6.4.2: - resolution: {integrity: sha512-6hNZ23h1M2Llky+SIAmVhL7s6BjLtZBCzjIz9iRSBUsysjE7kC39ulW0dH4o/eZtycmSt4qEr6RDVGTIuWu+ow==} - dev: true - /@vue/reactivity-transform/3.2.39: resolution: {integrity: sha512-HGuWu864zStiWs9wBC6JYOP1E00UjMdDWIG5W+FpUx28hV3uz9ODOKVNm/vdOy/Pvzg8+OcANxAVC85WFBbl3A==} dependencies: @@ -6849,6 +6833,18 @@ packages: - '@vue/composition-api' - vue + /@vueuse/core/9.4.0_vue@3.2.41: + resolution: {integrity: sha512-JzgenGj1ZF2BHOen5rsFiAyyI9sXAv7aKhNLlm9b7SwYQeKTcxTWdhudonURCSP3Egl9NQaRBzes2lv/1JUt/Q==} + dependencies: + '@types/web-bluetooth': 0.0.16 + '@vueuse/metadata': 9.4.0 + '@vueuse/shared': 9.4.0_vue@3.2.41 + vue-demi: 0.13.11_vue@3.2.41 + transitivePeerDependencies: + - '@vue/composition-api' + - vue + dev: true + /@vueuse/integrations/8.9.4_axios@0.26.1+vue@3.2.39: resolution: {integrity: sha512-Nk7mH0ThTdiuiiuB+1lyC+5ihnywrr+9h9IA4R4Ry8Mli/cZL38zc3qZWIsCVPm66Lr+7kEp3nnHdSxKi7ivrg==} peerDependencies: @@ -6900,6 +6896,10 @@ packages: /@vueuse/metadata/9.3.1: resolution: {integrity: sha512-G1BPhtx3OHaL/y4OZBofh6Xt02G1VA9PuOO8nac9sTKMkMqfyez5VfkF3D9GUjSRNO7cVWyH4rceeGXfr2wdMg==} + /@vueuse/metadata/9.4.0: + resolution: {integrity: sha512-7GKMdGAsJyQJl35MYOz/RDpP0FxuiZBRDSN79QIPbdqYx4Sd0sVTnIC68KJ6Oln0t0SouvSUMvRHuno216Ud2Q==} + dev: true + /@vueuse/shared/8.9.4_vue@3.2.39: resolution: {integrity: sha512-wt+T30c4K6dGRMVqPddexEVLa28YwxW5OFIPmzUHICjphfAuBFTTdDoyqREZNDOFJZ44ARH1WWQNCUK8koJ+Ag==} peerDependencies: @@ -6923,6 +6923,15 @@ packages: - '@vue/composition-api' - vue + /@vueuse/shared/9.4.0_vue@3.2.41: + resolution: {integrity: sha512-fTuem51KwMCnqUKkI8B57qAIMcFovtGgsCtAeqxIzH3i6nE9VYge+gVfneNHAAy7lj8twbkNfqQSygOPJTm4tQ==} + dependencies: + vue-demi: 0.13.11_vue@3.2.41 + transitivePeerDependencies: + - '@vue/composition-api' + - vue + dev: true + /@webassemblyjs/ast/1.11.1: resolution: {integrity: sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==} dependencies: @@ -9382,8 +9391,8 @@ packages: engines: {node: '>=12'} dev: false - /d3-graph-controller/2.3.17: - resolution: {integrity: sha512-M2ydlsf8Et3MyqS5rwqIErvJ70fQdovxPN7Al8FH6cU+z0yZXq2axrYEG6VIrETgCyPpDbBohddQwPVUOSiiSA==} + /d3-graph-controller/2.3.19: + resolution: {integrity: sha512-NEUDJIyY+YzWEVel31Hm6K8TAZ2gFH75NJcbO7Y0tLN+7eJrlb6CQcCe4p2DvWAKEapj6msSA9Tn5wA6nYk2ig==} dependencies: '@yeger/debounce': 1.0.48 d3-drag: 3.0.0 @@ -10046,11 +10055,6 @@ packages: engines: {node: '>=0.12'} dev: true - /entities/4.4.0: - resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==} - engines: {node: '>=0.12'} - dev: true - /enzyme-shallow-equal/1.0.4: resolution: {integrity: sha512-MttIwB8kKxypwHvRynuC3ahyNc+cFbR8mjVIltnmzQ0uKGqmsfO4bfBuLxb0beLNPhjblUEYvEbsg+VSygvF1Q==} dependencies: @@ -10688,9 +10692,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint/eslintrc': 1.3.2 - '@humanwhocodes/config-array': 0.10.7 - '@humanwhocodes/gitignore-to-minimatch': 1.0.2 + '@eslint/eslintrc': 1.3.3 + '@humanwhocodes/config-array': 0.11.6 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 @@ -10737,7 +10740,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint/eslintrc': 1.3.1 + '@eslint/eslintrc': 1.3.3 '@humanwhocodes/config-array': 0.9.5 ajv: 6.12.6 chalk: 4.1.2 @@ -11994,8 +11997,8 @@ packages: - encoding dev: true - /happy-dom/7.6.3: - resolution: {integrity: sha512-hPHyFzBbICaY9ptOfdiEUBUc9f6Lp8g8rVrN+uwJkXFg7JA+xQ8V6n+NUSxU8AistrVlS4BdLjo3oea14fQQ3w==} + /happy-dom/7.6.6: + resolution: {integrity: sha512-28NxRiHXjzhr+BGciLNUoQW4OaBnQPRT/LPYLufh0Fj3Iwh1j9qJaozjBm/Uqdj5Ps4cukevQ7ERieA6Ddwf1g==} dependencies: css.escape: 1.5.1 he: 1.2.0 @@ -13137,7 +13140,7 @@ packages: dependencies: '@jest/types': 26.6.2 '@types/graceful-fs': 4.1.5 - '@types/node': 18.7.18 + '@types/node': 18.11.5 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.10 @@ -13205,7 +13208,7 @@ packages: resolution: {integrity: sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==} engines: {node: '>= 10.14.2'} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 graceful-fs: 4.2.10 dev: true @@ -13214,7 +13217,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 18.7.18 + '@types/node': 18.11.5 chalk: 4.1.2 graceful-fs: 4.2.10 is-ci: 2.0.0 @@ -13226,7 +13229,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.0.1 - '@types/node': 18.7.18 + '@types/node': 18.11.5 chalk: 4.1.2 ci-info: 3.3.2 graceful-fs: 4.2.10 @@ -13237,7 +13240,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -13246,7 +13249,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.7.18 + '@types/node': 18.11.5 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -13394,47 +13397,6 @@ packages: - utf-8-validate dev: true - /jsdom/20.0.1: - resolution: {integrity: sha512-pksjj7Rqoa+wdpkKcLzQRHhJCEE42qQhl/xLMUKHgoSejaKOdaXEAnqs6uDNwMl/fciHTzKeR8Wm8cw7N+g98A==} - engines: {node: '>=14'} - peerDependencies: - canvas: ^2.5.0 - peerDependenciesMeta: - canvas: - optional: true - dependencies: - abab: 2.0.6 - acorn: 8.8.0 - acorn-globals: 7.0.1 - cssom: 0.5.0 - cssstyle: 2.3.0 - data-urls: 3.0.2 - decimal.js: 10.4.1 - domexception: 4.0.0 - escodegen: 2.0.0 - form-data: 4.0.0 - html-encoding-sniffer: 3.0.0 - http-proxy-agent: 5.0.0 - https-proxy-agent: 5.0.1 - is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.2 - parse5: 7.1.1 - saxes: 6.0.0 - symbol-tree: 3.2.4 - tough-cookie: 4.1.2 - w3c-xmlserializer: 3.0.0 - webidl-conversions: 7.0.0 - whatwg-encoding: 2.0.0 - whatwg-mimetype: 3.0.0 - whatwg-url: 11.0.0 - ws: 8.9.0 - xml-name-validator: 4.0.0 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - dev: true - /jsesc/0.5.0: resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} hasBin: true @@ -13924,8 +13886,8 @@ packages: sourcemap-codec: 1.4.8 dev: true - /magic-string/0.26.5: - resolution: {integrity: sha512-yXUIYOOQnEHKHOftp5shMWpB9ImfgfDJpapa38j/qMtTj5QHWucvxP4lUtuRmHT9vAzvtpHkWKXW9xBwimXeNg==} + /magic-string/0.26.7: + resolution: {integrity: sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==} engines: {node: '>=12'} dependencies: sourcemap-codec: 1.4.8 @@ -14330,15 +14292,6 @@ packages: hasBin: true dev: true - /mlly/0.5.14: - resolution: {integrity: sha512-DgRgNUSX9NIxxCxygX4Xeg9C7GX7OUx1wuQ8cXx9o9LE0e9wrH+OZ9fcnrlEedsC/rtqry3ZhUddC759XD/L0w==} - dependencies: - acorn: 8.8.0 - pathe: 0.3.5 - pkg-types: 0.3.4 - ufo: 0.8.5 - dev: true - /mlly/0.5.16: resolution: {integrity: sha512-LaJ8yuh4v0zEmge/g3c7jjFlhoCPfQn6RCjXgm9A0Qiuochq4BcuOxVfWmdnCoLTlg2MV+hqhOek+W2OhG0Lwg==} dependencies: @@ -15190,12 +15143,6 @@ packages: entities: 4.4.0 dev: true - /parse5/7.1.1: - resolution: {integrity: sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg==} - dependencies: - entities: 4.4.0 - dev: true - /parseurl/1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} @@ -15450,14 +15397,6 @@ packages: find-up: 5.0.0 dev: true - /pkg-types/0.3.4: - resolution: {integrity: sha512-s214f/xkRpwlwVBToWq9Mu0XlU3HhZMYCnr2var8+jjbavBHh/VCh4pBLsJW29rJ//B1jb4HlpMIaNIMH+W2/w==} - dependencies: - jsonc-parser: 3.2.0 - mlly: 0.5.14 - pathe: 0.3.5 - dev: true - /pkg-types/0.3.5: resolution: {integrity: sha512-VkxCBFVgQhNHYk9subx+HOhZ4jzynH11ah63LZsprTKwPCWG9pfWBlkElWFbvkP9BVR0dP1jS9xPdhaHQNK74Q==} dependencies: @@ -16723,7 +16662,7 @@ packages: rollup: ^2.55 typescript: ^4.1 dependencies: - magic-string: 0.26.5 + magic-string: 0.26.7 rollup: 2.79.0 typescript: 4.8.4 optionalDependencies: @@ -16766,7 +16705,7 @@ packages: commenting: 1.1.0 glob: 7.2.3 lodash: 4.17.21 - magic-string: 0.26.5 + magic-string: 0.26.7 mkdirp: 1.0.4 moment: 2.29.4 package-name-regex: 2.0.6 @@ -17120,6 +17059,14 @@ packages: resolution: {integrity: sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==} dev: true + /shiki-processor/0.1.0_shiki@0.11.1: + resolution: {integrity: sha512-7ty3VouP7AQMlERKeiobVeyhjUW6rPMM1b+xFcFF/XwhkN4//Fg9Ju6hPfIOvO4ztylkbLqYufbJmLJmw7SfQA==} + peerDependencies: + shiki: ^0.11.1 + dependencies: + shiki: 0.11.1 + dev: true + /shiki/0.11.1: resolution: {integrity: sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==} dependencies: @@ -18583,26 +18530,6 @@ packages: vfile: 4.2.1 dev: true - /unimport/0.6.7_rollup@2.79.0+vite@3.1.0: - resolution: {integrity: sha512-EMoVqDjswHkU+nD098QYHXH7Mkw7KwGDQAyeRF2lgairJnuO+wpkhIcmCqrD1OPJmsjkTbJ2tW6Ap8St0PuWZA==} - dependencies: - '@rollup/pluginutils': 4.2.1 - escape-string-regexp: 5.0.0 - fast-glob: 3.2.12 - local-pkg: 0.4.2 - magic-string: 0.26.3 - mlly: 0.5.14 - pathe: 0.3.5 - scule: 0.3.2 - strip-literal: 0.4.2 - unplugin: 0.9.5_rollup@2.79.0+vite@3.1.0 - transitivePeerDependencies: - - esbuild - - rollup - - vite - - webpack - dev: true - /unimport/0.6.7_vite@3.1.0: resolution: {integrity: sha512-EMoVqDjswHkU+nD098QYHXH7Mkw7KwGDQAyeRF2lgairJnuO+wpkhIcmCqrD1OPJmsjkTbJ2tW6Ap8St0PuWZA==} dependencies: @@ -18610,8 +18537,8 @@ packages: escape-string-regexp: 5.0.0 fast-glob: 3.2.12 local-pkg: 0.4.2 - magic-string: 0.26.3 - mlly: 0.5.14 + magic-string: 0.26.7 + mlly: 0.5.16 pathe: 0.3.5 scule: 0.3.2 strip-literal: 0.4.2 @@ -18623,19 +18550,22 @@ packages: - webpack dev: true - /unimport/0.6.8: - resolution: {integrity: sha512-MWkaPYvN0j+6jfEuiVFhfmy+aOtgAP11CozSbu/I3Cx+8ybjXIueB7GVlKofHabtjzSlPeAvWKJSFjHWsG2JaA==} + /unimport/0.7.0_rollup@2.79.0: + resolution: {integrity: sha512-Cr0whz4toYVid3JHlni/uThwavDVVCk6Zw0Gxnol1c7DprTA+Isr4T+asO6rDGkhkgV7r3vSdSs5Ym8F15JA+w==} dependencies: - '@rollup/pluginutils': 4.2.1 + '@rollup/pluginutils': 5.0.2_rollup@2.79.0 escape-string-regexp: 5.0.0 fast-glob: 3.2.12 local-pkg: 0.4.2 magic-string: 0.26.7 mlly: 0.5.16 pathe: 0.3.9 + pkg-types: 0.3.5 scule: 0.3.2 strip-literal: 0.4.2 - unplugin: 0.9.6 + unplugin: 0.10.2 + transitivePeerDependencies: + - rollup dev: true /union-value/1.0.1: @@ -18733,32 +18663,32 @@ packages: detect-node: 2.1.0 dev: false - /unocss/0.45.26_vite@3.1.0: - resolution: {integrity: sha512-d8mDD6YewHfSCA2uGbBzKY/UnQRSrIDgP7gI61Ll6XY+DcLCVMn0vc1BubQGEL2K0wP9wDsI8HDR6VzDI/0w9w==} + /unocss/0.46.0_rollup@2.79.0+vite@3.1.0: + resolution: {integrity: sha512-AWO47Cgl0KdP+zUHEs3SXfPB7dyx/LhXtu5mSPxA3xjfXzuUOeVvJCjL7vPLFy8XEzhiP9iWmUVuj520R+hFUQ==} engines: {node: '>=14'} peerDependencies: - '@unocss/webpack': 0.45.26 + '@unocss/webpack': 0.46.0 peerDependenciesMeta: '@unocss/webpack': optional: true dependencies: - '@unocss/astro': 0.45.26_vite@3.1.0 - '@unocss/cli': 0.45.26 - '@unocss/core': 0.45.26 - '@unocss/preset-attributify': 0.45.26 - '@unocss/preset-icons': 0.45.26 - '@unocss/preset-mini': 0.45.26 - '@unocss/preset-tagify': 0.45.26 - '@unocss/preset-typography': 0.45.26 - '@unocss/preset-uno': 0.45.26 - '@unocss/preset-web-fonts': 0.45.26 - '@unocss/preset-wind': 0.45.26 - '@unocss/reset': 0.45.26 - '@unocss/transformer-attributify-jsx': 0.45.26 - '@unocss/transformer-compile-class': 0.45.26 - '@unocss/transformer-directives': 0.45.26 - '@unocss/transformer-variant-group': 0.45.26 - '@unocss/vite': 0.45.26_vite@3.1.0 + '@unocss/astro': 0.46.0_rollup@2.79.0+vite@3.1.0 + '@unocss/cli': 0.46.0_rollup@2.79.0 + '@unocss/core': 0.46.0 + '@unocss/preset-attributify': 0.46.0 + '@unocss/preset-icons': 0.46.0 + '@unocss/preset-mini': 0.46.0 + '@unocss/preset-tagify': 0.46.0 + '@unocss/preset-typography': 0.46.0 + '@unocss/preset-uno': 0.46.0 + '@unocss/preset-web-fonts': 0.46.0 + '@unocss/preset-wind': 0.46.0 + '@unocss/reset': 0.46.0 + '@unocss/transformer-attributify-jsx': 0.46.0 + '@unocss/transformer-compile-class': 0.46.0 + '@unocss/transformer-directives': 0.46.0 + '@unocss/transformer-variant-group': 0.46.0 + '@unocss/vite': 0.46.0_rollup@2.79.0+vite@3.1.0 transitivePeerDependencies: - rollup - supports-color @@ -18824,8 +18754,8 @@ packages: - webpack dev: true - /unplugin-auto-import/0.11.3_6u46jplwha2mhx7sqors5yy6v4: - resolution: {integrity: sha512-hYE7jgwytkstwixrwqcjYd7fLmhpfv3/sqZXN2fT6noZiY3eFhC5erFlHfrN5HLq8/4/sKS6+plvaCk3HB2Stw==} + /unplugin-auto-import/0.11.4_6u46jplwha2mhx7sqors5yy6v4: + resolution: {integrity: sha512-lh/bRDRYwgnb9Cm5ur8TlTMGxA1GRZvgzCvBIf0vyuVRy7ebWcWefFElpUDpr8vLl+ZRGsPVCOGiYJ8TCR625Q==} engines: {node: '>=14'} peerDependencies: '@vueuse/core': '*' @@ -18838,8 +18768,8 @@ packages: '@vueuse/core': 9.3.1_vue@3.2.41 local-pkg: 0.4.2 magic-string: 0.26.7 - unimport: 0.6.8 - unplugin: 0.10.1 + unimport: 0.7.0_rollup@2.79.0 + unplugin: 0.10.2 transitivePeerDependencies: - rollup dev: true @@ -18892,7 +18822,7 @@ packages: magic-string: 0.26.7 minimatch: 5.1.0 resolve: 1.22.1 - unplugin: 0.10.1 + unplugin: 0.10.2 vue: 3.2.41 transitivePeerDependencies: - rollup @@ -18918,15 +18848,15 @@ packages: magic-string: 0.26.7 minimatch: 5.1.0 resolve: 1.22.1 - unplugin: 0.10.1 + unplugin: 0.10.2 vue: 3.2.41 transitivePeerDependencies: - rollup - supports-color dev: true - /unplugin/0.10.1: - resolution: {integrity: sha512-y1hdBitiLOJvCmer0/IGrMGmHplsm2oFRGWleoAJTRQ8aMHxHOe9gLntYlh1WNLKufBuQ2sOTrHF+KWH4xE8Ag==} + /unplugin/0.10.2: + resolution: {integrity: sha512-6rk7GUa4ICYjae5PrAllvcDeuT8pA9+j5J5EkxbMFaV+SalHhxZ7X2dohMzu6C3XzsMT+6jwR/+pwPNR3uK9MA==} dependencies: acorn: 8.8.0 chokidar: 3.5.3 @@ -18958,15 +18888,6 @@ packages: webpack-virtual-modules: 0.4.4 dev: true - /unplugin/0.9.6: - resolution: {integrity: sha512-YYLtfoNiie/lxswy1GOsKXgnLJTE27la/PeCGznSItk+8METYZErO+zzV9KQ/hXhPwzIJsfJ4s0m1Rl7ZCWZ4Q==} - dependencies: - acorn: 8.8.0 - chokidar: 3.5.3 - webpack-sources: 3.2.3 - webpack-virtual-modules: 0.4.5 - dev: true - /unset-value/1.0.0: resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} engines: {node: '>=0.10.0'} @@ -19261,17 +19182,18 @@ packages: optionalDependencies: fsevents: 2.3.2 - /vitepress/1.0.0-alpha.18: - resolution: {integrity: sha512-6Co3/t+oeF6vxJxG7/uy5/wIr+P/8szeFjn3gu/dpJ1aOGA0gnQ+61P8J52b2VTFSDpFC63adLvUFacdCJXywg==} + /vitepress/1.0.0-alpha.25: + resolution: {integrity: sha512-qvKQ4aCArGL8nxP7BAeMBY/N9qm6fX5/dVNGESDvpkm/M8BQlIkOIEanlkAEPY9VOCMA1zcX3wtstcEcnjc5fA==} hasBin: true dependencies: - '@docsearch/css': 3.2.1 - '@docsearch/js': 3.2.1 - '@vitejs/plugin-vue': 3.1.0_vite@3.1.0+vue@3.2.40 - '@vue/devtools-api': 6.4.2 - '@vueuse/core': 9.3.0_vue@3.2.40 + '@docsearch/css': 3.3.0 + '@docsearch/js': 3.3.0 + '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vue/devtools-api': 6.4.5 + '@vueuse/core': 9.4.0_vue@3.2.41 body-scroll-lock: 4.0.0-beta.0 shiki: 0.11.1 + shiki-processor: 0.1.0_shiki@0.11.1 vite: 3.1.0 vue: 3.2.41 transitivePeerDependencies: @@ -19951,31 +19873,6 @@ packages: optional: true dev: true - /ws/8.8.1: - resolution: {integrity: sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: true - - /ws/8.9.0: - resolution: {integrity: sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - /x-default-browser/0.4.0: resolution: {integrity: sha512-7LKo7RtWfoFN/rHx1UELv/2zHGMx8MkZKDq1xENmOCTkfIqZJ0zZ26NEJX8czhnPXVcqS0ARjjfJB+eJ0/5Cvw==} hasBin: true @@ -20023,7 +19920,7 @@ packages: dependencies: eslint-visitor-keys: 3.3.0 lodash: 4.17.21 - yaml: 2.1.3 + yaml: 2.1.1 dev: true /yaml/1.10.2: From e6046dff1bbbcb47abe378864141029c43239f48 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Wed, 26 Oct 2022 14:22:46 +0200 Subject: [PATCH 18/33] chore: use expect-type --- packages/vitest/LICENSE.md | 268 ++++++++++++++++-- packages/vitest/package.json | 1 + packages/vitest/src/node/core.ts | 2 +- packages/vitest/src/node/error.ts | 2 +- packages/vitest/src/typecheck/collect.ts | 2 +- packages/vitest/src/typecheck/expectTypeOf.ts | 191 +------------ packages/vitest/src/types/index.ts | 6 +- packages/vitest/src/utils/tasks.ts | 2 +- pnpm-lock.yaml | 6 + 9 files changed, 253 insertions(+), 227 deletions(-) diff --git a/packages/vitest/LICENSE.md b/packages/vitest/LICENSE.md index 86747084cd3c..3b95e92a0c5b 100644 --- a/packages/vitest/LICENSE.md +++ b/packages/vitest/LICENSE.md @@ -197,35 +197,6 @@ Repository: https://github.com/sinonjs/fake-timers.git --------------------------------------- -## acorn -License: MIT -By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine -Repository: https://github.com/acornjs/acorn.git - -> MIT License -> -> Copyright (C) 2012-2022 by various contributors (see AUTHORS) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - ## ansi-escapes License: MIT By: Sindre Sorhus @@ -575,6 +546,214 @@ Repository: sindresorhus/execa --------------------------------------- +## expect-type +License: Apache-2.0 +Repository: https://github.com/mmkal/expect-type.git + +> Apache License +> Version 2.0, January 2004 +> http://www.apache.org/licenses/ +> +> TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +> +> 1. Definitions. +> +> "License" shall mean the terms and conditions for use, reproduction, +> and distribution as defined by Sections 1 through 9 of this document. +> +> "Licensor" shall mean the copyright owner or entity authorized by +> the copyright owner that is granting the License. +> +> "Legal Entity" shall mean the union of the acting entity and all +> other entities that control, are controlled by, or are under common +> control with that entity. For the purposes of this definition, +> "control" means (i) the power, direct or indirect, to cause the +> direction or management of such entity, whether by contract or +> otherwise, or (ii) ownership of fifty percent (50%) or more of the +> outstanding shares, or (iii) beneficial ownership of such entity. +> +> "You" (or "Your") shall mean an individual or Legal Entity +> exercising permissions granted by this License. +> +> "Source" form shall mean the preferred form for making modifications, +> including but not limited to software source code, documentation +> source, and configuration files. +> +> "Object" form shall mean any form resulting from mechanical +> transformation or translation of a Source form, including but +> not limited to compiled object code, generated documentation, +> and conversions to other media types. +> +> "Work" shall mean the work of authorship, whether in Source or +> Object form, made available under the License, as indicated by a +> copyright notice that is included in or attached to the work +> (an example is provided in the Appendix below). +> +> "Derivative Works" shall mean any work, whether in Source or Object +> form, that is based on (or derived from) the Work and for which the +> editorial revisions, annotations, elaborations, or other modifications +> represent, as a whole, an original work of authorship. For the purposes +> of this License, Derivative Works shall not include works that remain +> separable from, or merely link (or bind by name) to the interfaces of, +> the Work and Derivative Works thereof. +> +> "Contribution" shall mean any work of authorship, including +> the original version of the Work and any modifications or additions +> to that Work or Derivative Works thereof, that is intentionally +> submitted to Licensor for inclusion in the Work by the copyright owner +> or by an individual or Legal Entity authorized to submit on behalf of +> the copyright owner. For the purposes of this definition, "submitted" +> means any form of electronic, verbal, or written communication sent +> to the Licensor or its representatives, including but not limited to +> communication on electronic mailing lists, source code control systems, +> and issue tracking systems that are managed by, or on behalf of, the +> Licensor for the purpose of discussing and improving the Work, but +> excluding communication that is conspicuously marked or otherwise +> designated in writing by the copyright owner as "Not a Contribution." +> +> "Contributor" shall mean Licensor and any individual or Legal Entity +> on behalf of whom a Contribution has been received by Licensor and +> subsequently incorporated within the Work. +> +> 2. Grant of Copyright License. Subject to the terms and conditions of +> this License, each Contributor hereby grants to You a perpetual, +> worldwide, non-exclusive, no-charge, royalty-free, irrevocable +> copyright license to reproduce, prepare Derivative Works of, +> publicly display, publicly perform, sublicense, and distribute the +> Work and such Derivative Works in Source or Object form. +> +> 3. Grant of Patent License. Subject to the terms and conditions of +> this License, each Contributor hereby grants to You a perpetual, +> worldwide, non-exclusive, no-charge, royalty-free, irrevocable +> (except as stated in this section) patent license to make, have made, +> use, offer to sell, sell, import, and otherwise transfer the Work, +> where such license applies only to those patent claims licensable +> by such Contributor that are necessarily infringed by their +> Contribution(s) alone or by combination of their Contribution(s) +> with the Work to which such Contribution(s) was submitted. If You +> institute patent litigation against any entity (including a +> cross-claim or counterclaim in a lawsuit) alleging that the Work +> or a Contribution incorporated within the Work constitutes direct +> or contributory patent infringement, then any patent licenses +> granted to You under this License for that Work shall terminate +> as of the date such litigation is filed. +> +> 4. Redistribution. You may reproduce and distribute copies of the +> Work or Derivative Works thereof in any medium, with or without +> modifications, and in Source or Object form, provided that You +> meet the following conditions: +> +> (a) You must give any other recipients of the Work or +> Derivative Works a copy of this License; and +> +> (b) You must cause any modified files to carry prominent notices +> stating that You changed the files; and +> +> (c) You must retain, in the Source form of any Derivative Works +> that You distribute, all copyright, patent, trademark, and +> attribution notices from the Source form of the Work, +> excluding those notices that do not pertain to any part of +> the Derivative Works; and +> +> (d) If the Work includes a "NOTICE" text file as part of its +> distribution, then any Derivative Works that You distribute must +> include a readable copy of the attribution notices contained +> within such NOTICE file, excluding those notices that do not +> pertain to any part of the Derivative Works, in at least one +> of the following places: within a NOTICE text file distributed +> as part of the Derivative Works; within the Source form or +> documentation, if provided along with the Derivative Works; or, +> within a display generated by the Derivative Works, if and +> wherever such third-party notices normally appear. The contents +> of the NOTICE file are for informational purposes only and +> do not modify the License. You may add Your own attribution +> notices within Derivative Works that You distribute, alongside +> or as an addendum to the NOTICE text from the Work, provided +> that such additional attribution notices cannot be construed +> as modifying the License. +> +> You may add Your own copyright statement to Your modifications and +> may provide additional or different license terms and conditions +> for use, reproduction, or distribution of Your modifications, or +> for any such Derivative Works as a whole, provided Your use, +> reproduction, and distribution of the Work otherwise complies with +> the conditions stated in this License. +> +> 5. Submission of Contributions. Unless You explicitly state otherwise, +> any Contribution intentionally submitted for inclusion in the Work +> by You to the Licensor shall be under the terms and conditions of +> this License, without any additional terms or conditions. +> Notwithstanding the above, nothing herein shall supersede or modify +> the terms of any separate license agreement you may have executed +> with Licensor regarding such Contributions. +> +> 6. Trademarks. This License does not grant permission to use the trade +> names, trademarks, service marks, or product names of the Licensor, +> except as required for reasonable and customary use in describing the +> origin of the Work and reproducing the content of the NOTICE file. +> +> 7. Disclaimer of Warranty. Unless required by applicable law or +> agreed to in writing, Licensor provides the Work (and each +> Contributor provides its Contributions) on an "AS IS" BASIS, +> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +> implied, including, without limitation, any warranties or conditions +> of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +> PARTICULAR PURPOSE. You are solely responsible for determining the +> appropriateness of using or redistributing the Work and assume any +> risks associated with Your exercise of permissions under this License. +> +> 8. Limitation of Liability. In no event and under no legal theory, +> whether in tort (including negligence), contract, or otherwise, +> unless required by applicable law (such as deliberate and grossly +> negligent acts) or agreed to in writing, shall any Contributor be +> liable to You for damages, including any direct, indirect, special, +> incidental, or consequential damages of any character arising as a +> result of this License or out of the use or inability to use the +> Work (including but not limited to damages for loss of goodwill, +> work stoppage, computer failure or malfunction, or any and all +> other commercial damages or losses), even if such Contributor +> has been advised of the possibility of such damages. +> +> 9. Accepting Warranty or Additional Liability. While redistributing +> the Work or Derivative Works thereof, You may choose to offer, +> and charge a fee for, acceptance of support, warranty, indemnity, +> or other liability obligations and/or rights consistent with this +> License. However, in accepting such obligations, You may act only +> on Your own behalf and on Your sole responsibility, not on behalf +> of any other Contributor, and only if You agree to indemnify, +> defend, and hold each Contributor harmless for any liability +> incurred by, or claims asserted against, such Contributor by reason +> of your accepting any such warranty or additional liability. +> +> END OF TERMS AND CONDITIONS +> +> APPENDIX: How to apply the Apache License to your work. +> +> To apply the Apache License to your work, attach the following +> boilerplate notice, with the fields enclosed by brackets "[]" +> replaced with your own identifying information. (Don't include +> the brackets!) The text should be enclosed in the appropriate +> comment syntax for the file format. We also recommend that a +> file or class name and description of purpose be included on the +> same "printed page" as the copyright notice for easier +> identification within third-party archives. +> +> Copyright [yyyy] [name of copyright owner] +> +> Licensed under the Apache License, Version 2.0 (the "License"); +> you may not use this file except in compliance with the License. +> You may obtain a copy of the License at +> +> http://www.apache.org/licenses/LICENSE-2.0 +> +> Unless required by applicable law or agreed to in writing, software +> distributed under the License is distributed on an "AS IS" BASIS, +> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +> See the License for the specific language governing permissions and +> limitations under the License. + +--------------------------------------- + ## fast-glob License: MIT By: Denis Malinochkin @@ -711,6 +890,35 @@ Repository: sindresorhus/get-stream --------------------------------------- +## get-tsconfig +License: MIT +By: Hiroki Osame +Repository: privatenumber/get-tsconfig + +> MIT License +> +> Copyright (c) Hiroki Osame +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +--------------------------------------- + ## glob-parent License: ISC By: Gulp Team, Elan Shanker, Blaine Bublitz @@ -1258,7 +1466,7 @@ Repository: sindresorhus/mimic-fn > MIT License > -> Copyright (c) Sindre Sorhus (sindresorhus.com) +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > diff --git a/packages/vitest/package.json b/packages/vitest/package.json index 44b0652b6836..6fff7de7c69a 100644 --- a/packages/vitest/package.json +++ b/packages/vitest/package.json @@ -137,6 +137,7 @@ "diff": "^5.1.0", "event-target-polyfill": "^0.0.3", "execa": "^6.1.0", + "expect-type": "^0.15.0", "fast-glob": "^3.2.12", "find-up": "^6.3.0", "flatted": "^3.2.7", diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 1b2be8c5aab4..e7c8bb4092a7 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -11,7 +11,7 @@ import type { ArgumentsType, CoverageProvider, OnServerRestartHandler, Reporter, import { SnapshotManager } from '../integrations/snapshot/manager' import { clearTimeout, deepMerge, hasFailed, noop, setTimeout, slash, toArray } from '../utils' import { getCoverageProvider } from '../integrations/coverage' -import { Typechecker } from '../typescript/typechecker' +import { Typechecker } from '../typecheck/typechecker' import { createPool } from './pool' import type { WorkerPool } from './pool' import { createBenchmarkReporters, createReporters } from './reporters/utils' diff --git a/packages/vitest/src/node/error.ts b/packages/vitest/src/node/error.ts index 873a3f01ee8b..5a5b6cbb1434 100644 --- a/packages/vitest/src/node/error.ts +++ b/packages/vitest/src/node/error.ts @@ -7,7 +7,7 @@ import type { ErrorWithDiff, ParsedStack, Position } from '../types' import { interpretSourcePos, lineSplitRE, parseStacktrace, posToNumber } from '../utils/source-map' import { F_POINTER } from '../utils/figures' import { stringify } from '../integrations/chai/jest-matcher-utils' -import { TypeCheckError } from '../typescript/typechecker' +import { TypeCheckError } from '../typecheck/typechecker' import type { Vitest } from './core' import { type DiffOptions, unifiedDiff } from './diff' import { divider } from './reporters/renderers/utils' diff --git a/packages/vitest/src/typecheck/collect.ts b/packages/vitest/src/typecheck/collect.ts index 1909587005ba..3651bcf344da 100644 --- a/packages/vitest/src/typecheck/collect.ts +++ b/packages/vitest/src/typecheck/collect.ts @@ -62,7 +62,7 @@ export async function collectTests(ctx: Vitest, filepath: string): Promise { - toBeAny: (...MISMATCH: MismatchArgs, B>) => true - toBeUnknown: (...MISMATCH: MismatchArgs, B>) => true - toBeNever: (...MISMATCH: MismatchArgs, B>) => true - toBeFunction: (...MISMATCH: MismatchArgs any>, B>) => true - toBeObject: (...MISMATCH: MismatchArgs, B>) => true - toBeArray: (...MISMATCH: MismatchArgs, B>) => true - toBeNumber: (...MISMATCH: MismatchArgs, B>) => true - toBeString: (...MISMATCH: MismatchArgs, B>) => true - toBeBoolean: (...MISMATCH: MismatchArgs, B>) => true - toBeVoid: (...MISMATCH: MismatchArgs, B>) => true - toBeSymbol: (...MISMATCH: MismatchArgs, B>) => true - toBeNull: (...MISMATCH: MismatchArgs, B>) => true - toBeUndefined: (...MISMATCH: MismatchArgs, B>) => true - toBeNullable: (...MISMATCH: MismatchArgs>>, B>) => true - toMatch: { - (...MISMATCH: MismatchArgs, B>): true - (expected: Expected, ...MISMATCH: MismatchArgs, B>): true - } - toBe: { - (...MISMATCH: MismatchArgs, B>): true - (expected: Expected, ...MISMATCH: MismatchArgs, B>): true - } - toBeCallableWith: B extends true ? (...args: Params) => true : never - toBeConstructibleWith: B extends true ? (...args: ConstructorParams) => true : never - toHaveProperty: ( - key: K, - ...MISMATCH: MismatchArgs, B> - ) => K extends keyof Actual ? ExpectTypeOf : true - extract: (v?: V) => ExpectTypeOf, B> - exclude: (v?: V) => ExpectTypeOf, B> - parameter: >(number: K) => ExpectTypeOf[K], B> - parameters: ExpectTypeOf, B> - constructorParameters: ExpectTypeOf, B> - instance: Actual extends new (...args: any[]) => infer I ? ExpectTypeOf : never - returns: Actual extends (...args: any[]) => infer R ? ExpectTypeOf : never - resolves: Actual extends PromiseLike ? ExpectTypeOf : never - items: Actual extends ArrayLike ? ExpectTypeOf : never - guards: Actual extends (v: any, ...args: any[]) => v is infer T ? ExpectTypeOf : never - asserts: Actual extends (v: any, ...args: any[]) => asserts v is infer T - ? // Guard methods `(v: any) => asserts v is T` does not actually defines a return type. Thus, any function taking 1 argument matches the signature before. - // In case the inferred assertion type `R` could not be determined (so, `unknown`), consider the function as a non-guard, and return a `never` type. - // See https://github.com/microsoft/TypeScript/issues/34636 - unknown extends T - ? never - : ExpectTypeOf - : never - not: ExpectTypeOf> -} -const fn: any = () => true - -export interface _ExpectTypeOf { - (actual: Actual): ExpectTypeOf - (): ExpectTypeOf - extend(matchers: Record): void -} - -interface MatcherConfiguration { - message: string -} - -const matchersConfiguration: Record = { - toBeAny: { - message: 'expected type to be any', - }, - toBeNull: { - message: 'expected type to be null', - }, - toBeNever: { - message: 'expected type to be never', - }, - toBe: { - message: 'expected two types to be equal', - }, - toBeUnknown: { - message: 'expected type to be unknown', - }, - toBeFunction: { - message: 'expected type to be a function', - }, - toBeObject: { - message: 'expected type to be an object', - }, - toBeArray: { - message: 'expected type to be an array', - }, - toBeString: { - message: 'expected type to be a string', - }, - toBeNumber: { - message: 'expected type to be a number', - }, - toBeBoolean: { - message: 'expected type to be boolean', - }, - toBeVoid: { - message: 'expected type to be void', - }, - toBeSymbol: { - message: 'expected type to be a symbol', - }, - toBeUndefined: { - message: 'expected type to be undefined', - }, - toBeNullable: { - message: 'expected type to be nullable', - }, - toMatch: { - message: 'expected types to extend one another', - }, - toBeCallableWith: { - message: 'expected type to be callable with given arguments', - }, - toBeConstructibleWith: { - message: 'expected type to be constructible with given arguments', - }, -} - -export const expectTypeOf: _ExpectTypeOf = ((_actual?: Actual): ExpectTypeOf => { - const nonFunctionProperties = [ - 'parameters', - 'returns', - 'resolves', - 'not', - 'items', - 'constructorParameters', - 'instance', - 'guards', - 'asserts', - ] as const - type Keys = keyof ExpectTypeOf - - type FunctionsDict = Record, any> - const obj: FunctionsDict = { - toBeAny: fn, - toBeUnknown: fn, - toBeNever: fn, - toBeFunction: fn, - toBeObject: fn, - toBeArray: fn, - toBeString: fn, - toBeNumber: fn, - toBeBoolean: fn, - toBeVoid: fn, - toBeSymbol: fn, - toBeNull: fn, - toBeUndefined: fn, - toBeNullable: fn, - toMatch: fn, - toBe: fn, - toBeCallableWith: fn, - toBeConstructibleWith: fn, - extract: expectTypeOf, - exclude: expectTypeOf, - toHaveProperty: expectTypeOf, - parameter: expectTypeOf, - } - - const getterProperties: readonly Keys[] = nonFunctionProperties - getterProperties.forEach((prop: Keys) => Object.defineProperty(obj, prop, { get: () => expectTypeOf({}) })) - - return obj as ExpectTypeOf -}) as _ExpectTypeOf - -// extend by calling setupFiles -expectTypeOf.extend = (matchers) => { - for (const matcher in matchers) - matchersConfiguration[matcher] = matchers[matcher] -} - -Object.defineProperty(expectTypeOf, EXPECT_TYPEOF_MATCHERS, { - value: matchersConfiguration, -}) +export { expectTypeOf, type ExpectTypeOf } from 'expect-type' diff --git a/packages/vitest/src/types/index.ts b/packages/vitest/src/types/index.ts index 1f07bb3be174..74bbd2b7b56d 100644 --- a/packages/vitest/src/types/index.ts +++ b/packages/vitest/src/types/index.ts @@ -1,9 +1,9 @@ import './vite' import './global' -export { expectTypeOf, type ExpectTypeOf } from '../typescript/expectTypeOf' -export { assertType, type AssertType } from '../typescript/assertType' -export * from '../typescript/types' +export { expectTypeOf, type ExpectTypeOf } from '../typecheck/expectTypeOf' +export { assertType, type AssertType } from '../typecheck/assertType' +export * from '../typecheck/types' export * from './config' export * from './tasks' export * from './reporter' diff --git a/packages/vitest/src/utils/tasks.ts b/packages/vitest/src/utils/tasks.ts index 0479f6e07fd1..7384f65acb41 100644 --- a/packages/vitest/src/utils/tasks.ts +++ b/packages/vitest/src/utils/tasks.ts @@ -1,5 +1,5 @@ import type { Arrayable, Benchmark, Suite, Task, Test, TypeCheck } from '../types' -import { TYPECHECK_SUITE } from '../typescript/constants' +import { TYPECHECK_SUITE } from '../typecheck/constants' import { toArray } from './base' function isAtomTest(s: Task): s is Test | Benchmark | TypeCheck { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d81afd47ec91..9e97c4a6bd65 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -790,6 +790,7 @@ importers: diff: ^5.1.0 event-target-polyfill: ^0.0.3 execa: ^6.1.0 + expect-type: ^0.15.0 fast-glob: ^3.2.12 find-up: ^6.3.0 flatted: ^3.2.7 @@ -851,6 +852,7 @@ importers: diff: 5.1.0 event-target-polyfill: 0.0.3 execa: 6.1.0 + expect-type: 0.15.0 fast-glob: 3.2.12 find-up: 6.3.0 flatted: 3.2.7 @@ -10988,6 +10990,10 @@ packages: - supports-color dev: true + /expect-type/0.15.0: + resolution: {integrity: sha512-yWnriYB4e8G54M5/fAFj7rCIBiKs1HAACaY13kCz6Ku0dezjS9aMcfcdVK2X8Tv2tEV1BPz/wKfQ7WA4S/d8aA==} + dev: true + /expect/29.0.1: resolution: {integrity: sha512-yQgemsjLU+1S8t2A7pXT3Sn/v5/37LY8J+tocWtKEA0iEYYc6gfKbbJJX2fxHZmd7K9WpdbQqXUpmYkq1aewYg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} From bdff5e479c0e865fcdf008d02568cebdfcf453db Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Thu, 27 Oct 2022 09:13:41 +0200 Subject: [PATCH 19/33] chore: fix types --- packages/vitest/src/node/logger.ts | 2 +- test/typescript/test.test-d.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/vitest/src/node/logger.ts b/packages/vitest/src/node/logger.ts index b7aa037ed633..360387cf8569 100644 --- a/packages/vitest/src/node/logger.ts +++ b/packages/vitest/src/node/logger.ts @@ -2,7 +2,7 @@ import { createLogUpdate } from 'log-update' import c from 'picocolors' import { version } from '../../../../package.json' import type { ErrorWithDiff } from '../types' -import type { TypeCheckError } from '../typescript/typechecker' +import type { TypeCheckError } from '../typecheck/typechecker' import { divider } from './reporters/renderers/utils' import type { Vitest } from './core' import { printError } from './error' diff --git a/test/typescript/test.test-d.ts b/test/typescript/test.test-d.ts index ef2bc662e114..f1f0db2cd604 100644 --- a/test/typescript/test.test-d.ts +++ b/test/typescript/test.test-d.ts @@ -2,15 +2,12 @@ import { describe, expectTypeOf, test } from 'vitest' describe('test', () => { test('some-test', () => { - expectTypeOf(45).toBe(45) - // expectTypeOf(45).toBe(80) - // expectTypeOf(45).toBe(80) - // expectTypeOf(45).toBe('22') + expectTypeOf(45).toEqualTypeOf(45) }) describe('test2', () => { test('some-test 2', () => { - expectTypeOf(45).toBe(45) + expectTypeOf(45).toEqualTypeOf(45) }) }) }) From b31fc0125d30f0571785db472a2e734e2e2090ea Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Thu, 27 Oct 2022 11:57:39 +0200 Subject: [PATCH 20/33] chore: docs --- docs/.vitepress/components/FeaturesList.vue | 1 + docs/api/index.md | 514 +++++++++++++++++++- docs/guide/features.md | 17 + docs/guide/testing-types.md | 34 +- 4 files changed, 548 insertions(+), 18 deletions(-) diff --git a/docs/.vitepress/components/FeaturesList.vue b/docs/.vitepress/components/FeaturesList.vue index c6d740800646..99bf99ac7701 100644 --- a/docs/.vitepress/components/FeaturesList.vue +++ b/docs/.vitepress/components/FeaturesList.vue @@ -23,6 +23,7 @@ happy-dom or jsdom for DOM mocking Code coverage via c8 or istanbul Rust-like in-source testing + Type Testing via expect-type diff --git a/docs/api/index.md b/docs/api/index.md index a931c0ff1d1b..81b2a1bc20a9 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1829,9 +1829,521 @@ You cannot use this syntax, when using Vitest as [type checker](/guide/testing-t If you want to know more, checkout [guide on extending matchers](/guide/extending-matchers). ::: +## expectTypeOf + +- **Type:** `(a: unknown) => ExpectTypeOf` + +### not + + - **Type:** `ExpectTypeOf` + + You can negate all assertions, using `.not` property. + +### toEqualTypeOf + + - **Type:** `(expected: T) => void` + + This matcher will check, if types are fully equal to each other. This matcher will not fail, if two objects have different values, but the same type, but will fail, if object is missing a property. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf({ a: 1 }).toEqualTypeOf<{ a: number }>() + expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 1 }) + expectTypeOf({ a: 1 }).toEqualTypeOf({ a: 2 }) + expectTypeOf({ a: 1, b: 1 }).not.toEqualTypeOf<{ a: number }>() + ``` + +### toMatchTypeOf + + - **Type:** `(expected: T) => void` + + This matcher checks if expect type extends provided type. It is different from `toEqual` and is more similar to expect's `toMatch`. With this matcher you can check, if an object "matches" a type. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf({ a: 1, b: 1 }).toMatchTypeOf({ a: 1 }) + expectTypeOf().toMatchTypeOf() + expectTypeOf().not.toMatchTypeOf() + ``` + +### extract + + - **Type:** `ExpectTypeOf` + + You can use `.extract` to narrow down types for further testing. + + ```ts + import { expectTypeOf } from 'vitest' + + type ResponsiveProp = T | T[] | { xs?: T; sm?: T; md?: T } + const getResponsiveProp = (_props: T): ResponsiveProp => ({}) + interface CSSProperties { margin?: string; padding?: string } + + const cssProperties: CSSProperties = { margin: '1px', padding: '2px' } + + expectTypeOf(getResponsiveProp(cssProperties)) + .extract<{ xs?: any }>() // extracts the last type from a union + .toEqualTypeOf<{ xs?: CSSProperties; sm?: CSSProperties; md?: CSSProperties }>() + + expectTypeOf(getResponsiveProp(cssProperties)) + .extract() // extracts an array from a union + .toEqualTypeOf() + ``` + + ::: warning + If no type is found in the union, `.extract` will return `never`. + ::: + +### exclude + + - **Type:** `ExpectTypeOf` + + You can use `.exclude` to remove types from a union for further testing. + + ```ts + import { expectTypeOf } from 'vitest' + + type ResponsiveProp = T | T[] | { xs?: T; sm?: T; md?: T } + const getResponsiveProp = (_props: T): ResponsiveProp => ({}) + interface CSSProperties { margin?: string; padding?: string } + + const cssProperties: CSSProperties = { margin: '1px', padding: '2px' } + + expectTypeOf(getResponsiveProp(cssProperties)) + .exclude() + .exclude<{ xs?: unknown }>() // or just .exclude() + .toEqualTypeOf() + ``` + + ::: warning + If no type is found in the union, `.exclude` will return `never`. + ::: + +### returns + + - **Type:** `ExpectTypeOf` + + You can use `.returns` to extract return value of a function type. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(() => {}).returns.toBeVoid() + expectTypeOf((a: number) => [a, a]).returns.toEqualTypeOf([1, 2]) + ``` + + ::: warning + If used on a non-function type, it will return `never`, so you won't be able to chain it with other matchers. + ::: + +### parameters + + - **Type:** `ExpectTypeOf` + + You can extract function arguments with `.parameters` to perform assertions on its value. Parameters are returned as an array. + + ```ts + import { expectTypeOf } from 'vitest' + + type NoParam = () => void + type HasParam = (s: string) => void + + expectTypeOf().parameters.toEqualTypeOf<[]>() + expectTypeOf().parameters.toEqualTypeOf<[string]>() + ``` + + ::: warning + If used on a non-function type, it will return `never`, so you won't be able to chain it with other matchers. + ::: + + ::: tip + You can also use [`.toBeCallableWith`](#tobecallablewith) matcher as a more expressive assertion. + ::: + +### parameter + + - **Type:** `(nth: number) => ExpectTypeOf` + + You can extract a certain function argument with `.parameter(number)` call to perform other assertions on it. + + ```ts + import { expectTypeOf } from 'vitest' + + const foo = (a: number, b: string) => [a, b] + + expectTypeOf(foo).parameter(0).toBeNumber() + expectTypeOf(foo).parameter(1).toBeString() + ``` + + ::: warning + If used on a non-function type, it will return `never`, so you won't be able to chain it with other matchers. + ::: + +### constructorParameters + + - **Type:** `ExpectTypeOf` + + You can extract constructor parameters as an array of values and perform assertions on them with this method. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(Date).constructorParameters.toEqualTypeOf<[] | [string | number | Date]>() + ``` + + ::: warning + If used on a non-function type, it will return `never`, so you won't be able to chain it with other matchers. + ::: + + ::: tip + You can also use [`.toBeConstructibleWith`](#tobeconstructiblewith) matcher as a more expressive assertion. + ::: + +### instance + + - **Type:** `ExpectTypeOf` + + This property gives access to matchers that can be performed on an instance of the provided class. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(Date).instance.toHaveProperty('toISOString') + ``` + + ::: warning + If used on a non-function type, it will return `never`, so you won't be able to chain it with other matchers. + ::: + +### items + + - **Type:** `ExpectTypeOf` + + You can get array item type with `.items` to perform further assertions. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf([1, 2, 3]).items.toEqualTypeOf() + expectTypeOf([1, 2, 3]).items.not.toEqualTypeOf() + ``` + +### resolves + + - **Type:** `ExpectTypeOf` + + This matcher extracts resolved value of a `Promise`, so you can perform other assertions on it. + + ```ts + import { expectTypeOf } from 'vitest' + + const asyncFunc = async () => 123 + + expectTypeOf(asyncFunc).returns.resolves.toBeNumber() + expectTypeOf(Promise.resolve('string')).resolves.toBeString() + ``` + + ::: warning + If used on a non-promise type, it will return `never`, so you won't be able to chain it with other matchers. + ::: + +### guards + + - **Type:** `ExpectTypeOf` + + This matcher extracts guard value (e.g., `v is number`), so you can perform assertions on it. + + ```ts + import { expectTypeOf } from 'vitest' + + const isString = (v: any): v is string => typeof v === 'string' + expectTypeOf(isString).guards.toBeString() + ``` + + ::: warning + Returns `never`, if the value is not a guard function, so you won't be able to chain it with other matchers. + ::: + +### asserts + + - **Type:** `ExpectTypeOf` + + This matcher extracts assert value (e.g., `assert v is number`), so you can perform assertions on it. + + ```ts + import { expectTypeOf } from 'vitest' + + const assertNumber = (v: any): asserts v is number => { + if (typeof v !== 'number') + throw new TypeError('Nope !') + } + + expectTypeOf(assertNumber).asserts.toBeNumber() + ``` + + ::: warning + Returns `never`, if the value is not an assert function, so you won't be able to chain it with other matchers. + ::: + +### toBeAny + + - **Type:** `() => void` + + With this matcher you can check, if provided type is `any` type. If the type is too specific, the test will fail. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf().toBeAny() + expectTypeOf({} as any).toBeAny() + expectTypeOf('string').not.toBeAny() + ``` + +### toBeUnknown + + - **Type:** `() => void` + + This matcher checks, if provided type is `unknown` type. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf().toBeUnknown() + expectTypeOf({} as unknown).toBeUnknown() + expectTypeOf('string').not.toBeUnknown() + ``` + +### toBeNever + + - **Type:** `() => void` + + This matcher checks, if provided type is a `never` type. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf().toBeNever() + expectTypeOf((): never => {}).returns.toBeNever() + ``` + +### toBeFunction + + - **Type:** `() => void` + + This matcher checks, if provided type is a `functon`. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(42).not.toBeFunction() + expectTypeOf((): never => {}).toBeFunction() + ``` + +### toBeObject + + - **Type:** `() => void` + + This matcher checks, if provided type is an `object`. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(42).not.toBeObject() + expectTypeOf({}).toBeObject() + ``` + +### toBeArray + + - **Type:** `() => void` + + This matcher checks, if provided type is `Array`. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(42).not.toBeArray() + expectTypeOf([]).toBeArray() + expectTypeOf([1, 2]).toBeArray() + expectTypeOf([{}, 42]).toBeArray() + ``` + +### toBeString + + - **Type:** `() => void` + + This matcher checks, if provided type is a `string`. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(42).not.toBeArray() + expectTypeOf([]).toBeArray() + expectTypeOf([1, 2]).toBeArray() + expectTypeOf().toBeArray() + ``` + +### toBeBoolean + + - **Type:** `() => void` + + This matcher checks, if provided type is `boolean`. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(42).not.toBeBoolean() + expectTypeOf(true).toBeBoolean() + expectTypeOf().toBeBoolean() + ``` + +### toBeVoid + + - **Type:** `() => void` + + This matcher checks, if provided type is `void`. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(() => {}).returns.toBeVoid() + expectTypeOf().toBeVoid() + ``` + +### toBeSymbol + + - **Type:** `() => void` + + This matcher checks, if provided type is a `symbol`. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(Symbol(1)).toBeSymbol() + expectTypeOf().toBeSymbol() + ``` + +### toBeNull + + - **Type:** `() => void` + + This matcher checks, if provided type is `null`. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(null).toBeNull() + expectTypeOf().toBeNull() + expectTypeOf(undefined).not.toBeNull() + ``` + +### toBeUndefined + + - **Type:** `() => void` + + This matcher checks, if provided type is `undefined`. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(undefined).toBeUndefined() + expectTypeOf().toBeUndefined() + expectTypeOf(null).not.toBeUndefined() + ``` + +### toBeNullable + + - **Type:** `() => void` + + This matcher checks, if you can use `null` or `undefined` with provided type. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf<1 | undefined>().toBeNullable() + expectTypeOf<1 | null>().toBeNullable() + expectTypeOf<1 | undefined | null>().toBeNullable() + ``` + +### toBeCallableWith + + - **Type:** `() => void` + + This matcher ensures you can call provided function with a set of parameters. + + ```ts + import { expectTypeOf } from 'vitest' + + type NoParam = () => void + type HasParam = (s: string) => void + + expectTypeOf().toBeCallableWith() + expectTypeOf().toBeCallableWith('some string') + ``` + + ::: warning + If used on a non-function type, it will return `never`, so you won't be able to chain it with other matchers. + ::: + +### toBeConstructibleWith + + - **Type:** `() => void` + + This matcher ensures you can create a new instance with a set of constructor parameters. + + ```ts + import { expectTypeOf } from 'vitest' + + expectTypeOf(Date).toBeConstructibleWith(new Date()) + expectTypeOf(Date).toBeConstructibleWith('01-01-2000') + ``` + + ::: warning + If used on a non-function type, it will return `never`, so you won't be able to chain it with other matchers. + ::: + +### toHaveProperty + + - **Type:** `(property: K) => ExpectTypeOf` + + This matcher checks if a property exists on provided object. If it exists, it also returns the same set of matchers for the type of this property, so you can chain assertions one after another. + + ```ts + import { expectTypeOf } from 'vitest' + + const obj = { a: 1, b: '' } + + expectTypeOf(obj).toHaveProperty('a') + expectTypeOf(obj).not.toHaveProperty('c') + + expectTypeOf(obj).toHaveProperty('a').toBeNumber() + expectTypeOf(obj).toHaveProperty('b').toBeString() + expectTypeOf(obj).toHaveProperty('a').not.toBeString() + ``` + +## assertType + + - **Type:** `(value: T): void` + + You can use this function as an alternative for `expectTypeOf` to easily assert that argument type is equal to provided generic. + + ```ts + import { assertType } from 'vitest' + + function concat(a: string, b: string): string + function concat(a: number, b: number): number + function concat(a: string | number, b: string | number): string | number + + assertType(concat('a', 'b')) + assertType(concat(1, 2)) + // @ts-expect-error wrong types + assertType(concat('a', 2)) + ``` + ## Setup and Teardown -These functions allow you to hook into the life cycle of tests to avoid repeating setup and teardown code. They apply to the current context: the file if they are used at the top-level or the current suite if they are inside a `describe` block. These hooks are not called, when you are running Vitest as type checker. +These functions allow you to hook into the life cycle of tests to avoid repeating setup and teardown code. They apply to the current context: the file if they are used at the top-level or the current suite if they are inside a `describe` block. These hooks are not called, when you are running Vitest as a type checker. ### beforeEach diff --git a/docs/guide/features.md b/docs/guide/features.md index 5bebfafce743..6aed1de35eb6 100644 --- a/docs/guide/features.md +++ b/docs/guide/features.md @@ -200,3 +200,20 @@ describe('sort', () => { }) }) ``` + +## Type Testing experimental + +Since Vitest 0.25.0 you can [write tests](/guide/testing-types) to catch type regressions. Vitest comes with [`expect-type`](https://github.com/mmkal/expect-type) package to provide you with a similar and easy to understand API. + +```ts +import { assertType, expectTypeOf } from 'vitest' +import { mount } from './mount.js' + +test('my types work properly', () => { + expectTypeOf(mount).toBeFunction() + expectTypeOf(mount).parameter(0).toMatchTypeOf<{ name: string }>() + + // @ts-expect-error name is a string + assertType(mount({ name: 42 })) +}) +``` diff --git a/docs/guide/testing-types.md b/docs/guide/testing-types.md index 989cc7a4f01f..73382d4ba72e 100644 --- a/docs/guide/testing-types.md +++ b/docs/guide/testing-types.md @@ -4,25 +4,25 @@ title: Testing Types | Guide # Testing Types -Vitest allows you to write tests for your types. +Vitest allows you to write tests for your types, using `expectTypeOf` or `assertType` syntaxes. By default all tests inside `*.test-d.ts` files are considered type tests, but you can change it with [`typechecker.include`](/config/#typechecker-include) config option. -Under the hood Vitest calls `tsc` or `vue-tsc`, depending on your config, and parses results. +Under the hood Vitest calls `tsc` or `vue-tsc`, depending on your config, and parses results. Vitest will also print out type errors in your source code, if it finds any. You can disable it with [`typechecker.ignoreSourceErrors`](/config/#typechecker-ignoresourceerrors) config option. + +Keep in mind that Vitest doesn't run or compile these files, they are only statically analyzed by the compiler, and because of that you cannot use any dynamic statements in test names, for example. ```ts -// TODO write normal tests examples -import { describe, expectTypeOf, test } from 'vitest' - -describe('test', () => { - test('some-test', () => { - expectTypeOf(45).toBe(45) - }) - - describe('test2', () => { - test('some-test 2', () => { - expectTypeOf(45).toBe(45) - }) - }) +import { assertType, expectTypeOf } from 'vitest' +import { mount } from './mount.js' + +test('my types work properly', () => { + expectTypeOf(mount).toBeFunction() + expectTypeOf(mount).parameter(0).toMatchTypeOf<{ name: string }>() + + // @ts-expect-error name is a string + assertType(mount({ name: 42 })) }) +``` + +Any type error triggered inside a test file will be treated as a test error, so you can use any type trick you want to test types of your project. -expectTypeOf({ wolk: 'true' }).toHaveProperty('wolk') -``` \ No newline at end of file +You can see a list of possible matchers in [API section](/api/#expecttypeof). From aad7a3f1e6c8e76e6885949f4a3a2c7cc7638a42 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Thu, 27 Oct 2022 12:07:28 +0200 Subject: [PATCH 21/33] fix: move collect utils to common utils --- packages/vitest/src/runtime/collect.ts | 72 +----------------------- packages/vitest/src/typecheck/collect.ts | 2 +- packages/vitest/src/utils/collect.ts | 70 +++++++++++++++++++++++ test/typescript/test.test-d.ts | 14 ++++- 4 files changed, 86 insertions(+), 72 deletions(-) create mode 100644 packages/vitest/src/utils/collect.ts diff --git a/packages/vitest/src/runtime/collect.ts b/packages/vitest/src/runtime/collect.ts index d149ed92b419..46b7d9fd5dac 100644 --- a/packages/vitest/src/runtime/collect.ts +++ b/packages/vitest/src/runtime/collect.ts @@ -1,5 +1,6 @@ -import type { File, ResolvedConfig, Suite, TaskBase } from '../types' +import type { File, ResolvedConfig, Suite } from '../types' import { getWorkerState, isBrowser, relativePath } from '../utils' +import { interpretTaskModes, someTasksAreOnly } from '../utils/collect' import { clearCollectorContext, defaultSuite } from './suite' import { getHooks, setHooks } from './map' import { processError } from './error' @@ -99,75 +100,6 @@ export async function collectTests(paths: string[], config: ResolvedConfig): Pro return files } -/** - * If any tasks been marked as `only`, mark all other tasks as `skip`. - */ -export function interpretTaskModes(suite: Suite, namePattern?: string | RegExp, onlyMode?: boolean, parentIsOnly?: boolean, allowOnly?: boolean) { - const suiteIsOnly = parentIsOnly || suite.mode === 'only' - - suite.tasks.forEach((t) => { - // Check if either the parent suite or the task itself are marked as included - const includeTask = suiteIsOnly || t.mode === 'only' - if (onlyMode) { - if (t.type === 'suite' && (includeTask || someTasksAreOnly(t))) { - // Don't skip this suite - if (t.mode === 'only') { - checkAllowOnly(t, allowOnly) - t.mode = 'run' - } - } - else if (t.mode === 'run' && !includeTask) { t.mode = 'skip' } - else if (t.mode === 'only') { - checkAllowOnly(t, allowOnly) - t.mode = 'run' - } - } - if (t.type === 'test') { - if (namePattern && !getTaskFullName(t).match(namePattern)) - t.mode = 'skip' - } - else if (t.type === 'suite') { - if (t.mode === 'skip') - skipAllTasks(t) - else - interpretTaskModes(t, namePattern, onlyMode, includeTask, allowOnly) - } - }) - - // if all subtasks are skipped, mark as skip - if (suite.mode === 'run') { - if (suite.tasks.length && suite.tasks.every(i => i.mode !== 'run')) - suite.mode = 'skip' - } -} - -function getTaskFullName(task: TaskBase): string { - return `${task.suite ? `${getTaskFullName(task.suite)} ` : ''}${task.name}` -} - -export function someTasksAreOnly(suite: Suite): boolean { - return suite.tasks.some(t => t.mode === 'only' || (t.type === 'suite' && someTasksAreOnly(t))) -} - -function skipAllTasks(suite: Suite) { - suite.tasks.forEach((t) => { - if (t.mode === 'run') { - t.mode = 'skip' - if (t.type === 'suite') - skipAllTasks(t) - } - }) -} - -function checkAllowOnly(task: TaskBase, allowOnly?: boolean) { - if (allowOnly) - return - task.result = { - state: 'fail', - error: processError(new Error('[Vitest] Unexpected .only modifier. Remove it or pass --allowOnly argument to bypass this error')), - } -} - function calculateHash(parent: Suite) { parent.tasks.forEach((t, idx) => { t.id = `${parent.id}_${idx}` diff --git a/packages/vitest/src/typecheck/collect.ts b/packages/vitest/src/typecheck/collect.ts index 3651bcf344da..9634bfb4a85a 100644 --- a/packages/vitest/src/typecheck/collect.ts +++ b/packages/vitest/src/typecheck/collect.ts @@ -4,7 +4,7 @@ import { ancestor as walkAst } from 'acorn-walk' import type { RawSourceMap } from 'vite-node' import type { File, Suite, Vitest } from '../types' -import { interpretTaskModes, someTasksAreOnly } from '../runtime/collect' +import { interpretTaskModes, someTasksAreOnly } from '../utils/collect' import { TYPECHECK_SUITE } from './constants' interface ParsedFile extends File { diff --git a/packages/vitest/src/utils/collect.ts b/packages/vitest/src/utils/collect.ts new file mode 100644 index 000000000000..7c29ebe468c0 --- /dev/null +++ b/packages/vitest/src/utils/collect.ts @@ -0,0 +1,70 @@ +import type { Suite, TaskBase } from '../types' + +/** + * If any tasks been marked as `only`, mark all other tasks as `skip`. + */ +export function interpretTaskModes(suite: Suite, namePattern?: string | RegExp, onlyMode?: boolean, parentIsOnly?: boolean, allowOnly?: boolean) { + const suiteIsOnly = parentIsOnly || suite.mode === 'only' + + suite.tasks.forEach((t) => { + // Check if either the parent suite or the task itself are marked as included + const includeTask = suiteIsOnly || t.mode === 'only' + if (onlyMode) { + if (t.type === 'suite' && (includeTask || someTasksAreOnly(t))) { + // Don't skip this suite + if (t.mode === 'only') { + checkAllowOnly(t, allowOnly) + t.mode = 'run' + } + } + else if (t.mode === 'run' && !includeTask) { t.mode = 'skip' } + else if (t.mode === 'only') { + checkAllowOnly(t, allowOnly) + t.mode = 'run' + } + } + if (t.type === 'test') { + if (namePattern && !getTaskFullName(t).match(namePattern)) + t.mode = 'skip' + } + else if (t.type === 'suite') { + if (t.mode === 'skip') + skipAllTasks(t) + else + interpretTaskModes(t, namePattern, onlyMode, includeTask, allowOnly) + } + }) + + // if all subtasks are skipped, mark as skip + if (suite.mode === 'run') { + if (suite.tasks.length && suite.tasks.every(i => i.mode !== 'run')) + suite.mode = 'skip' + } +} + +function getTaskFullName(task: TaskBase): string { + return `${task.suite ? `${getTaskFullName(task.suite)} ` : ''}${task.name}` +} + +export function someTasksAreOnly(suite: Suite): boolean { + return suite.tasks.some(t => t.mode === 'only' || (t.type === 'suite' && someTasksAreOnly(t))) +} + +function skipAllTasks(suite: Suite) { + suite.tasks.forEach((t) => { + if (t.mode === 'run') { + t.mode = 'skip' + if (t.type === 'suite') + skipAllTasks(t) + } + }) +} + +function checkAllowOnly(task: TaskBase, allowOnly?: boolean) { + if (allowOnly) + return + task.result = { + state: 'fail', + error: new Error('[Vitest] Unexpected .only modifier. Remove it or pass --allowOnly argument to bypass this error'), + } +} diff --git a/test/typescript/test.test-d.ts b/test/typescript/test.test-d.ts index f1f0db2cd604..50480284b408 100644 --- a/test/typescript/test.test-d.ts +++ b/test/typescript/test.test-d.ts @@ -2,9 +2,21 @@ import { describe, expectTypeOf, test } from 'vitest' describe('test', () => { test('some-test', () => { - expectTypeOf(45).toEqualTypeOf(45) + expectTypeOf(Date).toBeConstructibleWith(new Date()) + expectTypeOf(Date).toBeConstructibleWith('01-01-2000') + + type ResponsiveProp = T | T[] | { xs?: T; sm?: T; md?: T } + const getResponsiveProp = (_props: T): ResponsiveProp => ({}) + interface CSSProperties { margin?: string; padding?: string } + const cssProperties: CSSProperties = { margin: '1px', padding: '2px' } + expectTypeOf(getResponsiveProp(cssProperties)) + .exclude() + // .exclude<{ xs?: unknown }>() + .toEqualTypeOf() }) + expectTypeOf(Promise.resolve('string')).resolves.toEqualTypeOf() + describe('test2', () => { test('some-test 2', () => { expectTypeOf(45).toEqualTypeOf(45) From da3c9975f5377a875066058ac88c080afb3ac67c Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Thu, 27 Oct 2022 12:43:52 +0200 Subject: [PATCH 22/33] chore: tests for typechecker --- packages/vitest/src/typecheck/typechecker.ts | 6 +- pnpm-lock.yaml | 2 + test/typescript/failing/fail.test-d.ts | 15 ++++ test/typescript/failing/js-fail.test-d.js | 7 ++ test/typescript/failing/only.test-d.ts | 5 ++ test/typescript/failing/tsconfig.tmp.json | 81 +++++++++++++++++++ test/typescript/js.test-d.js | 5 -- test/typescript/package.json | 4 +- test/typescript/some-type.ts | 2 - test/typescript/test-d/js.test-d.js | 7 ++ test/typescript/{ => test-d}/test.test-d.ts | 3 +- .../test/__snapshots__/runner.test.ts.snap | 42 ++++++++++ test/typescript/test/runner.test.ts | 50 ++++++++++++ test/typescript/test/vitest.config.ts | 10 +++ tsconfig.json | 3 +- 15 files changed, 230 insertions(+), 12 deletions(-) create mode 100644 test/typescript/failing/fail.test-d.ts create mode 100644 test/typescript/failing/js-fail.test-d.js create mode 100644 test/typescript/failing/only.test-d.ts create mode 100644 test/typescript/failing/tsconfig.tmp.json delete mode 100644 test/typescript/js.test-d.js delete mode 100644 test/typescript/some-type.ts create mode 100644 test/typescript/test-d/js.test-d.js rename test/typescript/{ => test-d}/test.test-d.ts (91%) create mode 100644 test/typescript/test/__snapshots__/runner.test.ts.snap create mode 100644 test/typescript/test/runner.test.ts create mode 100644 test/typescript/test/vitest.config.ts diff --git a/packages/vitest/src/typecheck/typechecker.ts b/packages/vitest/src/typecheck/typechecker.ts index e70adbc7c62e..1741b90b10f3 100644 --- a/packages/vitest/src/typecheck/typechecker.ts +++ b/packages/vitest/src/typecheck/typechecker.ts @@ -166,9 +166,13 @@ export class Typechecker { return typesErrors } - public async stop() { + public async clear() { if (this.tmpConfigPath) await rm(this.tmpConfigPath) + } + + public async stop() { + await this.clear() this.process?.kill() } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e97c4a6bd65..a07611276469 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1088,12 +1088,14 @@ importers: test/typescript: specifiers: + execa: ^6.1.0 typescript: ^4.8.4 vitest: workspace:* vue-tsc: ^0.40.13 dependencies: vitest: link:../../packages/vitest devDependencies: + execa: 6.1.0 typescript: 4.8.4 vue-tsc: 0.40.13_typescript@4.8.4 diff --git a/test/typescript/failing/fail.test-d.ts b/test/typescript/failing/fail.test-d.ts new file mode 100644 index 000000000000..b05bbbceb1f1 --- /dev/null +++ b/test/typescript/failing/fail.test-d.ts @@ -0,0 +1,15 @@ +import { describe, expectTypeOf, test } from 'vitest' + +test('failing test', () => { + expectTypeOf(1).toEqualTypeOf() +}) + +describe('nested suite', () => { + describe('nested 2', () => { + test('failing test 2', () => { + expectTypeOf(1).toBeVoid() + }) + }) + + expectTypeOf(1).toBeVoid() +}) diff --git a/test/typescript/failing/js-fail.test-d.js b/test/typescript/failing/js-fail.test-d.js new file mode 100644 index 000000000000..e4f61e0f0df4 --- /dev/null +++ b/test/typescript/failing/js-fail.test-d.js @@ -0,0 +1,7 @@ +// @ts-check + +import { expectTypeOf, test } from 'vitest' + +test('js test fails', () => { + expectTypeOf(1).toBeArray() +}) diff --git a/test/typescript/failing/only.test-d.ts b/test/typescript/failing/only.test-d.ts new file mode 100644 index 000000000000..0fa60c9b0cc5 --- /dev/null +++ b/test/typescript/failing/only.test-d.ts @@ -0,0 +1,5 @@ +import { expectTypeOf, test } from 'vitest' + +test.only('failing test', () => { + expectTypeOf(1).toEqualTypeOf() +}) diff --git a/test/typescript/failing/tsconfig.tmp.json b/test/typescript/failing/tsconfig.tmp.json new file mode 100644 index 000000000000..0703dbe6df48 --- /dev/null +++ b/test/typescript/failing/tsconfig.tmp.json @@ -0,0 +1,81 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "lib": [ + "esnext", + "dom" + ], + "moduleResolution": "node", + "esModuleInterop": true, + "strict": true, + "strictNullChecks": true, + "resolveJsonModule": true, + "skipDefaultLibCheck": true, + "skipLibCheck": true, + "outDir": "./dist", + "declaration": true, + "inlineSourceMap": true, + "paths": { + "@vitest/ws-client": [ + "./packages/ws-client/src/index.ts" + ], + "@vitest/ui": [ + "./packages/ui/node/index.ts" + ], + "@vitest/browser": [ + "./packages/browser/node/index.ts" + ], + "#types": [ + "./packages/vitest/src/index.ts" + ], + "~/*": [ + "./packages/ui/client/*" + ], + "vitest": [ + "./packages/vitest/src/index.ts" + ], + "vitest/globals": [ + "./packages/vitest/globals.d.ts" + ], + "vitest/node": [ + "./packages/vitest/src/node/index.ts" + ], + "vitest/config": [ + "./packages/vitest/src/config.ts" + ], + "vitest/browser": [ + "./packages/vitest/src/browser.ts" + ], + "vite-node": [ + "./packages/vite-node/src/index.ts" + ], + "vite-node/client": [ + "./packages/vite-node/src/client.ts" + ], + "vite-node/server": [ + "./packages/vite-node/src/server.ts" + ], + "vite-node/utils": [ + "./packages/vite-node/src/utils.ts" + ] + }, + "types": [ + "node", + "vite/client" + ], + "emitDeclarationOnly": false, + "incremental": true, + "tsBuildInfoFile": "/Users/sheremet.mac/Projects/vitest/packages/vitest/dist/tsconfig.tmp.tsbuildinfo" + }, + "exclude": [ + "**/dist/**", + "./packages/vitest/dist/**", + "./packages/vitest/*.d.ts", + "./packages/ui/client/**", + "./examples/**/*.*", + "./bench/**", + "./test/typescript/**", + "./dist" + ] +} \ No newline at end of file diff --git a/test/typescript/js.test-d.js b/test/typescript/js.test-d.js deleted file mode 100644 index 338f2d767b08..000000000000 --- a/test/typescript/js.test-d.js +++ /dev/null @@ -1,5 +0,0 @@ -// @ts-check - -import { expectTypeOf } from 'vitest' - -expectTypeOf(1).toBe(2) diff --git a/test/typescript/package.json b/test/typescript/package.json index 6ea57579aed3..7873d6655cd9 100644 --- a/test/typescript/package.json +++ b/test/typescript/package.json @@ -1,12 +1,14 @@ { "scripts": { - "test": "vitest typecheck --run", + "test": "vitest", + "types": "vitest typecheck --run", "tsc": "tsc --watch --pretty false --noEmit" }, "dependencies": { "vitest": "workspace:*" }, "devDependencies": { + "execa": "^6.1.0", "typescript": "^4.8.4", "vue-tsc": "^0.40.13" } diff --git a/test/typescript/some-type.ts b/test/typescript/some-type.ts deleted file mode 100644 index 2b4beefad4fd..000000000000 --- a/test/typescript/some-type.ts +++ /dev/null @@ -1,2 +0,0 @@ -// const variable: () => number = () => 'some stirng' -// variable() diff --git a/test/typescript/test-d/js.test-d.js b/test/typescript/test-d/js.test-d.js new file mode 100644 index 000000000000..63697f27b4a6 --- /dev/null +++ b/test/typescript/test-d/js.test-d.js @@ -0,0 +1,7 @@ +// @ts-check + +import { expectTypeOf, test } from 'vitest' + +test('js test also works', () => { + expectTypeOf(1).toEqualTypeOf(2) +}) diff --git a/test/typescript/test.test-d.ts b/test/typescript/test-d/test.test-d.ts similarity index 91% rename from test/typescript/test.test-d.ts rename to test/typescript/test-d/test.test-d.ts index 50480284b408..9a3f1e45f67f 100644 --- a/test/typescript/test.test-d.ts +++ b/test/typescript/test-d/test.test-d.ts @@ -15,10 +15,9 @@ describe('test', () => { .toEqualTypeOf() }) - expectTypeOf(Promise.resolve('string')).resolves.toEqualTypeOf() - describe('test2', () => { test('some-test 2', () => { + expectTypeOf(Promise.resolve('string')).resolves.toEqualTypeOf() expectTypeOf(45).toEqualTypeOf(45) }) }) diff --git a/test/typescript/test/__snapshots__/runner.test.ts.snap b/test/typescript/test/__snapshots__/runner.test.ts.snap new file mode 100644 index 000000000000..8211b18af280 --- /dev/null +++ b/test/typescript/test/__snapshots__/runner.test.ts.snap @@ -0,0 +1,42 @@ +// Vitest Snapshot v1 + +exports[`should fails > typechek files > fail.test-d.ts 1`] = ` +" ❯ fail.test-d.ts:4:19 + 2| + 3| test('failing test', () => { + 4| expectTypeOf(1).toEqualTypeOf() + | ^ + 5| }) + 6| +" +`; + +exports[`should fails > typechek files > js-fail.test-d.js 1`] = ` +" ❯ js-fail.test-d.js:6:19 + 4| + 5| test('js test fails', () => { + 6| expectTypeOf(1).toBeArray() + | ^ + 7| }) + 8| +" +`; + +exports[`should fails > typechek files > only.test-d.ts 1`] = ` +" ❯ only.test-d.ts:4:19 + 2| + 3| test.only('failing test', () => { + 4| expectTypeOf(1).toEqualTypeOf() + | ^ + 5| }) + 6| +" +`; + +exports[`should fails > typechek files 1`] = ` +"TypeCheckError: Expected 1 arguments, but got 0. +TypeCheckError: Expected 1 arguments, but got 0. +TypeCheckError: Expected 1 arguments, but got 0. +TypeCheckError: Expected 1 arguments, but got 0. +TypeCheckError: Expected 1 arguments, but got 0." +`; diff --git a/test/typescript/test/runner.test.ts b/test/typescript/test/runner.test.ts new file mode 100644 index 000000000000..a1e9b033e83f --- /dev/null +++ b/test/typescript/test/runner.test.ts @@ -0,0 +1,50 @@ +import { resolve } from 'pathe' +import fg from 'fast-glob' +import { execa } from 'execa' +import { describe, expect, it } from 'vitest' + +describe('should fails', async () => { + const root = resolve(__dirname, '../failing') + const files = await fg('*.test-d.*', { cwd: root }) + + it('typechek files', async () => { + // in Windows child_process is very unstable, we skip testing it + if (process.platform === 'win32' && process.env.CI) + return + + const { stdout, stderr } = await execa('npx', [ + 'vitest', + 'typecheck', + '--dir', + 'failing', + '--config', + resolve(__dirname, './vitest.config.ts'), + ], { + cwd: root, + reject: false, + env: { + ...process.env, + CI: 'true', + NO_COLOR: 'true', + }, + }) + + expect(stderr).toBeTruthy() + const msg = String(stderr) + .split(/\n/g) + .reverse() + .filter(i => i.includes('TypeCheckError: ')) + .join('\n') + ?.trim() + .replace(root, '') + expect(msg).toMatchSnapshot() + + const lines = stdout.split(/\n/g) + + files.forEach((file) => { + const index = lines.findIndex(val => val.includes(`${file}:`)) + const msg = lines.slice(index, index + 8).join('\n') + expect(msg).toMatchSnapshot(file) + }) + }, 30_000) +}) diff --git a/test/typescript/test/vitest.config.ts b/test/typescript/test/vitest.config.ts new file mode 100644 index 000000000000..9c971afea0b4 --- /dev/null +++ b/test/typescript/test/vitest.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + typecheck: { + allowJs: true, + include: ['**/*.test-d.*'], + }, + }, +}) diff --git a/tsconfig.json b/tsconfig.json index 972ba657fdbd..22d442ff7374 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -40,6 +40,7 @@ "./packages/vitest/*.d.ts", "./packages/ui/client/**", "./examples/**/*.*", - "./bench/**" + "./bench/**", + "./test/typescript/**" ] } From aabd4b0d2314be9bd334c8875a0365155b5f30d1 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Thu, 27 Oct 2022 12:51:04 +0200 Subject: [PATCH 23/33] chore: fix bench test --- packages/vitest/src/typecheck/typechecker.ts | 1 + test/benchmark/test.mjs | 10 +-- test/benchmark/test/base.bench.ts | 4 +- test/benchmark/test/only.bench.ts | 10 +-- test/typescript/failing/tsconfig.tmp.json | 81 -------------------- 5 files changed, 13 insertions(+), 93 deletions(-) delete mode 100644 test/typescript/failing/tsconfig.tmp.json diff --git a/packages/vitest/src/typecheck/typechecker.ts b/packages/vitest/src/typecheck/typechecker.ts index 1741b90b10f3..f39317017b77 100644 --- a/packages/vitest/src/typecheck/typechecker.ts +++ b/packages/vitest/src/typecheck/typechecker.ts @@ -227,6 +227,7 @@ export class Typechecker { await stdout this._result = await this.prepareResults(output) await this._onParseEnd?.(this._result) + await this.clear() } } diff --git a/test/benchmark/test.mjs b/test/benchmark/test.mjs index 411a5046920b..1e4740574877 100644 --- a/test/benchmark/test.mjs +++ b/test/benchmark/test.mjs @@ -13,6 +13,11 @@ await execa('npx', ['vitest', 'bench', 'base.bench', 'mode.bench', 'only.bench'] error = e }) +if (error) { + console.error(error) + process.exit(1) +} + const benchResult = await readFile('./bench.json', 'utf-8') if (benchResult.includes('skip')) @@ -26,9 +31,4 @@ const todoBenches = ['unimplemented suite', 'unimplemented test'] if (todoBenches.some(b => benchResult.includes(b))) process.exit(1) -if (error) { - console.error(error) - process.exit(1) -} - process.exit(0) diff --git a/test/benchmark/test/base.bench.ts b/test/benchmark/test/base.bench.ts index 421cde41c6f3..0e15dc6c61d2 100644 --- a/test/benchmark/test/base.bench.ts +++ b/test/benchmark/test/base.bench.ts @@ -6,14 +6,14 @@ describe('sort', () => { x.sort((a, b) => { return a - b }) - }) + }, { iterations: 5, time: 0 }) bench('reverse', () => { const x = [1, 5, 4, 2, 3] x.reverse().sort((a, b) => { return a - b }) - }) + }, { iterations: 5, time: 0 }) // TODO: move to failed tests // should not be collect diff --git a/test/benchmark/test/only.bench.ts b/test/benchmark/test/only.bench.ts index 09bcee8e0218..bf012cace8b5 100644 --- a/test/benchmark/test/only.bench.ts +++ b/test/benchmark/test/only.bench.ts @@ -6,7 +6,7 @@ const run = [false, false, false, false, false] describe('a0', () => { bench.only('0', () => { run[0] = true - }) + }, { iterations: 1, time: 0 }) bench('s0', () => { expect(true).toBe(false) }) @@ -17,7 +17,7 @@ describe('a1', () => { describe('c1', () => { bench.only('1', () => { run[1] = true - }) + }, { iterations: 1, time: 0 }) }) bench('s1', () => { expect(true).toBe(false) @@ -28,7 +28,7 @@ describe('a1', () => { describe.only('a2', () => { bench('2', () => { run[2] = true - }) + }, { iterations: 1, time: 0 }) }) bench('s2', () => { @@ -39,7 +39,7 @@ describe.only('a3', () => { describe('b3', () => { bench('3', () => { run[3] = true - }) + }, { iterations: 1, time: 0 }) }) bench.skip('s3', () => { expect(true).toBe(false) @@ -50,7 +50,7 @@ describe('a4', () => { describe.only('b4', () => { bench('4', () => { run[4] = true - }) + }, { iterations: 1, time: 0 }) }) describe('sb4', () => { bench('s4', () => { diff --git a/test/typescript/failing/tsconfig.tmp.json b/test/typescript/failing/tsconfig.tmp.json deleted file mode 100644 index 0703dbe6df48..000000000000 --- a/test/typescript/failing/tsconfig.tmp.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "module": "esnext", - "lib": [ - "esnext", - "dom" - ], - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "strictNullChecks": true, - "resolveJsonModule": true, - "skipDefaultLibCheck": true, - "skipLibCheck": true, - "outDir": "./dist", - "declaration": true, - "inlineSourceMap": true, - "paths": { - "@vitest/ws-client": [ - "./packages/ws-client/src/index.ts" - ], - "@vitest/ui": [ - "./packages/ui/node/index.ts" - ], - "@vitest/browser": [ - "./packages/browser/node/index.ts" - ], - "#types": [ - "./packages/vitest/src/index.ts" - ], - "~/*": [ - "./packages/ui/client/*" - ], - "vitest": [ - "./packages/vitest/src/index.ts" - ], - "vitest/globals": [ - "./packages/vitest/globals.d.ts" - ], - "vitest/node": [ - "./packages/vitest/src/node/index.ts" - ], - "vitest/config": [ - "./packages/vitest/src/config.ts" - ], - "vitest/browser": [ - "./packages/vitest/src/browser.ts" - ], - "vite-node": [ - "./packages/vite-node/src/index.ts" - ], - "vite-node/client": [ - "./packages/vite-node/src/client.ts" - ], - "vite-node/server": [ - "./packages/vite-node/src/server.ts" - ], - "vite-node/utils": [ - "./packages/vite-node/src/utils.ts" - ] - }, - "types": [ - "node", - "vite/client" - ], - "emitDeclarationOnly": false, - "incremental": true, - "tsBuildInfoFile": "/Users/sheremet.mac/Projects/vitest/packages/vitest/dist/tsconfig.tmp.tsbuildinfo" - }, - "exclude": [ - "**/dist/**", - "./packages/vitest/dist/**", - "./packages/vitest/*.d.ts", - "./packages/ui/client/**", - "./examples/**/*.*", - "./bench/**", - "./test/typescript/**", - "./dist" - ] -} \ No newline at end of file From 602fcf718aaf264d14ae641e77c88c7559cd14c3 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Thu, 27 Oct 2022 12:54:13 +0200 Subject: [PATCH 24/33] chore: remove unused code --- packages/vitest/src/typecheck/utils.ts | 100 ------------------------- 1 file changed, 100 deletions(-) diff --git a/packages/vitest/src/typecheck/utils.ts b/packages/vitest/src/typecheck/utils.ts index c993921be418..f947f6860d6e 100644 --- a/packages/vitest/src/typecheck/utils.ts +++ b/packages/vitest/src/typecheck/utils.ts @@ -1,103 +1,3 @@ -/** - * https://github.com/mmkal/expect-type/blob/14cd7e2262ca99b793b6cfedd18015103614393f/src/index.ts - */ - -export type Not = T extends true ? false : true -export type Or = Types[number] extends false ? false : true -export type And = Types[number] extends true ? true : false -export type Eq = Left extends true ? Right : Not -export type Xor = Not> - -const secret = Symbol('secret') -type Secret = typeof secret - -export type IsNever = [T] extends [never] ? true : false -export type IsAny = [T] extends [Secret] ? Not> : false -export type IsUnknown = [unknown] extends [T] ? Not> : false -export type IsNeverOrAny = Or<[IsNever, IsAny]> - -/** - * Recursively walk a type and replace it with a branded type related to the original. This is useful for - * equality-checking stricter than `A extends B ? B extends A ? true : false : false`, because it detects - * the difference between a few edge-case types that vanilla typescript doesn't by default: - * - `any` vs `unknown` - * - `{ readonly a: string }` vs `{ a: string }` - * - `{ a?: string }` vs `{ a: string | undefined }` - */ -export type DeepBrand = IsNever extends true - ? { type: 'never' } - : IsAny extends true - ? { type: 'any' } - : IsUnknown extends true - ? { type: 'unknown' } - : T extends string | number | boolean | symbol | bigint | null | undefined | void - ? { - type: 'primitive' - value: T - } - : T extends new (...args: any[]) => any - ? { - type: 'constructor' - params: ConstructorParams - instance: DeepBrand any>>> - } - : T extends (...args: infer P) => infer R // avoid functions with different params/return values matching - ? { - type: 'function' - params: DeepBrand

- return: DeepBrand - } - : T extends any[] - ? { - type: 'array' - items: { [K in keyof T]: T[K] } - } - : { - type: 'object' - properties: { [K in keyof T]: DeepBrand } - readonly: ReadonlyKeys - required: RequiredKeys - optional: OptionalKeys - constructorParams: DeepBrand> - } - -export type RequiredKeys = Extract< - { - [K in keyof T]-?: {} extends Pick ? never : K - }[keyof T], - keyof T -> -export type OptionalKeys = Exclude> - -// adapted from some answers to https://github.com/type-challenges/type-challenges/issues?q=label%3A5+label%3Aanswer -// prettier-ignore -export type ReadonlyKeys = Extract<{ - [K in keyof T]-?: ReadonlyEquivalent< - { [_K in K]: T[K] }, - { -readonly [_K in K]: T[K] } - > extends true ? never : K; -}[keyof T], keyof T> - -// prettier-ignore -type ReadonlyEquivalent = Extends< - (() => T extends X ? true : false), - (() => T extends Y ? true : false) -> - -export type Extends = IsNever extends true ? IsNever : L extends R ? true : false -export type StrictExtends = Extends, DeepBrand> - -export type Equal = And<[StrictExtends, StrictExtends]> - -export type Params = Actual extends (...args: infer P) => any ? P : never -export type ConstructorParams = Actual extends new (...args: infer P) => any - ? Actual extends new () => any - ? P | [] - : P - : never - -export type MismatchArgs = Eq extends true ? [] : [never] - export const createIndexMap = (source: string) => { const map = new Map() let index = 0 From 708e935555fad1bf0c5f7f9f6f9a9a2696f8f70f Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Thu, 27 Oct 2022 13:09:34 +0200 Subject: [PATCH 25/33] refactor: rename --- packages/vitest/src/typecheck/typechecker.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vitest/src/typecheck/typechecker.ts b/packages/vitest/src/typecheck/typechecker.ts index f39317017b77..b8bc896784ff 100644 --- a/packages/vitest/src/typecheck/typechecker.ts +++ b/packages/vitest/src/typecheck/typechecker.ts @@ -195,15 +195,15 @@ export class Typechecker { if (typecheck.allowJs) cmd += ' --allowJs --checkJs' let output = '' - const stdout = execaCommand(cmd, { + const child = execaCommand(cmd, { cwd: root, stdout: 'pipe', reject: false, }) - this.process = stdout + this.process = child await this._onParseStart?.() let rerunTriggered = false - stdout.stdout?.on('data', (chunk) => { + child.stdout?.on('data', (chunk) => { output += chunk if (!watch) return @@ -224,7 +224,7 @@ export class Typechecker { } }) if (!watch) { - await stdout + await child this._result = await this.prepareResults(output) await this._onParseEnd?.(this._result) await this.clear() From dc1011b0fa9c4ffc01f7d522390b6697dded5527 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Fri, 28 Oct 2022 14:59:02 +0200 Subject: [PATCH 26/33] docs: fix docs --- docs/config/index.md | 14 +- docs/guide/testing-types.md | 59 +- pnpm-lock.yaml | 1862 +++++++++++++++++++++++++++++------ 3 files changed, 1632 insertions(+), 303 deletions(-) diff --git a/docs/config/index.md b/docs/config/index.md index 96899cc78976..473ac1d51af7 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -850,11 +850,11 @@ Vitest usually uses cache to sort tests, so long running tests start earlier - t Sets the randomization seed, if tests are running in random order. -### typechecker +### typecheck Options for configuring [typechecking](/guide/testing-types) test environment. -#### typechecker.checker +#### typecheck.checker - **Type**: `'tsc' | 'vue-tsc' | string` - **Default**: `tsc` @@ -868,28 +868,28 @@ You need to have a package installed to use typecheker: You can also pass down a path to custom binary or command name that produces the same output as `tsc --noEmit --pretty false`. -#### typechecker.include +#### typecheck.include - **Type**: `string[]` - **Default**: `['**/*.{test,spec}-d.{ts,js}']` Glob pattern for files that should be treated as test files -#### typechecker.exclude +#### typecheck.exclude - **Type**: `string[]` - **Default**: `['**/node_modules/**', '**/dist/**', '**/cypress/**', '**/.{idea,git,cache,output,temp}/**']` Glob pattern for files that should not be treated as test files -#### typechecker.allowJs +#### typecheck.allowJs - **Type**: `boolean` - **Default**: `false` Check JS files that have `@ts-check` comment. If you have it enabled in tsconfig, this will not overwrite it. -#### typechecker.ignoreSourceErrors +#### typecheck.ignoreSourceErrors - **Type**: `boolean` - **Default**: `false` @@ -898,7 +898,7 @@ Do not fail, if Vitest found errors outside the test files. This will not show y By default, if Vitest finds source error, it will fail test suite. -#### typechecker.tsconfig +#### typecheck.tsconfig - **Type**: `string` - **Default**: _tries to find closest tsconfig.json_ diff --git a/docs/guide/testing-types.md b/docs/guide/testing-types.md index 73382d4ba72e..2600900d17a9 100644 --- a/docs/guide/testing-types.md +++ b/docs/guide/testing-types.md @@ -4,11 +4,13 @@ title: Testing Types | Guide # Testing Types -Vitest allows you to write tests for your types, using `expectTypeOf` or `assertType` syntaxes. By default all tests inside `*.test-d.ts` files are considered type tests, but you can change it with [`typechecker.include`](/config/#typechecker-include) config option. +Vitest allows you to write tests for your types, using `expectTypeOf` or `assertType` syntaxes. By default all tests inside `*.test-d.ts` files are considered type tests, but you can change it with [`typecheck.include`](/config/#typecheck-include) config option. -Under the hood Vitest calls `tsc` or `vue-tsc`, depending on your config, and parses results. Vitest will also print out type errors in your source code, if it finds any. You can disable it with [`typechecker.ignoreSourceErrors`](/config/#typechecker-ignoresourceerrors) config option. +Under the hood Vitest calls `tsc` or `vue-tsc`, depending on your config, and parses results. Vitest will also print out type errors in your source code, if it finds any. You can disable it with [`typecheck.ignoreSourceErrors`](/config/#typecheck-ignoresourceerrors) config option. -Keep in mind that Vitest doesn't run or compile these files, they are only statically analyzed by the compiler, and because of that you cannot use any dynamic statements in test names, for example. +Keep in mind that Vitest doesn't run or compile these files, they are only statically analyzed by the compiler, and because of that you cannot use any dynamic statements. Meaning, you cannot use dynamic test names, and `test.each`, `test.runIf`, `test.skipIf`, `test.each`, `test.concurrent` APIs. But you can use other APIs, like `test`, `describe`, `.only`, `.skip` and `.todo`. + +Using CLI flags, like `--allowOnly` and `-t` are also supported for type checking. ```ts import { assertType, expectTypeOf } from 'vitest' @@ -26,3 +28,54 @@ test('my types work properly', () => { Any type error triggered inside a test file will be treated as a test error, so you can use any type trick you want to test types of your project. You can see a list of possible matchers in [API section](/api/#expecttypeof). + +## Reading Errors + +If you are using `expectTypeOf` API, you might notice hard to read errors or unexpected: + +```ts +expectTypeOf(1).toEqualTypeOf() +// ^^^^^^^^^^^^^^^^^^^^^^ +// index-c3943160.d.ts(90, 20): Arguments for the rest parameter 'MISMATCH' were not provided. +``` + +This is due to how [`expect-type`](https://github.com/mmkal/expect-type) handles type errors. + +Unfortunately, TypeScript doesn't provide type metadata without patching, so we cannot provide useful error messages at this point, but there are works in TypeScript project to fix this. If you want better messages, please, ask TypeScript team to have a look at mentioned PR. + +If you find it hard working with `expectTypeOf` API and figuring out errors, you can always use more simple `asserType` API: + +```ts +const answer = 42 + +assertType(answer) +// @ts-expect-error answer is not a string +assertType(answer) +``` + +## Run typechecking + +Add this command to your `scripts` section in `package.json`: + +```json +{ + "scripts": { + "typecheck": "vitest typecheck" + } +} +``` + +Now you can run typecheck: + +```sh +# npm +npm run typecheck + +# yarn +yarn typecheck + +# pnpm +pnpm run typecheck +``` + +Vitest uses `tsc --noEmit` or `vue-tsc --noEmit`, depending on your configuration, so you can remove these scripts from your pipeline. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a07611276469..c2ee836431f4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -116,7 +116,7 @@ importers: devDependencies: '@iconify-json/carbon': 1.1.9 '@unocss/reset': 0.46.0 - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 esno: 0.16.3 fast-glob: 3.2.12 https-localhost: 4.7.1 @@ -238,9 +238,9 @@ importers: react-dom: 18.0.0_react@18.0.0 devDependencies: '@testing-library/react': 13.3.0_zpnidt7m3osuk7shl3s4oenomq - '@types/node': 18.11.5 - '@types/react': 18.0.23 - '@vitejs/plugin-react': 2.1.0 + '@types/node': 18.11.7 + '@types/react': 18.0.24 + '@vitejs/plugin-react': 2.2.0 jsdom: 20.0.1 typescript: 4.6.3 vitest: link:../../packages/vitest @@ -288,7 +288,7 @@ importers: devDependencies: '@types/react': 17.0.49 '@types/react-test-renderer': 17.0.2 - '@vitejs/plugin-react': 2.1.0_vite@3.1.0 + '@vitejs/plugin-react': 2.2.0_vite@3.1.0 '@vitest/ui': link:../../packages/ui happy-dom: 7.6.6 jsdom: 20.0.1 @@ -316,7 +316,7 @@ importers: '@types/enzyme': 3.10.12 '@types/react': 17.0.49 '@types/react-dom': 17.0.17 - '@vitejs/plugin-react': 2.1.0_vite@3.1.0 + '@vitejs/plugin-react': 2.2.0_vite@3.1.0 '@vitest/ui': link:../../packages/ui '@wojtekmaj/enzyme-adapter-react-17': 0.6.7_7ltvq4e2railvf5uya4ffxpe2a enzyme: 3.11.0 @@ -495,7 +495,7 @@ importers: vitest: workspace:* vue: latest devDependencies: - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 '@vue/test-utils': 2.2.0_vue@3.2.41 jsdom: 20.0.1 vite: 3.1.0 @@ -549,7 +549,7 @@ importers: dependencies: vue: 3.2.41 devDependencies: - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 '@vue/test-utils': 2.0.2_vue@3.2.41 jsdom: 20.0.1 unplugin-auto-import: 0.11.2_vite@3.1.0 @@ -568,7 +568,7 @@ importers: dependencies: vue: 3.2.41 devDependencies: - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 '@vue/test-utils': 2.0.0_vue@3.2.41 jsdom: 20.0.1 vite: 3.1.0 @@ -584,8 +584,8 @@ importers: vitest: workspace:* vue: latest devDependencies: - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 - '@vitejs/plugin-vue-jsx': 2.0.1_vite@3.1.0+vue@3.2.41 + '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 + '@vitejs/plugin-vue-jsx': 2.1.0_vite@3.1.0+vue@3.2.41 '@vue/test-utils': 2.2.0_vue@3.2.41 jsdom: 20.0.1 vite: 3.1.0 @@ -964,7 +964,7 @@ importers: vitest: workspace:* vue: latest devDependencies: - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 '@vue/test-utils': 2.2.0_vue@3.2.41 happy-dom: 7.6.6 vite: 3.1.0 @@ -1405,18 +1405,23 @@ packages: resolution: {integrity: sha512-5yUzC5LqyTFp2HLmDoxGQelcdYgSpP9xsnMWBphAscOdFrHSAVbLNzWiy32sVNDqJRDiJK6klfDnAgu6PAGSHw==} engines: {node: '>=6.9.0'} + /@babel/compat-data/7.20.0: + resolution: {integrity: sha512-Gt9jszFJYq7qzXVK4slhc6NzJXnOVmRECWcVjF/T23rNXD9NtWQ0W3qxdg+p9wWIB+VQw3GYV/U2Ha9bRTfs4w==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/core/7.12.9: resolution: {integrity: sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/generator': 7.18.13 - '@babel/helper-module-transforms': 7.18.9 - '@babel/helpers': 7.18.9 - '@babel/parser': 7.18.13 + '@babel/generator': 7.20.0 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helpers': 7.20.0 + '@babel/parser': 7.20.0 '@babel/template': 7.18.10 - '@babel/traverse': 7.18.13 - '@babel/types': 7.18.13 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 convert-source-map: 1.8.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -1451,6 +1456,29 @@ packages: transitivePeerDependencies: - supports-color + /@babel/core/7.19.6: + resolution: {integrity: sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.0 + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.20.0 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.19.6 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helpers': 7.20.0 + '@babel/parser': 7.20.0 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 + convert-source-map: 1.8.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.1 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/generator/7.18.13: resolution: {integrity: sha512-CkPg8ySSPuHTYPJYo7IRALdqyjM9HCbt/3uOBEFbzyGVP6Mn8bwFPB0jX6982JVNBlYzM1nnPkfjuXSOPtQeEQ==} engines: {node: '>=6.9.0'} @@ -1459,11 +1487,20 @@ packages: '@jridgewell/gen-mapping': 0.3.2 jsesc: 2.5.2 + /@babel/generator/7.20.0: + resolution: {integrity: sha512-GUPcXxWibClgmYJuIwC2Bc2Lg+8b9VjaJ+HlNdACEVt+Wlr1eoU1OPZjZRm7Hzl0gaTsUZNQfeihvZJhG7oc3w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + '@jridgewell/gen-mapping': 0.3.2 + jsesc: 2.5.2 + dev: true + /@babel/helper-annotate-as-pure/7.18.6: resolution: {integrity: sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 dev: true /@babel/helper-builder-binary-assignment-operator-visitor/7.18.9: @@ -1471,7 +1508,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/helper-explode-assignable-expression': 7.18.6 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 dev: true /@babel/helper-compilation-targets/7.18.9_@babel+core@7.18.13: @@ -1486,8 +1523,34 @@ packages: browserslist: 4.21.3 semver: 6.3.0 - /@babel/helper-create-class-features-plugin/7.18.13_@babel+core@7.18.13: - resolution: {integrity: sha512-hDvXp+QYxSRL+23mpAlSGxHMDyIGChm0/AwTfTAAK5Ufe40nCsyNdaYCGuK91phn/fVu9kqayImRDkvNAgdrsA==} + /@babel/helper-compilation-targets/7.20.0_@babel+core@7.18.13: + resolution: {integrity: sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/compat-data': 7.20.0 + '@babel/core': 7.18.13 + '@babel/helper-validator-option': 7.18.6 + browserslist: 4.21.3 + semver: 6.3.0 + dev: true + + /@babel/helper-compilation-targets/7.20.0_@babel+core@7.19.6: + resolution: {integrity: sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/compat-data': 7.20.0 + '@babel/core': 7.19.6 + '@babel/helper-validator-option': 7.18.6 + browserslist: 4.21.3 + semver: 6.3.0 + dev: true + + /@babel/helper-create-class-features-plugin/7.19.0_@babel+core@7.18.13: + resolution: {integrity: sha512-NRz8DwF4jT3UfrmUoZjd0Uph9HQnP30t7Ash+weACcyNkiYTywpIjDBgReJMKgr+n86sn2nPVVmJ28Dm053Kqw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -1495,7 +1558,25 @@ packages: '@babel/core': 7.18.13 '@babel/helper-annotate-as-pure': 7.18.6 '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-function-name': 7.18.9 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-member-expression-to-functions': 7.18.9 + '@babel/helper-optimise-call-expression': 7.18.6 + '@babel/helper-replace-supers': 7.18.9 + '@babel/helper-split-export-declaration': 7.18.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-create-class-features-plugin/7.19.0_@babel+core@7.19.6: + resolution: {integrity: sha512-NRz8DwF4jT3UfrmUoZjd0Uph9HQnP30t7Ash+weACcyNkiYTywpIjDBgReJMKgr+n86sn2nPVVmJ28Dm053Kqw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.19.0 '@babel/helper-member-expression-to-functions': 7.18.9 '@babel/helper-optimise-call-expression': 7.18.6 '@babel/helper-replace-supers': 7.18.9 @@ -1515,16 +1596,27 @@ packages: regexpu-core: 5.1.0 dev: true - /@babel/helper-define-polyfill-provider/0.1.5_@babel+core@7.18.13: + /@babel/helper-create-regexp-features-plugin/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-7LcpH1wnQLGrI+4v+nPp+zUvIkF9x0ddv1Hkdue10tg3gmRnLy97DXh4STiOf1qeIInyD69Qv5kKSZzKD8B/7A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-annotate-as-pure': 7.18.6 + regexpu-core: 5.1.0 + dev: true + + /@babel/helper-define-polyfill-provider/0.1.5_@babel+core@7.19.6: resolution: {integrity: sha512-nXuzCSwlJ/WKr8qxzW816gwyT6VZgiJG17zR40fou70yfAcqjoNyTLl/DQ+FExw5Hx5KNqshmN8Ldl/r2N7cTg==} peerDependencies: '@babel/core': ^7.4.0-0 dependencies: - '@babel/core': 7.18.13 - '@babel/helper-compilation-targets': 7.18.9_@babel+core@7.18.13 + '@babel/core': 7.19.6 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.19.6 '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.18.9 - '@babel/traverse': 7.18.13 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/traverse': 7.20.0 debug: 4.3.4 lodash.debounce: 4.0.8 resolve: 1.22.1 @@ -1539,8 +1631,24 @@ packages: '@babel/core': ^7.4.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-compilation-targets': 7.18.9_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.18.13 + '@babel/helper-plugin-utils': 7.19.0 + debug: 4.3.4 + lodash.debounce: 4.0.8 + resolve: 1.22.1 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-define-polyfill-provider/0.3.2_@babel+core@7.19.6: + resolution: {integrity: sha512-r9QJJ+uDWrd+94BSPcP6/de67ygLtvVy6cK4luE6MOuDsZIdoaPBnfSpbO/+LTifjPckbKXRuI9BB/Z2/y3iTg==} + peerDependencies: + '@babel/core': ^7.4.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 debug: 4.3.4 lodash.debounce: 4.0.8 resolve: 1.22.1 @@ -1557,7 +1665,7 @@ packages: resolution: {integrity: sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 dev: true /@babel/helper-function-name/7.18.9: @@ -1565,26 +1673,34 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.18.10 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 + + /@babel/helper-function-name/7.19.0: + resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.18.10 + '@babel/types': 7.20.0 + dev: true /@babel/helper-hoist-variables/7.18.6: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 /@babel/helper-member-expression-to-functions/7.18.9: resolution: {integrity: sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 dev: true /@babel/helper-module-imports/7.16.0: resolution: {integrity: sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 dev: true /@babel/helper-module-imports/7.18.6: @@ -1608,11 +1724,27 @@ packages: transitivePeerDependencies: - supports-color + /@babel/helper-module-transforms/7.19.6: + resolution: {integrity: sha512-fCmcfQo/KYr/VXXDIyd3CBGZ6AFhPFy1TfSEJ+PilGVlQT6jcbqtHAM4C1EciRqMza7/TpOUZliuSH+U6HAhJw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-simple-access': 7.19.4 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/helper-optimise-call-expression/7.18.6: resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 dev: true /@babel/helper-plugin-utils/7.10.4: @@ -1622,6 +1754,11 @@ packages: /@babel/helper-plugin-utils/7.18.9: resolution: {integrity: sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w==} engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-plugin-utils/7.19.0: + resolution: {integrity: sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw==} + engines: {node: '>=6.9.0'} /@babel/helper-remap-async-to-generator/7.18.9_@babel+core@7.18.13: resolution: {integrity: sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==} @@ -1633,7 +1770,22 @@ packages: '@babel/helper-annotate-as-pure': 7.18.6 '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-wrap-function': 7.18.11 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-remap-async-to-generator/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-wrap-function': 7.18.11 + '@babel/types': 7.20.0 transitivePeerDependencies: - supports-color dev: true @@ -1646,7 +1798,7 @@ packages: '@babel/helper-member-expression-to-functions': 7.18.9 '@babel/helper-optimise-call-expression': 7.18.6 '@babel/traverse': 7.18.13 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 transitivePeerDependencies: - supports-color dev: true @@ -1655,29 +1807,44 @@ packages: resolution: {integrity: sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 + + /@babel/helper-simple-access/7.19.4: + resolution: {integrity: sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + dev: true /@babel/helper-skip-transparent-expression-wrappers/7.18.9: resolution: {integrity: sha512-imytd2gHi3cJPsybLRbmFrF7u5BIEuI2cNheyKi3/iOBC63kNn3q8Crn2xVuESli0aM4KYsyEqKyS7lFL8YVtw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 dev: true /@babel/helper-split-export-declaration/7.18.6: resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 /@babel/helper-string-parser/7.18.10: resolution: {integrity: sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==} engines: {node: '>=6.9.0'} + /@babel/helper-string-parser/7.19.4: + resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} + engines: {node: '>=6.9.0'} + /@babel/helper-validator-identifier/7.18.6: resolution: {integrity: sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==} engines: {node: '>=6.9.0'} + /@babel/helper-validator-identifier/7.19.1: + resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + engines: {node: '>=6.9.0'} + /@babel/helper-validator-option/7.18.6: resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} engines: {node: '>=6.9.0'} @@ -1686,10 +1853,10 @@ packages: resolution: {integrity: sha512-oBUlbv+rjZLh2Ks9SKi4aL7eKaAXBWleHzU89mP0G6BMUlRxSckk9tSIkgDGydhgFxHuGSlBQZfnaD47oBEB7w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-function-name': 7.18.9 + '@babel/helper-function-name': 7.19.0 '@babel/template': 7.18.10 - '@babel/traverse': 7.18.13 - '@babel/types': 7.18.13 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 transitivePeerDependencies: - supports-color dev: true @@ -1704,11 +1871,22 @@ packages: transitivePeerDependencies: - supports-color + /@babel/helpers/7.20.0: + resolution: {integrity: sha512-aGMjYraN0zosCEthoGLdqot1oRsmxVTQRHadsUPz5QM44Zej2PYRz7XiDE7GqnkZnNtLbOuxqoZw42vkU7+XEQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/highlight/7.18.6: resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 chalk: 2.4.2 js-tokens: 4.0.0 @@ -1719,6 +1897,13 @@ packages: dependencies: '@babel/types': 7.18.13 + /@babel/parser/7.20.0: + resolution: {integrity: sha512-G9VgAhEaICnz8iiJeGJQyVl6J2nTjbW0xeisva0PK6XcKsga7BIaqm4ZF8Rg1Wbaqmy6znspNqhPaPkyukujzg==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.20.0 + /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==} engines: {node: '>=6.9.0'} @@ -1726,7 +1911,17 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/7.18.9_@babel+core@7.18.13: @@ -1736,11 +1931,23 @@ packages: '@babel/core': ^7.13.0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-skip-transparent-expression-wrappers': 7.18.9 '@babel/plugin-proposal-optional-chaining': 7.18.9_@babel+core@7.18.13 dev: true + /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-AHrP9jadvH7qlOj6PINbgSuphjQUAK7AOT7DPjBo9EHoLhQTnnK5u45e1Hd4DbSQEO9nqPWtQ89r+XEOWFScKg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.13.0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-skip-transparent-expression-wrappers': 7.18.9 + '@babel/plugin-proposal-optional-chaining': 7.18.9_@babel+core@7.19.6 + dev: true + /@babel/plugin-proposal-async-generator-functions/7.18.10_@babel+core@7.18.13: resolution: {integrity: sha512-1mFuY2TOsR1hxbjCo4QL+qlIjV07p4H4EUYw2J/WCqsvFV6V9X9z9YhXbWndc/4fw+hYGlDT7egYxliMp5O6Ew==} engines: {node: '>=6.9.0'} @@ -1749,13 +1956,28 @@ packages: dependencies: '@babel/core': 7.18.13 '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-remap-async-to-generator': 7.18.9_@babel+core@7.18.13 '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.18.13 transitivePeerDependencies: - supports-color dev: true + /@babel/plugin-proposal-async-generator-functions/7.18.10_@babel+core@7.19.6: + resolution: {integrity: sha512-1mFuY2TOsR1hxbjCo4QL+qlIjV07p4H4EUYw2J/WCqsvFV6V9X9z9YhXbWndc/4fw+hYGlDT7egYxliMp5O6Ew==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-remap-async-to-generator': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.19.6 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/plugin-proposal-class-properties/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} engines: {node: '>=6.9.0'} @@ -1763,8 +1985,21 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-create-class-features-plugin': 7.18.13_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.18.13 + '@babel/helper-plugin-utils': 7.19.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-class-properties/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 transitivePeerDependencies: - supports-color dev: true @@ -1776,25 +2011,39 @@ packages: '@babel/core': ^7.12.0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-create-class-features-plugin': 7.18.13_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.18.13 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-class-static-block': 7.14.5_@babel+core@7.18.13 transitivePeerDependencies: - supports-color dev: true - /@babel/plugin-proposal-decorators/7.18.10_@babel+core@7.18.13: + /@babel/plugin-proposal-class-static-block/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-+I3oIiNxrCpup3Gi8n5IGMwj0gOCAjcJUSQEcotNnCCPMEnixawOQ+KeJPlgfjzx+FKQ1QSyZOWe7wmoJp7vhw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.12.0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-class-static-block': 7.14.5_@babel+core@7.19.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-decorators/7.18.10_@babel+core@7.19.6: resolution: {integrity: sha512-wdGTwWF5QtpTY/gbBtQLAiCnoxfD4qMbN87NYZle1dOZ9Os8Y6zXcKrIaOU8W+TIvFUWVGG9tUgNww3CjXRVVw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.18.13 - '@babel/helper-create-class-features-plugin': 7.18.13_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/core': 7.19.6 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-replace-supers': 7.18.9 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/plugin-syntax-decorators': 7.18.6_@babel+core@7.18.13 + '@babel/plugin-syntax-decorators': 7.18.6_@babel+core@7.19.6 transitivePeerDependencies: - supports-color dev: true @@ -1806,19 +2055,30 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.18.13 dev: true - /@babel/plugin-proposal-export-default-from/7.18.10_@babel+core@7.18.13: + /@babel/plugin-proposal-dynamic-import/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.19.6 + dev: true + + /@babel/plugin-proposal-export-default-from/7.18.10_@babel+core@7.19.6: resolution: {integrity: sha512-5H2N3R2aQFxkV4PIBUR/i7PUSwgTZjouJKzI8eKswfIjT0PhvzkPn0t0wIS5zn6maQuvtT0t1oHtMUz61LOuow==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 - '@babel/plugin-syntax-export-default-from': 7.18.6_@babel+core@7.18.13 + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-export-default-from': 7.18.6_@babel+core@7.19.6 dev: true /@babel/plugin-proposal-export-namespace-from/7.18.9_@babel+core@7.18.13: @@ -1828,10 +2088,21 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-export-namespace-from': 7.8.3_@babel+core@7.18.13 dev: true + /@babel/plugin-proposal-export-namespace-from/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-export-namespace-from': 7.8.3_@babel+core@7.19.6 + dev: true + /@babel/plugin-proposal-json-strings/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==} engines: {node: '>=6.9.0'} @@ -1839,10 +2110,21 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.18.13 dev: true + /@babel/plugin-proposal-json-strings/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.19.6 + dev: true + /@babel/plugin-proposal-logical-assignment-operators/7.18.9_@babel+core@7.18.13: resolution: {integrity: sha512-128YbMpjCrP35IOExw2Fq+x55LMP42DzhOhX2aNNIdI9avSWl2PI0yuBWarr3RYpZBSPtabfadkH2yeRiMD61Q==} engines: {node: '>=6.9.0'} @@ -1850,10 +2132,21 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.18.13 dev: true + /@babel/plugin-proposal-logical-assignment-operators/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-128YbMpjCrP35IOExw2Fq+x55LMP42DzhOhX2aNNIdI9avSWl2PI0yuBWarr3RYpZBSPtabfadkH2yeRiMD61Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.19.6 + dev: true + /@babel/plugin-proposal-nullish-coalescing-operator/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==} engines: {node: '>=6.9.0'} @@ -1861,10 +2154,21 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.18.13 dev: true + /@babel/plugin-proposal-nullish-coalescing-operator/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.19.6 + dev: true + /@babel/plugin-proposal-numeric-separator/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==} engines: {node: '>=6.9.0'} @@ -1872,17 +2176,28 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.18.13 dev: true + /@babel/plugin-proposal-numeric-separator/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.19.6 + dev: true + /@babel/plugin-proposal-object-rest-spread/7.12.1_@babel+core@7.12.9: resolution: {integrity: sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.12.9 '@babel/plugin-transform-parameters': 7.18.8_@babel+core@7.12.9 dev: true @@ -1893,14 +2208,28 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/compat-data': 7.18.13 + '@babel/compat-data': 7.20.0 '@babel/core': 7.18.13 - '@babel/helper-compilation-targets': 7.18.9_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.18.13 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.18.13 '@babel/plugin-transform-parameters': 7.18.8_@babel+core@7.18.13 dev: true + /@babel/plugin-proposal-object-rest-spread/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-kDDHQ5rflIeY5xl69CEqGEZ0KY369ehsCIEbTGb4siHG5BE9sga/T0r0OUwyZNLMmZE79E1kbsqAjwFCW4ds6Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.20.0 + '@babel/core': 7.19.6 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.19.6 + '@babel/plugin-transform-parameters': 7.18.8_@babel+core@7.19.6 + dev: true + /@babel/plugin-proposal-optional-catch-binding/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==} engines: {node: '>=6.9.0'} @@ -1908,10 +2237,21 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.18.13 dev: true + /@babel/plugin-proposal-optional-catch-binding/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.19.6 + dev: true + /@babel/plugin-proposal-optional-chaining/7.18.9_@babel+core@7.18.13: resolution: {integrity: sha512-v5nwt4IqBXihxGsW2QmCWMDS3B3bzGIk/EQVZz2ei7f3NJl8NzAJVvUmpDW5q1CRNY+Beb/k58UAH1Km1N411w==} engines: {node: '>=6.9.0'} @@ -1919,11 +2259,23 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-skip-transparent-expression-wrappers': 7.18.9 '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.18.13 dev: true + /@babel/plugin-proposal-optional-chaining/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-v5nwt4IqBXihxGsW2QmCWMDS3B3bzGIk/EQVZz2ei7f3NJl8NzAJVvUmpDW5q1CRNY+Beb/k58UAH1Km1N411w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-skip-transparent-expression-wrappers': 7.18.9 + '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.19.6 + dev: true + /@babel/plugin-proposal-private-methods/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==} engines: {node: '>=6.9.0'} @@ -1931,8 +2283,21 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-create-class-features-plugin': 7.18.13_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.18.13 + '@babel/helper-plugin-utils': 7.19.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-proposal-private-methods/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 transitivePeerDependencies: - supports-color dev: true @@ -1945,13 +2310,28 @@ packages: dependencies: '@babel/core': 7.18.13 '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-create-class-features-plugin': 7.18.13_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.18.13 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-private-property-in-object': 7.14.5_@babel+core@7.18.13 transitivePeerDependencies: - supports-color dev: true + /@babel/plugin-proposal-private-property-in-object/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-private-property-in-object': 7.14.5_@babel+core@7.19.6 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/plugin-proposal-unicode-property-regex/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==} engines: {node: '>=4'} @@ -1960,7 +2340,18 @@ packages: dependencies: '@babel/core': 7.18.13 '@babel/helper-create-regexp-features-plugin': 7.18.6_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-proposal-unicode-property-regex/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==} + engines: {node: '>=4'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-create-regexp-features-plugin': 7.18.6_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.18.13: @@ -1969,7 +2360,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.19.6: + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.18.13: @@ -1978,7 +2378,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.19.6: + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-class-static-block/7.14.5_@babel+core@7.18.13: @@ -1988,17 +2397,27 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: true - /@babel/plugin-syntax-decorators/7.18.6_@babel+core@7.18.13: + /@babel/plugin-syntax-class-static-block/7.14.5_@babel+core@7.19.6: + resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-decorators/7.18.6_@babel+core@7.19.6: resolution: {integrity: sha512-fqyLgjcxf/1yhyZ6A+yo1u9gJ7eleFQod2lkaUsF9DQ7sbbY3Ligym3L0+I2c0WmqNKDpoD9UTb1AKP3qRMOAQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-dynamic-import/7.8.3_@babel+core@7.18.13: @@ -2007,17 +2426,26 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-dynamic-import/7.8.3_@babel+core@7.19.6: + resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true - /@babel/plugin-syntax-export-default-from/7.18.6_@babel+core@7.18.13: + /@babel/plugin-syntax-export-default-from/7.18.6_@babel+core@7.19.6: resolution: {integrity: sha512-Kr//z3ujSVNx6E9z9ih5xXXMqK07VVTuqPmqGe6Mss/zW5XPeLZeSDZoP9ab/hT4wPKqAgjl2PnhPrcpk8Seew==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-export-namespace-from/7.8.3_@babel+core@7.18.13: @@ -2026,7 +2454,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-export-namespace-from/7.8.3_@babel+core@7.19.6: + resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-flow/7.18.6_@babel+core@7.18.13: @@ -2036,7 +2473,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-import-assertions/7.18.6_@babel+core@7.18.13: @@ -2046,7 +2483,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-import-assertions/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-/DU3RXad9+bZwrgWJQKbr39gYbJpLJHezqEzRzi/BHRlJ9zsQb4CK2CA/5apllXNomwA1qHwzvHl+AdEmC5krQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.18.13: @@ -2055,7 +2502,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.18.13: @@ -2064,7 +2511,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.19.6: + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-jsx/7.12.1_@babel+core@7.12.9: @@ -2073,7 +2529,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-jsx/7.18.6: @@ -2082,7 +2538,7 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: false /@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.18.13: @@ -2092,7 +2548,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.18.13: @@ -2101,7 +2567,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.19.6: + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.18.13: @@ -2110,7 +2585,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.19.6: + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.18.13: @@ -2119,7 +2603,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.19.6: + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.12.9: @@ -2128,7 +2621,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.18.13: @@ -2137,7 +2630,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.19.6: + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.18.13: @@ -2146,7 +2648,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.19.6: + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.18.13: @@ -2155,7 +2666,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.19.6: + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-private-property-in-object/7.14.5_@babel+core@7.18.13: @@ -2165,7 +2685,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-private-property-in-object/7.14.5_@babel+core@7.19.6: + resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.18.13: @@ -2175,17 +2705,37 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: true - /@babel/plugin-syntax-typescript/7.18.6_@babel+core@7.18.13: - resolution: {integrity: sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==} + /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.19.6: + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-typescript/7.20.0_@babel+core@7.18.13: + resolution: {integrity: sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-syntax-typescript/7.20.0_@babel+core@7.19.6: + resolution: {integrity: sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-arrow-functions/7.18.6_@babel+core@7.18.13: @@ -2195,7 +2745,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-arrow-functions/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-9S9X9RUefzrsHZmKMbDXxweEH+YlE8JJEuat9FdvW9Qh1cw7W64jELCtWNkPBPX5En45uy28KGvA/AySqUh8CQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-async-to-generator/7.18.6_@babel+core@7.18.13: @@ -2206,12 +2766,26 @@ packages: dependencies: '@babel/core': 7.18.13 '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-remap-async-to-generator': 7.18.9_@babel+core@7.18.13 transitivePeerDependencies: - supports-color dev: true + /@babel/plugin-transform-async-to-generator/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-ARE5wZLKnTgPW7/1ftQmSi1CmkqqHo2DNmtztFhvgtOWSDfq0Cq9/9L+KnZNYSNrydBekhW3rwShduf59RoXag==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-remap-async-to-generator': 7.18.9_@babel+core@7.19.6 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/plugin-transform-block-scoped-functions/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==} engines: {node: '>=6.9.0'} @@ -2219,7 +2793,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-block-scoped-functions/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-block-scoping/7.18.9_@babel+core@7.18.13: @@ -2229,7 +2813,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-block-scoping/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-5sDIJRV1KtQVEbt/EIBwGy4T01uYIo4KRB3VUqzkhrAIOGx7AoctL9+Ux88btY0zXdDyPJ9mW+bg+v+XEkGmtw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-classes/7.18.9_@babel+core@7.18.13: @@ -2241,9 +2835,9 @@ packages: '@babel/core': 7.18.13 '@babel/helper-annotate-as-pure': 7.18.6 '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-function-name': 7.18.9 + '@babel/helper-function-name': 7.19.0 '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-replace-supers': 7.18.9 '@babel/helper-split-export-declaration': 7.18.6 globals: 11.12.0 @@ -2251,35 +2845,85 @@ packages: - supports-color dev: true - /@babel/plugin-transform-computed-properties/7.18.9_@babel+core@7.18.13: - resolution: {integrity: sha512-+i0ZU1bCDymKakLxn5srGHrsAPRELC2WIbzwjLhHW9SIE1cPYkLCL0NlnXMZaM1vhfgA2+M7hySk42VBvrkBRw==} + /@babel/plugin-transform-classes/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-EkRQxsxoytpTlKJmSPYrsOMjCILacAjtSVkd4gChEe2kXjFCun3yohhW5I7plXJhCemM0gKsaGMcO8tinvCA5g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/core': 7.19.6 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-optimise-call-expression': 7.18.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-replace-supers': 7.18.9 + '@babel/helper-split-export-declaration': 7.18.6 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color dev: true - /@babel/plugin-transform-destructuring/7.18.13_@babel+core@7.18.13: - resolution: {integrity: sha512-TodpQ29XekIsex2A+YJPj5ax2plkGa8YYY6mFjCohk/IG9IY42Rtuj1FuDeemfg2ipxIFLzPeA83SIBnlhSIow==} + /@babel/plugin-transform-computed-properties/7.18.9_@babel+core@7.18.13: + resolution: {integrity: sha512-+i0ZU1bCDymKakLxn5srGHrsAPRELC2WIbzwjLhHW9SIE1cPYkLCL0NlnXMZaM1vhfgA2+M7hySk42VBvrkBRw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: true - /@babel/plugin-transform-dotall-regex/7.18.6_@babel+core@7.18.13: - resolution: {integrity: sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==} + /@babel/plugin-transform-computed-properties/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-+i0ZU1bCDymKakLxn5srGHrsAPRELC2WIbzwjLhHW9SIE1cPYkLCL0NlnXMZaM1vhfgA2+M7hySk42VBvrkBRw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-destructuring/7.18.13_@babel+core@7.18.13: + resolution: {integrity: sha512-TodpQ29XekIsex2A+YJPj5ax2plkGa8YYY6mFjCohk/IG9IY42Rtuj1FuDeemfg2ipxIFLzPeA83SIBnlhSIow==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.18.13 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-destructuring/7.18.13_@babel+core@7.19.6: + resolution: {integrity: sha512-TodpQ29XekIsex2A+YJPj5ax2plkGa8YYY6mFjCohk/IG9IY42Rtuj1FuDeemfg2ipxIFLzPeA83SIBnlhSIow==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-dotall-regex/7.18.6_@babel+core@7.18.13: + resolution: {integrity: sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 '@babel/helper-create-regexp-features-plugin': 7.18.6_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-dotall-regex/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-create-regexp-features-plugin': 7.18.6_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-duplicate-keys/7.18.9_@babel+core@7.18.13: @@ -2289,7 +2933,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-duplicate-keys/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-exponentiation-operator/7.18.6_@babel+core@7.18.13: @@ -2300,7 +2954,18 @@ packages: dependencies: '@babel/core': 7.18.13 '@babel/helper-builder-binary-assignment-operator-visitor': 7.18.9 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-exponentiation-operator/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-flow-strip-types/7.18.9_@babel+core@7.18.13: @@ -2310,7 +2975,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-flow': 7.18.6_@babel+core@7.18.13 dev: true @@ -2321,7 +2986,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-for-of/7.18.8_@babel+core@7.19.6: + resolution: {integrity: sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-function-name/7.18.9_@babel+core@7.18.13: @@ -2331,9 +3006,21 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-compilation-targets': 7.18.9_@babel+core@7.18.13 - '@babel/helper-function-name': 7.18.9 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.18.13 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-function-name/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.19.6 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-literals/7.18.9_@babel+core@7.18.13: @@ -2343,7 +3030,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-literals/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-member-expression-literals/7.18.6_@babel+core@7.18.13: @@ -2353,7 +3050,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-member-expression-literals/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-modules-amd/7.18.6_@babel+core@7.18.13: @@ -2363,8 +3070,22 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-module-transforms': 7.18.9 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + babel-plugin-dynamic-import-node: 2.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-modules-amd/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-Pra5aXsmTsOnjM3IajS8rTaLCy++nGM4v3YR4esk5PCsyg9z8NA5oQLwxzMUtDBd8F+UmVza3VxoAaWCbzH1rg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 babel-plugin-dynamic-import-node: 2.3.3 transitivePeerDependencies: - supports-color @@ -2377,9 +3098,24 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-module-transforms': 7.18.9 - '@babel/helper-plugin-utils': 7.18.9 - '@babel/helper-simple-access': 7.18.6 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-simple-access': 7.19.4 + babel-plugin-dynamic-import-node: 2.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-modules-commonjs/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-Qfv2ZOWikpvmedXQJDSbxNqy7Xr/j2Y8/KfijM0iJyKkBTmWuvCA1yeH1yDM7NJhBW/2aXxeucLj6i80/LAJ/Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-simple-access': 7.19.4 babel-plugin-dynamic-import-node: 2.3.3 transitivePeerDependencies: - supports-color @@ -2393,9 +3129,25 @@ packages: dependencies: '@babel/core': 7.18.13 '@babel/helper-hoist-variables': 7.18.6 - '@babel/helper-module-transforms': 7.18.9 - '@babel/helper-plugin-utils': 7.18.9 - '@babel/helper-validator-identifier': 7.18.6 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-validator-identifier': 7.19.1 + babel-plugin-dynamic-import-node: 2.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-modules-systemjs/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-zY/VSIbbqtoRoJKo2cDTewL364jSlZGvn0LKOf9ntbfxOvjfmyrdtEEOAdswOswhZEb8UH3jDkCKHd1sPgsS0A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-validator-identifier': 7.19.1 babel-plugin-dynamic-import-node: 2.3.3 transitivePeerDependencies: - supports-color @@ -2408,8 +3160,21 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-module-transforms': 7.18.9 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-modules-umd/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 transitivePeerDependencies: - supports-color dev: true @@ -2422,7 +3187,18 @@ packages: dependencies: '@babel/core': 7.18.13 '@babel/helper-create-regexp-features-plugin': 7.18.6_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-named-capturing-groups-regex/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-UmEOGF8XgaIqD74bC8g7iV3RYj8lMf0Bw7NJzvnS9qQhM4mg+1WHKotUIdjxgD2RGrgFLZZPCFPFj3P/kVDYhg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-create-regexp-features-plugin': 7.18.6_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-new-target/7.18.6_@babel+core@7.18.13: @@ -2432,7 +3208,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-new-target/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-object-super/7.18.6_@babel+core@7.18.13: @@ -2442,7 +3228,20 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-replace-supers': 7.18.9 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/plugin-transform-object-super/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-replace-supers': 7.18.9 transitivePeerDependencies: - supports-color @@ -2455,7 +3254,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-parameters/7.18.8_@babel+core@7.18.13: @@ -2465,7 +3264,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-parameters/7.18.8_@babel+core@7.19.6: + resolution: {integrity: sha512-ivfbE3X2Ss+Fj8nnXvKJS6sjRG4gzwPMsP+taZC+ZzEGjAYlvENixmt1sZ5Ca6tWls+BlKSGKPJ6OOXvXCbkFg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-property-literals/7.18.6_@babel+core@7.18.13: @@ -2475,7 +3284,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-property-literals/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-react-display-name/7.18.6_@babel+core@7.18.13: @@ -2485,7 +3304,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-react-display-name/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-TV4sQ+T013n61uMoygyMRm+xf04Bd5oqFpv2jAEQwSZ8NwQA7zeRPg1LMVg2PWi3zWBz+CLKD+v5bcpZ/BS0aA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-react-jsx-development/7.18.6_@babel+core@7.18.13: @@ -2495,7 +3324,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/plugin-transform-react-jsx': 7.18.10_@babel+core@7.18.13 + '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.18.13 + dev: true + + /@babel/plugin-transform-react-jsx-development/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.19.6 dev: true /@babel/plugin-transform-react-jsx-self/7.18.6_@babel+core@7.18.13: @@ -2505,7 +3344,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-react-jsx-self/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-A0LQGx4+4Jv7u/tWzoJF7alZwnBDQd6cGLh9P+Ttk4dpiL+J5p7NSNv/9tlEFFJDq3kjxOavWmbm6t0Gk+A3Ig==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-react-jsx-source/7.18.6_@babel+core@7.18.13: @@ -2518,6 +3367,16 @@ packages: '@babel/helper-plugin-utils': 7.18.9 dev: true + /@babel/plugin-transform-react-jsx-source/7.19.6_@babel+core@7.19.6: + resolution: {integrity: sha512-RpAi004QyMNisst/pvSanoRdJ4q+jMCWyk9zdw/CyLB9j8RXEahodR6l2GyttDRyEVWZtbN+TpLiHJ3t34LbsQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + /@babel/plugin-transform-react-jsx/7.18.10_@babel+core@7.18.13: resolution: {integrity: sha512-gCy7Iikrpu3IZjYZolFE4M1Sm+nrh1/6za2Ewj77Z+XirT4TsbJcvOFOyF+fRPwU6AKKK136CZxx6L8AbSFG6A==} engines: {node: '>=6.9.0'} @@ -2532,6 +3391,34 @@ packages: '@babel/types': 7.18.13 dev: true + /@babel/plugin-transform-react-jsx/7.19.0_@babel+core@7.18.13: + resolution: {integrity: sha512-UVEvX3tXie3Szm3emi1+G63jyw1w5IcMY0FSKM+CRnKRI5Mr1YbCNgsSTwoTwKphQEG9P+QqmuRFneJPZuHNhg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.18.13 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.18.13 + '@babel/types': 7.20.0 + dev: true + + /@babel/plugin-transform-react-jsx/7.19.0_@babel+core@7.19.6: + resolution: {integrity: sha512-UVEvX3tXie3Szm3emi1+G63jyw1w5IcMY0FSKM+CRnKRI5Mr1YbCNgsSTwoTwKphQEG9P+QqmuRFneJPZuHNhg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.19.6 + '@babel/types': 7.20.0 + dev: true + /@babel/plugin-transform-react-pure-annotations/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ==} engines: {node: '>=6.9.0'} @@ -2540,7 +3427,18 @@ packages: dependencies: '@babel/core': 7.18.13 '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-react-pure-annotations/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-regenerator/7.18.6_@babel+core@7.18.13: @@ -2550,7 +3448,18 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + regenerator-transform: 0.15.0 + dev: true + + /@babel/plugin-transform-regenerator/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 regenerator-transform: 0.15.0 dev: true @@ -2561,7 +3470,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-reserved-words/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-shorthand-properties/7.18.6_@babel+core@7.18.13: @@ -2571,7 +3490,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-shorthand-properties/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-spread/7.18.9_@babel+core@7.18.13: @@ -2581,7 +3510,18 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-skip-transparent-expression-wrappers': 7.18.9 + dev: true + + /@babel/plugin-transform-spread/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-39Q814wyoOPtIB/qGopNIL9xDChOE1pNU0ZY5dO0owhiVt/5kFm4li+/bBtwc7QotG0u5EPzqhZdjMtmqBqyQA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-skip-transparent-expression-wrappers': 7.18.9 dev: true @@ -2592,7 +3532,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-sticky-regex/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-template-literals/7.18.9_@babel+core@7.18.13: @@ -2602,29 +3552,77 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-template-literals/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-typeof-symbol/7.18.9_@babel+core@7.18.13: + resolution: {integrity: sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.18.13 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-typeof-symbol/7.18.9_@babel+core@7.19.6: + resolution: {integrity: sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-typescript/7.18.12_@babel+core@7.18.13: + resolution: {integrity: sha512-2vjjam0cum0miPkenUbQswKowuxs/NjMwIKEq0zwegRxXk12C9YOF9STXnaUptITOtOJHKHpzvvWYOjbm6tc0w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.18.13 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.18.13 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.18.13 + transitivePeerDependencies: + - supports-color dev: true - /@babel/plugin-transform-typeof-symbol/7.18.9_@babel+core@7.18.13: - resolution: {integrity: sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==} + /@babel/plugin-transform-typescript/7.20.0_@babel+core@7.18.13: + resolution: {integrity: sha512-xOAsAFaun3t9hCwZ13Qe7gq423UgMZ6zAgmLxeGGapFqlT/X3L5qT2btjiVLlFn7gWtMaVyceS5VxGAuKbgizw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.18.13 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.18.13 + transitivePeerDependencies: + - supports-color dev: true - /@babel/plugin-transform-typescript/7.18.12_@babel+core@7.18.13: - resolution: {integrity: sha512-2vjjam0cum0miPkenUbQswKowuxs/NjMwIKEq0zwegRxXk12C9YOF9STXnaUptITOtOJHKHpzvvWYOjbm6tc0w==} + /@babel/plugin-transform-typescript/7.20.0_@babel+core@7.19.6: + resolution: {integrity: sha512-xOAsAFaun3t9hCwZ13Qe7gq423UgMZ6zAgmLxeGGapFqlT/X3L5qT2btjiVLlFn7gWtMaVyceS5VxGAuKbgizw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.18.13 - '@babel/helper-create-class-features-plugin': 7.18.13_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 - '@babel/plugin-syntax-typescript': 7.18.6_@babel+core@7.18.13 + '@babel/core': 7.19.6 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.19.6 transitivePeerDependencies: - supports-color dev: true @@ -2636,7 +3634,17 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-unicode-escapes/7.18.10_@babel+core@7.19.6: + resolution: {integrity: sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-unicode-regex/7.18.6_@babel+core@7.18.13: @@ -2647,7 +3655,18 @@ packages: dependencies: '@babel/core': 7.18.13 '@babel/helper-create-regexp-features-plugin': 7.18.6_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 + dev: true + + /@babel/plugin-transform-unicode-regex/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-create-regexp-features-plugin': 7.18.6_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/preset-env/7.18.10_@babel+core@7.18.13: @@ -2656,10 +3675,10 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/compat-data': 7.18.13 + '@babel/compat-data': 7.20.0 '@babel/core': 7.18.13 - '@babel/helper-compilation-targets': 7.18.9_@babel+core@7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.18.13 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-validator-option': 7.18.6 '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.18.6_@babel+core@7.18.13 '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.18.9_@babel+core@7.18.13 @@ -2726,7 +3745,7 @@ packages: '@babel/plugin-transform-unicode-escapes': 7.18.10_@babel+core@7.18.13 '@babel/plugin-transform-unicode-regex': 7.18.6_@babel+core@7.18.13 '@babel/preset-modules': 0.1.5_@babel+core@7.18.13 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 babel-plugin-polyfill-corejs2: 0.3.2_@babel+core@7.18.13 babel-plugin-polyfill-corejs3: 0.5.3_@babel+core@7.18.13 babel-plugin-polyfill-regenerator: 0.4.0_@babel+core@7.18.13 @@ -2736,6 +3755,92 @@ packages: - supports-color dev: true + /@babel/preset-env/7.18.10_@babel+core@7.19.6: + resolution: {integrity: sha512-wVxs1yjFdW3Z/XkNfXKoblxoHgbtUF7/l3PvvP4m02Qz9TZ6uZGxRVYjSQeR87oQmHco9zWitW5J82DJ7sCjvA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.20.0 + '@babel/core': 7.19.6 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-validator-option': 7.18.6 + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-proposal-async-generator-functions': 7.18.10_@babel+core@7.19.6 + '@babel/plugin-proposal-class-properties': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-class-static-block': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-dynamic-import': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-export-namespace-from': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-proposal-json-strings': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-logical-assignment-operators': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-numeric-separator': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-object-rest-spread': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-proposal-optional-catch-binding': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-optional-chaining': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-proposal-private-methods': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-private-property-in-object': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-unicode-property-regex': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.19.6 + '@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.19.6 + '@babel/plugin-syntax-class-static-block': 7.14.5_@babel+core@7.19.6 + '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.19.6 + '@babel/plugin-syntax-export-namespace-from': 7.8.3_@babel+core@7.19.6 + '@babel/plugin-syntax-import-assertions': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.19.6 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.19.6 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.19.6 + '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.19.6 + '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.19.6 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.19.6 + '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.19.6 + '@babel/plugin-syntax-private-property-in-object': 7.14.5_@babel+core@7.19.6 + '@babel/plugin-syntax-top-level-await': 7.14.5_@babel+core@7.19.6 + '@babel/plugin-transform-arrow-functions': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-async-to-generator': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-block-scoped-functions': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-block-scoping': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-classes': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-computed-properties': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-destructuring': 7.18.13_@babel+core@7.19.6 + '@babel/plugin-transform-dotall-regex': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-duplicate-keys': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-exponentiation-operator': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-for-of': 7.18.8_@babel+core@7.19.6 + '@babel/plugin-transform-function-name': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-literals': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-member-expression-literals': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-modules-amd': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-modules-commonjs': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-modules-systemjs': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-modules-umd': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-named-capturing-groups-regex': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-new-target': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-object-super': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-parameters': 7.18.8_@babel+core@7.19.6 + '@babel/plugin-transform-property-literals': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-regenerator': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-reserved-words': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-shorthand-properties': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-spread': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-sticky-regex': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-template-literals': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-typeof-symbol': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-unicode-escapes': 7.18.10_@babel+core@7.19.6 + '@babel/plugin-transform-unicode-regex': 7.18.6_@babel+core@7.19.6 + '@babel/preset-modules': 0.1.5_@babel+core@7.19.6 + '@babel/types': 7.20.0 + babel-plugin-polyfill-corejs2: 0.3.2_@babel+core@7.19.6 + babel-plugin-polyfill-corejs3: 0.5.3_@babel+core@7.19.6 + babel-plugin-polyfill-regenerator: 0.4.0_@babel+core@7.19.6 + core-js-compat: 3.25.0 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/preset-flow/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-E7BDhL64W6OUqpuyHnSroLnqyRTcG6ZdOBl1OKI/QK/HJfplqK/S3sq1Cckx7oTodJ5yOXyfw7rEADJ6UjoQDQ==} engines: {node: '>=6.9.0'} @@ -2743,7 +3848,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-validator-option': 7.18.6 '@babel/plugin-transform-flow-strip-types': 7.18.9_@babel+core@7.18.13 dev: true @@ -2754,10 +3859,23 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-proposal-unicode-property-regex': 7.18.6_@babel+core@7.18.13 '@babel/plugin-transform-dotall-regex': 7.18.6_@babel+core@7.18.13 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 + esutils: 2.0.3 + dev: true + + /@babel/preset-modules/0.1.5_@babel+core@7.19.6: + resolution: {integrity: sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-proposal-unicode-property-regex': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-dotall-regex': 7.18.6_@babel+core@7.19.6 + '@babel/types': 7.20.0 esutils: 2.0.3 dev: true @@ -2768,14 +3886,29 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-validator-option': 7.18.6 '@babel/plugin-transform-react-display-name': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-transform-react-jsx': 7.18.10_@babel+core@7.18.13 + '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.18.13 '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.18.13 '@babel/plugin-transform-react-pure-annotations': 7.18.6_@babel+core@7.18.13 dev: true + /@babel/preset-react/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-zXr6atUmyYdiWRVLOZahakYmOBHtWc2WGCkP8PYTgZi0iJXDY2CN180TdrIW4OGOAdLc7TifzDIvtx6izaRIzg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-validator-option': 7.18.6 + '@babel/plugin-transform-react-display-name': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.19.6 + '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-react-pure-annotations': 7.18.6_@babel+core@7.19.6 + dev: true + /@babel/preset-typescript/7.18.6_@babel+core@7.18.13: resolution: {integrity: sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ==} engines: {node: '>=6.9.0'} @@ -2783,20 +3916,34 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-validator-option': 7.18.6 - '@babel/plugin-transform-typescript': 7.18.12_@babel+core@7.18.13 + '@babel/plugin-transform-typescript': 7.20.0_@babel+core@7.18.13 transitivePeerDependencies: - supports-color dev: true - /@babel/register/7.18.9_@babel+core@7.18.13: + /@babel/preset-typescript/7.18.6_@babel+core@7.19.6: + resolution: {integrity: sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/helper-validator-option': 7.18.6 + '@babel/plugin-transform-typescript': 7.20.0_@babel+core@7.19.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/register/7.18.9_@babel+core@7.19.6: resolution: {integrity: sha512-ZlbnXDcNYHMR25ITwwNKT88JiaukkdVj/nG7r3wnuXkOTHc60Uy05PwMCPre0hSkY68E6zK3xz+vUJSP2jWmcw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.18.13 + '@babel/core': 7.19.6 clone-deep: 4.0.1 find-cache-dir: 2.1.0 make-dir: 2.1.0 @@ -2843,6 +3990,24 @@ packages: transitivePeerDependencies: - supports-color + /@babel/traverse/7.20.0: + resolution: {integrity: sha512-5+cAXQNARgjRUK0JWu2UBwja4JLSO/rBMPJzpsKb+oBF5xlUuCfljQepS4XypBQoiigL0VQjTZy6WiONtUdScQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.20.0 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.20.0 + '@babel/types': 7.20.0 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/types/7.18.13: resolution: {integrity: sha512-ePqfTihzW0W6XAU+aMw2ykilisStJfDnsejDCXRchCcMJ4O0+8DhPXf2YUbZ6wjBlsEmZwLK/sPweWtu8hcJYQ==} engines: {node: '>=6.9.0'} @@ -2851,6 +4016,14 @@ packages: '@babel/helper-validator-identifier': 7.18.6 to-fast-properties: 2.0.0 + /@babel/types/7.20.0: + resolution: {integrity: sha512-Jlgt3H0TajCW164wkTOTzHkZb075tMQMULzrLUoUeKmO7eFL96GgDxf7/Axhc5CAuKE3KFyVW1p6ysKsi2oXAg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.19.4 + '@babel/helper-validator-identifier': 7.19.1 + to-fast-properties: 2.0.0 + /@base2/pretty-print-object/1.0.1: resolution: {integrity: sha512-4iri8i1AqYHJE2DstZYkyEprg6Pq6sKx3xn5FpySk9sNhH7qN2LLlHJCfDTZRILNwQNPD7mATWM0TBui7uC1pA==} dev: true @@ -3329,7 +4502,7 @@ packages: resolution: {integrity: sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==} engines: {node: '>= 10.14.2'} dependencies: - '@babel/core': 7.18.13 + '@babel/core': 7.19.6 '@jest/types': 26.6.2 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 @@ -3354,7 +4527,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.5 + '@types/node': 18.11.7 '@types/yargs': 15.0.14 chalk: 4.1.2 dev: true @@ -3366,7 +4539,7 @@ packages: '@jest/schemas': 29.0.0 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.5 + '@types/node': 18.11.7 '@types/yargs': 17.0.12 chalk: 4.1.2 dev: true @@ -3879,7 +5052,7 @@ packages: engines: {node: '>=14'} hasBin: true dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 playwright-core: 1.25.1 dev: true @@ -3942,7 +5115,7 @@ packages: slash: 4.0.0 dev: true - /@rollup/plugin-babel/5.3.1_qa5xd24o3tymwictiiptlhxtom: + /@rollup/plugin-babel/5.3.1_s45mkc5s7is4owdeow33qgy2s4: resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==} engines: {node: '>= 10.0.0'} peerDependencies: @@ -3953,7 +5126,7 @@ packages: '@types/babel__core': optional: true dependencies: - '@babel/core': 7.18.13 + '@babel/core': 7.19.6 '@babel/helper-module-imports': 7.18.6 '@rollup/pluginutils': 3.1.0_rollup@2.79.0 rollup: 2.79.0 @@ -4221,7 +5394,7 @@ packages: react-dom: optional: true dependencies: - '@babel/plugin-transform-react-jsx': 7.18.10_@babel+core@7.18.13 + '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.18.13 '@babel/preset-env': 7.18.10_@babel+core@7.18.13 '@jest/transform': 26.6.2 '@mdx-js/react': 1.6.22_react@17.0.2 @@ -4560,7 +5733,7 @@ packages: typescript: optional: true dependencies: - '@babel/core': 7.18.13 + '@babel/core': 7.19.6 '@storybook/addons': 6.5.10_sfoxds7t5ydpegc3knd667wn6m '@storybook/api': 6.5.10_sfoxds7t5ydpegc3knd667wn6m '@storybook/channel-postmessage': 6.5.10 @@ -4580,7 +5753,7 @@ packages: '@types/node': 16.11.56 '@types/webpack': 4.41.32 autoprefixer: 9.8.8 - babel-loader: 8.2.5_li4tts7salxwv3rbqjnooz7t7e + babel-loader: 8.2.5_q4ydpsrmbqywduja5orgah6fgq case-sensitive-paths-webpack-plugin: 2.4.0 core-js: 3.25.0 css-loader: 3.6.0_webpack@4.46.0 @@ -4788,35 +5961,35 @@ packages: typescript: optional: true dependencies: - '@babel/core': 7.18.13 - '@babel/plugin-proposal-class-properties': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-proposal-decorators': 7.18.10_@babel+core@7.18.13 - '@babel/plugin-proposal-export-default-from': 7.18.10_@babel+core@7.18.13 - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-proposal-object-rest-spread': 7.18.9_@babel+core@7.18.13 - '@babel/plugin-proposal-optional-chaining': 7.18.9_@babel+core@7.18.13 - '@babel/plugin-proposal-private-methods': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-proposal-private-property-in-object': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.18.13 - '@babel/plugin-transform-arrow-functions': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-transform-block-scoping': 7.18.9_@babel+core@7.18.13 - '@babel/plugin-transform-classes': 7.18.9_@babel+core@7.18.13 - '@babel/plugin-transform-destructuring': 7.18.13_@babel+core@7.18.13 - '@babel/plugin-transform-for-of': 7.18.8_@babel+core@7.18.13 - '@babel/plugin-transform-parameters': 7.18.8_@babel+core@7.18.13 - '@babel/plugin-transform-shorthand-properties': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-transform-spread': 7.18.9_@babel+core@7.18.13 - '@babel/preset-env': 7.18.10_@babel+core@7.18.13 - '@babel/preset-react': 7.18.6_@babel+core@7.18.13 - '@babel/preset-typescript': 7.18.6_@babel+core@7.18.13 - '@babel/register': 7.18.9_@babel+core@7.18.13 + '@babel/core': 7.19.6 + '@babel/plugin-proposal-class-properties': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-decorators': 7.18.10_@babel+core@7.19.6 + '@babel/plugin-proposal-export-default-from': 7.18.10_@babel+core@7.19.6 + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-object-rest-spread': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-proposal-optional-chaining': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-proposal-private-methods': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-proposal-private-property-in-object': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.19.6 + '@babel/plugin-transform-arrow-functions': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-block-scoping': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-classes': 7.18.9_@babel+core@7.19.6 + '@babel/plugin-transform-destructuring': 7.18.13_@babel+core@7.19.6 + '@babel/plugin-transform-for-of': 7.18.8_@babel+core@7.19.6 + '@babel/plugin-transform-parameters': 7.18.8_@babel+core@7.19.6 + '@babel/plugin-transform-shorthand-properties': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-spread': 7.18.9_@babel+core@7.19.6 + '@babel/preset-env': 7.18.10_@babel+core@7.19.6 + '@babel/preset-react': 7.18.6_@babel+core@7.19.6 + '@babel/preset-typescript': 7.18.6_@babel+core@7.19.6 + '@babel/register': 7.18.9_@babel+core@7.19.6 '@storybook/node-logger': 6.5.10 '@storybook/semver': 7.3.2 '@types/node': 16.11.56 '@types/pretty-hrtime': 1.0.1 - babel-loader: 8.2.5_li4tts7salxwv3rbqjnooz7t7e + babel-loader: 8.2.5_q4ydpsrmbqywduja5orgah6fgq babel-plugin-macros: 3.1.0 - babel-plugin-polyfill-corejs3: 0.1.7_@babel+core@7.18.13 + babel-plugin-polyfill-corejs3: 0.1.7_@babel+core@7.19.6 chalk: 4.1.2 core-js: 3.25.0 express: 4.18.1 @@ -4976,15 +6149,15 @@ packages: '@storybook/mdx2-csf': optional: true dependencies: - '@babel/core': 7.18.13 - '@babel/generator': 7.18.13 - '@babel/parser': 7.18.13 - '@babel/plugin-transform-react-jsx': 7.18.10_@babel+core@7.18.13 - '@babel/preset-env': 7.18.10_@babel+core@7.18.13 - '@babel/traverse': 7.18.13 - '@babel/types': 7.18.13 + '@babel/core': 7.19.6 + '@babel/generator': 7.20.0 + '@babel/parser': 7.20.0 + '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.19.6 + '@babel/preset-env': 7.18.10_@babel+core@7.19.6 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 '@storybook/csf': 0.0.2--canary.4566f4d.1 - '@storybook/mdx1-csf': 0.0.1_@babel+core@7.18.13 + '@storybook/mdx1-csf': 0.0.1_@babel+core@7.19.6 core-js: 3.25.0 fs-extra: 9.1.0 global: 4.4.0 @@ -5009,7 +6182,7 @@ packages: /@storybook/docs-tools/6.5.10_sfoxds7t5ydpegc3knd667wn6m: resolution: {integrity: sha512-/bvYgOO+CxMEcHifkjJg0A60OTGOhcjGxnsB1h0gJuxMrqA/7Qwc108bFmPiX0eiD1BovFkZLJV4O6OY7zP5Vw==} dependencies: - '@babel/core': 7.18.13 + '@babel/core': 7.19.6 '@storybook/csf': 0.0.2--canary.4566f4d.1 '@storybook/store': 6.5.10_sfoxds7t5ydpegc3knd667wn6m core-js: 3.25.0 @@ -5045,9 +6218,9 @@ packages: typescript: optional: true dependencies: - '@babel/core': 7.18.13 - '@babel/plugin-transform-template-literals': 7.18.9_@babel+core@7.18.13 - '@babel/preset-react': 7.18.6_@babel+core@7.18.13 + '@babel/core': 7.19.6 + '@babel/plugin-transform-template-literals': 7.18.9_@babel+core@7.19.6 + '@babel/preset-react': 7.18.6_@babel+core@7.19.6 '@storybook/addons': 6.5.10_sfoxds7t5ydpegc3knd667wn6m '@storybook/core-client': 6.5.10_5bux6joajxjwtryfea6pxumd6u '@storybook/core-common': 6.5.10_rw34wyrummvuuuhgiylphbvpae @@ -5056,7 +6229,7 @@ packages: '@storybook/ui': 6.5.10_sfoxds7t5ydpegc3knd667wn6m '@types/node': 16.11.56 '@types/webpack': 4.41.32 - babel-loader: 8.2.5_li4tts7salxwv3rbqjnooz7t7e + babel-loader: 8.2.5_q4ydpsrmbqywduja5orgah6fgq case-sensitive-paths-webpack-plugin: 2.4.0 chalk: 4.1.2 core-js: 3.25.0 @@ -5096,10 +6269,29 @@ packages: /@storybook/mdx1-csf/0.0.1_@babel+core@7.18.13: resolution: {integrity: sha512-4biZIWWzoWlCarMZmTpqcJNgo/RBesYZwGFbQeXiGYsswuvfWARZnW9RE9aUEMZ4XPn7B1N3EKkWcdcWe/K2tg==} dependencies: - '@babel/generator': 7.18.13 - '@babel/parser': 7.18.13 + '@babel/generator': 7.20.0 + '@babel/parser': 7.20.0 '@babel/preset-env': 7.18.10_@babel+core@7.18.13 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 + '@mdx-js/mdx': 1.6.22 + '@types/lodash': 4.14.186 + js-string-escape: 1.0.1 + loader-utils: 2.0.2 + lodash: 4.17.21 + prettier: 2.3.0 + ts-dedent: 2.2.0 + transitivePeerDependencies: + - '@babel/core' + - supports-color + dev: true + + /@storybook/mdx1-csf/0.0.1_@babel+core@7.19.6: + resolution: {integrity: sha512-4biZIWWzoWlCarMZmTpqcJNgo/RBesYZwGFbQeXiGYsswuvfWARZnW9RE9aUEMZ4XPn7B1N3EKkWcdcWe/K2tg==} + dependencies: + '@babel/generator': 7.20.0 + '@babel/parser': 7.20.0 + '@babel/preset-env': 7.18.10_@babel+core@7.19.6 + '@babel/types': 7.20.0 '@mdx-js/mdx': 1.6.22 '@types/lodash': 4.14.186 js-string-escape: 1.0.1 @@ -5678,7 +6870,7 @@ packages: /@types/cheerio/0.22.31: resolution: {integrity: sha512-Kt7Cdjjdi2XWSfrZ53v4Of0wG3ZcmaegFXjMmz9tfNrZSkzzo36G0AL1YqSdcIA78Etjt6E609pt5h1xnQkPUw==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/codemirror/5.60.5: @@ -5690,7 +6882,7 @@ packages: /@types/concat-stream/1.6.1: resolution: {integrity: sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/cookie/0.4.1: @@ -5719,7 +6911,7 @@ packages: resolution: {integrity: sha512-xryQlOEIe1TduDWAOphR0ihfebKFSWOXpIsk+70JskCfRfW+xALdnJ0r1ZOTo85F9Qsjk6vtlU7edTYHbls9tA==} dependencies: '@types/cheerio': 0.22.31 - '@types/react': 18.0.23 + '@types/react': 18.0.24 dev: true /@types/eslint-scope/3.7.4: @@ -5750,33 +6942,33 @@ packages: /@types/form-data/0.0.33: resolution: {integrity: sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.1 - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/glob/8.0.0: resolution: {integrity: sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==} dependencies: '@types/minimatch': 5.1.1 - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/graceful-fs/4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/hast/2.3.4: @@ -5837,7 +7029,7 @@ packages: /@types/jsdom/20.0.0: resolution: {integrity: sha512-YfAchFs0yM1QPDrLm2VHe+WHGtqms3NXnXAMolrgrVP6fgBHHXy1ozAbo/dFtPNtZC/m66bPiCTWYmqp1F14gA==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 '@types/tough-cookie': 4.0.2 parse5: 7.0.0 dev: true @@ -5881,7 +7073,7 @@ packages: /@types/node-fetch/2.6.2: resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 form-data: 3.0.1 dev: true @@ -5901,6 +7093,10 @@ packages: resolution: {integrity: sha512-3JRwhbjI+cHLAkUorhf8RnqUbFXajvzX4q6fMn5JwkgtuwfYtRQYI3u4V92vI6NJuTsbBQWWh3RZjFsuevyMGQ==} dev: true + /@types/node/18.11.7: + resolution: {integrity: sha512-LhFTglglr63mNXUSRYD8A+ZAIu5sFqNJ4Y2fPuY7UlrySJH87rRRlhtVmMHplmfk5WkoJGmDjE9oiTfyX94CpQ==} + dev: true + /@types/node/18.7.13: resolution: {integrity: sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==} dev: false @@ -5935,7 +7131,7 @@ packages: /@types/prompts/2.4.1: resolution: {integrity: sha512-1Mqzhzi9W5KlooNE4o0JwSXGUDeQXKldbGn9NO4tpxwZbHXYd+WcKpCksG2lbhH7U9I9LigfsdVsP2QAY0lNPA==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/prop-types/15.7.5: @@ -5954,13 +7150,13 @@ packages: /@types/react-dom/18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: - '@types/react': 18.0.23 + '@types/react': 18.0.24 dev: true /@types/react-is/17.0.3: resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==} dependencies: - '@types/react': 18.0.23 + '@types/react': 18.0.24 dev: false /@types/react-test-renderer/17.0.2: @@ -5972,7 +7168,7 @@ packages: /@types/react-transition-group/4.4.5: resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==} dependencies: - '@types/react': 18.0.23 + '@types/react': 18.0.24 dev: false /@types/react/17.0.49: @@ -5983,8 +7179,8 @@ packages: csstype: 3.1.0 dev: true - /@types/react/18.0.23: - resolution: {integrity: sha512-R1wTULtCiJkudAN2DJGoYYySbGtOdzZyUWAACYinKdiQC8auxso4kLDUhQ7AJ2kh3F6A6z4v69U6tNY39hihVQ==} + /@types/react/18.0.24: + resolution: {integrity: sha512-wRJWT6ouziGUy+9uX0aW4YOJxAY0bG6/AOk5AW5QSvZqI7dk6VBIbXvcVgIw/W5Jrl24f77df98GEKTJGOLx7Q==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 @@ -5993,7 +7189,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/scheduler/0.16.2: @@ -6002,7 +7198,7 @@ packages: /@types/set-cookie-parser/2.4.2: resolution: {integrity: sha512-fBZgytwhYAUkj/jC/FAV4RQ5EerRup1YQsXQCh8rZfiHkc4UahC192oH0smGwsXol3cL3A5oETuAHeQHmhXM4w==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/sinonjs__fake-timers/8.1.1: @@ -6072,7 +7268,7 @@ packages: /@types/webpack-sources/3.2.0: resolution: {integrity: sha512-Ft7YH3lEVRQ6ls8k4Ff1oB4jN6oy/XmU6tQISKdhfh+1mR+viZFphS6WL0IrtDOzvefmJg5a0s7ZQoRXwqTEFg==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 '@types/source-list-map': 0.1.2 source-map: 0.7.4 dev: true @@ -6080,7 +7276,7 @@ packages: /@types/webpack/4.41.32: resolution: {integrity: sha512-cb+0ioil/7oz5//7tZUSwbrSAN/NWHrQylz5cW8G0dWTcF/g+/dSdMlKVZspBYuMAN1+WnwHrkxiRrLcwd0Heg==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 '@types/tapable': 1.0.8 '@types/uglify-js': 3.17.0 '@types/webpack-sources': 3.2.0 @@ -6091,7 +7287,7 @@ packages: /@types/ws/8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true /@types/yargs-parser/21.0.0: @@ -6114,7 +7310,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 dev: true optional: true @@ -6471,34 +7667,34 @@ packages: - supports-color dev: true - /@vitejs/plugin-react/2.1.0: - resolution: {integrity: sha512-am6rPyyU3LzUYne3Gd9oj9c4Rzbq5hQnuGXSMT6Gujq45Il/+bunwq3lrB7wghLkiF45ygMwft37vgJ/NE8IAA==} + /@vitejs/plugin-react/2.2.0: + resolution: {integrity: sha512-FFpefhvExd1toVRlokZgxgy2JtnBOdp4ZDsq7ldCWaqGSGn9UhWMAVm/1lxPL14JfNS5yGz+s9yFrQY6shoStA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^3.0.0 dependencies: - '@babel/core': 7.18.13 - '@babel/plugin-transform-react-jsx': 7.18.10_@babel+core@7.18.13 - '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-transform-react-jsx-self': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-transform-react-jsx-source': 7.18.6_@babel+core@7.18.13 + '@babel/core': 7.19.6 + '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.19.6 + '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-react-jsx-self': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-react-jsx-source': 7.19.6_@babel+core@7.19.6 magic-string: 0.26.7 react-refresh: 0.14.0 transitivePeerDependencies: - supports-color dev: true - /@vitejs/plugin-react/2.1.0_vite@3.1.0: - resolution: {integrity: sha512-am6rPyyU3LzUYne3Gd9oj9c4Rzbq5hQnuGXSMT6Gujq45Il/+bunwq3lrB7wghLkiF45ygMwft37vgJ/NE8IAA==} + /@vitejs/plugin-react/2.2.0_vite@3.1.0: + resolution: {integrity: sha512-FFpefhvExd1toVRlokZgxgy2JtnBOdp4ZDsq7ldCWaqGSGn9UhWMAVm/1lxPL14JfNS5yGz+s9yFrQY6shoStA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^3.0.0 dependencies: - '@babel/core': 7.18.13 - '@babel/plugin-transform-react-jsx': 7.18.10_@babel+core@7.18.13 - '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-transform-react-jsx-self': 7.18.6_@babel+core@7.18.13 - '@babel/plugin-transform-react-jsx-source': 7.18.6_@babel+core@7.18.13 + '@babel/core': 7.19.6 + '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.19.6 + '@babel/plugin-transform-react-jsx-development': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-react-jsx-self': 7.18.6_@babel+core@7.19.6 + '@babel/plugin-transform-react-jsx-source': 7.19.6_@babel+core@7.19.6 magic-string: 0.26.7 react-refresh: 0.14.0 vite: 3.1.0 @@ -6523,6 +7719,22 @@ packages: - supports-color dev: true + /@vitejs/plugin-vue-jsx/2.1.0_vite@3.1.0+vue@3.2.41: + resolution: {integrity: sha512-vvL8MHKN0hUf5LE+/rCk1rduwzW6NihD6xEfM4s1gGCSWQFYd5zLdxBs++z3S7AV/ynr7Yig5Xp1Bm0wlB4IAA==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + vite: ^3.0.0 + vue: ^3.0.0 + dependencies: + '@babel/core': 7.19.6 + '@babel/plugin-transform-typescript': 7.20.0_@babel+core@7.19.6 + '@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.19.6 + vite: 3.1.0 + vue: 3.2.41 + transitivePeerDependencies: + - supports-color + dev: true + /@vitejs/plugin-vue/3.1.2_vite@3.1.0+vue@3.2.41: resolution: {integrity: sha512-3zxKNlvA3oNaKDYX0NBclgxTQ1xaFdL7PzwF6zj9tGFziKwmBa3Q/6XcJQxudlT81WxDjEhHmevvIC4Orc1LhQ==} engines: {node: ^14.18.0 || >=16.0.0} @@ -6534,6 +7746,17 @@ packages: vue: 3.2.41 dev: true + /@vitejs/plugin-vue/3.2.0_vite@3.1.0+vue@3.2.41: + resolution: {integrity: sha512-E0tnaL4fr+qkdCNxJ+Xd0yM31UwMkQje76fsDVBBUCoGOUPexu2VDUYHL8P4CwV+zMvWw6nlRw19OnRKmYAJpw==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + vite: ^3.0.0 + vue: ^3.2.25 + dependencies: + vite: 3.1.0 + vue: 3.2.41 + dev: true + /@vitejs/plugin-vue2/1.1.2_vite@3.1.0+vue@2.7.10: resolution: {integrity: sha512-y6OEA+2UdJ0xrEQHodq20v9r3SpS62IOHrgN92JPLvVpNkhcissu7yvD5PXMzMESyazj0XNWGsc8UQk8+mVrjQ==} engines: {node: '>=14.6.0'} @@ -6604,6 +7827,23 @@ packages: - supports-color dev: true + /@vue/babel-plugin-jsx/1.1.1_@babel+core@7.19.6: + resolution: {integrity: sha512-j2uVfZjnB5+zkcbc/zsOc0fSNGCMMjaEXP52wdwdIfn0qjFfEYpYZBFKFg+HHnQeJCVrjOeO0YxgaL7DMrym9w==} + dependencies: + '@babel/helper-module-imports': 7.18.6 + '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.19.6 + '@babel/template': 7.18.10 + '@babel/traverse': 7.18.13 + '@babel/types': 7.18.13 + '@vue/babel-helper-vue-transform-on': 1.0.2 + camelcase: 6.3.0 + html-tags: 3.2.0 + svg-tags: 1.0.0 + transitivePeerDependencies: + - '@babel/core' + - supports-color + dev: true + /@vue/compiler-core/3.2.39: resolution: {integrity: sha512-mf/36OWXqWn0wsC40nwRRGheR/qoID+lZXbIuLnr4/AngM0ov8Xvv8GHunC0rKRIkh60bTqydlqTeBo49rlbqw==} dependencies: @@ -6635,7 +7875,7 @@ packages: /@vue/compiler-sfc/2.7.10: resolution: {integrity: sha512-55Shns6WPxlYsz4WX7q9ZJBL77sKE1ZAYNYStLs6GbhIOMrNtjMvzcob6gu3cGlfpCR4bT7NXgyJ3tly2+Hx8Q==} dependencies: - '@babel/parser': 7.18.13 + '@babel/parser': 7.20.0 postcss: 8.4.16 source-map: 0.6.1 @@ -6686,7 +7926,7 @@ packages: /@vue/reactivity-transform/3.2.39: resolution: {integrity: sha512-HGuWu864zStiWs9wBC6JYOP1E00UjMdDWIG5W+FpUx28hV3uz9ODOKVNm/vdOy/Pvzg8+OcANxAVC85WFBbl3A==} dependencies: - '@babel/parser': 7.18.13 + '@babel/parser': 7.20.0 '@vue/compiler-core': 3.2.39 '@vue/shared': 3.2.39 estree-walker: 2.0.2 @@ -7860,14 +9100,14 @@ packages: schema-utils: 2.7.1 dev: true - /babel-loader/8.2.5_li4tts7salxwv3rbqjnooz7t7e: + /babel-loader/8.2.5_q4ydpsrmbqywduja5orgah6fgq: resolution: {integrity: sha512-OSiFfH89LrEMiWd4pLNqGz4CwJDtbs2ZVc+iGu2HrkRfPxId9F2anQj38IxWpmRfsUY0aBZYi1EFcd3mhtRMLQ==} engines: {node: '>= 8.9'} peerDependencies: '@babel/core': ^7.0.0 webpack: '>=2' dependencies: - '@babel/core': 7.18.13 + '@babel/core': 7.19.6 find-cache-dir: 3.3.2 loader-utils: 2.0.2 make-dir: 3.1.0 @@ -7905,7 +9145,7 @@ packages: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} dependencies: - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.1 @@ -7922,7 +9162,7 @@ packages: '@babel/core': 7.18.13 '@babel/helper-module-imports': 7.16.0 '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.18.13 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 html-entities: 2.3.2 dev: true @@ -7939,7 +9179,7 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/compat-data': 7.18.13 + '@babel/compat-data': 7.20.0 '@babel/core': 7.18.13 '@babel/helper-define-polyfill-provider': 0.3.2_@babel+core@7.18.13 semver: 6.3.0 @@ -7947,13 +9187,26 @@ packages: - supports-color dev: true - /babel-plugin-polyfill-corejs3/0.1.7_@babel+core@7.18.13: + /babel-plugin-polyfill-corejs2/0.3.2_@babel+core@7.19.6: + resolution: {integrity: sha512-LPnodUl3lS0/4wN3Rb+m+UK8s7lj2jcLRrjho4gLw+OJs+I4bvGXshINesY5xx/apM+biTnQ9reDI8yj+0M5+Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.20.0 + '@babel/core': 7.19.6 + '@babel/helper-define-polyfill-provider': 0.3.2_@babel+core@7.19.6 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-polyfill-corejs3/0.1.7_@babel+core@7.19.6: resolution: {integrity: sha512-u+gbS9bbPhZWEeyy1oR/YaaSpod/KDT07arZHb80aTpl8H5ZBq+uN1nN9/xtX7jQyfLdPfoqI4Rue/MQSWJquw==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.18.13 - '@babel/helper-define-polyfill-provider': 0.1.5_@babel+core@7.18.13 + '@babel/core': 7.19.6 + '@babel/helper-define-polyfill-provider': 0.1.5_@babel+core@7.19.6 core-js-compat: 3.25.0 transitivePeerDependencies: - supports-color @@ -7971,6 +9224,18 @@ packages: - supports-color dev: true + /babel-plugin-polyfill-corejs3/0.5.3_@babel+core@7.19.6: + resolution: {integrity: sha512-zKsXDh0XjnrUEW0mxIHLfjBfnXSMr5Q/goMe/fxpQnLm07mcOZiIZHBNWCMx60HmdvjxfXcalac0tfFg0wqxyw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-define-polyfill-provider': 0.3.2_@babel+core@7.19.6 + core-js-compat: 3.25.0 + transitivePeerDependencies: + - supports-color + dev: true + /babel-plugin-polyfill-regenerator/0.4.0_@babel+core@7.18.13: resolution: {integrity: sha512-RW1cnryiADFeHmfLS+WW/G431p1PsW5qdRdz0SDRi7TKcUgc7Oh/uXkT7MZ/+tGsT1BkczEAmD5XjUyJ5SWDTw==} peerDependencies: @@ -7982,6 +9247,17 @@ packages: - supports-color dev: true + /babel-plugin-polyfill-regenerator/0.4.0_@babel+core@7.19.6: + resolution: {integrity: sha512-RW1cnryiADFeHmfLS+WW/G431p1PsW5qdRdz0SDRi7TKcUgc7Oh/uXkT7MZ/+tGsT1BkczEAmD5XjUyJ5SWDTw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.6 + '@babel/helper-define-polyfill-provider': 0.3.2_@babel+core@7.19.6 + transitivePeerDependencies: + - supports-color + dev: true + /babel-plugin-react-docgen/4.2.1: resolution: {integrity: sha512-UQ0NmGHj/HAqi5Bew8WvNfCk8wSsmdgNd8ZdMjBCICtyCJCq9LiqgqvjCYe570/Wg7AQArSq1VQ60Dd/CHN7mQ==} dependencies: @@ -10852,8 +12128,8 @@ packages: resolution: {integrity: sha512-YNF+mZ/Wu2FU/gvmzuWtYc8rloubL7wfXCTgouFrnjGVXPA/EeYYA7pupXWrb3Iv1cTBeSSxxJIbK23l4MRNqg==} engines: {node: '>=8.3.0'} dependencies: - '@babel/traverse': 7.18.13 - '@babel/types': 7.18.13 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 c8: 7.12.0 transitivePeerDependencies: - supports-color @@ -13148,7 +14424,7 @@ packages: dependencies: '@jest/types': 26.6.2 '@types/graceful-fs': 4.1.5 - '@types/node': 18.11.5 + '@types/node': 18.11.7 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.10 @@ -13216,7 +14492,7 @@ packages: resolution: {integrity: sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==} engines: {node: '>= 10.14.2'} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 graceful-fs: 4.2.10 dev: true @@ -13225,7 +14501,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 18.11.5 + '@types/node': 18.11.7 chalk: 4.1.2 graceful-fs: 4.2.10 is-ci: 2.0.0 @@ -13237,7 +14513,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.0.1 - '@types/node': 18.11.5 + '@types/node': 18.11.7 chalk: 4.1.2 ci-info: 3.3.2 graceful-fs: 4.2.10 @@ -13248,7 +14524,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -13257,7 +14533,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.11.5 + '@types/node': 18.11.7 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -15975,8 +17251,8 @@ packages: engines: {node: '>=8.10.0'} hasBin: true dependencies: - '@babel/core': 7.18.13 - '@babel/generator': 7.18.13 + '@babel/core': 7.19.6 + '@babel/generator': 7.20.0 '@babel/runtime': 7.18.9 ast-types: 0.14.2 commander: 2.20.3 @@ -15994,7 +17270,7 @@ packages: engines: {node: '>=12.0.0'} hasBin: true dependencies: - '@babel/core': 7.18.13 + '@babel/core': 7.19.6 '@babel/generator': 7.18.13 ast-types: 0.14.2 commander: 2.20.3 @@ -19196,7 +20472,7 @@ packages: dependencies: '@docsearch/css': 3.3.0 '@docsearch/js': 3.3.0 - '@vitejs/plugin-vue': 3.1.2_vite@3.1.0+vue@3.2.41 + '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 '@vue/devtools-api': 6.4.5 '@vueuse/core': 9.4.0_vue@3.2.41 body-scroll-lock: 4.0.0-beta.0 @@ -19678,10 +20954,10 @@ packages: engines: {node: '>=10.0.0'} dependencies: '@apideck/better-ajv-errors': 0.3.6_ajv@8.11.0 - '@babel/core': 7.18.13 - '@babel/preset-env': 7.18.10_@babel+core@7.18.13 + '@babel/core': 7.19.6 + '@babel/preset-env': 7.18.10_@babel+core@7.19.6 '@babel/runtime': 7.18.9 - '@rollup/plugin-babel': 5.3.1_qa5xd24o3tymwictiiptlhxtom + '@rollup/plugin-babel': 5.3.1_s45mkc5s7is4owdeow33qgy2s4 '@rollup/plugin-node-resolve': 11.2.1_rollup@2.79.0 '@rollup/plugin-replace': 2.4.2_rollup@2.79.0 '@surma/rollup-plugin-off-main-thread': 2.2.3 From 3294579ea03231616feaf0b97f369b638f103810 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Fri, 28 Oct 2022 16:24:23 +0200 Subject: [PATCH 27/33] docs: add tip about "ts-expect-error" --- docs/guide/testing-types.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/guide/testing-types.md b/docs/guide/testing-types.md index 2600900d17a9..35340ea892d5 100644 --- a/docs/guide/testing-types.md +++ b/docs/guide/testing-types.md @@ -43,7 +43,7 @@ This is due to how [`expect-type`](https://github.com/mmkal/expect-type) handles Unfortunately, TypeScript doesn't provide type metadata without patching, so we cannot provide useful error messages at this point, but there are works in TypeScript project to fix this. If you want better messages, please, ask TypeScript team to have a look at mentioned PR. -If you find it hard working with `expectTypeOf` API and figuring out errors, you can always use more simple `asserType` API: +If you find it hard working with `expectTypeOf` API and figuring out errors, you can always use more simple `assertType` API: ```ts const answer = 42 @@ -53,6 +53,17 @@ assertType(answer) assertType(answer) ``` +::: tip +When using `@ts-expect-error` syntax, you might want to make sure that you didn't make a typo. You can do that by including your type files in [`test.include`](/config/#include) config option, so Vitest will also actually *run* these tests and fail with `ReferenceError`. + +This will pass, because it expects an error, but the word “answer” has a typo, so it's a false positive error: + +```ts +// @ts-expect-error answer is not a string +assertType(answr) // +``` +::: + ## Run typechecking Add this command to your `scripts` section in `package.json`: From 9557df4e1756baee56e90777ae3c7f8006928ee4 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 27 Oct 2022 23:58:47 +0800 Subject: [PATCH 28/33] chore: add test --- packages/ui/client/auto-imports.d.ts | 5 + pnpm-lock.yaml | 304 +++++++++--------- .../typescript/failing/expect-error.test-d.ts | 6 + test/typescript/failing/fail.test-d.ts | 1 + 4 files changed, 170 insertions(+), 146 deletions(-) create mode 100644 test/typescript/failing/expect-error.test-d.ts diff --git a/packages/ui/client/auto-imports.d.ts b/packages/ui/client/auto-imports.d.ts index 148c5b0e4739..58e175b362a0 100644 --- a/packages/ui/client/auto-imports.d.ts +++ b/packages/ui/client/auto-imports.d.ts @@ -41,6 +41,8 @@ declare global { const nextTick: typeof import('vue')['nextTick'] const onActivated: typeof import('vue')['onActivated'] const onBeforeMount: typeof import('vue')['onBeforeMount'] + const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] + const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] const onClickOutside: typeof import('@vueuse/core')['onClickOutside'] @@ -72,6 +74,7 @@ declare global { const refThrottled: typeof import('@vueuse/core')['refThrottled'] const refWithControl: typeof import('@vueuse/core')['refWithControl'] const resolveComponent: typeof import('vue')['resolveComponent'] + const resolveDirective: typeof import('vue')['resolveDirective'] const resolveRef: typeof import('@vueuse/core')['resolveRef'] const resolveUnref: typeof import('@vueuse/core')['resolveUnref'] const shallowReactive: typeof import('vue')['shallowReactive'] @@ -164,6 +167,7 @@ declare global { const useIntervalFn: typeof import('@vueuse/core')['useIntervalFn'] const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier'] const useLastChanged: typeof import('@vueuse/core')['useLastChanged'] + const useLink: typeof import('vue-router')['useLink'] const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage'] const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys'] const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory'] @@ -205,6 +209,7 @@ declare global { const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage'] const useShare: typeof import('@vueuse/core')['useShare'] const useSlots: typeof import('vue')['useSlots'] + const useSorted: typeof import('@vueuse/core')['useSorted'] const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition'] const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis'] const useStepper: typeof import('@vueuse/core')['useStepper'] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c2ee836431f4..32b950c85308 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -133,7 +133,7 @@ importers: vite: ^3.1.0 vitest: workspace:* devDependencies: - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 vite: 3.1.0 vitest: link:../../packages/vitest @@ -147,7 +147,7 @@ importers: vite: ^3.1.0 vitest: workspace:* devDependencies: - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 axios: 0.26.1 fastify: 4.5.3 supertest: 6.2.4 @@ -166,7 +166,7 @@ importers: '@rollup/plugin-graphql': 1.1.0_graphql@16.6.0 graphql: 16.6.0 devDependencies: - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 vite: 3.1.0 vitest: link:../../packages/vitest @@ -177,7 +177,7 @@ importers: vite: ^3.1.0 vitest: workspace:* devDependencies: - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 jest-image-snapshot: 4.5.1 vite: 3.1.0 vitest: link:../../packages/vitest @@ -192,8 +192,8 @@ importers: dependencies: lit: 2.3.1 devDependencies: - '@vitest/ui': link:../../packages/ui - jsdom: 20.0.1 + '@vitest/ui': 0.24.5 + jsdom: 20.0.2 vite: 3.1.0 vitest: link:../../packages/vitest @@ -213,7 +213,7 @@ importers: axios: 0.26.1 tinyspy: 0.3.3 devDependencies: - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 react: 18.2.0 vite: 3.1.0 vitest: link:../../packages/vitest @@ -238,10 +238,10 @@ importers: react-dom: 18.0.0_react@18.0.0 devDependencies: '@testing-library/react': 13.3.0_zpnidt7m3osuk7shl3s4oenomq - '@types/node': 18.11.7 - '@types/react': 18.0.24 + '@types/node': 18.11.9 + '@types/react': 18.0.25 '@vitejs/plugin-react': 2.2.0 - jsdom: 20.0.1 + jsdom: 20.0.2 typescript: 4.6.3 vitest: link:../../packages/vitest @@ -254,7 +254,7 @@ importers: vitest: workspace:* devDependencies: '@playwright/test': 1.25.1 - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 playwright: 1.25.1 vite: 3.1.0 vitest: link:../../packages/vitest @@ -266,7 +266,7 @@ importers: vite: ^3.1.0 vitest: workspace:* devDependencies: - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 puppeteer: 13.7.0 vite: 3.1.0 vitest: link:../../packages/vitest @@ -289,9 +289,9 @@ importers: '@types/react': 17.0.49 '@types/react-test-renderer': 17.0.2 '@vitejs/plugin-react': 2.2.0_vite@3.1.0 - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 happy-dom: 7.6.6 - jsdom: 20.0.1 + jsdom: 20.0.2 react-test-renderer: 17.0.2_react@17.0.2 vite: 3.1.0 vitest: link:../../packages/vitest @@ -317,7 +317,7 @@ importers: '@types/react': 17.0.49 '@types/react-dom': 17.0.17 '@vitejs/plugin-react': 2.2.0_vite@3.1.0 - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 '@wojtekmaj/enzyme-adapter-react-17': 0.6.7_7ltvq4e2railvf5uya4ffxpe2a enzyme: 3.11.0 vite: 3.1.0 @@ -360,9 +360,9 @@ importers: '@testing-library/jest-dom': 5.16.5 '@testing-library/react': 13.3.0_biqbaboplfbrettd7655fr4n2y '@testing-library/user-event': 14.4.3 - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 date-fns: 2.29.2 - jsdom: 20.0.1 + jsdom: 20.0.2 vite: 3.1.0 vitest: link:../../packages/vitest @@ -412,9 +412,9 @@ importers: '@types/react': 17.0.49 '@types/react-dom': 17.0.17 '@vitejs/plugin-react': 1.3.2 - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 babel-loader: 8.2.5_@babel+core@7.18.13 - jsdom: 20.0.1 + jsdom: 20.0.2 msw: 0.39.2 msw-storybook-addon: 1.6.3_ssm5z5kjlefxgbmyszjdm3lzke typescript: 4.8.2 @@ -447,8 +447,8 @@ importers: '@types/react': 17.0.49 '@types/react-dom': 17.0.17 '@vitejs/plugin-react': 1.3.2 - '@vitest/ui': link:../../packages/ui - jsdom: 20.0.1 + '@vitest/ui': 0.24.5 + jsdom: 20.0.2 vite: 3.1.0 vitest: link:../../packages/vitest @@ -478,9 +478,9 @@ importers: '@types/react': 17.0.49 '@types/react-dom': 17.0.17 '@vitejs/plugin-react': 1.3.2 - '@vitest/ui': link:../../packages/ui + '@vitest/ui': 0.24.5 cross-fetch: 3.1.5 - jsdom: 20.0.1 + jsdom: 20.0.2 msw: 0.39.2 vite: 3.1.0 vitest: link:../../packages/vitest @@ -496,8 +496,8 @@ importers: vue: latest devDependencies: '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 - '@vue/test-utils': 2.2.0_vue@3.2.41 - jsdom: 20.0.1 + '@vue/test-utils': 2.2.1_vue@3.2.41 + jsdom: 20.0.2 vite: 3.1.0 vite-plugin-ruby: 3.1.2_vite@3.1.0 vitest: link:../../packages/vitest @@ -513,7 +513,7 @@ importers: dependencies: solid-js: 1.5.2 devDependencies: - jsdom: 20.0.1 + jsdom: 20.0.2 solid-testing-library: 0.3.0_solid-js@1.5.2 vite-plugin-solid: 2.3.0_solid-js@1.5.2 vitest: link:../../packages/vitest @@ -530,8 +530,8 @@ importers: devDependencies: '@sveltejs/vite-plugin-svelte': 1.0.3_svelte@3.49.0+vite@3.1.0 '@testing-library/svelte': 3.2.1_svelte@3.49.0 - '@vitest/ui': link:../../packages/ui - jsdom: 20.0.1 + '@vitest/ui': 0.24.5 + jsdom: 20.0.2 svelte: 3.49.0 vite: 3.1.0 vitest: link:../../packages/vitest @@ -551,7 +551,7 @@ importers: devDependencies: '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 '@vue/test-utils': 2.0.2_vue@3.2.41 - jsdom: 20.0.1 + jsdom: 20.0.2 unplugin-auto-import: 0.11.2_vite@3.1.0 unplugin-vue-components: 0.22.4_vite@3.1.0+vue@3.2.41 vite: 3.1.0 @@ -570,7 +570,7 @@ importers: devDependencies: '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 '@vue/test-utils': 2.0.0_vue@3.2.41 - jsdom: 20.0.1 + jsdom: 20.0.2 vite: 3.1.0 vitest: link:../../packages/vitest @@ -585,9 +585,9 @@ importers: vue: latest devDependencies: '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 - '@vitejs/plugin-vue-jsx': 2.1.0_vite@3.1.0+vue@3.2.41 - '@vue/test-utils': 2.2.0_vue@3.2.41 - jsdom: 20.0.1 + '@vitejs/plugin-vue-jsx': 2.1.1_vite@3.1.0+vue@3.2.41 + '@vue/test-utils': 2.2.1_vue@3.2.41 + jsdom: 20.0.2 vite: 3.1.0 vitest: link:../../packages/vitest vue: 3.2.41 @@ -606,7 +606,7 @@ importers: devDependencies: '@vitejs/plugin-vue2': 1.1.2_vite@3.1.0+vue@2.7.10 '@vue/test-utils': 1.3.0_42puyn3dcxirnpdjnosl7pbb6a - jsdom: 20.0.1 + jsdom: 20.0.2 vite: 3.1.0 vitest: link:../../packages/vitest vue-template-compiler: 2.7.10 @@ -965,7 +965,7 @@ importers: vue: latest devDependencies: '@vitejs/plugin-vue': 3.2.0_vite@3.1.0+vue@3.2.41 - '@vue/test-utils': 2.2.0_vue@3.2.41 + '@vue/test-utils': 2.2.1_vue@3.2.41 happy-dom: 7.6.6 vite: 3.1.0 vitest: link:../../packages/vitest @@ -1401,14 +1401,9 @@ packages: dependencies: '@babel/highlight': 7.18.6 - /@babel/compat-data/7.18.13: - resolution: {integrity: sha512-5yUzC5LqyTFp2HLmDoxGQelcdYgSpP9xsnMWBphAscOdFrHSAVbLNzWiy32sVNDqJRDiJK6klfDnAgu6PAGSHw==} - engines: {node: '>=6.9.0'} - /@babel/compat-data/7.20.0: resolution: {integrity: sha512-Gt9jszFJYq7qzXVK4slhc6NzJXnOVmRECWcVjF/T23rNXD9NtWQ0W3qxdg+p9wWIB+VQw3GYV/U2Ha9bRTfs4w==} engines: {node: '>=6.9.0'} - dev: true /@babel/core/7.12.9: resolution: {integrity: sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==} @@ -1483,7 +1478,7 @@ packages: resolution: {integrity: sha512-CkPg8ySSPuHTYPJYo7IRALdqyjM9HCbt/3uOBEFbzyGVP6Mn8bwFPB0jX6982JVNBlYzM1nnPkfjuXSOPtQeEQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 '@jridgewell/gen-mapping': 0.3.2 jsesc: 2.5.2 @@ -1494,7 +1489,6 @@ packages: '@babel/types': 7.20.0 '@jridgewell/gen-mapping': 0.3.2 jsesc: 2.5.2 - dev: true /@babel/helper-annotate-as-pure/7.18.6: resolution: {integrity: sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==} @@ -1517,7 +1511,7 @@ packages: peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/compat-data': 7.18.13 + '@babel/compat-data': 7.20.0 '@babel/core': 7.18.13 '@babel/helper-validator-option': 7.18.6 browserslist: 4.21.3 @@ -1668,20 +1662,12 @@ packages: '@babel/types': 7.20.0 dev: true - /@babel/helper-function-name/7.18.9: - resolution: {integrity: sha512-fJgWlZt7nxGksJS9a0XdSaI4XvpExnNIgRP+rVefWh5U7BL8pPuir6SJUmFKRfjWQ51OtWSzwOxhaH/EBWWc0A==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.18.10 - '@babel/types': 7.20.0 - /@babel/helper-function-name/7.19.0: resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.18.10 '@babel/types': 7.20.0 - dev: true /@babel/helper-hoist-variables/7.18.6: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} @@ -1707,7 +1693,7 @@ packages: resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 /@babel/helper-module-transforms/7.18.9: resolution: {integrity: sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g==} @@ -1715,12 +1701,12 @@ packages: dependencies: '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-module-imports': 7.18.6 - '@babel/helper-simple-access': 7.18.6 + '@babel/helper-simple-access': 7.19.4 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 '@babel/template': 7.18.10 - '@babel/traverse': 7.18.13 - '@babel/types': 7.18.13 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 transitivePeerDependencies: - supports-color @@ -1751,11 +1737,6 @@ packages: resolution: {integrity: sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==} dev: true - /@babel/helper-plugin-utils/7.18.9: - resolution: {integrity: sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w==} - engines: {node: '>=6.9.0'} - dev: true - /@babel/helper-plugin-utils/7.19.0: resolution: {integrity: sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw==} engines: {node: '>=6.9.0'} @@ -1797,24 +1778,17 @@ packages: '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-member-expression-to-functions': 7.18.9 '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/traverse': 7.18.13 + '@babel/traverse': 7.20.0 '@babel/types': 7.20.0 transitivePeerDependencies: - supports-color dev: true - /@babel/helper-simple-access/7.18.6: - resolution: {integrity: sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.20.0 - /@babel/helper-simple-access/7.19.4: resolution: {integrity: sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.20.0 - dev: true /@babel/helper-skip-transparent-expression-wrappers/7.18.9: resolution: {integrity: sha512-imytd2gHi3cJPsybLRbmFrF7u5BIEuI2cNheyKi3/iOBC63kNn3q8Crn2xVuESli0aM4KYsyEqKyS7lFL8YVtw==} @@ -1829,18 +1803,10 @@ packages: dependencies: '@babel/types': 7.20.0 - /@babel/helper-string-parser/7.18.10: - resolution: {integrity: sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==} - engines: {node: '>=6.9.0'} - /@babel/helper-string-parser/7.19.4: resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} engines: {node: '>=6.9.0'} - /@babel/helper-validator-identifier/7.18.6: - resolution: {integrity: sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==} - engines: {node: '>=6.9.0'} - /@babel/helper-validator-identifier/7.19.1: resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} engines: {node: '>=6.9.0'} @@ -1866,8 +1832,8 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.18.10 - '@babel/traverse': 7.18.13 - '@babel/types': 7.18.13 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 transitivePeerDependencies: - supports-color @@ -1895,7 +1861,7 @@ packages: engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 /@babel/parser/7.20.0: resolution: {integrity: sha512-G9VgAhEaICnz8iiJeGJQyVl6J2nTjbW0xeisva0PK6XcKsga7BIaqm4ZF8Rg1Wbaqmy6znspNqhPaPkyukujzg==} @@ -3364,7 +3330,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.18.13 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 dev: true /@babel/plugin-transform-react-jsx-source/7.19.6_@babel+core@7.19.6: @@ -3386,9 +3352,9 @@ packages: '@babel/core': 7.18.13 '@babel/helper-annotate-as-pure': 7.18.6 '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.18.13 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 dev: true /@babel/plugin-transform-react-jsx/7.19.0_@babel+core@7.18.13: @@ -3970,21 +3936,21 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/parser': 7.18.13 - '@babel/types': 7.18.13 + '@babel/parser': 7.20.0 + '@babel/types': 7.20.0 /@babel/traverse/7.18.13: resolution: {integrity: sha512-N6kt9X1jRMLPxxxPYWi7tgvJRH/rtoU+dbKAPDM44RFHiMH8igdsaSBgFeskhSl/kLWLDUvIh1RXCrTmg0/zvA==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/generator': 7.18.13 + '@babel/generator': 7.20.0 '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-function-name': 7.18.9 + '@babel/helper-function-name': 7.19.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.18.13 - '@babel/types': 7.18.13 + '@babel/parser': 7.20.0 + '@babel/types': 7.20.0 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -4006,14 +3972,13 @@ packages: globals: 11.12.0 transitivePeerDependencies: - supports-color - dev: true /@babel/types/7.18.13: resolution: {integrity: sha512-ePqfTihzW0W6XAU+aMw2ykilisStJfDnsejDCXRchCcMJ4O0+8DhPXf2YUbZ6wjBlsEmZwLK/sPweWtu8hcJYQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.18.10 - '@babel/helper-validator-identifier': 7.18.6 + '@babel/helper-string-parser': 7.19.4 + '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 /@babel/types/7.20.0: @@ -4527,7 +4492,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.7 + '@types/node': 18.11.9 '@types/yargs': 15.0.14 chalk: 4.1.2 dev: true @@ -4539,7 +4504,7 @@ packages: '@jest/schemas': 29.0.0 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.7 + '@types/node': 18.11.9 '@types/yargs': 17.0.12 chalk: 4.1.2 dev: true @@ -5052,7 +5017,7 @@ packages: engines: {node: '>=14'} hasBin: true dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 playwright-core: 1.25.1 dev: true @@ -6307,10 +6272,10 @@ packages: /@storybook/mdx1-csf/0.0.4_u2aypivye4tius5ftakppbroiy: resolution: {integrity: sha512-xxUEMy0D+0G1aSYxbeVNbs+XBU5nCqW4I7awpBYSTywXDv/MJWeC6FDRpj5P1pgfq8j8jWDD5ZDvBQ7syFg0LQ==} dependencies: - '@babel/generator': 7.18.13 - '@babel/parser': 7.18.13 + '@babel/generator': 7.20.0 + '@babel/parser': 7.20.0 '@babel/preset-env': 7.18.10_@babel+core@7.18.13 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 '@mdx-js/mdx': 1.6.22 '@mdx-js/react': 1.6.22_react@17.0.2 '@types/lodash': 4.14.186 @@ -6870,7 +6835,7 @@ packages: /@types/cheerio/0.22.31: resolution: {integrity: sha512-Kt7Cdjjdi2XWSfrZ53v4Of0wG3ZcmaegFXjMmz9tfNrZSkzzo36G0AL1YqSdcIA78Etjt6E609pt5h1xnQkPUw==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/codemirror/5.60.5: @@ -6882,7 +6847,7 @@ packages: /@types/concat-stream/1.6.1: resolution: {integrity: sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/cookie/0.4.1: @@ -6911,7 +6876,7 @@ packages: resolution: {integrity: sha512-xryQlOEIe1TduDWAOphR0ihfebKFSWOXpIsk+70JskCfRfW+xALdnJ0r1ZOTo85F9Qsjk6vtlU7edTYHbls9tA==} dependencies: '@types/cheerio': 0.22.31 - '@types/react': 18.0.24 + '@types/react': 18.0.25 dev: true /@types/eslint-scope/3.7.4: @@ -6940,35 +6905,35 @@ packages: dev: true /@types/form-data/0.0.33: - resolution: {integrity: sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==} + resolution: {integrity: sha1-yayFsqX9GENbjIXZ7LUObWyJP/g=} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.1 - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/glob/8.0.0: resolution: {integrity: sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==} dependencies: '@types/minimatch': 5.1.1 - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/graceful-fs/4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/hast/2.3.4: @@ -7029,7 +6994,7 @@ packages: /@types/jsdom/20.0.0: resolution: {integrity: sha512-YfAchFs0yM1QPDrLm2VHe+WHGtqms3NXnXAMolrgrVP6fgBHHXy1ozAbo/dFtPNtZC/m66bPiCTWYmqp1F14gA==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 '@types/tough-cookie': 4.0.2 parse5: 7.0.0 dev: true @@ -7073,7 +7038,7 @@ packages: /@types/node-fetch/2.6.2: resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 form-data: 3.0.1 dev: true @@ -7093,8 +7058,8 @@ packages: resolution: {integrity: sha512-3JRwhbjI+cHLAkUorhf8RnqUbFXajvzX4q6fMn5JwkgtuwfYtRQYI3u4V92vI6NJuTsbBQWWh3RZjFsuevyMGQ==} dev: true - /@types/node/18.11.7: - resolution: {integrity: sha512-LhFTglglr63mNXUSRYD8A+ZAIu5sFqNJ4Y2fPuY7UlrySJH87rRRlhtVmMHplmfk5WkoJGmDjE9oiTfyX94CpQ==} + /@types/node/18.11.9: + resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==} dev: true /@types/node/18.7.13: @@ -7131,7 +7096,7 @@ packages: /@types/prompts/2.4.1: resolution: {integrity: sha512-1Mqzhzi9W5KlooNE4o0JwSXGUDeQXKldbGn9NO4tpxwZbHXYd+WcKpCksG2lbhH7U9I9LigfsdVsP2QAY0lNPA==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/prop-types/15.7.5: @@ -7150,13 +7115,13 @@ packages: /@types/react-dom/18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: - '@types/react': 18.0.24 + '@types/react': 18.0.25 dev: true /@types/react-is/17.0.3: resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==} dependencies: - '@types/react': 18.0.24 + '@types/react': 18.0.25 dev: false /@types/react-test-renderer/17.0.2: @@ -7168,7 +7133,7 @@ packages: /@types/react-transition-group/4.4.5: resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==} dependencies: - '@types/react': 18.0.24 + '@types/react': 18.0.25 dev: false /@types/react/17.0.49: @@ -7179,8 +7144,8 @@ packages: csstype: 3.1.0 dev: true - /@types/react/18.0.24: - resolution: {integrity: sha512-wRJWT6ouziGUy+9uX0aW4YOJxAY0bG6/AOk5AW5QSvZqI7dk6VBIbXvcVgIw/W5Jrl24f77df98GEKTJGOLx7Q==} + /@types/react/18.0.25: + resolution: {integrity: sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 @@ -7189,7 +7154,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/scheduler/0.16.2: @@ -7198,7 +7163,7 @@ packages: /@types/set-cookie-parser/2.4.2: resolution: {integrity: sha512-fBZgytwhYAUkj/jC/FAV4RQ5EerRup1YQsXQCh8rZfiHkc4UahC192oH0smGwsXol3cL3A5oETuAHeQHmhXM4w==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/sinonjs__fake-timers/8.1.1: @@ -7268,7 +7233,7 @@ packages: /@types/webpack-sources/3.2.0: resolution: {integrity: sha512-Ft7YH3lEVRQ6ls8k4Ff1oB4jN6oy/XmU6tQISKdhfh+1mR+viZFphS6WL0IrtDOzvefmJg5a0s7ZQoRXwqTEFg==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 '@types/source-list-map': 0.1.2 source-map: 0.7.4 dev: true @@ -7276,7 +7241,7 @@ packages: /@types/webpack/4.41.32: resolution: {integrity: sha512-cb+0ioil/7oz5//7tZUSwbrSAN/NWHrQylz5cW8G0dWTcF/g+/dSdMlKVZspBYuMAN1+WnwHrkxiRrLcwd0Heg==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 '@types/tapable': 1.0.8 '@types/uglify-js': 3.17.0 '@types/webpack-sources': 3.2.0 @@ -7287,7 +7252,7 @@ packages: /@types/ws/8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true /@types/yargs-parser/21.0.0: @@ -7310,7 +7275,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 dev: true optional: true @@ -7719,8 +7684,8 @@ packages: - supports-color dev: true - /@vitejs/plugin-vue-jsx/2.1.0_vite@3.1.0+vue@3.2.41: - resolution: {integrity: sha512-vvL8MHKN0hUf5LE+/rCk1rduwzW6NihD6xEfM4s1gGCSWQFYd5zLdxBs++z3S7AV/ynr7Yig5Xp1Bm0wlB4IAA==} + /@vitejs/plugin-vue-jsx/2.1.1_vite@3.1.0+vue@3.2.41: + resolution: {integrity: sha512-JgDhxstQlwnHBvZ1BSnU5mbmyQ14/t5JhREc6YH5kWyu2QdAAOsLF6xgHoIWarj8tddaiwFrNzLbWJPudpXKYA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^3.0.0 @@ -7768,6 +7733,12 @@ packages: vue: 2.7.10 dev: true + /@vitest/ui/0.24.5: + resolution: {integrity: sha512-hdj6cmlrVPt3Mpgn0ITytTqnxQLGB4hRgueFuzlKSrqAG30wUrrxQjrW55krE1NR15r1c2jzUBwjzvIJsyoUwg==} + dependencies: + sirv: 2.0.2 + dev: true + /@volar/code-gen/0.40.13: resolution: {integrity: sha512-4gShBWuMce868OVvgyA1cU5WxHbjfEme18Tw6uVMfweZCF5fB2KECG0iPrA9D54vHk3FeHarODNwgIaaFfUBlA==} dependencies: @@ -7816,8 +7787,8 @@ packages: '@babel/helper-module-imports': 7.18.6 '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.18.13 '@babel/template': 7.18.10 - '@babel/traverse': 7.18.13 - '@babel/types': 7.18.13 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 '@vue/babel-helper-vue-transform-on': 1.0.2 camelcase: 6.3.0 html-tags: 3.2.0 @@ -7833,8 +7804,8 @@ packages: '@babel/helper-module-imports': 7.18.6 '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.19.6 '@babel/template': 7.18.10 - '@babel/traverse': 7.18.13 - '@babel/types': 7.18.13 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 '@vue/babel-helper-vue-transform-on': 1.0.2 camelcase: 6.3.0 html-tags: 3.2.0 @@ -7847,7 +7818,7 @@ packages: /@vue/compiler-core/3.2.39: resolution: {integrity: sha512-mf/36OWXqWn0wsC40nwRRGheR/qoID+lZXbIuLnr4/AngM0ov8Xvv8GHunC0rKRIkh60bTqydlqTeBo49rlbqw==} dependencies: - '@babel/parser': 7.18.13 + '@babel/parser': 7.20.0 '@vue/shared': 3.2.39 estree-walker: 2.0.2 source-map: 0.6.1 @@ -7855,7 +7826,7 @@ packages: /@vue/compiler-core/3.2.41: resolution: {integrity: sha512-oA4mH6SA78DT+96/nsi4p9DX97PHcNROxs51lYk7gb9Z4BPKQ3Mh+BLn6CQZBw857Iuhu28BfMSRHAlPvD4vlw==} dependencies: - '@babel/parser': 7.18.13 + '@babel/parser': 7.20.0 '@vue/shared': 3.2.41 estree-walker: 2.0.2 source-map: 0.6.1 @@ -7882,7 +7853,7 @@ packages: /@vue/compiler-sfc/3.2.39: resolution: {integrity: sha512-fqAQgFs1/BxTUZkd0Vakn3teKUt//J3c420BgnYgEOoVdTwYpBTSXCMJ88GOBCylmUBbtquGPli9tVs7LzsWIA==} dependencies: - '@babel/parser': 7.18.13 + '@babel/parser': 7.20.0 '@vue/compiler-core': 3.2.39 '@vue/compiler-dom': 3.2.39 '@vue/compiler-ssr': 3.2.39 @@ -7896,7 +7867,7 @@ packages: /@vue/compiler-sfc/3.2.41: resolution: {integrity: sha512-+1P2m5kxOeaxVmJNXnBskAn3BenbTmbxBxWOtBq3mQTCokIreuMULFantBUclP0+KnzNCMOvcnKinqQZmiOF8w==} dependencies: - '@babel/parser': 7.18.13 + '@babel/parser': 7.20.0 '@vue/compiler-core': 3.2.41 '@vue/compiler-dom': 3.2.41 '@vue/compiler-ssr': 3.2.41 @@ -7935,7 +7906,7 @@ packages: /@vue/reactivity-transform/3.2.41: resolution: {integrity: sha512-mK5+BNMsL4hHi+IR3Ft/ho6Za+L3FA5j8WvreJ7XzHrqkPq8jtF/SMo7tuc9gHjLDwKZX1nP1JQOKo9IEAn54A==} dependencies: - '@babel/parser': 7.18.13 + '@babel/parser': 7.20.0 '@vue/compiler-core': 3.2.41 '@vue/shared': 3.2.41 estree-walker: 2.0.2 @@ -8040,8 +8011,8 @@ packages: vue: 3.2.41 dev: true - /@vue/test-utils/2.2.0_vue@3.2.41: - resolution: {integrity: sha512-EKp5/N7ieNZdoLTkD16j/irUjIEDN63QUIc41vLUMqGvSsTQN0QxbFiQqh5v49RPfS5vZH+DhjNUEkijCMOCSg==} + /@vue/test-utils/2.2.1_vue@3.2.41: + resolution: {integrity: sha512-AkLt24wnnxedJ3NX090JYiueog184QqlR5TVNZM+lggCrK8XjeuPr274okaLqDmiRgp4XVCaGa07KqKLGQbsMQ==} peerDependencies: vue: ^3.0.1 dependencies: @@ -11851,7 +11822,7 @@ packages: peerDependencies: eslint: '>=8.18.0' dependencies: - '@babel/helper-validator-identifier': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 ci-info: 3.3.2 clean-regexp: 1.0.0 eslint: 8.26.0 @@ -14424,7 +14395,7 @@ packages: dependencies: '@jest/types': 26.6.2 '@types/graceful-fs': 4.1.5 - '@types/node': 18.11.7 + '@types/node': 18.11.9 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.10 @@ -14492,7 +14463,7 @@ packages: resolution: {integrity: sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==} engines: {node: '>= 10.14.2'} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 graceful-fs: 4.2.10 dev: true @@ -14501,7 +14472,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/node': 18.11.7 + '@types/node': 18.11.9 chalk: 4.1.2 graceful-fs: 4.2.10 is-ci: 2.0.0 @@ -14513,7 +14484,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.0.1 - '@types/node': 18.11.7 + '@types/node': 18.11.9 chalk: 4.1.2 ci-info: 3.3.2 graceful-fs: 4.2.10 @@ -14524,7 +14495,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -14533,7 +14504,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.11.7 + '@types/node': 18.11.9 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -14681,6 +14652,47 @@ packages: - utf-8-validate dev: true + /jsdom/20.0.2: + resolution: {integrity: sha512-AHWa+QO/cgRg4N+DsmHg1Y7xnz+8KU3EflM0LVDTdmrYOc1WWTSkOjtpUveQH+1Bqd5rtcVnb/DuxV/UjDO4rA==} + engines: {node: '>=14'} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + dependencies: + abab: 2.0.6 + acorn: 8.8.0 + acorn-globals: 7.0.1 + cssom: 0.5.0 + cssstyle: 2.3.0 + data-urls: 3.0.2 + decimal.js: 10.4.1 + domexception: 4.0.0 + escodegen: 2.0.0 + form-data: 4.0.0 + html-encoding-sniffer: 3.0.0 + http-proxy-agent: 5.0.0 + https-proxy-agent: 5.0.1 + is-potential-custom-element-name: 1.0.1 + nwsapi: 2.2.2 + parse5: 7.1.1 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 4.1.2 + w3c-xmlserializer: 3.0.0 + webidl-conversions: 7.0.0 + whatwg-encoding: 2.0.0 + whatwg-mimetype: 3.0.0 + whatwg-url: 11.0.0 + ws: 8.10.0 + xml-name-validator: 4.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /jsesc/0.5.0: resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} hasBin: true @@ -17271,7 +17283,7 @@ packages: hasBin: true dependencies: '@babel/core': 7.19.6 - '@babel/generator': 7.18.13 + '@babel/generator': 7.20.0 ast-types: 0.14.2 commander: 2.20.3 doctrine: 3.0.0 @@ -18475,9 +18487,9 @@ packages: peerDependencies: solid-js: ^1.3 dependencies: - '@babel/generator': 7.18.13 + '@babel/generator': 7.20.0 '@babel/helper-module-imports': 7.18.6 - '@babel/types': 7.18.13 + '@babel/types': 7.20.0 solid-js: 1.5.2 dev: true diff --git a/test/typescript/failing/expect-error.test-d.ts b/test/typescript/failing/expect-error.test-d.ts new file mode 100644 index 000000000000..ba2277ca4a7f --- /dev/null +++ b/test/typescript/failing/expect-error.test-d.ts @@ -0,0 +1,6 @@ +import { expectTypeOf, test } from 'vitest' + +test('failing test with expect-error', () => { + // @ts-expect-error expect nothing + expectTypeOf(1).toEqualTypeOf() +}) diff --git a/test/typescript/failing/fail.test-d.ts b/test/typescript/failing/fail.test-d.ts index b05bbbceb1f1..3c0393858ca2 100644 --- a/test/typescript/failing/fail.test-d.ts +++ b/test/typescript/failing/fail.test-d.ts @@ -13,3 +13,4 @@ describe('nested suite', () => { expectTypeOf(1).toBeVoid() }) + From 48ca8c2d5287f198e7dd2cc52a5f286e6725045a Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 28 Oct 2022 00:01:09 +0800 Subject: [PATCH 29/33] chore: add test --- test/typescript/test-d/test.test-d.ts | 12 ++++++++++++ test/typescript/test/runner.test.ts | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/test/typescript/test-d/test.test-d.ts b/test/typescript/test-d/test.test-d.ts index 9a3f1e45f67f..dcbd61361c37 100644 --- a/test/typescript/test-d/test.test-d.ts +++ b/test/typescript/test-d/test.test-d.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ import { describe, expectTypeOf, test } from 'vitest' describe('test', () => { @@ -21,6 +22,17 @@ describe('test', () => { expectTypeOf(45).toEqualTypeOf(45) }) }) + + test('ignored error', () => { + // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error + // @ts-ignore + expectTypeOf(45).toEqualTypeOf() + }) + + test('expected error', () => { + // @ts-expect-error + expectTypeOf(45).toEqualTypeOf() + }) }) expectTypeOf({ wolk: 'true' }).toHaveProperty('wolk') diff --git a/test/typescript/test/runner.test.ts b/test/typescript/test/runner.test.ts index a1e9b033e83f..16f4866c5a1a 100644 --- a/test/typescript/test/runner.test.ts +++ b/test/typescript/test/runner.test.ts @@ -7,7 +7,7 @@ describe('should fails', async () => { const root = resolve(__dirname, '../failing') const files = await fg('*.test-d.*', { cwd: root }) - it('typechek files', async () => { + it('typecheck files', async () => { // in Windows child_process is very unstable, we skip testing it if (process.platform === 'win32' && process.env.CI) return From 0c1d5f6b536ca4d14be898047550c0d09aac83bb Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 7 Nov 2022 20:55:33 +0800 Subject: [PATCH 30/33] chore: fix build --- packages/vite-node/package.json | 2 ++ packages/vitest/package.json | 1 + packages/vitest/src/typecheck/typechecker.ts | 2 +- pnpm-lock.yaml | 13 +++++++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/vite-node/package.json b/packages/vite-node/package.json index 96ce0e85ba50..ac8a7c1b8ac1 100644 --- a/packages/vite-node/package.json +++ b/packages/vite-node/package.json @@ -78,11 +78,13 @@ "debug": "^4.3.4", "mlly": "^0.5.16", "pathe": "^0.2.0", + "source-map": "^0.6.1", "source-map-support": "^0.5.21", "vite": "^3.0.0" }, "devDependencies": { "@types/debug": "^4.1.7", + "@types/source-map": "^0.5.7", "@types/source-map-support": "^0.5.6", "cac": "^6.7.14", "picocolors": "^1.0.0", diff --git a/packages/vitest/package.json b/packages/vitest/package.json index a9a781d72443..460c6e4d92a9 100644 --- a/packages/vitest/package.json +++ b/packages/vitest/package.json @@ -113,6 +113,7 @@ "chai": "^4.3.6", "debug": "^4.3.4", "local-pkg": "^0.4.2", + "source-map": "^0.6.1", "strip-literal": "^0.4.2", "tinybench": "^2.3.1", "tinypool": "^0.3.0", diff --git a/packages/vitest/src/typecheck/typechecker.ts b/packages/vitest/src/typecheck/typechecker.ts index b8bc896784ff..be22befc5776 100644 --- a/packages/vitest/src/typecheck/typechecker.ts +++ b/packages/vitest/src/typecheck/typechecker.ts @@ -2,7 +2,7 @@ import { rm } from 'fs/promises' import type { ExecaChildProcess } from 'execa' import { execaCommand } from 'execa' import { resolve } from 'pathe' -import { SourceMapConsumer } from 'source-map-js' +import { SourceMapConsumer } from 'source-map' import { ensurePackageInstalled } from '../utils' import type { Awaitable, File, ParsedStack, Task, TscErrorInfo, Vitest } from '../types' import { getRawErrsMapFromTsCompile, getTsconfigPath } from './parse' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c25fc191cad3..7e72b2845572 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -748,6 +748,7 @@ importers: packages/vite-node: specifiers: '@types/debug': ^4.1.7 + '@types/source-map': ^0.5.7 '@types/source-map-support': ^0.5.6 cac: ^6.7.14 debug: ^4.3.4 @@ -755,16 +756,19 @@ importers: pathe: ^0.2.0 picocolors: ^1.0.0 rollup: ^2.79.0 + source-map: ^0.6.1 source-map-support: ^0.5.21 vite: ^3.2.0 dependencies: debug: 4.3.4 mlly: 0.5.16 pathe: 0.2.0 + source-map: 0.6.1 source-map-support: 0.5.21 vite: 3.2.2 devDependencies: '@types/debug': 4.1.7 + '@types/source-map': 0.5.7 '@types/source-map-support': 0.5.6 cac: 6.7.14 picocolors: 1.0.0 @@ -816,6 +820,7 @@ importers: pretty-format: ^27.5.1 prompts: ^2.4.2 rollup: ^2.79.0 + source-map: ^0.6.1 strip-ansi: ^7.0.1 strip-literal: ^0.4.2 tinybench: ^2.3.1 @@ -834,6 +839,7 @@ importers: chai: 4.3.6 debug: 4.3.4 local-pkg: 0.4.2 + source-map: 0.6.1 strip-literal: 0.4.2 tinybench: 2.3.1 tinypool: 0.3.0 @@ -7214,6 +7220,13 @@ packages: source-map: 0.6.1 dev: true + /@types/source-map/0.5.7: + resolution: {integrity: sha512-LrnsgZIfJaysFkv9rRJp4/uAyqw87oVed3s1hhF83nwbo9c7MG9g5DqR0seHP+lkX4ldmMrVolPjQSe2ZfD0yA==} + deprecated: This is a stub types definition for source-map (https://github.com/mozilla/source-map). source-map provides its own type definitions, so you don't need @types/source-map installed! + dependencies: + source-map: 0.7.4 + dev: true + /@types/stack-utils/2.0.1: resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} dev: true From b7858866d826adc1c765b5503929926e0d447fdf Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 7 Nov 2022 21:39:01 +0800 Subject: [PATCH 31/33] chore: cleanup --- packages/vitest/src/node/error.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/vitest/src/node/error.ts b/packages/vitest/src/node/error.ts index 9dc1c99bb996..6c321b4b7aa8 100644 --- a/packages/vitest/src/node/error.ts +++ b/packages/vitest/src/node/error.ts @@ -46,8 +46,6 @@ export async function printError(error: unknown, ctx: Vitest, options: PrintErro const stacks = parseStacktrace(e, fullStack) - await interpretSourcePos(stacks, ctx) - const nearest = error instanceof TypeCheckError ? error.stacks[0] : stacks.find(stack => From d80ad38ae2eb44b5079cdfce14e3559e42119bb6 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 7 Nov 2022 22:26:53 +0800 Subject: [PATCH 32/33] chore: update --- packages/vitest/src/node/error.ts | 10 ++++----- packages/vitest/src/typecheck/parse.ts | 8 +++---- packages/vitest/src/typecheck/typechecker.ts | 18 +++++++-------- .../test/__snapshots__/runner.test.ts.snap | 22 ++++++++++++++----- test/typescript/test/runner.test.ts | 12 +++++----- 5 files changed, 40 insertions(+), 30 deletions(-) diff --git a/packages/vitest/src/node/error.ts b/packages/vitest/src/node/error.ts index 6c321b4b7aa8..c825909fdad6 100644 --- a/packages/vitest/src/node/error.ts +++ b/packages/vitest/src/node/error.ts @@ -65,7 +65,7 @@ export async function printError(error: unknown, ctx: Vitest, options: PrintErro // for example, when there is a source map file, but no source in node_modules if (nearest.file === file || existsSync(file)) { const sourceCode = readFileSync(file, 'utf-8') - ctx.logger.log(c.yellow(generateCodeFrame(sourceCode, 4, pos))) + ctx.logger.error(c.yellow(generateCodeFrame(sourceCode, 4, pos))) } } }) @@ -180,19 +180,19 @@ function printStack( const file = fileFromParsedStack(frame) const path = relative(ctx.config.root, file) - logger.log(color(` ${c.dim(F_POINTER)} ${[frame.method, c.dim(`${path}:${pos.line}:${pos.column}`)].filter(Boolean).join(' ')}`)) + logger.error(color(` ${c.dim(F_POINTER)} ${[frame.method, c.dim(`${path}:${pos.line}:${pos.column}`)].filter(Boolean).join(' ')}`)) onStack?.(frame, pos) // reached at test file, skip the follow stack if (frame.file in ctx.state.filesMap) break } - logger.log() + logger.error() const hasProperties = Object.keys(errorProperties).length > 0 if (hasProperties) { - logger.log(c.red(c.dim(divider()))) + logger.error(c.red(c.dim(divider()))) const propertiesString = stringify(errorProperties, 10, { printBasicPrototype: false }) - logger.log(c.red(c.bold('Serialized Error:')), c.gray(propertiesString)) + logger.error(c.red(c.bold('Serialized Error:')), c.gray(propertiesString)) } } diff --git a/packages/vitest/src/typecheck/parse.ts b/packages/vitest/src/typecheck/parse.ts index 83e97957eff2..34adb3137aae 100644 --- a/packages/vitest/src/typecheck/parse.ts +++ b/packages/vitest/src/typecheck/parse.ts @@ -58,7 +58,7 @@ export async function makeTscErrorInfo( } export async function getTsconfigPath(root: string, config: TypecheckConfig) { - const tmpConfigPath = path.join(root, 'tsconfig.tmp.json') + const tempConfigPath = path.join(root, 'tsconfig.temp.json') const configName = config.tsconfig?.includes('jsconfig.json') ? 'jsconfig.json' @@ -81,11 +81,11 @@ export async function getTsconfigPath(root: string, config: TypecheckConfig) { ) const tsconfigFinalContent = JSON.stringify(tmpTsConfig, null, 2) - await writeFile(tmpConfigPath, tsconfigFinalContent) - return tmpConfigPath + await writeFile(tempConfigPath, tsconfigFinalContent) + return tempConfigPath } catch (err) { - throw new Error('failed to write tsconfig.tmp.json', { cause: err }) + throw new Error('failed to write tsconfig.temp.json', { cause: err }) } } diff --git a/packages/vitest/src/typecheck/typechecker.ts b/packages/vitest/src/typecheck/typechecker.ts index be22befc5776..4a4508a8eedd 100644 --- a/packages/vitest/src/typecheck/typechecker.ts +++ b/packages/vitest/src/typecheck/typechecker.ts @@ -1,6 +1,6 @@ import { rm } from 'fs/promises' import type { ExecaChildProcess } from 'execa' -import { execaCommand } from 'execa' +import { execa } from 'execa' import { resolve } from 'pathe' import { SourceMapConsumer } from 'source-map' import { ensurePackageInstalled } from '../utils' @@ -35,7 +35,7 @@ export class Typechecker { } private _tests: Record | null = {} - private tmpConfigPath?: string + private tempConfigPath?: string private process!: ExecaChildProcess constructor(protected ctx: Vitest, protected files: string[]) {} @@ -167,8 +167,8 @@ export class Typechecker { } public async clear() { - if (this.tmpConfigPath) - await rm(this.tmpConfigPath) + if (this.tempConfigPath) + await rm(this.tempConfigPath, { force: true }) } public async stop() { @@ -187,15 +187,15 @@ export class Typechecker { const { root, watch, typecheck } = this.ctx.config await this.ensurePackageInstalled(root, typecheck.checker) - this.tmpConfigPath = await getTsconfigPath(root, typecheck) - let cmd = `${typecheck.checker} --noEmit --pretty false -p ${this.tmpConfigPath}` + this.tempConfigPath = await getTsconfigPath(root, typecheck) + const args = ['--noEmit', '--pretty', 'false', '-p', this.tempConfigPath] // use builtin watcher, because it's faster if (watch) - cmd += ' --watch' + args.push('--watch') if (typecheck.allowJs) - cmd += ' --allowJs --checkJs' + args.push('--allowJs', '--checkJs') let output = '' - const child = execaCommand(cmd, { + const child = execa(typecheck.checker, args, { cwd: root, stdout: 'pipe', reject: false, diff --git a/test/typescript/test/__snapshots__/runner.test.ts.snap b/test/typescript/test/__snapshots__/runner.test.ts.snap index 8211b18af280..fedcd22e556b 100644 --- a/test/typescript/test/__snapshots__/runner.test.ts.snap +++ b/test/typescript/test/__snapshots__/runner.test.ts.snap @@ -1,6 +1,17 @@ // Vitest Snapshot v1 -exports[`should fails > typechek files > fail.test-d.ts 1`] = ` +exports[`should fails > typecheck files > expect-error.test-d.ts 1`] = ` +" ❯ expect-error.test-d.ts:4:3 + 2| + 3| test('failing test with expect-error', () => { + 4| // @ts-expect-error expect nothing + | ^ + 5| expectTypeOf(1).toEqualTypeOf() + 6| }) +" +`; + +exports[`should fails > typecheck files > fail.test-d.ts 1`] = ` " ❯ fail.test-d.ts:4:19 2| 3| test('failing test', () => { @@ -11,7 +22,7 @@ exports[`should fails > typechek files > fail.test-d.ts 1`] = ` " `; -exports[`should fails > typechek files > js-fail.test-d.js 1`] = ` +exports[`should fails > typecheck files > js-fail.test-d.js 1`] = ` " ❯ js-fail.test-d.js:6:19 4| 5| test('js test fails', () => { @@ -22,7 +33,7 @@ exports[`should fails > typechek files > js-fail.test-d.js 1`] = ` " `; -exports[`should fails > typechek files > only.test-d.ts 1`] = ` +exports[`should fails > typecheck files > only.test-d.ts 1`] = ` " ❯ only.test-d.ts:4:19 2| 3| test.only('failing test', () => { @@ -33,10 +44,11 @@ exports[`should fails > typechek files > only.test-d.ts 1`] = ` " `; -exports[`should fails > typechek files 1`] = ` +exports[`should fails > typecheck files 1`] = ` "TypeCheckError: Expected 1 arguments, but got 0. TypeCheckError: Expected 1 arguments, but got 0. TypeCheckError: Expected 1 arguments, but got 0. TypeCheckError: Expected 1 arguments, but got 0. -TypeCheckError: Expected 1 arguments, but got 0." +TypeCheckError: Expected 1 arguments, but got 0. +TypeCheckError: Unused '@ts-expect-error' directive." `; diff --git a/test/typescript/test/runner.test.ts b/test/typescript/test/runner.test.ts index 16f4866c5a1a..31f5c3360f7f 100644 --- a/test/typescript/test/runner.test.ts +++ b/test/typescript/test/runner.test.ts @@ -12,7 +12,7 @@ describe('should fails', async () => { if (process.platform === 'win32' && process.env.CI) return - const { stdout, stderr } = await execa('npx', [ + const { stderr } = await execa('npx', [ 'vitest', 'typecheck', '--dir', @@ -30,17 +30,15 @@ describe('should fails', async () => { }) expect(stderr).toBeTruthy() - const msg = String(stderr) - .split(/\n/g) - .reverse() + const lines = String(stderr).split(/\n/g) + const msg = lines .filter(i => i.includes('TypeCheckError: ')) + .reverse() .join('\n') - ?.trim() + .trim() .replace(root, '') expect(msg).toMatchSnapshot() - const lines = stdout.split(/\n/g) - files.forEach((file) => { const index = lines.findIndex(val => val.includes(`${file}:`)) const msg = lines.slice(index, index + 8).join('\n') From 1f10e9cc9f436ce01028d7a681c7dfb88a978d9b Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 7 Nov 2022 22:54:50 +0800 Subject: [PATCH 33/33] chore: update --- packages/vitest/src/node/error.ts | 27 ++++++++++++------- .../test/__snapshots__/runner.test.ts.snap | 4 +-- test/stacktraces/test/runner.test.ts | 26 ++++++++---------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/packages/vitest/src/node/error.ts b/packages/vitest/src/node/error.ts index c825909fdad6..cb06ed529dc6 100644 --- a/packages/vitest/src/node/error.ts +++ b/packages/vitest/src/node/error.ts @@ -58,17 +58,24 @@ export async function printError(error: unknown, ctx: Vitest, options: PrintErro if (type) printErrorType(type, ctx) printErrorMessage(e, ctx.logger) - printStack(ctx, stacks, nearest, errorProperties, (s, pos) => { - if (showCodeFrame && s === nearest && nearest) { - const file = fileFromParsedStack(nearest) - // could point to non-existing original file - // for example, when there is a source map file, but no source in node_modules - if (nearest.file === file || existsSync(file)) { - const sourceCode = readFileSync(file, 'utf-8') - ctx.logger.error(c.yellow(generateCodeFrame(sourceCode, 4, pos))) + + // if the error provide the frame + if (e.frame) { + ctx.logger.error(c.yellow(e.frame)) + } + else { + printStack(ctx, stacks, nearest, errorProperties, (s, pos) => { + if (showCodeFrame && s === nearest && nearest) { + const file = fileFromParsedStack(nearest) + // could point to non-existing original file + // for example, when there is a source map file, but no source in node_modules + if (nearest.file === file || existsSync(file)) { + const sourceCode = readFileSync(file, 'utf-8') + ctx.logger.error(c.yellow(generateCodeFrame(sourceCode, 4, pos))) + } } - } - }) + }) + } if (e.cause && 'name' in e.cause) { (e.cause as any).name = `Caused by: ${(e.cause as any).name}` diff --git a/test/stacktraces/test/__snapshots__/runner.test.ts.snap b/test/stacktraces/test/__snapshots__/runner.test.ts.snap index 421a5591b00f..706d64998dc1 100644 --- a/test/stacktraces/test/__snapshots__/runner.test.ts.snap +++ b/test/stacktraces/test/__snapshots__/runner.test.ts.snap @@ -1,8 +1,8 @@ // Vitest Snapshot v1 exports[`stacktraces should pick error frame if present > frame.spec.imba > frame.spec.imba 1`] = ` -" ❯ frame.spec.imba (0 test) - +" FAIL frame.spec.imba [ frame.spec.imba ] +imba-parser error: Unexpected 'CALL_END' 4 | test(\\"1+1\\") do 5 | expect(1+1).toBe 2 6 | frame. diff --git a/test/stacktraces/test/runner.test.ts b/test/stacktraces/test/runner.test.ts index 2e96047586e6..4c9254afa4c1 100644 --- a/test/stacktraces/test/runner.test.ts +++ b/test/stacktraces/test/runner.test.ts @@ -13,21 +13,19 @@ describe('stacktraces should respect sourcemaps', async () => { if (process.platform === 'win32' && process.env.CI) return - let error: any - await execa('npx', ['vitest', 'run', file], { + const { stderr } = await execa('npx', ['vitest', 'run', file], { cwd: root, + reject: false, + stdio: 'pipe', env: { ...process.env, CI: 'true', NO_COLOR: 'true', }, }) - .catch((e) => { - error = e - }) - expect(error).toBeTruthy() - const lines = String(error).split(/\n/g) + expect(stderr).toBeTruthy() + const lines = String(stderr).split(/\n/g) const index = lines.findIndex(val => val.includes(`${file}:`)) const msg = lines.slice(index, index + 8).join('\n') expect(msg).toMatchSnapshot(file) @@ -45,22 +43,20 @@ describe('stacktraces should pick error frame if present', async () => { if (process.platform === 'win32' && process.env.CI) return - let error: any - await execa('npx', ['vitest', 'run', file], { + const { stderr } = await execa('npx', ['vitest', 'run', file], { cwd: root, + reject: false, + stdio: 'pipe', env: { ...process.env, CI: 'true', NO_COLOR: 'true', }, }) - .catch((e) => { - error = e - }) - expect(error).toBeTruthy() - const lines = String(error).split(/\n/g) - const index = lines.findIndex(val => val.includes('(0 test)')) + expect(stderr).toBeTruthy() + const lines = String(stderr).split(/\n/g) + const index = lines.findIndex(val => val.includes('FAIL')) const msg = lines.slice(index, index + 8).join('\n') expect(msg).toMatchSnapshot(file) }, 30000)