From 0c1213413a2c0c577141036530dae8c29fffc389 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 11 Aug 2022 21:58:08 +0800 Subject: [PATCH 01/17] feat: support object style hooks --- package.json | 3 +- packages/vite/src/node/build.ts | 61 ++++-- packages/vite/src/node/plugin.ts | 57 +++--- .../vite/src/node/server/pluginContainer.ts | 160 +++++++++++---- .../__tests__/object-hooks.spec.ts | 5 + playground/object-hooks/index.html | 4 + playground/object-hooks/main.ts | 2 + playground/object-hooks/package.json | 14 ++ playground/object-hooks/vite.config.ts | 69 +++++++ pnpm-lock.yaml | 189 +++++++----------- 10 files changed, 370 insertions(+), 194 deletions(-) create mode 100644 playground/object-hooks/__tests__/object-hooks.spec.ts create mode 100644 playground/object-hooks/index.html create mode 100644 playground/object-hooks/main.ts create mode 100644 playground/object-hooks/package.json create mode 100644 playground/object-hooks/vite.config.ts diff --git a/package.json b/package.json index 8c0f9a07e76a9a..260969be5c372b 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,8 @@ "pnpm": { "overrides": { "vite": "workspace:*", - "@vitejs/plugin-vue": "workspace:*" + "@vitejs/plugin-vue": "workspace:*", + "rollup": "file:/Users/antfu/f/rollup" }, "packageExtensions": { "postcss-load-config": { diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index fffeae697abc8b..ba5b0f739f331e 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -16,7 +16,6 @@ import type { WarningHandler, WatcherOptions } from 'rollup' -import type Rollup from 'rollup' import type { Terser } from 'types/terser' import commonjsPlugin from '@rollup/plugin-commonjs' import type { RollupCommonJSOptions } from 'types/commonjs' @@ -312,7 +311,7 @@ export function resolveBuildPlugins(config: ResolvedConfig): { ...(options.rollupOptions.plugins ? (options.rollupOptions.plugins.filter(Boolean) as Plugin[]) : []) - ], + ] as Plugin[], post: [ buildImportAnalysisPlugin(config), ...(config.esbuild !== false ? [buildEsbuildPlugin(config)] : []), @@ -321,7 +320,7 @@ export function resolveBuildPlugins(config: ResolvedConfig): { ...(options.ssrManifest ? [ssrManifestPlugin(config)] : []), buildReporterPlugin(config), loadFallbackPlugin() - ] + ] as Plugin[] } } @@ -387,7 +386,9 @@ async function doBuild( // inject ssr arg to plugin load/transform hooks const plugins = ( - ssr ? config.plugins.map((p) => injectSsrFlagToHooks(p)) : config.plugins + ssr + ? config.plugins.map((p) => injectSsrFlagToHooks(p as Plugin)) + : config.plugins ) as Plugin[] const userExternal = options.rollupOptions?.external @@ -791,34 +792,60 @@ function injectSsrFlagToHooks(plugin: Plugin): Plugin { } } -function wrapSsrResolveId( - fn?: Rollup.ResolveIdHook -): Rollup.ResolveIdHook | undefined { - if (!fn) return +function wrapSsrResolveId(hook?: Plugin['resolveId']): Plugin['resolveId'] { + if (!hook) return - return function (id, importer, options) { + const fn = 'handler' in hook ? hook.handler : hook + const handler: Plugin['resolveId'] = function (id, importer, options) { return fn.call(this, id, importer, injectSsrFlag(options)) } + + if ('handler' in hook) { + return { + ...hook, + handler + } as Plugin['resolveId'] + } else { + return handler + } } -function wrapSsrLoad(fn?: Rollup.LoadHook): Rollup.LoadHook | undefined { - if (!fn) return +function wrapSsrLoad(hook?: Plugin['load']): Plugin['load'] { + if (!hook) return - return function (id, ...args) { + const fn = 'handler' in hook ? hook.handler : hook + const handler: Plugin['load'] = function (id, ...args) { // @ts-expect-error: Receiving options param to be future-proof if Rollup adds it return fn.call(this, id, injectSsrFlag(args[0])) } + + if ('handler' in hook) { + return { + ...hook, + handler + } as Plugin['load'] + } else { + return handler + } } -function wrapSsrTransform( - fn?: Rollup.TransformHook -): Rollup.TransformHook | undefined { - if (!fn) return +function wrapSsrTransform(hook?: Plugin['transform']): Plugin['transform'] { + if (!hook) return - return function (code, importer, ...args) { + const fn = 'handler' in hook ? hook.handler : hook + const handler: Plugin['transform'] = function (code, importer, ...args) { // @ts-expect-error: Receiving options param to be future-proof if Rollup adds it return fn.call(this, code, importer, injectSsrFlag(args[0])) } + + if ('handler' in hook) { + return { + ...hook, + handler + } as Plugin['transform'] + } else { + return handler + } } function injectSsrFlag>( diff --git a/packages/vite/src/node/plugin.ts b/packages/vite/src/node/plugin.ts index 69b19415b0daa7..7edfc2ba4f1b7e 100644 --- a/packages/vite/src/node/plugin.ts +++ b/packages/vite/src/node/plugin.ts @@ -1,6 +1,7 @@ import type { CustomPluginOptions, LoadResult, + ObjectHook, PluginContext, ResolveIdResult, Plugin as RollupPlugin, @@ -128,29 +129,35 @@ export interface Plugin extends RollupPlugin { /** * extend hooks with ssr flag */ - resolveId?: ( - this: PluginContext, - source: string, - importer: string | undefined, - options: { - custom?: CustomPluginOptions - ssr?: boolean - /** - * @internal - */ - scan?: boolean - isEntry: boolean - } - ) => Promise | ResolveIdResult - load?: ( - this: PluginContext, - id: string, - options?: { ssr?: boolean } - ) => Promise | LoadResult - transform?: ( - this: TransformPluginContext, - code: string, - id: string, - options?: { ssr?: boolean } - ) => Promise | TransformResult + resolveId?: ObjectHook< + ( + this: PluginContext, + source: string, + importer: string | undefined, + options: { + custom?: CustomPluginOptions + ssr?: boolean + /** + * @internal + */ + scan?: boolean + isEntry: boolean + } + ) => Promise | ResolveIdResult + > + load?: ObjectHook< + ( + this: PluginContext, + id: string, + options?: { ssr?: boolean } + ) => Promise | LoadResult + > + transform?: ObjectHook< + ( + this: TransformPluginContext, + code: string, + id: string, + options?: { ssr?: boolean } + ) => Promise | TransformResult + > } diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index fc1523fc7888a0..ab2e830846110b 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -34,14 +34,17 @@ import { join, resolve } from 'node:path' import { performance } from 'node:perf_hooks' import { createRequire } from 'node:module' import type { + AsyncPluginHooks, CustomPluginOptions, EmittedFile, + FunctionPluginHooks, InputOptions, LoadResult, MinimalPluginContext, ModuleInfo, NormalizedInputOptions, OutputOptions, + ParallelPluginHooks, PartialResolvedId, ResolvedId, RollupError, @@ -181,6 +184,71 @@ export async function createPluginContainer( } } + function getOrCreate(map: Map, key: K, init: () => V): V { + const existing = map.get(key) + if (existing) { + return existing + } + const value = init() + map.set(key, value) + return value + } + + const sortedPlugins = new Map() + + function getSortedPlugins( + hookName: keyof Plugin, + validateHandler?: ( + handler: unknown, + hookName: string, + plugin: Plugin + ) => void + ): Plugin[] { + return getOrCreate(sortedPlugins, hookName, () => + getSortedValidatedPlugins(hookName, plugins, validateHandler) + ) + } + + function validateFunctionPluginHandler( + handler: unknown, + hookName: string, + plugin: Plugin + ) { + if (typeof handler !== 'function') { + // TODO: + } + } + + function getSortedValidatedPlugins( + hookName: keyof Plugin, + plugins: readonly Plugin[], + validateHandler = validateFunctionPluginHandler + ): Plugin[] { + const pre: Plugin[] = [] + const normal: Plugin[] = [] + const post: Plugin[] = [] + for (const plugin of plugins) { + const hook = plugin[hookName] + if (hook) { + if (typeof hook === 'object') { + validateHandler(hook.handler, hookName, plugin) + if (hook.order === 'pre') { + pre.push(plugin) + continue + } + if (hook.order === 'post') { + post.push(plugin) + continue + } + } else { + validateHandler(hook, hookName, plugin) + } + normal.push(plugin) + } + } + return [...pre, ...normal, ...post] + } + function warnIncompatibleMethod(method: string, plugin: string) { logger.warn( colors.cyan(`[plugin:${plugin}] `) + @@ -192,6 +260,30 @@ export async function createPluginContainer( ) } + // parallel, ignores returns + async function hookParallel( + hookName: H, + args: (plugin: Plugin) => Parameters + ): Promise { + const parallelPromises: Promise[] = [] + for (const plugin of getSortedPlugins(hookName)) { + if (!plugin[hookName]) continue + // @ts-expect-error + const handler = + 'handler' in plugin[hookName] + ? plugin[hookName]!.handler + : plugin[hookName] + if ((plugin[hookName] as { sequential?: boolean }).sequential) { + await Promise.all(parallelPromises) + parallelPromises.length = 0 + await handler.call(...args(plugin)) + } else { + parallelPromises.push(handler.call(...args(plugin))) + } + } + await Promise.all(parallelPromises) + } + // throw when an unsupported ModuleInfo property is accessed, // so that incompatible plugins fail in a non-cryptic way. const ModuleInfoProxy: ProxyHandler = { @@ -500,10 +592,11 @@ export async function createPluginContainer( const container: PluginContainer = { options: await (async () => { let options = rollupOptions - for (const plugin of plugins) { + for (const plugin of getSortedPlugins('options')) { if (!plugin.options) continue - options = - (await plugin.options.call(minimalContext, options)) || options + const handler = + 'handler' in plugin.options ? plugin.options.handler : plugin.options + options = (await handler.call(minimalContext, options)) || options } if (options.acornInjectPlugins) { parser = acorn.Parser.extend( @@ -520,15 +613,13 @@ export async function createPluginContainer( getModuleInfo, async buildStart() { - await Promise.all( - plugins.map((plugin) => { - if (plugin.buildStart) { - return plugin.buildStart.call( - new Context(plugin) as any, - container.options as NormalizedInputOptions - ) - } - }) + await hookParallel( + 'buildStart', + (plugin) => + [ + new Context(plugin), + container.options as NormalizedInputOptions + ] as any ) }, @@ -544,24 +635,23 @@ export async function createPluginContainer( let id: string | null = null const partial: Partial = {} - for (const plugin of plugins) { + for (const plugin of getSortedPlugins('resolveId')) { if (!plugin.resolveId) continue if (skip?.has(plugin)) continue ctx._activePlugin = plugin const pluginResolveStart = isDebug ? performance.now() : 0 - const result = await plugin.resolveId.call( - ctx as any, - rawId, - importer, - { - custom: options?.custom, - isEntry: !!options?.isEntry, - ssr, - scan - } - ) + const handler = + 'handler' in plugin.resolveId + ? plugin.resolveId.handler + : plugin.resolveId + const result = await handler.call(ctx as any, rawId, importer, { + custom: options?.custom, + isEntry: !!options?.isEntry, + ssr, + scan + }) if (!result) continue if (typeof result === 'string') { @@ -607,10 +697,12 @@ export async function createPluginContainer( const ssr = options?.ssr const ctx = new Context() ctx.ssr = !!ssr - for (const plugin of plugins) { + for (const plugin of getSortedPlugins('load')) { if (!plugin.load) continue ctx._activePlugin = plugin - const result = await plugin.load.call(ctx as any, id, { ssr }) + const handler = + 'handler' in plugin.load ? plugin.load.handler : plugin.load + const result = await handler.call(ctx as any, id, { ssr }) if (result != null) { if (isObject(result)) { updateModuleInfo(id, result) @@ -626,15 +718,19 @@ export async function createPluginContainer( const ssr = options?.ssr const ctx = new TransformContext(id, code, inMap as SourceMap) ctx.ssr = !!ssr - for (const plugin of plugins) { + for (const plugin of getSortedPlugins('transform')) { if (!plugin.transform) continue ctx._activePlugin = plugin ctx._activeId = id ctx._activeCode = code const start = isDebug ? performance.now() : 0 let result: TransformResult | string | undefined + const handler = + 'handler' in plugin.transform + ? plugin.transform.handler + : plugin.transform try { - result = await plugin.transform.call(ctx as any, code, id, { ssr }) + result = await handler.call(ctx as any, code, id, { ssr }) } catch (e) { ctx.error(e) } @@ -670,12 +766,8 @@ export async function createPluginContainer( async close() { if (closed) return const ctx = new Context() - await Promise.all( - plugins.map((p) => p.buildEnd && p.buildEnd.call(ctx as any)) - ) - await Promise.all( - plugins.map((p) => p.closeBundle && p.closeBundle.call(ctx as any)) - ) + await hookParallel('buildEnd', () => [ctx] as any) + await hookParallel('closeBundle', () => [ctx] as any) closed = true } } diff --git a/playground/object-hooks/__tests__/object-hooks.spec.ts b/playground/object-hooks/__tests__/object-hooks.spec.ts new file mode 100644 index 00000000000000..a169cdc69f24cd --- /dev/null +++ b/playground/object-hooks/__tests__/object-hooks.spec.ts @@ -0,0 +1,5 @@ +import { page } from '~utils' + +test('object hooks', async () => { + expect(await page.textContent('#transform')).toMatch('ok') +}) diff --git a/playground/object-hooks/index.html b/playground/object-hooks/index.html new file mode 100644 index 00000000000000..008ef32c159a6d --- /dev/null +++ b/playground/object-hooks/index.html @@ -0,0 +1,4 @@ +

Transform Hook order

+
+ + diff --git a/playground/object-hooks/main.ts b/playground/object-hooks/main.ts new file mode 100644 index 00000000000000..8e4878d209bf9e --- /dev/null +++ b/playground/object-hooks/main.ts @@ -0,0 +1,2 @@ +const app = document.getElementById('transform') +app.innerText = '__TRANSFORM__' diff --git a/playground/object-hooks/package.json b/playground/object-hooks/package.json new file mode 100644 index 00000000000000..380aaa142fd0c4 --- /dev/null +++ b/playground/object-hooks/package.json @@ -0,0 +1,14 @@ +{ + "name": "test-extensions", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "debug": "node --inspect-brk ../../packages/vite/bin/vite", + "preview": "vite preview" + }, + "dependencies": { + "vue": "^3.2.37" + } +} diff --git a/playground/object-hooks/vite.config.ts b/playground/object-hooks/vite.config.ts new file mode 100644 index 00000000000000..554462dc730df3 --- /dev/null +++ b/playground/object-hooks/vite.config.ts @@ -0,0 +1,69 @@ +/* eslint-disable import/no-nodejs-modules */ +import assert from 'assert' +import { defineConfig } from 'vite' + +let count = 0 +export default defineConfig({ + plugins: [ + { + name: 'plugin1', + buildStart: { + async handler() { + await new Promise((r) => setTimeout(r, 100)) + count += 1 + } + }, + transform: { + order: 'post', + handler(code) { + return code.replace('__TRANSFORM3__', 'ok') + } + } + }, + { + name: 'plugin2', + buildStart: { + sequential: true, + async handler() { + assert(count === 1) + await new Promise((r) => setTimeout(r, 100)) + count += 1 + } + }, + transform: { + handler(code) { + return code.replace('__TRANSFORM1__', '__TRANSFORM2__') + } + } + }, + { + name: 'plugin3', + buildStart: { + async handler() { + assert(count === 2) + await new Promise((r) => setTimeout(r, 100)) + count += 1 + } + }, + transform: { + order: 'pre', + handler(code) { + return code.replace('__TRANSFORM__', '__TRANSFORM1__') + } + } + }, + { + name: 'plugin4', + buildStart: { + async handler() { + assert(count === 2) + } + }, + transform: { + handler(code) { + return code.replace('__TRANSFORM2__', '__TRANSFORM3__') + } + } + } + ] +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6261eb2fcba374..f9ae573dc6c886 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,6 +3,7 @@ lockfileVersion: 5.4 overrides: vite: workspace:* '@vitejs/plugin-vue': workspace:* + rollup: file:/Users/antfu/f/rollup packageExtensionsChecksum: 696422bac84dd936748019990f84746e @@ -51,7 +52,7 @@ importers: prettier: 2.7.1 prompts: ^2.4.2 rimraf: ^3.0.2 - rollup: ^2.75.6 + rollup: file:/Users/antfu/f/rollup semver: ^7.3.7 simple-git-hooks: ^2.8.0 tslib: ^2.4.0 @@ -65,7 +66,7 @@ importers: devDependencies: '@babel/types': 7.18.10 '@microsoft/api-extractor': 7.29.0 - '@rollup/plugin-typescript': 8.3.4_uct5nfewsakxkk4livyn3qaf3e + '@rollup/plugin-typescript': 8.3.4_g3vehnszjsenbs4mtbawzk7eky '@types/babel__core': 7.1.19 '@types/babel__standalone': 7.1.4 '@types/convert-source-map': 1.5.2 @@ -104,7 +105,7 @@ importers: prettier: 2.7.1 prompts: 2.4.2 rimraf: 3.0.2 - rollup: 2.75.6 + rollup: file:../../f/rollup semver: 7.3.7 simple-git-hooks: 2.8.0 tslib: 2.4.0 @@ -171,7 +172,7 @@ importers: '@jridgewell/gen-mapping': ^0.3.2 '@jridgewell/trace-mapping': ^0.3.14 debug: ^4.3.4 - rollup: ^2.75.6 + rollup: file:/Users/antfu/f/rollup slash: ^4.0.0 source-map: ^0.6.1 vite: workspace:* @@ -180,7 +181,7 @@ importers: '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.14 debug: 4.3.4 - rollup: 2.75.6 + rollup: file:../../f/rollup slash: 4.0.0 source-map: 0.6.1 vite: link:../vite @@ -249,7 +250,7 @@ importers: postcss-modules: ^4.3.1 resolve: ^1.22.1 resolve.exports: ^1.1.0 - rollup: ^2.75.6 + rollup: file:/Users/antfu/f/rollup rollup-plugin-license: ^2.8.1 sirv: ^2.0.2 source-map-js: ^1.0.2 @@ -265,7 +266,7 @@ importers: esbuild: 0.14.47 postcss: 8.4.16 resolve: 1.22.1 - rollup: 2.75.6 + rollup: file:../../f/rollup optionalDependencies: fsevents: 2.3.2 devDependencies: @@ -273,12 +274,12 @@ importers: '@babel/parser': 7.18.11 '@babel/types': 7.18.10 '@jridgewell/trace-mapping': 0.3.14 - '@rollup/plugin-alias': 3.1.9_rollup@2.75.6 - '@rollup/plugin-commonjs': 22.0.2_rollup@2.75.6 - '@rollup/plugin-dynamic-import-vars': 1.4.4_rollup@2.75.6 - '@rollup/plugin-json': 4.1.0_rollup@2.75.6 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.75.6 - '@rollup/plugin-typescript': 8.3.4_rollup@2.75.6+tslib@2.4.0 + '@rollup/plugin-alias': 3.1.9_rollup@2.77.2 + '@rollup/plugin-commonjs': 22.0.2_rollup@2.77.2 + '@rollup/plugin-dynamic-import-vars': 1.4.4_rollup@2.77.2 + '@rollup/plugin-json': 4.1.0_rollup@2.77.2 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.2 + '@rollup/plugin-typescript': 8.3.4_rollup@2.77.2+tslib@2.4.0 '@rollup/pluginutils': 4.2.1 '@vue/compiler-dom': 3.2.37 acorn: 8.8.0 @@ -311,7 +312,7 @@ importers: postcss-load-config: 4.0.1_postcss@8.4.16 postcss-modules: 4.3.1_postcss@8.4.16 resolve.exports: 1.1.0 - rollup-plugin-license: 2.8.1_rollup@2.75.6 + rollup-plugin-license: 2.8.1_rollup@2.77.2 sirv: 2.0.2 source-map-js: 1.0.2 source-map-support: 0.5.21 @@ -610,6 +611,12 @@ importers: dependencies: test-package-e-excluded: link:../test-package-e-excluded + playground/object-hooks: + specifiers: + vue: ^3.2.37 + dependencies: + vue: 3.2.37 + playground/optimize-deps: specifiers: '@vitejs/plugin-vue': workspace:* @@ -2368,59 +2375,49 @@ packages: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true - /@rollup/plugin-alias/3.1.9_rollup@2.75.6: + /@rollup/plugin-alias/3.1.9_rollup@2.77.2: resolution: {integrity: sha512-QI5fsEvm9bDzt32k39wpOwZhVzRcL5ydcffUHMyLVaVaLeC70I8TJZ17F1z1eMoLu4E/UOcH9BWVkKpIKdrfiw==} engines: {node: '>=8.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0 dependencies: - rollup: 2.75.6 + rollup: file:../../f/rollup slash: 3.0.0 dev: true - /@rollup/plugin-alias/3.1.9_rollup@2.77.0: - resolution: {integrity: sha512-QI5fsEvm9bDzt32k39wpOwZhVzRcL5ydcffUHMyLVaVaLeC70I8TJZ17F1z1eMoLu4E/UOcH9BWVkKpIKdrfiw==} - engines: {node: '>=8.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0 - dependencies: - rollup: 2.77.0 - slash: 3.0.0 - dev: true - - /@rollup/plugin-commonjs/22.0.1_rollup@2.77.0: + /@rollup/plugin-commonjs/22.0.1_rollup@2.77.2: resolution: {integrity: sha512-dGfEZvdjDHObBiP5IvwTKMVeq/tBZGMBHZFMdIV1ClMM/YoWS34xrHFGfag9SN2ZtMgNZRFruqvxZQEa70O6nQ==} engines: {node: '>= 12.0.0'} peerDependencies: rollup: ^2.68.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.0 + '@rollup/pluginutils': 3.1.0_rollup@2.77.2 commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.2.0 is-reference: 1.2.1 magic-string: 0.25.9 resolve: 1.22.1 - rollup: 2.77.0 + rollup: file:../../f/rollup dev: true - /@rollup/plugin-commonjs/22.0.2_rollup@2.75.6: + /@rollup/plugin-commonjs/22.0.2_rollup@2.77.2: resolution: {integrity: sha512-//NdP6iIwPbMTcazYsiBMbJW7gfmpHom33u1beiIoHDEM0Q9clvtQB1T0efvMqHeKsGohiHo97BCPCkBXdscwg==} engines: {node: '>= 12.0.0'} peerDependencies: rollup: ^2.68.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.75.6 + '@rollup/pluginutils': 3.1.0_rollup@2.77.2 commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.2.0 is-reference: 1.2.1 magic-string: 0.25.9 resolve: 1.22.1 - rollup: 2.75.6 + rollup: file:../../f/rollup dev: true - /@rollup/plugin-dynamic-import-vars/1.4.4_rollup@2.75.6: + /@rollup/plugin-dynamic-import-vars/1.4.4_rollup@2.77.2: resolution: {integrity: sha512-51BcU6ag9EeF09CtEsa5D/IHYo7KI42TR1Jc4doNzV1nHAiH7TvUi5vsLERFMjs9Gzy9K0otbZH/2wb0hpBhRA==} engines: {node: '>= 10.0.0'} peerDependencies: @@ -2430,68 +2427,44 @@ packages: estree-walker: 2.0.2 fast-glob: 3.2.11 magic-string: 0.25.9 - rollup: 2.75.6 - dev: true - - /@rollup/plugin-json/4.1.0_rollup@2.75.6: - resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} - peerDependencies: - rollup: ^1.20.0 || ^2.0.0 - dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.75.6 - rollup: 2.75.6 + rollup: file:../../f/rollup dev: true - /@rollup/plugin-json/4.1.0_rollup@2.77.0: + /@rollup/plugin-json/4.1.0_rollup@2.77.2: resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.0 - rollup: 2.77.0 + '@rollup/pluginutils': 3.1.0_rollup@2.77.2 + rollup: file:../../f/rollup dev: true - /@rollup/plugin-node-resolve/13.3.0_rollup@2.75.6: + /@rollup/plugin-node-resolve/13.3.0_rollup@2.77.2: resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} engines: {node: '>= 10.0.0'} peerDependencies: rollup: ^2.42.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.75.6 + '@rollup/pluginutils': 3.1.0_rollup@2.77.2 '@types/resolve': 1.17.1 deepmerge: 4.2.2 is-builtin-module: 3.1.0 is-module: 1.0.0 resolve: 1.22.1 - rollup: 2.75.6 + rollup: file:../../f/rollup dev: true - /@rollup/plugin-node-resolve/13.3.0_rollup@2.77.0: - resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} - engines: {node: '>= 10.0.0'} - peerDependencies: - rollup: ^2.42.0 - dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.0 - '@types/resolve': 1.17.1 - deepmerge: 4.2.2 - is-builtin-module: 3.1.0 - is-module: 1.0.0 - resolve: 1.22.1 - rollup: 2.77.0 - dev: true - - /@rollup/plugin-replace/4.0.0_rollup@2.77.0: + /@rollup/plugin-replace/4.0.0_rollup@2.77.2: resolution: {integrity: sha512-+rumQFiaNac9y64OHtkHGmdjm7us9bo1PlbgQfdihQtuNxzjpaB064HbRnewUOggLQxVCCyINfStkgmBeQpv1g==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.0 + '@rollup/pluginutils': 3.1.0_rollup@2.77.2 magic-string: 0.25.9 - rollup: 2.77.0 + rollup: file:../../f/rollup dev: true - /@rollup/plugin-typescript/8.3.4_rollup@2.75.6+tslib@2.4.0: + /@rollup/plugin-typescript/8.3.4_g3vehnszjsenbs4mtbawzk7eky: resolution: {integrity: sha512-wt7JnYE9antX6BOXtsxGoeVSu4dZfw0dU3xykfOQ4hC3EddxRbVG/K0xiY1Wup7QOHJcjLYXWAn0Kx9Z1SBHHg==} engines: {node: '>=8.0.0'} peerDependencies: @@ -2502,13 +2475,14 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.75.6 + '@rollup/pluginutils': 3.1.0_rollup@2.77.2 resolve: 1.22.1 - rollup: 2.75.6 + rollup: file:../../f/rollup tslib: 2.4.0 + typescript: 4.6.4 dev: true - /@rollup/plugin-typescript/8.3.4_uct5nfewsakxkk4livyn3qaf3e: + /@rollup/plugin-typescript/8.3.4_rollup@2.77.2+tslib@2.4.0: resolution: {integrity: sha512-wt7JnYE9antX6BOXtsxGoeVSu4dZfw0dU3xykfOQ4hC3EddxRbVG/K0xiY1Wup7QOHJcjLYXWAn0Kx9Z1SBHHg==} engines: {node: '>=8.0.0'} peerDependencies: @@ -2519,14 +2493,13 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.75.6 + '@rollup/pluginutils': 3.1.0_rollup@2.77.2 resolve: 1.22.1 - rollup: 2.75.6 + rollup: file:../../f/rollup tslib: 2.4.0 - typescript: 4.6.4 dev: true - /@rollup/pluginutils/3.1.0_rollup@2.75.6: + /@rollup/pluginutils/3.1.0_rollup@2.77.2: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -2535,19 +2508,7 @@ packages: '@types/estree': 0.0.39 estree-walker: 1.0.1 picomatch: 2.3.1 - rollup: 2.75.6 - dev: true - - /@rollup/pluginutils/3.1.0_rollup@2.77.0: - resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} - engines: {node: '>= 8.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0 - dependencies: - '@types/estree': 0.0.39 - estree-walker: 1.0.1 - picomatch: 2.3.1 - rollup: 2.77.0 + rollup: file:../../f/rollup dev: true /@rollup/pluginutils/4.2.1: @@ -7696,7 +7657,7 @@ packages: dependencies: glob: 7.2.0 - /rollup-plugin-dts/4.2.2_55kiftncucr43pz4hskma6yi2q: + /rollup-plugin-dts/4.2.2_oo3i3f3qmqiztdz5qgxrrjmd5e: resolution: {integrity: sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==} engines: {node: '>=v12.22.11'} peerDependencies: @@ -7704,13 +7665,13 @@ packages: typescript: ^4.1 dependencies: magic-string: 0.26.2 - rollup: 2.77.0 + rollup: file:../../f/rollup typescript: 4.7.4 optionalDependencies: '@babel/code-frame': 7.18.6 dev: true - /rollup-plugin-esbuild/4.9.1_nkjtn7ewzjrspe36n7zrekxwnm: + /rollup-plugin-esbuild/4.9.1_z4wjf5stc47okcxkgg4qwbc5si: resolution: {integrity: sha512-qn/x7Wz9p3Xnva99qcb+nopH0d2VJwVnsxJTGEg+Sh2Z3tqQl33MhOwzekVo1YTKgv+yAmosjcBRJygMfGrtLw==} engines: {node: '>=12'} peerDependencies: @@ -7723,12 +7684,12 @@ packages: esbuild: 0.14.50 joycon: 3.1.1 jsonc-parser: 3.0.0 - rollup: 2.77.0 + rollup: file:../../f/rollup transitivePeerDependencies: - supports-color dev: true - /rollup-plugin-license/2.8.1_rollup@2.75.6: + /rollup-plugin-license/2.8.1_rollup@2.77.2: resolution: {integrity: sha512-VYd9pzaNL7NN6xQp93XiiCV2UoduXgSmTcz6rl9bHPdiifT6yH3Zw/omEr73Rq8TIyN4nqJACBbKIT/2eE66wg==} engines: {node: '>=10.0.0'} peerDependencies: @@ -7741,26 +7702,11 @@ packages: mkdirp: 1.0.4 moment: 2.29.3 package-name-regex: 2.0.6 - rollup: 2.75.6 + rollup: file:../../f/rollup spdx-expression-validate: 2.0.0 spdx-satisfies: 5.0.1 dev: true - /rollup/2.75.6: - resolution: {integrity: sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA==} - engines: {node: '>=10.0.0'} - hasBin: true - optionalDependencies: - fsevents: 2.3.2 - - /rollup/2.77.0: - resolution: {integrity: sha512-vL8xjY4yOQEw79DvyXLijhnhh+R/O9zpF/LEgkCebZFtb6ELeN9H3/2T0r8+mp+fFTBHZ5qGpOpW2ela2zRt3g==} - engines: {node: '>=10.0.0'} - hasBin: true - optionalDependencies: - fsevents: 2.3.2 - dev: true - /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -8627,11 +8573,11 @@ packages: resolution: {integrity: sha512-W6pFPS6/ewlEV5uWbNgfo0i2LbVBsue5GKlOkCo6ozIrInOBEgq4s3HCUB5eZSw6Ty2iwF8dKM65pZX7QGZJ0g==} hasBin: true dependencies: - '@rollup/plugin-alias': 3.1.9_rollup@2.77.0 - '@rollup/plugin-commonjs': 22.0.1_rollup@2.77.0 - '@rollup/plugin-json': 4.1.0_rollup@2.77.0 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.0 - '@rollup/plugin-replace': 4.0.0_rollup@2.77.0 + '@rollup/plugin-alias': 3.1.9_rollup@2.77.2 + '@rollup/plugin-commonjs': 22.0.1_rollup@2.77.2 + '@rollup/plugin-json': 4.1.0_rollup@2.77.2 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.2 + '@rollup/plugin-replace': 4.0.0_rollup@2.77.2 '@rollup/pluginutils': 4.2.1 chalk: 5.0.1 consola: 2.15.3 @@ -8648,9 +8594,9 @@ packages: pkg-types: 0.3.3 pretty-bytes: 6.0.0 rimraf: 3.0.2 - rollup: 2.77.0 - rollup-plugin-dts: 4.2.2_55kiftncucr43pz4hskma6yi2q - rollup-plugin-esbuild: 4.9.1_nkjtn7ewzjrspe36n7zrekxwnm + rollup: file:../../f/rollup + rollup-plugin-dts: 4.2.2_oo3i3f3qmqiztdz5qgxrrjmd5e + rollup-plugin-esbuild: 4.9.1_z4wjf5stc47okcxkgg4qwbc5si scule: 0.2.1 typescript: 4.7.4 untyped: 0.4.4 @@ -9069,6 +9015,15 @@ packages: commander: 2.20.3 dev: true + file:../../f/rollup: + resolution: {directory: ../../f/rollup, type: directory} + name: rollup + version: 2.77.2 + engines: {node: '>=10.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + file:playground/alias/dir/module: resolution: {directory: playground/alias/dir/module, type: directory} name: '@vite/aliased-module' From a6b80ef6d1d903dd65aa89795beb959c2df4f9ea Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 12 Aug 2022 15:48:08 +0800 Subject: [PATCH 02/17] chore: update --- package.json | 2 +- .../vite/src/node/server/pluginContainer.ts | 19 ++- pnpm-lock.yaml | 132 +++++++++--------- 3 files changed, 77 insertions(+), 76 deletions(-) diff --git a/package.json b/package.json index 260969be5c372b..bf4a098a182b9c 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "overrides": { "vite": "workspace:*", "@vitejs/plugin-vue": "workspace:*", - "rollup": "file:/Users/antfu/f/rollup" + "rollup": "rollup/rollup#object-hooks" }, "packageExtensions": { "postcss-load-config": { diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index ab2e830846110b..cc4d4536d32632 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -137,6 +137,8 @@ type PluginContext = Omit< | 'load' > +type ObjectHookNames = AsyncPluginHooks & ParallelPluginHooks + export let parser = acorn.Parser export async function createPluginContainer( @@ -261,24 +263,21 @@ export async function createPluginContainer( } // parallel, ignores returns - async function hookParallel( + async function hookParallel( hookName: H, args: (plugin: Plugin) => Parameters ): Promise { const parallelPromises: Promise[] = [] for (const plugin of getSortedPlugins(hookName)) { - if (!plugin[hookName]) continue - // @ts-expect-error - const handler = - 'handler' in plugin[hookName] - ? plugin[hookName]!.handler - : plugin[hookName] - if ((plugin[hookName] as { sequential?: boolean }).sequential) { + const hook = plugin[hookName] + if (!hook) continue + const handler: Function = 'handler' in hook ? hook.handler : hook + if ((hook as { sequential?: boolean }).sequential) { await Promise.all(parallelPromises) parallelPromises.length = 0 - await handler.call(...args(plugin)) + await handler.call(args(plugin)) } else { - parallelPromises.push(handler.call(...args(plugin))) + parallelPromises.push(handler.call(args(plugin))) } } await Promise.all(parallelPromises) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f9ae573dc6c886..19df305b42dcdf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,7 +3,7 @@ lockfileVersion: 5.4 overrides: vite: workspace:* '@vitejs/plugin-vue': workspace:* - rollup: file:/Users/antfu/f/rollup + rollup: rollup/rollup#object-hooks packageExtensionsChecksum: 696422bac84dd936748019990f84746e @@ -52,7 +52,7 @@ importers: prettier: 2.7.1 prompts: ^2.4.2 rimraf: ^3.0.2 - rollup: file:/Users/antfu/f/rollup + rollup: rollup/rollup#object-hooks semver: ^7.3.7 simple-git-hooks: ^2.8.0 tslib: ^2.4.0 @@ -66,7 +66,7 @@ importers: devDependencies: '@babel/types': 7.18.10 '@microsoft/api-extractor': 7.29.0 - '@rollup/plugin-typescript': 8.3.4_g3vehnszjsenbs4mtbawzk7eky + '@rollup/plugin-typescript': 8.3.4_3keby64tsz2dfz2qzugmc5hqae '@types/babel__core': 7.1.19 '@types/babel__standalone': 7.1.4 '@types/convert-source-map': 1.5.2 @@ -105,7 +105,7 @@ importers: prettier: 2.7.1 prompts: 2.4.2 rimraf: 3.0.2 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 semver: 7.3.7 simple-git-hooks: 2.8.0 tslib: 2.4.0 @@ -172,7 +172,7 @@ importers: '@jridgewell/gen-mapping': ^0.3.2 '@jridgewell/trace-mapping': ^0.3.14 debug: ^4.3.4 - rollup: file:/Users/antfu/f/rollup + rollup: rollup/rollup#object-hooks slash: ^4.0.0 source-map: ^0.6.1 vite: workspace:* @@ -181,7 +181,7 @@ importers: '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.14 debug: 4.3.4 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 slash: 4.0.0 source-map: 0.6.1 vite: link:../vite @@ -250,7 +250,7 @@ importers: postcss-modules: ^4.3.1 resolve: ^1.22.1 resolve.exports: ^1.1.0 - rollup: file:/Users/antfu/f/rollup + rollup: rollup/rollup#object-hooks rollup-plugin-license: ^2.8.1 sirv: ^2.0.2 source-map-js: ^1.0.2 @@ -266,7 +266,7 @@ importers: esbuild: 0.14.47 postcss: 8.4.16 resolve: 1.22.1 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 optionalDependencies: fsevents: 2.3.2 devDependencies: @@ -274,12 +274,12 @@ importers: '@babel/parser': 7.18.11 '@babel/types': 7.18.10 '@jridgewell/trace-mapping': 0.3.14 - '@rollup/plugin-alias': 3.1.9_rollup@2.77.2 - '@rollup/plugin-commonjs': 22.0.2_rollup@2.77.2 - '@rollup/plugin-dynamic-import-vars': 1.4.4_rollup@2.77.2 - '@rollup/plugin-json': 4.1.0_rollup@2.77.2 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.2 - '@rollup/plugin-typescript': 8.3.4_rollup@2.77.2+tslib@2.4.0 + '@rollup/plugin-alias': 3.1.9_rollup@2.77.3 + '@rollup/plugin-commonjs': 22.0.2_rollup@2.77.3 + '@rollup/plugin-dynamic-import-vars': 1.4.4_rollup@2.77.3 + '@rollup/plugin-json': 4.1.0_rollup@2.77.3 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.3 + '@rollup/plugin-typescript': 8.3.4_rollup@2.77.3+tslib@2.4.0 '@rollup/pluginutils': 4.2.1 '@vue/compiler-dom': 3.2.37 acorn: 8.8.0 @@ -312,7 +312,7 @@ importers: postcss-load-config: 4.0.1_postcss@8.4.16 postcss-modules: 4.3.1_postcss@8.4.16 resolve.exports: 1.1.0 - rollup-plugin-license: 2.8.1_rollup@2.77.2 + rollup-plugin-license: 2.8.1_rollup@2.77.3 sirv: 2.0.2 source-map-js: 1.0.2 source-map-support: 0.5.21 @@ -2375,49 +2375,49 @@ packages: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true - /@rollup/plugin-alias/3.1.9_rollup@2.77.2: + /@rollup/plugin-alias/3.1.9_rollup@2.77.3: resolution: {integrity: sha512-QI5fsEvm9bDzt32k39wpOwZhVzRcL5ydcffUHMyLVaVaLeC70I8TJZ17F1z1eMoLu4E/UOcH9BWVkKpIKdrfiw==} engines: {node: '>=8.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0 dependencies: - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 slash: 3.0.0 dev: true - /@rollup/plugin-commonjs/22.0.1_rollup@2.77.2: + /@rollup/plugin-commonjs/22.0.1_rollup@2.77.3: resolution: {integrity: sha512-dGfEZvdjDHObBiP5IvwTKMVeq/tBZGMBHZFMdIV1ClMM/YoWS34xrHFGfag9SN2ZtMgNZRFruqvxZQEa70O6nQ==} engines: {node: '>= 12.0.0'} peerDependencies: rollup: ^2.68.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.2 + '@rollup/pluginutils': 3.1.0_rollup@2.77.3 commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.2.0 is-reference: 1.2.1 magic-string: 0.25.9 resolve: 1.22.1 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 dev: true - /@rollup/plugin-commonjs/22.0.2_rollup@2.77.2: + /@rollup/plugin-commonjs/22.0.2_rollup@2.77.3: resolution: {integrity: sha512-//NdP6iIwPbMTcazYsiBMbJW7gfmpHom33u1beiIoHDEM0Q9clvtQB1T0efvMqHeKsGohiHo97BCPCkBXdscwg==} engines: {node: '>= 12.0.0'} peerDependencies: rollup: ^2.68.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.2 + '@rollup/pluginutils': 3.1.0_rollup@2.77.3 commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.2.0 is-reference: 1.2.1 magic-string: 0.25.9 resolve: 1.22.1 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 dev: true - /@rollup/plugin-dynamic-import-vars/1.4.4_rollup@2.77.2: + /@rollup/plugin-dynamic-import-vars/1.4.4_rollup@2.77.3: resolution: {integrity: sha512-51BcU6ag9EeF09CtEsa5D/IHYo7KI42TR1Jc4doNzV1nHAiH7TvUi5vsLERFMjs9Gzy9K0otbZH/2wb0hpBhRA==} engines: {node: '>= 10.0.0'} peerDependencies: @@ -2427,44 +2427,44 @@ packages: estree-walker: 2.0.2 fast-glob: 3.2.11 magic-string: 0.25.9 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 dev: true - /@rollup/plugin-json/4.1.0_rollup@2.77.2: + /@rollup/plugin-json/4.1.0_rollup@2.77.3: resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.2 - rollup: file:../../f/rollup + '@rollup/pluginutils': 3.1.0_rollup@2.77.3 + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 dev: true - /@rollup/plugin-node-resolve/13.3.0_rollup@2.77.2: + /@rollup/plugin-node-resolve/13.3.0_rollup@2.77.3: resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} engines: {node: '>= 10.0.0'} peerDependencies: rollup: ^2.42.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.2 + '@rollup/pluginutils': 3.1.0_rollup@2.77.3 '@types/resolve': 1.17.1 deepmerge: 4.2.2 is-builtin-module: 3.1.0 is-module: 1.0.0 resolve: 1.22.1 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 dev: true - /@rollup/plugin-replace/4.0.0_rollup@2.77.2: + /@rollup/plugin-replace/4.0.0_rollup@2.77.3: resolution: {integrity: sha512-+rumQFiaNac9y64OHtkHGmdjm7us9bo1PlbgQfdihQtuNxzjpaB064HbRnewUOggLQxVCCyINfStkgmBeQpv1g==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.2 + '@rollup/pluginutils': 3.1.0_rollup@2.77.3 magic-string: 0.25.9 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 dev: true - /@rollup/plugin-typescript/8.3.4_g3vehnszjsenbs4mtbawzk7eky: + /@rollup/plugin-typescript/8.3.4_3keby64tsz2dfz2qzugmc5hqae: resolution: {integrity: sha512-wt7JnYE9antX6BOXtsxGoeVSu4dZfw0dU3xykfOQ4hC3EddxRbVG/K0xiY1Wup7QOHJcjLYXWAn0Kx9Z1SBHHg==} engines: {node: '>=8.0.0'} peerDependencies: @@ -2475,14 +2475,14 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.2 + '@rollup/pluginutils': 3.1.0_rollup@2.77.3 resolve: 1.22.1 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 tslib: 2.4.0 typescript: 4.6.4 dev: true - /@rollup/plugin-typescript/8.3.4_rollup@2.77.2+tslib@2.4.0: + /@rollup/plugin-typescript/8.3.4_rollup@2.77.3+tslib@2.4.0: resolution: {integrity: sha512-wt7JnYE9antX6BOXtsxGoeVSu4dZfw0dU3xykfOQ4hC3EddxRbVG/K0xiY1Wup7QOHJcjLYXWAn0Kx9Z1SBHHg==} engines: {node: '>=8.0.0'} peerDependencies: @@ -2493,13 +2493,13 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.2 + '@rollup/pluginutils': 3.1.0_rollup@2.77.3 resolve: 1.22.1 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 tslib: 2.4.0 dev: true - /@rollup/pluginutils/3.1.0_rollup@2.77.2: + /@rollup/pluginutils/3.1.0_rollup@2.77.3: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -2508,7 +2508,7 @@ packages: '@types/estree': 0.0.39 estree-walker: 1.0.1 picomatch: 2.3.1 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 dev: true /@rollup/pluginutils/4.2.1: @@ -7657,7 +7657,7 @@ packages: dependencies: glob: 7.2.0 - /rollup-plugin-dts/4.2.2_oo3i3f3qmqiztdz5qgxrrjmd5e: + /rollup-plugin-dts/4.2.2_u7uwnjpwzdscdmf57dt35g5b44: resolution: {integrity: sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==} engines: {node: '>=v12.22.11'} peerDependencies: @@ -7665,13 +7665,13 @@ packages: typescript: ^4.1 dependencies: magic-string: 0.26.2 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 typescript: 4.7.4 optionalDependencies: '@babel/code-frame': 7.18.6 dev: true - /rollup-plugin-esbuild/4.9.1_z4wjf5stc47okcxkgg4qwbc5si: + /rollup-plugin-esbuild/4.9.1_2iris4hk65ococgfijcajol2fq: resolution: {integrity: sha512-qn/x7Wz9p3Xnva99qcb+nopH0d2VJwVnsxJTGEg+Sh2Z3tqQl33MhOwzekVo1YTKgv+yAmosjcBRJygMfGrtLw==} engines: {node: '>=12'} peerDependencies: @@ -7684,12 +7684,12 @@ packages: esbuild: 0.14.50 joycon: 3.1.1 jsonc-parser: 3.0.0 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 transitivePeerDependencies: - supports-color dev: true - /rollup-plugin-license/2.8.1_rollup@2.77.2: + /rollup-plugin-license/2.8.1_rollup@2.77.3: resolution: {integrity: sha512-VYd9pzaNL7NN6xQp93XiiCV2UoduXgSmTcz6rl9bHPdiifT6yH3Zw/omEr73Rq8TIyN4nqJACBbKIT/2eE66wg==} engines: {node: '>=10.0.0'} peerDependencies: @@ -7702,7 +7702,7 @@ packages: mkdirp: 1.0.4 moment: 2.29.3 package-name-regex: 2.0.6 - rollup: file:../../f/rollup + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 spdx-expression-validate: 2.0.0 spdx-satisfies: 5.0.1 dev: true @@ -8573,11 +8573,11 @@ packages: resolution: {integrity: sha512-W6pFPS6/ewlEV5uWbNgfo0i2LbVBsue5GKlOkCo6ozIrInOBEgq4s3HCUB5eZSw6Ty2iwF8dKM65pZX7QGZJ0g==} hasBin: true dependencies: - '@rollup/plugin-alias': 3.1.9_rollup@2.77.2 - '@rollup/plugin-commonjs': 22.0.1_rollup@2.77.2 - '@rollup/plugin-json': 4.1.0_rollup@2.77.2 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.2 - '@rollup/plugin-replace': 4.0.0_rollup@2.77.2 + '@rollup/plugin-alias': 3.1.9_rollup@2.77.3 + '@rollup/plugin-commonjs': 22.0.1_rollup@2.77.3 + '@rollup/plugin-json': 4.1.0_rollup@2.77.3 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.3 + '@rollup/plugin-replace': 4.0.0_rollup@2.77.3 '@rollup/pluginutils': 4.2.1 chalk: 5.0.1 consola: 2.15.3 @@ -8594,9 +8594,9 @@ packages: pkg-types: 0.3.3 pretty-bytes: 6.0.0 rimraf: 3.0.2 - rollup: file:../../f/rollup - rollup-plugin-dts: 4.2.2_oo3i3f3qmqiztdz5qgxrrjmd5e - rollup-plugin-esbuild: 4.9.1_z4wjf5stc47okcxkgg4qwbc5si + rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup-plugin-dts: 4.2.2_u7uwnjpwzdscdmf57dt35g5b44 + rollup-plugin-esbuild: 4.9.1_2iris4hk65ococgfijcajol2fq scule: 0.2.1 typescript: 4.7.4 untyped: 0.4.4 @@ -9015,15 +9015,6 @@ packages: commander: 2.20.3 dev: true - file:../../f/rollup: - resolution: {directory: ../../f/rollup, type: directory} - name: rollup - version: 2.77.2 - engines: {node: '>=10.0.0'} - hasBin: true - optionalDependencies: - fsevents: 2.3.2 - file:playground/alias/dir/module: resolution: {directory: playground/alias/dir/module, type: directory} name: '@vite/aliased-module' @@ -9322,3 +9313,14 @@ packages: name: dep-to-optimize version: 1.0.0 dev: false + + github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945: + resolution: {tarball: https://codeload.github.com/rollup/rollup/tar.gz/fd3d91f3b4249387d3f8e89f84c387a86eb96945} + name: rollup + version: 2.77.3 + engines: {node: '>=10.0.0'} + hasBin: true + prepare: true + requiresBuild: true + optionalDependencies: + fsevents: 2.3.2 From bb4ae283f941574a915f4e6e0774df5d25fa0a09 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 12 Aug 2022 20:55:11 +0800 Subject: [PATCH 03/17] chore: refactor --- .../vite/src/node/server/pluginContainer.ts | 50 ++++--------------- 1 file changed, 9 insertions(+), 41 deletions(-) diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index cc4d4536d32632..87148f0c9701dd 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -137,8 +137,6 @@ type PluginContext = Omit< | 'load' > -type ObjectHookNames = AsyncPluginHooks & ParallelPluginHooks - export let parser = acorn.Parser export async function createPluginContainer( @@ -186,45 +184,18 @@ export async function createPluginContainer( } } - function getOrCreate(map: Map, key: K, init: () => V): V { - const existing = map.get(key) - if (existing) { - return existing - } - const value = init() - map.set(key, value) - return value - } - - const sortedPlugins = new Map() - - function getSortedPlugins( - hookName: keyof Plugin, - validateHandler?: ( - handler: unknown, - hookName: string, - plugin: Plugin - ) => void - ): Plugin[] { - return getOrCreate(sortedPlugins, hookName, () => - getSortedValidatedPlugins(hookName, plugins, validateHandler) - ) - } - - function validateFunctionPluginHandler( - handler: unknown, - hookName: string, - plugin: Plugin - ) { - if (typeof handler !== 'function') { - // TODO: - } + const sortedPluginsCache = new Map() + function getSortedPlugins(hookName: keyof Plugin): Plugin[] { + if (sortedPluginsCache.has(hookName)) + return sortedPluginsCache.get(hookName)! + const sorted = getSortedValidatedPlugins(hookName, plugins) + sortedPluginsCache.set(hookName, sorted) + return sorted } function getSortedValidatedPlugins( hookName: keyof Plugin, - plugins: readonly Plugin[], - validateHandler = validateFunctionPluginHandler + plugins: readonly Plugin[] ): Plugin[] { const pre: Plugin[] = [] const normal: Plugin[] = [] @@ -233,7 +204,6 @@ export async function createPluginContainer( const hook = plugin[hookName] if (hook) { if (typeof hook === 'object') { - validateHandler(hook.handler, hookName, plugin) if (hook.order === 'pre') { pre.push(plugin) continue @@ -242,8 +212,6 @@ export async function createPluginContainer( post.push(plugin) continue } - } else { - validateHandler(hook, hookName, plugin) } normal.push(plugin) } @@ -263,7 +231,7 @@ export async function createPluginContainer( } // parallel, ignores returns - async function hookParallel( + async function hookParallel( hookName: H, args: (plugin: Plugin) => Parameters ): Promise { From 60fd59065457d8ceb3682eb909181e702b4362c0 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 12 Aug 2022 21:46:10 +0800 Subject: [PATCH 04/17] feat: support object hooks for `configureServer` and `resolvedConfig` --- packages/vite/src/node/config.ts | 46 +++++++++----- packages/vite/src/node/plugin.ts | 8 ++- packages/vite/src/node/plugins/index.ts | 61 ++++++++++++++++++- packages/vite/src/node/preview.ts | 8 +-- packages/vite/src/node/server/index.ts | 6 +- .../vite/src/node/server/pluginContainer.ts | 50 +++------------ 6 files changed, 107 insertions(+), 72 deletions(-) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index fa0a25e463b811..8f1458ae3eebec 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -8,7 +8,7 @@ import type { Alias, AliasOptions } from 'types/alias' import aliasPlugin from '@rollup/plugin-alias' import { build } from 'esbuild' import type { RollupOptions } from 'rollup' -import type { Plugin } from './plugin' +import type { HookHandler, Plugin } from './plugin' import type { BuildOptions, RenderBuiltAssetUrl, @@ -33,7 +33,7 @@ import { normalizeAlias, normalizePath } from './utils' -import { resolvePlugins } from './plugins' +import { createPluginHookUtils, resolvePlugins } from './plugins' import type { ESBuildOptions } from './plugins/esbuild' import { CLIENT_ENTRY, @@ -289,7 +289,7 @@ export interface LegacyOptions { buildSsrCjsExternalHeuristics?: boolean } -export interface ResolveWorkerOptions { +export interface ResolveWorkerOptions extends PluginHookUtils { format: 'es' | 'iife' plugins: Plugin[] rollupOptions: RollupOptions @@ -334,9 +334,16 @@ export type ResolvedConfig = Readonly< worker: ResolveWorkerOptions appType: AppType experimental: ExperimentalOptions - } + } & PluginHookUtils > +export interface PluginHookUtils { + getSortedPlugins: (hookName: keyof Plugin) => Plugin[] + getSortedPluginHooks: ( + hookName: K + ) => NonNullable>[] +} + export type ResolveFn = ( id: string, importer?: string, @@ -609,7 +616,9 @@ export async function resolveConfig( const resolvedWorkerOptions: ResolveWorkerOptions = { format: workerConfig.worker?.format || 'iife', plugins: [], - rollupOptions: workerConfig.worker?.rollupOptions || {} + rollupOptions: workerConfig.worker?.rollupOptions || {}, + getSortedPlugins: undefined!, + getSortedPluginHooks: undefined! } const resolvedConfig: ResolvedConfig = { @@ -660,7 +669,9 @@ export async function resolveConfig( importGlobRestoreExtension: false, hmrPartialAccept: false, ...config.experimental - } + }, + getSortedPlugins: undefined!, + getSortedPluginHooks: undefined! } const resolved: ResolvedConfig = { ...config, @@ -673,6 +684,7 @@ export async function resolveConfig( normalPlugins, postPlugins ) + Object.assign(resolved, createPluginHookUtils(resolved.plugins)) const workerResolved: ResolvedConfig = { ...workerConfig, @@ -680,24 +692,26 @@ export async function resolveConfig( isWorker: true, mainConfig: resolved } - resolvedConfig.worker.plugins = await resolvePlugins( workerResolved, workerPrePlugins, workerNormalPlugins, workerPostPlugins ) + Object.assign( + resolvedConfig.worker, + createPluginHookUtils(resolvedConfig.worker.plugins) + ) // call configResolved hooks - await Promise.all( - userPlugins - .map((p) => p.configResolved?.(resolved)) - .concat( - resolvedConfig.worker.plugins.map((p) => - p.configResolved?.(workerResolved) - ) - ) - ) + await Promise.all([ + ...resolved + .getSortedPluginHooks('configResolved') + .map((hook) => hook(resolved)), + ...resolvedConfig.worker + .getSortedPluginHooks('configResolved') + .map((hook) => hook(workerResolved)) + ]) // validate config diff --git a/packages/vite/src/node/plugin.ts b/packages/vite/src/node/plugin.ts index 7edfc2ba4f1b7e..7443dd9b856831 100644 --- a/packages/vite/src/node/plugin.ts +++ b/packages/vite/src/node/plugin.ts @@ -71,7 +71,7 @@ export interface Plugin extends RollupPlugin { /** * Use this hook to read and store the final resolved vite config. */ - configResolved?: (config: ResolvedConfig) => void | Promise + configResolved?: ObjectHook<(config: ResolvedConfig) => void | Promise> /** * Configure the vite server. The hook receives the {@link ViteDevServer} * instance. This can also be used to store a reference to the server @@ -81,7 +81,7 @@ export interface Plugin extends RollupPlugin { * can return a post hook that will be called after internal middlewares * are applied. Hook can be async functions and will be called in series. */ - configureServer?: ServerHook + configureServer?: ObjectHook /** * Configure the preview server. The hook receives the connect server and * its underlying http server. @@ -90,7 +90,7 @@ export interface Plugin extends RollupPlugin { * return a post hook that will be called after other middlewares are * applied. Hooks can be async functions and will be called in series. */ - configurePreviewServer?: PreviewServerHook + configurePreviewServer?: ObjectHook /** * Transform index.html. * The hook receives the following arguments: @@ -161,3 +161,5 @@ export interface Plugin extends RollupPlugin { ) => Promise | TransformResult > } + +export type HookHandler = T extends ObjectHook ? H : T diff --git a/packages/vite/src/node/plugins/index.ts b/packages/vite/src/node/plugins/index.ts index a2fbebcc75b66e..bd480cbdf919f5 100644 --- a/packages/vite/src/node/plugins/index.ts +++ b/packages/vite/src/node/plugins/index.ts @@ -1,7 +1,7 @@ import aliasPlugin from '@rollup/plugin-alias' -import type { ResolvedConfig } from '../config' +import type { PluginHookUtils, ResolvedConfig } from '../config' import { isDepsOptimizerEnabled } from '../config' -import type { Plugin } from '../plugin' +import type { HookHandler, Plugin } from '../plugin' import { getDepsOptimizer } from '../optimizer' import { shouldExternalizeForSSR } from '../ssr/ssrExternal' import { jsonPlugin } from './json' @@ -99,3 +99,60 @@ export async function resolvePlugins( : [clientInjectionsPlugin(config), importAnalysisPlugin(config)]) ].filter(Boolean) as Plugin[] } + +export function createPluginHookUtils( + plugins: readonly Plugin[] +): PluginHookUtils { + // sort plugins per hook + const sortedPluginsCache = new Map() + function getSortedPlugins(hookName: keyof Plugin): Plugin[] { + if (sortedPluginsCache.has(hookName)) + return sortedPluginsCache.get(hookName)! + const sorted = getSortedValidatedPlugins(hookName, plugins) + sortedPluginsCache.set(hookName, sorted) + return sorted + } + function getSortedPluginHooks( + hookName: K + ): NonNullable>[] { + const plugins = getSortedPlugins(hookName) + return plugins + .map((p) => { + const hook = p[hookName]! + // @ts-expect-error cast + return 'handler' in hook ? hook.handler : hook + }) + .filter(Boolean) + } + + return { + getSortedPlugins, + getSortedPluginHooks + } +} + +function getSortedValidatedPlugins( + hookName: keyof Plugin, + plugins: readonly Plugin[] +): Plugin[] { + const pre: Plugin[] = [] + const normal: Plugin[] = [] + const post: Plugin[] = [] + for (const plugin of plugins) { + const hook = plugin[hookName] + if (hook) { + if (typeof hook === 'object') { + if (hook.order === 'pre') { + pre.push(plugin) + continue + } + if (hook.order === 'post') { + post.push(plugin) + continue + } + } + normal.push(plugin) + } + } + return [...pre, ...normal, ...post] +} diff --git a/packages/vite/src/node/preview.ts b/packages/vite/src/node/preview.ts index 2a563575c69ce1..71533111678e27 100644 --- a/packages/vite/src/node/preview.ts +++ b/packages/vite/src/node/preview.ts @@ -87,12 +87,8 @@ export async function preview( // apply server hooks from plugins const postHooks: ((() => void) | void)[] = [] - for (const plugin of config.plugins) { - if (plugin.configurePreviewServer) { - postHooks.push( - await plugin.configurePreviewServer({ middlewares: app, httpServer }) - ) - } + for (const hook of config.getSortedPluginHooks('configurePreviewServer')) { + postHooks.push(await hook({ middlewares: app, httpServer })) } // cors diff --git a/packages/vite/src/node/server/index.ts b/packages/vite/src/node/server/index.ts index 98d7814e587751..1cfe057dd03c30 100644 --- a/packages/vite/src/node/server/index.ts +++ b/packages/vite/src/node/server/index.ts @@ -492,10 +492,8 @@ export async function createServer( // apply server configuration hooks from plugins const postHooks: ((() => void) | void)[] = [] - for (const plugin of config.plugins) { - if (plugin.configureServer) { - postHooks.push(await plugin.configureServer(server)) - } + for (const hook of config.getSortedPluginHooks('configureServer')) { + postHooks.push(await hook(server)) } // Internal middlewares ------------------------------------------------------ diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index 87148f0c9701dd..81737e317d0cc2 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -140,7 +140,13 @@ type PluginContext = Omit< export let parser = acorn.Parser export async function createPluginContainer( - { plugins, logger, root, build: { rollupOptions } }: ResolvedConfig, + { + getSortedPluginHooks, + getSortedPlugins, + logger, + root, + build: { rollupOptions } + }: ResolvedConfig, moduleGraph?: ModuleGraph, watcher?: FSWatcher ): Promise { @@ -184,41 +190,6 @@ export async function createPluginContainer( } } - const sortedPluginsCache = new Map() - function getSortedPlugins(hookName: keyof Plugin): Plugin[] { - if (sortedPluginsCache.has(hookName)) - return sortedPluginsCache.get(hookName)! - const sorted = getSortedValidatedPlugins(hookName, plugins) - sortedPluginsCache.set(hookName, sorted) - return sorted - } - - function getSortedValidatedPlugins( - hookName: keyof Plugin, - plugins: readonly Plugin[] - ): Plugin[] { - const pre: Plugin[] = [] - const normal: Plugin[] = [] - const post: Plugin[] = [] - for (const plugin of plugins) { - const hook = plugin[hookName] - if (hook) { - if (typeof hook === 'object') { - if (hook.order === 'pre') { - pre.push(plugin) - continue - } - if (hook.order === 'post') { - post.push(plugin) - continue - } - } - normal.push(plugin) - } - } - return [...pre, ...normal, ...post] - } - function warnIncompatibleMethod(method: string, plugin: string) { logger.warn( colors.cyan(`[plugin:${plugin}] `) + @@ -559,11 +530,8 @@ export async function createPluginContainer( const container: PluginContainer = { options: await (async () => { let options = rollupOptions - for (const plugin of getSortedPlugins('options')) { - if (!plugin.options) continue - const handler = - 'handler' in plugin.options ? plugin.options.handler : plugin.options - options = (await handler.call(minimalContext, options)) || options + for (const optionsHook of getSortedPluginHooks('options')) { + options = (await optionsHook.call(minimalContext, options)) || options } if (options.acornInjectPlugins) { parser = acorn.Parser.extend( From 8c7389b8ff8d9d387c9106bd1f19cff229a7c0f5 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 12 Aug 2022 21:54:55 +0800 Subject: [PATCH 05/17] feat: support object hooks for `config` and `handleHotUpdate` --- packages/vite/src/node/config.ts | 26 ++++++++++++++++--------- packages/vite/src/node/plugin.ts | 18 ++++++++++------- packages/vite/src/node/plugins/index.ts | 4 ++-- packages/vite/src/node/server/hmr.ts | 10 ++++------ 4 files changed, 34 insertions(+), 24 deletions(-) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 8f1458ae3eebec..6237b1d5461c11 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -33,7 +33,11 @@ import { normalizeAlias, normalizePath } from './utils' -import { createPluginHookUtils, resolvePlugins } from './plugins' +import { + createPluginHookUtils, + getSortedPluginsByHook, + resolvePlugins +} from './plugins' import type { ESBuildOptions } from './plugins/esbuild' import { CLIENT_ENTRY, @@ -438,9 +442,11 @@ export async function resolveConfig( // run config hooks const userPlugins = [...prePlugins, ...normalPlugins, ...postPlugins] - for (const p of userPlugins) { - if (p.config) { - const res = await p.config(config, configEnv) + for (const p of getSortedPluginsByHook('config', userPlugins)) { + const hook = p.config + const handler = hook && 'handler' in hook ? hook.handler : hook + if (handler) { + const res = await handler(config, configEnv) if (res) { config = mergeConfig(config, res) } @@ -595,7 +601,7 @@ export async function resolveConfig( const BASE_URL = resolvedBase // resolve worker - let workerConfig = mergeConfig({}, config) + const workerConfig = mergeConfig({}, config) const [workerPrePlugins, workerNormalPlugins, workerPostPlugins] = sortUserPlugins(rawWorkerUserPlugins) @@ -605,11 +611,13 @@ export async function resolveConfig( ...workerNormalPlugins, ...workerPostPlugins ] - for (const p of workerUserPlugins) { - if (p.config) { - const res = await p.config(workerConfig, configEnv) + for (const p of getSortedPluginsByHook('config', workerUserPlugins)) { + const hook = p.config + const handler = hook && 'handler' in hook ? hook.handler : hook + if (handler) { + const res = await handler(workerConfig, configEnv) if (res) { - workerConfig = mergeConfig(workerConfig, res) + config = mergeConfig(config, res) } } } diff --git a/packages/vite/src/node/plugin.ts b/packages/vite/src/node/plugin.ts index 7443dd9b856831..a30006ec7915f5 100644 --- a/packages/vite/src/node/plugin.ts +++ b/packages/vite/src/node/plugin.ts @@ -64,10 +64,12 @@ export interface Plugin extends RollupPlugin { * Note: User plugins are resolved before running this hook so injecting other * plugins inside the `config` hook will have no effect. */ - config?: ( - config: UserConfig, - env: ConfigEnv - ) => UserConfig | null | void | Promise + config?: ObjectHook< + ( + config: UserConfig, + env: ConfigEnv + ) => UserConfig | null | void | Promise + > /** * Use this hook to read and store the final resolved vite config. */ @@ -122,9 +124,11 @@ export interface Plugin extends RollupPlugin { * - If the hook doesn't return a value, the hmr update will be performed as * normal. */ - handleHotUpdate?( - ctx: HmrContext - ): Array | void | Promise | void> + handleHotUpdate?: ObjectHook< + ( + ctx: HmrContext + ) => Array | void | Promise | void> + > /** * extend hooks with ssr flag diff --git a/packages/vite/src/node/plugins/index.ts b/packages/vite/src/node/plugins/index.ts index bd480cbdf919f5..75c8297bf26919 100644 --- a/packages/vite/src/node/plugins/index.ts +++ b/packages/vite/src/node/plugins/index.ts @@ -108,7 +108,7 @@ export function createPluginHookUtils( function getSortedPlugins(hookName: keyof Plugin): Plugin[] { if (sortedPluginsCache.has(hookName)) return sortedPluginsCache.get(hookName)! - const sorted = getSortedValidatedPlugins(hookName, plugins) + const sorted = getSortedPluginsByHook(hookName, plugins) sortedPluginsCache.set(hookName, sorted) return sorted } @@ -131,7 +131,7 @@ export function createPluginHookUtils( } } -function getSortedValidatedPlugins( +export function getSortedPluginsByHook( hookName: keyof Plugin, plugins: readonly Plugin[] ): Plugin[] { diff --git a/packages/vite/src/node/server/hmr.ts b/packages/vite/src/node/server/hmr.ts index a4de1284a7e050..f3298944a5e0b0 100644 --- a/packages/vite/src/node/server/hmr.ts +++ b/packages/vite/src/node/server/hmr.ts @@ -93,12 +93,10 @@ export async function handleHMRUpdate( server } - for (const plugin of config.plugins) { - if (plugin.handleHotUpdate) { - const filteredModules = await plugin.handleHotUpdate(hmrContext) - if (filteredModules) { - hmrContext.modules = filteredModules - } + for (const hook of config.getSortedPluginHooks('handleHotUpdate')) { + const filteredModules = await hook(hmrContext) + if (filteredModules) { + hmrContext.modules = filteredModules } } From ec188a1c2052e188e07eb61bc38ae41a1c9235b4 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 12 Aug 2022 22:07:11 +0800 Subject: [PATCH 06/17] chore: fix types --- packages/vite/src/node/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/index.ts b/packages/vite/src/node/index.ts index 7dfada6825780b..c595ff0aa7e7e3 100644 --- a/packages/vite/src/node/index.ts +++ b/packages/vite/src/node/index.ts @@ -50,7 +50,7 @@ export type { SSRFormat, SSRTarget } from './ssr' -export type { Plugin } from './plugin' +export type { Plugin, HookHandler } from './plugin' export type { PackageCache, PackageData } from './packages' export type { Logger, From b65e10a7561a3e33e758b9798cdecff5c187b9c6 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sat, 13 Aug 2022 05:47:03 +0800 Subject: [PATCH 07/17] chore: update --- .../vite/src/node/server/pluginContainer.ts | 24 ++++++++++++------- .../__tests__/object-hooks.spec.ts | 1 + 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index 81737e317d0cc2..148f8490d96691 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -204,6 +204,7 @@ export async function createPluginContainer( // parallel, ignores returns async function hookParallel( hookName: H, + context: (plugin: Plugin) => ThisType, args: (plugin: Plugin) => Parameters ): Promise { const parallelPromises: Promise[] = [] @@ -214,9 +215,9 @@ export async function createPluginContainer( if ((hook as { sequential?: boolean }).sequential) { await Promise.all(parallelPromises) parallelPromises.length = 0 - await handler.call(args(plugin)) + await handler.apply(context(plugin), args(plugin)) } else { - parallelPromises.push(handler.call(args(plugin))) + parallelPromises.push(handler.apply(context(plugin), args(plugin))) } } await Promise.all(parallelPromises) @@ -550,11 +551,8 @@ export async function createPluginContainer( async buildStart() { await hookParallel( 'buildStart', - (plugin) => - [ - new Context(plugin), - container.options as NormalizedInputOptions - ] as any + (plugin) => new Context(plugin), + () => [container.options as NormalizedInputOptions] ) }, @@ -701,8 +699,16 @@ export async function createPluginContainer( async close() { if (closed) return const ctx = new Context() - await hookParallel('buildEnd', () => [ctx] as any) - await hookParallel('closeBundle', () => [ctx] as any) + await hookParallel( + 'buildEnd', + () => ctx, + () => [] + ) + await hookParallel( + 'closeBundle', + () => ctx, + () => [] + ) closed = true } } diff --git a/playground/object-hooks/__tests__/object-hooks.spec.ts b/playground/object-hooks/__tests__/object-hooks.spec.ts index a169cdc69f24cd..8e6de2d23025f6 100644 --- a/playground/object-hooks/__tests__/object-hooks.spec.ts +++ b/playground/object-hooks/__tests__/object-hooks.spec.ts @@ -1,3 +1,4 @@ +import { expect, test } from 'vitest' import { page } from '~utils' test('object hooks', async () => { From 31a47767ea2b694f374a3e6ac687e39fc95e8571 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 14 Aug 2022 19:02:37 +0800 Subject: [PATCH 08/17] chore: upgrade to rollup ^2.78.0 --- package.json | 5 +- packages/plugin-vue/package.json | 2 +- packages/vite/package.json | 2 +- pnpm-lock.yaml | 129 +++++++++++++++---------------- 4 files changed, 66 insertions(+), 72 deletions(-) diff --git a/package.json b/package.json index c5d4fc51d7dac3..e8cec7f0065f2a 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "prettier": "2.7.1", "prompts": "^2.4.2", "rimraf": "^3.0.2", - "rollup": ">=2.75.6 <2.77.0 || ~2.77.0", + "rollup": "^2.78.0", "semver": "^7.3.7", "simple-git-hooks": "^2.8.0", "tslib": "^2.4.0", @@ -111,8 +111,7 @@ "pnpm": { "overrides": { "vite": "workspace:*", - "@vitejs/plugin-vue": "workspace:*", - "rollup": "rollup/rollup#object-hooks" + "@vitejs/plugin-vue": "workspace:*" }, "packageExtensions": { "postcss-load-config": { diff --git a/packages/plugin-vue/package.json b/packages/plugin-vue/package.json index 3054fa2ed960a9..67f4145c2ea199 100644 --- a/packages/plugin-vue/package.json +++ b/packages/plugin-vue/package.json @@ -42,7 +42,7 @@ "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.14", "debug": "^4.3.4", - "rollup": ">=2.75.6 <2.77.0 || ~2.77.0", + "rollup": "^2.78.0", "slash": "^4.0.0", "source-map": "^0.6.1", "vite": "workspace:*", diff --git a/packages/vite/package.json b/packages/vite/package.json index 20e44f51170be0..52c606ec57b6cc 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -61,7 +61,7 @@ "esbuild": "^0.14.47", "postcss": "^8.4.16", "resolve": "^1.22.1", - "rollup": ">=2.75.6 <2.77.0 || ~2.77.0" + "rollup": "^2.78.0" }, "optionalDependencies": { "fsevents": "~2.3.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 53e78b260edfc2..02ced38540999f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,7 +3,6 @@ lockfileVersion: 5.4 overrides: vite: workspace:* '@vitejs/plugin-vue': workspace:* - rollup: rollup/rollup#object-hooks packageExtensionsChecksum: 696422bac84dd936748019990f84746e @@ -52,7 +51,7 @@ importers: prettier: 2.7.1 prompts: ^2.4.2 rimraf: ^3.0.2 - rollup: rollup/rollup#object-hooks + rollup: ^2.78.0 semver: ^7.3.7 simple-git-hooks: ^2.8.0 tslib: ^2.4.0 @@ -66,7 +65,7 @@ importers: devDependencies: '@babel/types': 7.18.10 '@microsoft/api-extractor': 7.29.0 - '@rollup/plugin-typescript': 8.3.4_3keby64tsz2dfz2qzugmc5hqae + '@rollup/plugin-typescript': 8.3.4_7emp2e44zzc74lnyjhc37gdv4y '@types/babel__core': 7.1.19 '@types/babel__standalone': 7.1.4 '@types/convert-source-map': 1.5.2 @@ -105,7 +104,7 @@ importers: prettier: 2.7.1 prompts: 2.4.2 rimraf: 3.0.2 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 semver: 7.3.7 simple-git-hooks: 2.8.0 tslib: 2.4.0 @@ -172,7 +171,7 @@ importers: '@jridgewell/gen-mapping': ^0.3.2 '@jridgewell/trace-mapping': ^0.3.14 debug: ^4.3.4 - rollup: rollup/rollup#object-hooks + rollup: ^2.78.0 slash: ^4.0.0 source-map: ^0.6.1 vite: workspace:* @@ -181,7 +180,7 @@ importers: '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.14 debug: 4.3.4 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 slash: 4.0.0 source-map: 0.6.1 vite: link:../vite @@ -250,7 +249,7 @@ importers: postcss-modules: ^4.3.1 resolve: ^1.22.1 resolve.exports: ^1.1.0 - rollup: rollup/rollup#object-hooks + rollup: ^2.78.0 rollup-plugin-license: ^2.8.1 sirv: ^2.0.2 source-map-js: ^1.0.2 @@ -266,7 +265,7 @@ importers: esbuild: 0.14.47 postcss: 8.4.16 resolve: 1.22.1 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 optionalDependencies: fsevents: 2.3.2 devDependencies: @@ -274,12 +273,12 @@ importers: '@babel/parser': 7.18.11 '@babel/types': 7.18.10 '@jridgewell/trace-mapping': 0.3.14 - '@rollup/plugin-alias': 3.1.9_rollup@2.77.3 - '@rollup/plugin-commonjs': 22.0.2_rollup@2.77.3 - '@rollup/plugin-dynamic-import-vars': 1.4.4_rollup@2.77.3 - '@rollup/plugin-json': 4.1.0_rollup@2.77.3 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.3 - '@rollup/plugin-typescript': 8.3.4_rollup@2.77.3+tslib@2.4.0 + '@rollup/plugin-alias': 3.1.9_rollup@2.78.0 + '@rollup/plugin-commonjs': 22.0.2_rollup@2.78.0 + '@rollup/plugin-dynamic-import-vars': 1.4.4_rollup@2.78.0 + '@rollup/plugin-json': 4.1.0_rollup@2.78.0 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.78.0 + '@rollup/plugin-typescript': 8.3.4_rollup@2.78.0+tslib@2.4.0 '@rollup/pluginutils': 4.2.1 '@vue/compiler-dom': 3.2.37 acorn: 8.8.0 @@ -312,7 +311,7 @@ importers: postcss-load-config: 4.0.1_postcss@8.4.16 postcss-modules: 4.3.1_postcss@8.4.16 resolve.exports: 1.1.0 - rollup-plugin-license: 2.8.1_rollup@2.77.3 + rollup-plugin-license: 2.8.1_rollup@2.78.0 sirv: 2.0.2 source-map-js: 1.0.2 source-map-support: 0.5.21 @@ -2380,49 +2379,49 @@ packages: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true - /@rollup/plugin-alias/3.1.9_rollup@2.77.3: + /@rollup/plugin-alias/3.1.9_rollup@2.78.0: resolution: {integrity: sha512-QI5fsEvm9bDzt32k39wpOwZhVzRcL5ydcffUHMyLVaVaLeC70I8TJZ17F1z1eMoLu4E/UOcH9BWVkKpIKdrfiw==} engines: {node: '>=8.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0 dependencies: - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 slash: 3.0.0 dev: true - /@rollup/plugin-commonjs/22.0.1_rollup@2.77.3: + /@rollup/plugin-commonjs/22.0.1_rollup@2.78.0: resolution: {integrity: sha512-dGfEZvdjDHObBiP5IvwTKMVeq/tBZGMBHZFMdIV1ClMM/YoWS34xrHFGfag9SN2ZtMgNZRFruqvxZQEa70O6nQ==} engines: {node: '>= 12.0.0'} peerDependencies: rollup: ^2.68.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.3 + '@rollup/pluginutils': 3.1.0_rollup@2.78.0 commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.2.0 is-reference: 1.2.1 magic-string: 0.25.9 resolve: 1.22.1 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 dev: true - /@rollup/plugin-commonjs/22.0.2_rollup@2.77.3: + /@rollup/plugin-commonjs/22.0.2_rollup@2.78.0: resolution: {integrity: sha512-//NdP6iIwPbMTcazYsiBMbJW7gfmpHom33u1beiIoHDEM0Q9clvtQB1T0efvMqHeKsGohiHo97BCPCkBXdscwg==} engines: {node: '>= 12.0.0'} peerDependencies: rollup: ^2.68.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.3 + '@rollup/pluginutils': 3.1.0_rollup@2.78.0 commondir: 1.0.1 estree-walker: 2.0.2 glob: 7.2.0 is-reference: 1.2.1 magic-string: 0.25.9 resolve: 1.22.1 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 dev: true - /@rollup/plugin-dynamic-import-vars/1.4.4_rollup@2.77.3: + /@rollup/plugin-dynamic-import-vars/1.4.4_rollup@2.78.0: resolution: {integrity: sha512-51BcU6ag9EeF09CtEsa5D/IHYo7KI42TR1Jc4doNzV1nHAiH7TvUi5vsLERFMjs9Gzy9K0otbZH/2wb0hpBhRA==} engines: {node: '>= 10.0.0'} peerDependencies: @@ -2432,44 +2431,44 @@ packages: estree-walker: 2.0.2 fast-glob: 3.2.11 magic-string: 0.25.9 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 dev: true - /@rollup/plugin-json/4.1.0_rollup@2.77.3: + /@rollup/plugin-json/4.1.0_rollup@2.78.0: resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.3 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + '@rollup/pluginutils': 3.1.0_rollup@2.78.0 + rollup: 2.78.0 dev: true - /@rollup/plugin-node-resolve/13.3.0_rollup@2.77.3: + /@rollup/plugin-node-resolve/13.3.0_rollup@2.78.0: resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} engines: {node: '>= 10.0.0'} peerDependencies: rollup: ^2.42.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.3 + '@rollup/pluginutils': 3.1.0_rollup@2.78.0 '@types/resolve': 1.17.1 deepmerge: 4.2.2 is-builtin-module: 3.1.0 is-module: 1.0.0 resolve: 1.22.1 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 dev: true - /@rollup/plugin-replace/4.0.0_rollup@2.77.3: + /@rollup/plugin-replace/4.0.0_rollup@2.78.0: resolution: {integrity: sha512-+rumQFiaNac9y64OHtkHGmdjm7us9bo1PlbgQfdihQtuNxzjpaB064HbRnewUOggLQxVCCyINfStkgmBeQpv1g==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.3 + '@rollup/pluginutils': 3.1.0_rollup@2.78.0 magic-string: 0.25.9 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 dev: true - /@rollup/plugin-typescript/8.3.4_3keby64tsz2dfz2qzugmc5hqae: + /@rollup/plugin-typescript/8.3.4_7emp2e44zzc74lnyjhc37gdv4y: resolution: {integrity: sha512-wt7JnYE9antX6BOXtsxGoeVSu4dZfw0dU3xykfOQ4hC3EddxRbVG/K0xiY1Wup7QOHJcjLYXWAn0Kx9Z1SBHHg==} engines: {node: '>=8.0.0'} peerDependencies: @@ -2480,14 +2479,14 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.3 + '@rollup/pluginutils': 3.1.0_rollup@2.78.0 resolve: 1.22.1 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 tslib: 2.4.0 typescript: 4.6.4 dev: true - /@rollup/plugin-typescript/8.3.4_rollup@2.77.3+tslib@2.4.0: + /@rollup/plugin-typescript/8.3.4_rollup@2.78.0+tslib@2.4.0: resolution: {integrity: sha512-wt7JnYE9antX6BOXtsxGoeVSu4dZfw0dU3xykfOQ4hC3EddxRbVG/K0xiY1Wup7QOHJcjLYXWAn0Kx9Z1SBHHg==} engines: {node: '>=8.0.0'} peerDependencies: @@ -2498,13 +2497,13 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.3 + '@rollup/pluginutils': 3.1.0_rollup@2.78.0 resolve: 1.22.1 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 tslib: 2.4.0 dev: true - /@rollup/pluginutils/3.1.0_rollup@2.77.3: + /@rollup/pluginutils/3.1.0_rollup@2.78.0: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -2513,7 +2512,7 @@ packages: '@types/estree': 0.0.39 estree-walker: 1.0.1 picomatch: 2.3.1 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 dev: true /@rollup/pluginutils/4.2.1: @@ -7662,7 +7661,7 @@ packages: dependencies: glob: 7.2.0 - /rollup-plugin-dts/4.2.2_u7uwnjpwzdscdmf57dt35g5b44: + /rollup-plugin-dts/4.2.2_nm5mlcuxlwr6samvke7b2fz27i: resolution: {integrity: sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==} engines: {node: '>=v12.22.11'} peerDependencies: @@ -7670,13 +7669,13 @@ packages: typescript: ^4.1 dependencies: magic-string: 0.26.2 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 typescript: 4.7.4 optionalDependencies: '@babel/code-frame': 7.18.6 dev: true - /rollup-plugin-esbuild/4.9.1_2iris4hk65ococgfijcajol2fq: + /rollup-plugin-esbuild/4.9.1_ld7xpgrk42dikpwynh4v6hkwbu: resolution: {integrity: sha512-qn/x7Wz9p3Xnva99qcb+nopH0d2VJwVnsxJTGEg+Sh2Z3tqQl33MhOwzekVo1YTKgv+yAmosjcBRJygMfGrtLw==} engines: {node: '>=12'} peerDependencies: @@ -7689,12 +7688,12 @@ packages: esbuild: 0.14.50 joycon: 3.1.1 jsonc-parser: 3.0.0 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 transitivePeerDependencies: - supports-color dev: true - /rollup-plugin-license/2.8.1_rollup@2.77.3: + /rollup-plugin-license/2.8.1_rollup@2.78.0: resolution: {integrity: sha512-VYd9pzaNL7NN6xQp93XiiCV2UoduXgSmTcz6rl9bHPdiifT6yH3Zw/omEr73Rq8TIyN4nqJACBbKIT/2eE66wg==} engines: {node: '>=10.0.0'} peerDependencies: @@ -7707,11 +7706,18 @@ packages: mkdirp: 1.0.4 moment: 2.29.3 package-name-regex: 2.0.6 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 + rollup: 2.78.0 spdx-expression-validate: 2.0.0 spdx-satisfies: 5.0.1 dev: true + /rollup/2.78.0: + resolution: {integrity: sha512-4+YfbQC9QEVvKTanHhIAFVUFSRsezvQF8vFOJwtGfb9Bb+r014S+qryr9PSmw8x6sMnPkmFBGAvIFVQxvJxjtg==} + engines: {node: '>=10.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -8578,11 +8584,11 @@ packages: resolution: {integrity: sha512-W6pFPS6/ewlEV5uWbNgfo0i2LbVBsue5GKlOkCo6ozIrInOBEgq4s3HCUB5eZSw6Ty2iwF8dKM65pZX7QGZJ0g==} hasBin: true dependencies: - '@rollup/plugin-alias': 3.1.9_rollup@2.77.3 - '@rollup/plugin-commonjs': 22.0.1_rollup@2.77.3 - '@rollup/plugin-json': 4.1.0_rollup@2.77.3 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.3 - '@rollup/plugin-replace': 4.0.0_rollup@2.77.3 + '@rollup/plugin-alias': 3.1.9_rollup@2.78.0 + '@rollup/plugin-commonjs': 22.0.1_rollup@2.78.0 + '@rollup/plugin-json': 4.1.0_rollup@2.78.0 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.78.0 + '@rollup/plugin-replace': 4.0.0_rollup@2.78.0 '@rollup/pluginutils': 4.2.1 chalk: 5.0.1 consola: 2.15.3 @@ -8599,9 +8605,9 @@ packages: pkg-types: 0.3.3 pretty-bytes: 6.0.0 rimraf: 3.0.2 - rollup: github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945 - rollup-plugin-dts: 4.2.2_u7uwnjpwzdscdmf57dt35g5b44 - rollup-plugin-esbuild: 4.9.1_2iris4hk65ococgfijcajol2fq + rollup: 2.78.0 + rollup-plugin-dts: 4.2.2_nm5mlcuxlwr6samvke7b2fz27i + rollup-plugin-esbuild: 4.9.1_ld7xpgrk42dikpwynh4v6hkwbu scule: 0.2.1 typescript: 4.7.4 untyped: 0.4.4 @@ -9318,14 +9324,3 @@ packages: name: dep-to-optimize version: 1.0.0 dev: false - - github.com/rollup/rollup/fd3d91f3b4249387d3f8e89f84c387a86eb96945: - resolution: {tarball: https://codeload.github.com/rollup/rollup/tar.gz/fd3d91f3b4249387d3f8e89f84c387a86eb96945} - name: rollup - version: 2.77.3 - engines: {node: '>=10.0.0'} - hasBin: true - prepare: true - requiresBuild: true - optionalDependencies: - fsevents: 2.3.2 From 301484f5181e08169b2d07e5b2d7a7e6699985af Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 14 Aug 2022 19:21:52 +0800 Subject: [PATCH 09/17] fix: pluginContainer --- .../vite/src/node/server/pluginContainer.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index 148f8490d96691..f44efd1fcd26b7 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -77,6 +77,7 @@ import { } from '../utils' import { FS_PREFIX } from '../constants' import type { ResolvedConfig } from '../config' +import { createPluginHookUtils } from '../plugins' import { buildErrorMessage } from './middlewares/error' import type { ModuleGraph } from './moduleGraph' @@ -140,17 +141,19 @@ type PluginContext = Omit< export let parser = acorn.Parser export async function createPluginContainer( - { - getSortedPluginHooks, - getSortedPlugins, - logger, - root, - build: { rollupOptions } - }: ResolvedConfig, + config: ResolvedConfig, moduleGraph?: ModuleGraph, watcher?: FSWatcher ): Promise { const isDebug = process.env.DEBUG + const { + plugins, + logger, + root, + build: { rollupOptions } + } = config + const { getSortedPluginHooks, getSortedPlugins } = + createPluginHookUtils(plugins) const seenResolves: Record = {} const debugResolve = createDebugger('vite:resolve') From 8bdfc57dd6a920515ca3cdfe27d82df33a3b5cc2 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 14 Aug 2022 20:32:12 +0800 Subject: [PATCH 10/17] chore: cleanup --- packages/vite/src/node/build.ts | 12 +++++------- packages/vite/src/node/plugins/worker.ts | 1 - 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index e99f46938e98a8..822751e8bb67fe 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -312,7 +312,7 @@ export function resolveBuildPlugins(config: ResolvedConfig): { ...(options.rollupOptions.plugins ? (options.rollupOptions.plugins.filter(Boolean) as Plugin[]) : []) - ] as Plugin[], + ], post: [ buildImportAnalysisPlugin(config), ...(config.esbuild !== false ? [buildEsbuildPlugin(config)] : []), @@ -321,7 +321,7 @@ export function resolveBuildPlugins(config: ResolvedConfig): { ...(options.ssrManifest ? [ssrManifestPlugin(config)] : []), buildReporterPlugin(config), loadFallbackPlugin() - ] as Plugin[] + ] } } @@ -386,11 +386,9 @@ async function doBuild( const outDir = resolve(options.outDir) // inject ssr arg to plugin load/transform hooks - const plugins = ( - ssr - ? config.plugins.map((p) => injectSsrFlagToHooks(p as Plugin)) - : config.plugins - ) as Plugin[] + const plugins = ssr + ? config.plugins.map((p) => injectSsrFlagToHooks(p)) + : config.plugins const userExternal = options.rollupOptions?.external let external = userExternal diff --git a/packages/vite/src/node/plugins/worker.ts b/packages/vite/src/node/plugins/worker.ts index 25aa49d38a966a..336562d4326dd2 100644 --- a/packages/vite/src/node/plugins/worker.ts +++ b/packages/vite/src/node/plugins/worker.ts @@ -237,7 +237,6 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin { injectEnv = module?.transformResult?.code || '' } } - return { code: injectEnv + raw } From d2f5229b5207dfc54c0d24f7ef42d2d7afbf9236 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 14 Aug 2022 20:37:36 +0800 Subject: [PATCH 11/17] fix: worker --- packages/vite/src/node/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index e182b9c66eb438..4fb0fcc9a15a93 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -601,7 +601,7 @@ export async function resolveConfig( const BASE_URL = resolvedBase // resolve worker - const workerConfig = mergeConfig({}, config) + let workerConfig = mergeConfig({}, config) const [workerPrePlugins, workerNormalPlugins, workerPostPlugins] = sortUserPlugins(rawWorkerUserPlugins) @@ -617,7 +617,7 @@ export async function resolveConfig( if (handler) { const res = await handler(workerConfig, configEnv) if (res) { - config = mergeConfig(config, res) + workerConfig = mergeConfig(workerConfig, res) } } } From 9ab44f0f85f0483e09155e2198234c493a9b6826 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 14 Aug 2022 20:54:17 +0800 Subject: [PATCH 12/17] chore: lint --- packages/vite/src/node/build.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index 822751e8bb67fe..ee692a908f6550 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -386,9 +386,9 @@ async function doBuild( const outDir = resolve(options.outDir) // inject ssr arg to plugin load/transform hooks - const plugins = ssr - ? config.plugins.map((p) => injectSsrFlagToHooks(p)) - : config.plugins + const plugins = ( + ssr ? config.plugins.map((p) => injectSsrFlagToHooks(p)) : config.plugins + ) as Plugin[] const userExternal = options.rollupOptions?.external let external = userExternal From 0b4d75f608f7b3c0400726076b522f73a6580c71 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 14 Aug 2022 22:30:00 +0800 Subject: [PATCH 13/17] fix: test https://github.com/rollup/rollup/pull/4588 --- playground/lib/__tests__/lib.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playground/lib/__tests__/lib.spec.ts b/playground/lib/__tests__/lib.spec.ts index 54a7613d04cdce..0f9b837aab2b3f 100644 --- a/playground/lib/__tests__/lib.spec.ts +++ b/playground/lib/__tests__/lib.spec.ts @@ -24,7 +24,7 @@ describe.runIf(isBuild)('build', () => { expect(await page.textContent('.iife')).toBe('It works') const code = readFile('dist/my-lib-custom-filename.iife.js') // esbuild helpers are injected inside of the IIFE wrapper - expect(code).toMatch(/^const MyLib=function\(\){"use strict";/) + expect(code).toMatch(/^var MyLib=function\(\){"use strict";/) }) test('Library mode does not include `preload`', async () => { From 6cc4b1441aa6956df29eadee2bdbaa79146a2cd1 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 14 Aug 2022 22:32:50 +0800 Subject: [PATCH 14/17] chore: limit rollup range --- package.json | 2 +- packages/plugin-vue/package.json | 2 +- pnpm-lock.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index e8cec7f0065f2a..30e21dcc47f5b0 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "prettier": "2.7.1", "prompts": "^2.4.2", "rimraf": "^3.0.2", - "rollup": "^2.78.0", + "rollup": "~2.78.0", "semver": "^7.3.7", "simple-git-hooks": "^2.8.0", "tslib": "^2.4.0", diff --git a/packages/plugin-vue/package.json b/packages/plugin-vue/package.json index 67f4145c2ea199..359d77897cdca7 100644 --- a/packages/plugin-vue/package.json +++ b/packages/plugin-vue/package.json @@ -42,7 +42,7 @@ "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.14", "debug": "^4.3.4", - "rollup": "^2.78.0", + "rollup": "~2.78.0", "slash": "^4.0.0", "source-map": "^0.6.1", "vite": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 02ced38540999f..634a4f9b4aef5a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,7 +51,7 @@ importers: prettier: 2.7.1 prompts: ^2.4.2 rimraf: ^3.0.2 - rollup: ^2.78.0 + rollup: ~2.78.0 semver: ^7.3.7 simple-git-hooks: ^2.8.0 tslib: ^2.4.0 @@ -171,7 +171,7 @@ importers: '@jridgewell/gen-mapping': ^0.3.2 '@jridgewell/trace-mapping': ^0.3.14 debug: ^4.3.4 - rollup: ^2.78.0 + rollup: ~2.78.0 slash: ^4.0.0 source-map: ^0.6.1 vite: workspace:* From 90f01855250716b8b82363ab6d0a01b9917eb4c5 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 14 Aug 2022 23:03:56 +0800 Subject: [PATCH 15/17] chore: update --- packages/vite/package.json | 2 +- pnpm-lock.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vite/package.json b/packages/vite/package.json index 52c606ec57b6cc..307945ff2b4123 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -61,7 +61,7 @@ "esbuild": "^0.14.47", "postcss": "^8.4.16", "resolve": "^1.22.1", - "rollup": "^2.78.0" + "rollup": "~2.78.0" }, "optionalDependencies": { "fsevents": "~2.3.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 634a4f9b4aef5a..f6ad5e519c1484 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -249,7 +249,7 @@ importers: postcss-modules: ^4.3.1 resolve: ^1.22.1 resolve.exports: ^1.1.0 - rollup: ^2.78.0 + rollup: ~2.78.0 rollup-plugin-license: ^2.8.1 sirv: ^2.0.2 source-map-js: ^1.0.2 From 55e342a521c0280a7de19bbfa54b5b3989be1ebb Mon Sep 17 00:00:00 2001 From: patak-dev Date: Sun, 21 Aug 2022 21:34:02 +0200 Subject: [PATCH 16/17] chore: update lock --- pnpm-lock.yaml | 339 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 273 insertions(+), 66 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fbcecb2287f34c..94823a37e6d9c1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,8 +64,8 @@ importers: vue: ^3.2.37 devDependencies: '@babel/types': 7.18.10 - '@microsoft/api-extractor': 7.29.0 - '@rollup/plugin-typescript': 8.3.4_nzsoit4cp576bo3qoi6msb73em + '@microsoft/api-extractor': 7.29.3 + '@rollup/plugin-typescript': 8.3.4_7emp2e44zzc74lnyjhc37gdv4y '@types/babel__core': 7.1.19 '@types/babel__standalone': 7.1.4 '@types/convert-source-map': 1.5.2 @@ -110,10 +110,10 @@ importers: tslib: 2.4.0 tsx: 3.8.2 typescript: 4.6.4 - unbuild: 0.7.6 + unbuild: 0.8.9 vite: link:packages/vite - vitepress: 1.0.0-alpha.4 - vitest: 0.21.0 + vitepress: 1.0.0-alpha.9 + vitest: 0.22.1 vue: 3.2.37 packages/create-vite: @@ -140,7 +140,7 @@ importers: core-js: 3.24.1 magic-string: 0.26.2 regenerator-runtime: 0.13.9 - systemjs: 6.12.1 + systemjs: 6.12.3 devDependencies: '@babel/core': 7.18.10 vite: link:../vite @@ -301,7 +301,7 @@ importers: launch-editor-middleware: 2.5.0 magic-string: 0.26.2 micromatch: 4.0.5 - mlly: 0.5.7 + mlly: 0.5.13 mrmime: 1.0.1 okie: 1.0.1 open: 8.4.0 @@ -665,6 +665,7 @@ importers: dep-with-builtin-module-cjs: file:playground/optimize-deps/dep-with-builtin-module-cjs dep-with-builtin-module-esm: file:playground/optimize-deps/dep-with-builtin-module-esm dep-with-dynamic-import: file:playground/optimize-deps/dep-with-dynamic-import + dep-with-optional-peer-dep: file:playground/optimize-deps/dep-with-optional-peer-dep lodash: 4.17.21 lodash-es: 4.17.21 lodash.clonedeep: 4.5.0 @@ -1256,8 +1257,12 @@ importers: packages: - /@algolia/autocomplete-core/1.6.3: - resolution: {integrity: sha512-dqQqRt01fX3YuVFrkceHsoCnzX0bLhrrg8itJI1NM68KjrPYQPYsE+kY8EZTCM4y8VDnhqJErR73xe/ZsV+qAA==} + /@adobe/css-tools/4.0.1: + resolution: {integrity: sha512-+u76oB43nOHrF4DDWRLWDCtci7f3QJoEBigemIdIeTi1ODqjx6Tad9NCVnPRwewWlKkVab5PlK8DCtPTyX7S8g==} + dev: true + + /@algolia/autocomplete-core/1.7.1: + resolution: {integrity: sha512-eiZw+fxMzNQn01S8dA/hcCpoWCOCwcIIEUtHHdzN5TGB3IpzLbuhqFeTfh2OUhhgkE8Uo17+wH+QJ/wYyQmmzg==} dependencies: '@algolia/autocomplete-shared': 1.7.1 dev: true @@ -2156,6 +2161,15 @@ packages: get-tsconfig: 4.1.0 dev: true + /@esbuild/linux-loong64/0.15.5: + resolution: {integrity: sha512-UHkDFCfSGTuXq08oQltXxSZmH1TXyWsL+4QhZDWvvLl6mEJQqk3u7/wq1LjhrrAXYIllaTtRSzUXl4Olkf2J8A==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@eslint/eslintrc/1.3.0: resolution: {integrity: sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2295,8 +2309,8 @@ packages: '@rushstack/node-core-library': 3.50.2 dev: true - /@microsoft/api-extractor/7.29.0: - resolution: {integrity: sha512-tGU5DiwQ7/gN9Chi7cuAdspTuVY8hNcq5hBtvwAvb1H85tbiIHuqgoneHI60rkqlud7szkHJLiCkv75kQ0JLjw==} + /@microsoft/api-extractor/7.29.3: + resolution: {integrity: sha512-PHq+Oo8yiXhwi11VQ1Nz36s+aZwgFqjtkd41udWHtSpyMv2slJ74m1cHdpWbs2ovGUCfldayzdpGwnexZLd2bA==} hasBin: true dependencies: '@microsoft/api-extractor-model': 7.23.1 @@ -2395,23 +2409,7 @@ packages: slash: 3.0.0 dev: true - /@rollup/plugin-commonjs/22.0.1_rollup@2.77.0: - resolution: {integrity: sha512-dGfEZvdjDHObBiP5IvwTKMVeq/tBZGMBHZFMdIV1ClMM/YoWS34xrHFGfag9SN2ZtMgNZRFruqvxZQEa70O6nQ==} - engines: {node: '>= 12.0.0'} - peerDependencies: - rollup: ^2.68.0 - dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.77.0 - commondir: 1.0.1 - estree-walker: 2.0.2 - glob: 7.2.0 - is-reference: 1.2.1 - magic-string: 0.25.9 - resolve: 1.22.1 - rollup: 2.77.0 - dev: true - - /@rollup/plugin-commonjs/22.0.2_rollup@2.77.0: + /@rollup/plugin-commonjs/22.0.2_rollup@2.78.0: resolution: {integrity: sha512-//NdP6iIwPbMTcazYsiBMbJW7gfmpHom33u1beiIoHDEM0Q9clvtQB1T0efvMqHeKsGohiHo97BCPCkBXdscwg==} engines: {node: '>= 12.0.0'} peerDependencies: @@ -4353,6 +4351,15 @@ packages: dev: true optional: true + /esbuild-android-64/0.15.5: + resolution: {integrity: sha512-dYPPkiGNskvZqmIK29OPxolyY3tp+c47+Fsc2WYSOVjEPWNCHNyqhtFqQadcXMJDQt8eN0NMDukbyQgFcHquXg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + /esbuild-android-arm64/0.14.47: resolution: {integrity: sha512-OkwOjj7ts4lBp/TL6hdd8HftIzOy/pdtbrNA4+0oVWgGG64HrdVzAF5gxtJufAPOsEjkyh1oIYvKAUinKKQRSQ==} engines: {node: '>=12'} @@ -4370,6 +4377,15 @@ packages: dev: true optional: true + /esbuild-android-arm64/0.15.5: + resolution: {integrity: sha512-YyEkaQl08ze3cBzI/4Cm1S+rVh8HMOpCdq8B78JLbNFHhzi4NixVN93xDrHZLztlocEYqi45rHHCgA8kZFidFg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + /esbuild-darwin-64/0.14.47: resolution: {integrity: sha512-R6oaW0y5/u6Eccti/TS6c/2c1xYTb1izwK3gajJwi4vIfNs1s8B1dQzI1UiC9T61YovOQVuePDcfqHLT3mUZJA==} engines: {node: '>=12'} @@ -4387,6 +4403,15 @@ packages: dev: true optional: true + /esbuild-darwin-64/0.15.5: + resolution: {integrity: sha512-Cr0iIqnWKx3ZTvDUAzG0H/u9dWjLE4c2gTtRLz4pqOBGjfjqdcZSfAObFzKTInLLSmD0ZV1I/mshhPoYSBMMCQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /esbuild-darwin-arm64/0.14.47: resolution: {integrity: sha512-seCmearlQyvdvM/noz1L9+qblC5vcBrhUaOoLEDDoLInF/VQ9IkobGiLlyTPYP5dW1YD4LXhtBgOyevoIHGGnw==} engines: {node: '>=12'} @@ -4404,6 +4429,15 @@ packages: dev: true optional: true + /esbuild-darwin-arm64/0.15.5: + resolution: {integrity: sha512-WIfQkocGtFrz7vCu44ypY5YmiFXpsxvz2xqwe688jFfSVCnUsCn2qkEVDo7gT8EpsLOz1J/OmqjExePL1dr1Kg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /esbuild-freebsd-64/0.14.47: resolution: {integrity: sha512-ZH8K2Q8/Ux5kXXvQMDsJcxvkIwut69KVrYQhza/ptkW50DC089bCVrJZZ3sKzIoOx+YPTrmsZvqeZERjyYrlvQ==} engines: {node: '>=12'} @@ -4421,6 +4455,15 @@ packages: dev: true optional: true + /esbuild-freebsd-64/0.15.5: + resolution: {integrity: sha512-M5/EfzV2RsMd/wqwR18CELcenZ8+fFxQAAEO7TJKDmP3knhWSbD72ILzrXFMMwshlPAS1ShCZ90jsxkm+8FlaA==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /esbuild-freebsd-arm64/0.14.47: resolution: {integrity: sha512-ZJMQAJQsIOhn3XTm7MPQfCzEu5b9STNC+s90zMWe2afy9EwnHV7Ov7ohEMv2lyWlc2pjqLW8QJnz2r0KZmeAEQ==} engines: {node: '>=12'} @@ -4438,6 +4481,15 @@ packages: dev: true optional: true + /esbuild-freebsd-arm64/0.15.5: + resolution: {integrity: sha512-2JQQ5Qs9J0440F/n/aUBNvY6lTo4XP/4lt1TwDfHuo0DY3w5++anw+jTjfouLzbJmFFiwmX7SmUhMnysocx96w==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /esbuild-linux-32/0.14.47: resolution: {integrity: sha512-FxZOCKoEDPRYvq300lsWCTv1kcHgiiZfNrPtEhFAiqD7QZaXrad8LxyJ8fXGcWzIFzRiYZVtB3ttvITBvAFhKw==} engines: {node: '>=12'} @@ -4455,6 +4507,15 @@ packages: dev: true optional: true + /esbuild-linux-32/0.15.5: + resolution: {integrity: sha512-gO9vNnIN0FTUGjvTFucIXtBSr1Woymmx/aHQtuU+2OllGU6YFLs99960UD4Dib1kFovVgs59MTXwpFdVoSMZoQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + /esbuild-linux-64/0.14.47: resolution: {integrity: sha512-nFNOk9vWVfvWYF9YNYksZptgQAdstnDCMtR6m42l5Wfugbzu11VpMCY9XrD4yFxvPo9zmzcoUL/88y0lfJZJJw==} engines: {node: '>=12'} @@ -4472,6 +4533,15 @@ packages: dev: true optional: true + /esbuild-linux-64/0.15.5: + resolution: {integrity: sha512-ne0GFdNLsm4veXbTnYAWjbx3shpNKZJUd6XpNbKNUZaNllDZfYQt0/zRqOg0sc7O8GQ+PjSMv9IpIEULXVTVmg==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /esbuild-linux-arm/0.14.47: resolution: {integrity: sha512-ZGE1Bqg/gPRXrBpgpvH81tQHpiaGxa8c9Rx/XOylkIl2ypLuOcawXEAo8ls+5DFCcRGt/o3sV+PzpAFZobOsmA==} engines: {node: '>=12'} @@ -4489,6 +4559,15 @@ packages: dev: true optional: true + /esbuild-linux-arm/0.15.5: + resolution: {integrity: sha512-wvAoHEN+gJ/22gnvhZnS/+2H14HyAxM07m59RSLn3iXrQsdS518jnEWRBnJz3fR6BJa+VUTo0NxYjGaNt7RA7Q==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + /esbuild-linux-arm64/0.14.47: resolution: {integrity: sha512-ywfme6HVrhWcevzmsufjd4iT3PxTfCX9HOdxA7Hd+/ZM23Y9nXeb+vG6AyA6jgq/JovkcqRHcL9XwRNpWG6XRw==} engines: {node: '>=12'} @@ -4506,6 +4585,15 @@ packages: dev: true optional: true + /esbuild-linux-arm64/0.15.5: + resolution: {integrity: sha512-7EgFyP2zjO065XTfdCxiXVEk+f83RQ1JsryN1X/VSX2li9rnHAt2swRbpoz5Vlrl6qjHrCmq5b6yxD13z6RheA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /esbuild-linux-mips64le/0.14.47: resolution: {integrity: sha512-mg3D8YndZ1LvUiEdDYR3OsmeyAew4MA/dvaEJxvyygahWmpv1SlEEnhEZlhPokjsUMfRagzsEF/d/2XF+kTQGg==} engines: {node: '>=12'} @@ -4523,6 +4611,15 @@ packages: dev: true optional: true + /esbuild-linux-mips64le/0.15.5: + resolution: {integrity: sha512-KdnSkHxWrJ6Y40ABu+ipTZeRhFtc8dowGyFsZY5prsmMSr1ZTG9zQawguN4/tunJ0wy3+kD54GaGwdcpwWAvZQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + /esbuild-linux-ppc64le/0.14.47: resolution: {integrity: sha512-WER+f3+szmnZiWoK6AsrTKGoJoErG2LlauSmk73LEZFQ/iWC+KhhDsOkn1xBUpzXWsxN9THmQFltLoaFEH8F8w==} engines: {node: '>=12'} @@ -4540,6 +4637,15 @@ packages: dev: true optional: true + /esbuild-linux-ppc64le/0.15.5: + resolution: {integrity: sha512-QdRHGeZ2ykl5P0KRmfGBZIHmqcwIsUKWmmpZTOq573jRWwmpfRmS7xOhmDHBj9pxv+6qRMH8tLr2fe+ZKQvCYw==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /esbuild-linux-riscv64/0.14.47: resolution: {integrity: sha512-1fI6bP3A3rvI9BsaaXbMoaOjLE3lVkJtLxsgLHqlBhLlBVY7UqffWBvkrX/9zfPhhVMd9ZRFiaqXnB1T7BsL2g==} engines: {node: '>=12'} @@ -4557,6 +4663,15 @@ packages: dev: true optional: true + /esbuild-linux-riscv64/0.15.5: + resolution: {integrity: sha512-p+WE6RX+jNILsf+exR29DwgV6B73khEQV0qWUbzxaycxawZ8NE0wA6HnnTxbiw5f4Gx9sJDUBemh9v49lKOORA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /esbuild-linux-s390x/0.14.47: resolution: {integrity: sha512-eZrWzy0xFAhki1CWRGnhsHVz7IlSKX6yT2tj2Eg8lhAwlRE5E96Hsb0M1mPSE1dHGpt1QVwwVivXIAacF/G6mw==} engines: {node: '>=12'} @@ -4574,6 +4689,15 @@ packages: dev: true optional: true + /esbuild-linux-s390x/0.15.5: + resolution: {integrity: sha512-J2ngOB4cNzmqLHh6TYMM/ips8aoZIuzxJnDdWutBw5482jGXiOzsPoEF4j2WJ2mGnm7FBCO4StGcwzOgic70JQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + /esbuild-netbsd-64/0.14.47: resolution: {integrity: sha512-Qjdjr+KQQVH5Q2Q1r6HBYswFTToPpss3gqCiSw2Fpq/ua8+eXSQyAMG+UvULPqXceOwpnPo4smyZyHdlkcPppQ==} engines: {node: '>=12'} @@ -4591,6 +4715,15 @@ packages: dev: true optional: true + /esbuild-netbsd-64/0.15.5: + resolution: {integrity: sha512-MmKUYGDizYjFia0Rwt8oOgmiFH7zaYlsoQ3tIOfPxOqLssAsEgG0MUdRDm5lliqjiuoog8LyDu9srQk5YwWF3w==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + /esbuild-openbsd-64/0.14.47: resolution: {integrity: sha512-QpgN8ofL7B9z8g5zZqJE+eFvD1LehRlxr25PBkjyyasakm4599iroUpaj96rdqRlO2ShuyqwJdr+oNqWwTUmQw==} engines: {node: '>=12'} @@ -4608,6 +4741,15 @@ packages: dev: true optional: true + /esbuild-openbsd-64/0.15.5: + resolution: {integrity: sha512-2mMFfkLk3oPWfopA9Plj4hyhqHNuGyp5KQyTT9Rc8hFd8wAn5ZrbJg+gNcLMo2yzf8Uiu0RT6G9B15YN9WQyMA==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + /esbuild-sunos-64/0.14.47: resolution: {integrity: sha512-uOeSgLUwukLioAJOiGYm3kNl+1wJjgJA8R671GYgcPgCx7QR73zfvYqXFFcIO93/nBdIbt5hd8RItqbbf3HtAQ==} engines: {node: '>=12'} @@ -4625,6 +4767,15 @@ packages: dev: true optional: true + /esbuild-sunos-64/0.15.5: + resolution: {integrity: sha512-2sIzhMUfLNoD+rdmV6AacilCHSxZIoGAU2oT7XmJ0lXcZWnCvCtObvO6D4puxX9YRE97GodciRGDLBaiC6x1SA==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + /esbuild-windows-32/0.14.47: resolution: {integrity: sha512-H0fWsLTp2WBfKLBgwYT4OTfFly4Im/8B5f3ojDv1Kx//kiubVY0IQunP2Koc/fr/0wI7hj3IiBDbSrmKlrNgLQ==} engines: {node: '>=12'} @@ -4642,6 +4793,15 @@ packages: dev: true optional: true + /esbuild-windows-32/0.15.5: + resolution: {integrity: sha512-e+duNED9UBop7Vnlap6XKedA/53lIi12xv2ebeNS4gFmu7aKyTrok7DPIZyU5w/ftHD4MUDs5PJUkQPP9xJRzg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /esbuild-windows-64/0.14.47: resolution: {integrity: sha512-/Pk5jIEH34T68r8PweKRi77W49KwanZ8X6lr3vDAtOlH5EumPE4pBHqkCUdELanvsT14yMXLQ/C/8XPi1pAtkQ==} engines: {node: '>=12'} @@ -4659,6 +4819,15 @@ packages: dev: true optional: true + /esbuild-windows-64/0.15.5: + resolution: {integrity: sha512-v+PjvNtSASHOjPDMIai9Yi+aP+Vwox+3WVdg2JB8N9aivJ7lyhp4NVU+J0MV2OkWFPnVO8AE/7xH+72ibUUEnw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /esbuild-windows-arm64/0.14.47: resolution: {integrity: sha512-HFSW2lnp62fl86/qPQlqw6asIwCnEsEoNIL1h2uVMgakddf+vUuMcCbtUY1i8sst7KkgHrVKCJQB33YhhOweCQ==} engines: {node: '>=12'} @@ -4676,6 +4845,15 @@ packages: dev: true optional: true + /esbuild-windows-arm64/0.15.5: + resolution: {integrity: sha512-Yz8w/D8CUPYstvVQujByu6mlf48lKmXkq6bkeSZZxTA626efQOJb26aDGLzmFWx6eg/FwrXgt6SZs9V8Pwy/aA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /esbuild/0.14.47: resolution: {integrity: sha512-wI4ZiIfFxpkuxB8ju4MHrGwGLyp1+awEHAHVpx6w7a+1pmYIq8T9FGEVVwFo0iFierDoMj++Xq69GXWYn2EiwA==} engines: {node: '>=12'} @@ -4731,6 +4909,35 @@ packages: esbuild-windows-arm64: 0.14.50 dev: true + /esbuild/0.15.5: + resolution: {integrity: sha512-VSf6S1QVqvxfIsSKb3UKr3VhUCis7wgDbtF4Vd9z84UJr05/Sp2fRKmzC+CSPG/dNAPPJZ0BTBLTT1Fhd6N9Gg==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/linux-loong64': 0.15.5 + esbuild-android-64: 0.15.5 + esbuild-android-arm64: 0.15.5 + esbuild-darwin-64: 0.15.5 + esbuild-darwin-arm64: 0.15.5 + esbuild-freebsd-64: 0.15.5 + esbuild-freebsd-arm64: 0.15.5 + esbuild-linux-32: 0.15.5 + esbuild-linux-64: 0.15.5 + esbuild-linux-arm: 0.15.5 + esbuild-linux-arm64: 0.15.5 + esbuild-linux-mips64le: 0.15.5 + esbuild-linux-ppc64le: 0.15.5 + esbuild-linux-riscv64: 0.15.5 + esbuild-linux-s390x: 0.15.5 + esbuild-netbsd-64: 0.15.5 + esbuild-openbsd-64: 0.15.5 + esbuild-sunos-64: 0.15.5 + esbuild-windows-32: 0.15.5 + esbuild-windows-64: 0.15.5 + esbuild-windows-arm64: 0.15.5 + dev: true + /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -6462,18 +6669,11 @@ packages: typescript: 4.7.4 dev: true - /mlly/0.5.5: - resolution: {integrity: sha512-2R4JT/SxRDPexomw4rmHYY/gWAGmL9Kkq1OR76Ua6w+P340a1aBDTWzKo2kAlxzrG82OdXs5VB9Lmcmyit0Obg==} - dependencies: - pathe: 0.3.2 - pkg-types: 0.3.3 - dev: true - - /mlly/0.5.7: - resolution: {integrity: sha512-rz+n2i9862ymLH+UDlHpsuTVyCIAs+9WejS2De2VUlAKdpq8OJ9x/C2M7nNUMLEW1H+D6n0uZlpz8+tMGxCmyQ==} + /mlly/0.5.13: + resolution: {integrity: sha512-0SK2fqoan+PMjADs4I2egAtrtNtpjqRez6PDTCeAdGjUQNJCvO5o9v2NEq52WA1jFmMU97qBr/JgdvCquehDbA==} dependencies: acorn: 8.8.0 - pathe: 0.3.3 + pathe: 0.3.5 pkg-types: 0.3.3 ufo: 0.8.5 dev: true @@ -6934,12 +7134,8 @@ packages: resolution: {integrity: sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==} dev: true - /pathe/0.3.2: - resolution: {integrity: sha512-qhnmX0TOqlCvdWWTkoM83wh5J8fZ2yhbDEc9MlsnAEtEc+JCwxUKEwmd6pkY9hRe6JR1Uecbc14VcAKX2yFSTA==} - dev: true - - /pathe/0.3.3: - resolution: {integrity: sha512-x3nrPvG0HDSDzUiJ0WqtzhN4MD+h5B+dFJ3/qyxVuARlr4Y3aJv8gri2cZzp9Z8sGs2a+aG9gNbKngh3gme57A==} + /pathe/0.3.5: + resolution: {integrity: sha512-grU/QeYP0ChuE5kjU2/k8VtAeODzbernHlue0gTa27+ayGIu3wqYBIPGfP9r5xSqgCgDd4nWrjKXEfxMillByg==} dev: true /pathval/1.1.1: @@ -6995,8 +7191,8 @@ packages: resolution: {integrity: sha512-6AJcCMnjUQPQv/Wk960w0TOmjhdjbeaQJoSKWRQv9N3rgkessCu6J0Ydsog/nw1MbpnxHuPzYbfOn2KmlZO1FA==} dependencies: jsonc-parser: 3.0.0 - mlly: 0.5.7 - pathe: 0.3.3 + mlly: 0.5.13 + pathe: 0.3.5 dev: true /playwright-chromium/1.25.0: @@ -7672,8 +7868,8 @@ packages: '@babel/code-frame': 7.18.6 dev: true - /rollup-plugin-esbuild/4.9.1_nkjtn7ewzjrspe36n7zrekxwnm: - resolution: {integrity: sha512-qn/x7Wz9p3Xnva99qcb+nopH0d2VJwVnsxJTGEg+Sh2Z3tqQl33MhOwzekVo1YTKgv+yAmosjcBRJygMfGrtLw==} + /rollup-plugin-esbuild/4.9.3_g2b53jqudjimruv6spqg4ieafm: + resolution: {integrity: sha512-bxfUNYTa9Tw/4kdFfT9gtidDtqXyRdCW11ctZM7D8houCCVqp5qHzQF7hhIr31rqMA0APbG47fgVbbCGXgM49Q==} engines: {node: '>=12'} peerDependencies: esbuild: '>=0.10.1' @@ -7682,7 +7878,7 @@ packages: '@rollup/pluginutils': 4.2.1 debug: 4.3.4 es-module-lexer: 0.9.3 - esbuild: 0.14.50 + esbuild: 0.15.5 joycon: 3.1.1 jsonc-parser: 3.0.0 rollup: 2.78.0 @@ -8197,8 +8393,8 @@ packages: resolution: {integrity: sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=} dev: false - /systemjs/6.12.1: - resolution: {integrity: sha512-hqTN6kW+pN6/qro6G9OZ7ceDQOcYno020zBQKpZQLsJhYTDMCMNfXi/Y8duF5iW+4WWZr42ry0MMkcRGpbwG2A==} + /systemjs/6.12.3: + resolution: {integrity: sha512-TtYUN86Hs8V1QGAoj9ad1xmJmZS9Lurfi8Iu8QWOKaUDDuTH0Bpfdxz9qZIdxsmvAg3WMQnZ5/pkQvloh2sr/Q==} dev: false /tailwindcss/3.1.8: @@ -8569,8 +8765,8 @@ packages: which-boxed-primitive: 1.0.2 dev: true - /unbuild/0.7.6: - resolution: {integrity: sha512-W6pFPS6/ewlEV5uWbNgfo0i2LbVBsue5GKlOkCo6ozIrInOBEgq4s3HCUB5eZSw6Ty2iwF8dKM65pZX7QGZJ0g==} + /unbuild/0.8.9: + resolution: {integrity: sha512-LCFL/V3Y0UDxal6MNvSTGuyOnTAha467oTCRURZqj4zaW1r/kTDeVNkA9OdP8J/bnsxr0CvkdjRjlvv/K3o7Yw==} hasBin: true dependencies: '@rollup/plugin-alias': 3.1.9_rollup@2.78.0 @@ -8581,23 +8777,24 @@ packages: '@rollup/pluginutils': 4.2.1 chalk: 5.0.1 consola: 2.15.3 - defu: 6.0.0 - esbuild: 0.14.50 + defu: 6.1.0 + esbuild: 0.15.5 + globby: 13.1.2 hookable: 5.1.1 jiti: 1.14.0 magic-string: 0.26.2 mkdirp: 1.0.4 mkdist: 0.3.13_typescript@4.7.4 - mlly: 0.5.5 + mlly: 0.5.13 mri: 1.2.0 - pathe: 0.3.2 + pathe: 0.3.5 pkg-types: 0.3.3 pretty-bytes: 6.0.0 rimraf: 3.0.2 - rollup: 2.77.0 - rollup-plugin-dts: 4.2.2_55kiftncucr43pz4hskma6yi2q - rollup-plugin-esbuild: 4.9.1_nkjtn7ewzjrspe36n7zrekxwnm - scule: 0.2.1 + rollup: 2.78.0 + rollup-plugin-dts: 4.2.2_nm5mlcuxlwr6samvke7b2fz27i + rollup-plugin-esbuild: 4.9.3_g2b53jqudjimruv6spqg4ieafm + scule: 0.3.2 typescript: 4.7.4 untyped: 0.4.5 transitivePeerDependencies: @@ -8695,9 +8892,8 @@ packages: engines: {node: '>= 0.8'} dev: true - /vitepress/1.0.0-alpha.4: - resolution: {integrity: sha512-bOAA4KW6vYGlkbcrPLZLTKWTgXVroObU+o9xj9EENyEl6yg26WWvfN7DGA4BftjdM5O8nR93Z5khPQ3W/tFE7Q==} - engines: {node: '>=14.6.0'} + /vitepress/1.0.0-alpha.9: + resolution: {integrity: sha512-+VxgjflIcssbuyUBRYjZRpQ8w25v6XnIbXFmm9qwLVaqZdC0rN6qViEp7oRwA3HUlrGxj7GEzqQjW7xj4+E83w==} hasBin: true dependencies: '@docsearch/css': 3.2.1 @@ -8717,8 +8913,8 @@ packages: - react-dom dev: true - /vitest/0.21.0: - resolution: {integrity: sha512-+BQB2swk4wQdw5loOoL8esIYh/1ifAliuwj2HWHNE2F8SAl/jF7/aoCJBoXGSf/Ws19k3pH4NrWeVtcSwM0j2w==} + /vitest/0.22.1: + resolution: {integrity: sha512-+x28YTnSLth4KbXg7MCzoDAzPJlJex7YgiZbUh6YLp0/4PqVZ7q7/zyfdL0OaPtKTpNiQFPpMC8Y2MSzk8F7dw==} engines: {node: '>=v14.16.0'} hasBin: true peerDependencies: @@ -9131,6 +9327,17 @@ packages: version: 0.0.0 dev: false + file:playground/optimize-deps/dep-with-optional-peer-dep: + resolution: {directory: playground/optimize-deps/dep-with-optional-peer-dep, type: directory} + name: dep-with-optional-peer-dep + version: 0.0.0 + peerDependencies: + foobar: 0.0.0 + peerDependenciesMeta: + foobar: + optional: true + dev: false + file:playground/optimize-deps/nested-exclude: resolution: {directory: playground/optimize-deps/nested-exclude, type: directory} name: nested-exclude From 31c5593030bf9d2f009e06552232fd5a73592e18 Mon Sep 17 00:00:00 2001 From: patak-dev Date: Sun, 21 Aug 2022 21:43:45 +0200 Subject: [PATCH 17/17] chore: redo lock --- pnpm-lock.yaml | 343 +++++++++++++++++++++++-------------------------- 1 file changed, 162 insertions(+), 181 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 94823a37e6d9c1..b8ed1ac468401a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,7 +64,7 @@ importers: vue: ^3.2.37 devDependencies: '@babel/types': 7.18.10 - '@microsoft/api-extractor': 7.29.3 + '@microsoft/api-extractor': 7.29.2 '@rollup/plugin-typescript': 8.3.4_7emp2e44zzc74lnyjhc37gdv4y '@types/babel__core': 7.1.19 '@types/babel__standalone': 7.1.4 @@ -110,10 +110,10 @@ importers: tslib: 2.4.0 tsx: 3.8.2 typescript: 4.6.4 - unbuild: 0.8.9 + unbuild: 0.8.8 vite: link:packages/vite - vitepress: 1.0.0-alpha.9 - vitest: 0.22.1 + vitepress: 1.0.0-alpha.5 + vitest: 0.22.0 vue: 3.2.37 packages/create-vite: @@ -140,7 +140,7 @@ importers: core-js: 3.24.1 magic-string: 0.26.2 regenerator-runtime: 0.13.9 - systemjs: 6.12.3 + systemjs: 6.12.2 devDependencies: '@babel/core': 7.18.10 vite: link:../vite @@ -301,7 +301,7 @@ importers: launch-editor-middleware: 2.5.0 magic-string: 0.26.2 micromatch: 4.0.5 - mlly: 0.5.13 + mlly: 0.5.12 mrmime: 1.0.1 okie: 1.0.1 open: 8.4.0 @@ -1261,24 +1261,14 @@ 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.6.3: + resolution: {integrity: sha512-dqQqRt01fX3YuVFrkceHsoCnzX0bLhrrg8itJI1NM68KjrPYQPYsE+kY8EZTCM4y8VDnhqJErR73xe/ZsV+qAA==} dependencies: - '@algolia/autocomplete-shared': 1.7.1 + '@algolia/autocomplete-shared': 1.6.3 dev: true - /@algolia/autocomplete-preset-algolia/1.7.1_algoliasearch@4.13.1: - resolution: {integrity: sha512-pJwmIxeJCymU1M6cGujnaIYcY3QPOVYZOXhFkWVM7IxKzy272BwCvMFMyc5NpG/QmiObBxjo7myd060OeTNJXg==} - peerDependencies: - '@algolia/client-search': ^4.9.1 - algoliasearch: ^4.9.1 - dependencies: - '@algolia/autocomplete-shared': 1.7.1 - algoliasearch: 4.13.1 - dev: true - - /@algolia/autocomplete-shared/1.7.1: - resolution: {integrity: sha512-eTmGVqY3GeyBTT8IWiB2K5EuURAqhnumfktAEoHxfDY2o7vg2rSnO16ZtIG0fMgt3py28Vwgq42/bVEuaQV7pg==} + /@algolia/autocomplete-shared/1.6.3: + resolution: {integrity: sha512-UV46bnkTztyADFaETfzFC5ryIdGVb2zpAoYgu0tfcuYWjhg1KbLXveFffZIrGVoboqmAk1b+jMrl6iCja1i3lg==} dev: true /@algolia/cache-browser-local-storage/4.13.1: @@ -1959,7 +1949,7 @@ packages: resolution: {integrity: sha512-aKXj1KT66sBj0vVzk6rEeAO6Z9aiiQ68wfDgge3nHhA/my6xMM/7HGQUNumKZaoa2qUPQ5whJG9aAifsxUKfLA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.16.7 + '@babel/code-frame': 7.18.6 '@babel/generator': 7.18.2 '@babel/helper-environment-visitor': 7.18.2 '@babel/helper-function-name': 7.17.9 @@ -2023,42 +2013,31 @@ packages: dependencies: '@jridgewell/trace-mapping': 0.3.9 - /@docsearch/css/3.2.1: - resolution: {integrity: sha512-gaP6TxxwQC+K8D6TRx5WULUWKrcbzECOPA2KCVMuI+6C7dNiGUk5yXXzVhc5sld79XKYLnO9DRTI4mjXDYkh+g==} + /@docsearch/css/3.1.0: + resolution: {integrity: sha512-bh5IskwkkodbvC0FzSg1AxMykfDl95hebEKwxNoq4e5QaGzOXSBgW8+jnMFZ7JU4sTBiB04vZWoUSzNrPboLZA==} dev: true - /@docsearch/js/3.2.1: - resolution: {integrity: sha512-H1PekEtSeS0msetR2YGGey2w7jQ2wAKfGODJvQTygSwMgUZ+2DHpzUgeDyEBIXRIfaBcoQneqrzsljM62pm6Xg==} + /@docsearch/js/3.1.0: + resolution: {integrity: sha512-5XSK+xbP0hcTIp54MECqxkWLs6kf7Ug4nWdxWNtx8cUpLiFNFnKXDxCb35wnyNpjukmrx7Q9DkO5tFFsmNVxng==} dependencies: - '@docsearch/react': 3.2.1 + '@docsearch/react': 3.1.0 preact: 10.7.3 transitivePeerDependencies: - - '@algolia/client-search' - '@types/react' - react - react-dom dev: true - /@docsearch/react/3.2.1: - resolution: {integrity: sha512-EzTQ/y82s14IQC5XVestiK/kFFMe2aagoYFuTAIfIb/e+4FU7kSMKonRtLwsCiLQHmjvNQq+HO+33giJ5YVtaQ==} + /@docsearch/react/3.1.0: + resolution: {integrity: sha512-bjB6ExnZzf++5B7Tfoi6UXgNwoUnNOfZ1NyvnvPhWgCMy5V/biAtLL4o7owmZSYdAKeFSvZ5Lxm0is4su/dBWg==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' react: '>= 16.8.0 < 19.0.0' react-dom: '>= 16.8.0 < 19.0.0' - peerDependenciesMeta: - '@types/react': - optional: true - react: - optional: true - react-dom: - optional: true dependencies: - '@algolia/autocomplete-core': 1.7.1 - '@algolia/autocomplete-preset-algolia': 1.7.1_algoliasearch@4.13.1 - '@docsearch/css': 3.2.1 + '@algolia/autocomplete-core': 1.6.3 + '@docsearch/css': 3.1.0 algoliasearch: 4.13.1 - transitivePeerDependencies: - - '@algolia/client-search' dev: true /@emotion/babel-plugin/11.10.0: @@ -2161,8 +2140,8 @@ packages: get-tsconfig: 4.1.0 dev: true - /@esbuild/linux-loong64/0.15.5: - resolution: {integrity: sha512-UHkDFCfSGTuXq08oQltXxSZmH1TXyWsL+4QhZDWvvLl6mEJQqk3u7/wq1LjhrrAXYIllaTtRSzUXl4Olkf2J8A==} + /@esbuild/linux-loong64/0.15.3: + resolution: {integrity: sha512-pe7L+LnITFHUSUnuhSQRyYN2E5Anl0r7x/jW+ufc+4fBcaK3Q51b/3ufFWWhmIiuCkr7oKtmVSpaJ1DxbtSfuw==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -2301,22 +2280,22 @@ packages: - supports-color dev: false - /@microsoft/api-extractor-model/7.23.1: - resolution: {integrity: sha512-axlZ33H2LfYX7goAaWpzABWZl3JtX/EUkfVBsI4SuMn3AZYBJsP5MVpMCq7jt0PCefWGwwO+Rv+lCmmJIjFhlQ==} + /@microsoft/api-extractor-model/7.23.0: + resolution: {integrity: sha512-h+2aVyf8IYidPZp+N+yIc/LY/aBwRZ1Vxlsx7rU31807bba5ScJ94bj7OjsPMje0vRYALf+yjZToYT0HdP6omA==} dependencies: '@microsoft/tsdoc': 0.14.1 '@microsoft/tsdoc-config': 0.16.1 - '@rushstack/node-core-library': 3.50.2 + '@rushstack/node-core-library': 3.50.1 dev: true - /@microsoft/api-extractor/7.29.3: - resolution: {integrity: sha512-PHq+Oo8yiXhwi11VQ1Nz36s+aZwgFqjtkd41udWHtSpyMv2slJ74m1cHdpWbs2ovGUCfldayzdpGwnexZLd2bA==} + /@microsoft/api-extractor/7.29.2: + resolution: {integrity: sha512-MwT/Xi1DperfrBO+SU3f/xKdyR6bMvk59/WN6w7g1rHmDBMegan3Ya6npMo+abJAgQOtp6uExY/elHXcYE/Ofw==} hasBin: true dependencies: - '@microsoft/api-extractor-model': 7.23.1 + '@microsoft/api-extractor-model': 7.23.0 '@microsoft/tsdoc': 0.14.1 '@microsoft/tsdoc-config': 0.16.1 - '@rushstack/node-core-library': 3.50.2 + '@rushstack/node-core-library': 3.50.1 '@rushstack/rig-package': 0.3.14 '@rushstack/ts-command-line': 4.12.2 colors: 1.2.5 @@ -2527,8 +2506,8 @@ packages: picomatch: 2.3.1 dev: true - /@rushstack/node-core-library/3.50.2: - resolution: {integrity: sha512-+zpZBcaX5s+wA0avF0Lk3sd5jbGRo5SmsEJpElJbqQd3KGFvc/hcyeNSMqV5+esJ1JuTfnE1QyRt8nvxFNTaQg==} + /@rushstack/node-core-library/3.50.1: + resolution: {integrity: sha512-9d2xE7E9yQEBS6brTptdP8cslt6iL5+UnkY2lRxQQ4Q/jlXtsrWCCJCxwr56W/eJEe9YT/yHR4mMn5QY64Ps2w==} dependencies: '@types/node': 12.20.24 colors: 1.2.5 @@ -2747,10 +2726,6 @@ packages: '@types/node': 17.0.42 dev: true - /@types/web-bluetooth/0.0.15: - resolution: {integrity: sha512-w7hEHXnPMEZ+4nGKl/KDRVpxkwYxYExuHOYXyzIzCDzEZ9ZCGMAewulr9IqJu2LR4N37fcnb1XVeuZ09qgOxhA==} - dev: true - /@types/ws/8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: @@ -2940,11 +2915,6 @@ packages: /@vue/devtools-api/6.1.4: resolution: {integrity: sha512-IiA0SvDrJEgXvVxjNkHPFfDx6SXw0b/TUkqMcDZWNg9fnCAHbTpoo59YfJ9QLFkwa3raau5vSlRVzMSLDnfdtQ==} - dev: false - - /@vue/devtools-api/6.2.1: - resolution: {integrity: sha512-OEgAMeQXvCoJ+1x8WyQuVZzFo0wcyCmUR3baRVLmKBo1LmYZWMlRiXlux5jd0fqVJu6PfDbOrZItVqUEzLobeQ==} - dev: true /@vue/reactivity-transform/3.2.37: resolution: {integrity: sha512-IWopkKEb+8qpu/1eMKVeXrK0NLw9HicGviJzhJDEyfxTR9e1WtpnnbYkJWurX6WwoFP0sz10xQg8yL8lgskAZg==} @@ -2985,29 +2955,40 @@ packages: /@vue/shared/3.2.37: resolution: {integrity: sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==} - /@vueuse/core/9.1.0_vue@3.2.37: - resolution: {integrity: sha512-BIroqvXEqt826aE9r3K5cox1zobuPuAzdYJ36kouC2TVhlXvFKIILgFVWrpp9HZPwB3aLzasmG3K87q7TSyXZg==} + /@vueuse/core/8.6.0_vue@3.2.37: + resolution: {integrity: sha512-VirzExCm/N+QdrEWT7J4uSrvJ5hquKIAU9alQ37kUvIJk9XxCLxmfRnmekYc1kz2+6BnoyuKYXVmrMV351CB4w==} + peerDependencies: + '@vue/composition-api': ^1.1.0 + vue: ^2.6.0 || ^3.2.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + vue: + optional: true dependencies: - '@types/web-bluetooth': 0.0.15 - '@vueuse/metadata': 9.1.0 - '@vueuse/shared': 9.1.0_vue@3.2.37 + '@vueuse/metadata': 8.6.0 + '@vueuse/shared': 8.6.0_vue@3.2.37 + vue: 3.2.37 vue-demi: 0.13.1_vue@3.2.37 - transitivePeerDependencies: - - '@vue/composition-api' - - vue dev: true - /@vueuse/metadata/9.1.0: - resolution: {integrity: sha512-8OEhlog1iaAGTD3LICZ8oBGQdYeMwByvXetOtAOZCJOzyCRSwqwdggTsmVZZ1rkgYIEqgUBk942AsAPwM21s6A==} + /@vueuse/metadata/8.6.0: + resolution: {integrity: sha512-F+CKPvaExsm7QgRr8y+ZNJFwXasn89rs5wth/HeX9lJ1q8XEt+HJ16Q5Sxh4rfG5YSKXrStveVge8TKvPjMjFA==} dev: true - /@vueuse/shared/9.1.0_vue@3.2.37: - resolution: {integrity: sha512-pB/3njQu4tfJJ78ajELNda0yMG6lKfpToQW7Soe09CprF1k3QuyoNi1tBNvo75wBDJWD+LOnr+c4B5HZ39jY/Q==} + /@vueuse/shared/8.6.0_vue@3.2.37: + resolution: {integrity: sha512-Y/IVywZo7IfEoSSEtCYpkVEmPV7pU35mEIxV7PbD/D3ly18B3mEsBaPbtDkNM/QP3zAZ5mn4nEkOfddX4uwuIA==} + peerDependencies: + '@vue/composition-api': ^1.1.0 + vue: ^2.6.0 || ^3.2.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + vue: + optional: true dependencies: + vue: 3.2.37 vue-demi: 0.13.1_vue@3.2.37 - transitivePeerDependencies: - - '@vue/composition-api' - - vue dev: true /@wessberg/stringutil/1.0.19: @@ -3694,7 +3675,7 @@ packages: dev: true /concat-map/0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} /connect-history-api-fallback/2.0.0: resolution: {integrity: sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==} @@ -4102,8 +4083,8 @@ packages: /defined/1.0.0: resolution: {integrity: sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==} - /defu/6.1.0: - resolution: {integrity: sha512-pOFYRTIhoKujrmbTRhcW5lYQLBXw/dlTwfI8IguF1QCDJOcJzNH1w+YFjxqy6BAuJrClTy6MUE8q+oKJ2FLsIw==} + /defu/6.0.0: + resolution: {integrity: sha512-t2MZGLf1V2rV4VBZbWIaXKdX/mUcYW0n2znQZoADBkGGxYL8EWqCuCZBmJPJ/Yy9fofJkyuuSuo5GSwo0XdEgw==} dev: true /delayed-stream/1.0.0: @@ -4351,8 +4332,8 @@ packages: dev: true optional: true - /esbuild-android-64/0.15.5: - resolution: {integrity: sha512-dYPPkiGNskvZqmIK29OPxolyY3tp+c47+Fsc2WYSOVjEPWNCHNyqhtFqQadcXMJDQt8eN0NMDukbyQgFcHquXg==} + /esbuild-android-64/0.15.3: + resolution: {integrity: sha512-sHGQ50Bb80ow+DZ8s6mabWn/j+vgfsNDMhipv4v410O++C6gpEcR9A5jR9bTkMsVbr46Id0MMhUGpBasq8H92A==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -4377,8 +4358,8 @@ packages: dev: true optional: true - /esbuild-android-arm64/0.15.5: - resolution: {integrity: sha512-YyEkaQl08ze3cBzI/4Cm1S+rVh8HMOpCdq8B78JLbNFHhzi4NixVN93xDrHZLztlocEYqi45rHHCgA8kZFidFg==} + /esbuild-android-arm64/0.15.3: + resolution: {integrity: sha512-+Oiwzgp7HTyeNkgpQySGLCq3zFmvVVyBiNz8bO+7Tc6tlnxSYf8jjQBThRTUsy6vrrjG91h9vZNlYkiikzzWUg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -4403,8 +4384,8 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.15.5: - resolution: {integrity: sha512-Cr0iIqnWKx3ZTvDUAzG0H/u9dWjLE4c2gTtRLz4pqOBGjfjqdcZSfAObFzKTInLLSmD0ZV1I/mshhPoYSBMMCQ==} + /esbuild-darwin-64/0.15.3: + resolution: {integrity: sha512-n2BkxzCPHv6OOOs9gxp4AYsccawuw9bDeW9rpSASHao0zQ/u0kP6bjD4ATf2G4A3cml8HGwp18aROl4ws+4Ytg==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -4429,8 +4410,8 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.15.5: - resolution: {integrity: sha512-WIfQkocGtFrz7vCu44ypY5YmiFXpsxvz2xqwe688jFfSVCnUsCn2qkEVDo7gT8EpsLOz1J/OmqjExePL1dr1Kg==} + /esbuild-darwin-arm64/0.15.3: + resolution: {integrity: sha512-fSk5M1vQ+y48csVJ4QxweT//DdDytDAb0AvU1gYITqZGA1kL1/i4C5fjKDNZMjB7dkg2a+rfkMyrpZUli+To/w==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -4455,8 +4436,8 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.15.5: - resolution: {integrity: sha512-M5/EfzV2RsMd/wqwR18CELcenZ8+fFxQAAEO7TJKDmP3knhWSbD72ILzrXFMMwshlPAS1ShCZ90jsxkm+8FlaA==} + /esbuild-freebsd-64/0.15.3: + resolution: {integrity: sha512-b21XfM0Wrxu0CzFQN7B4xuAMGUNLT3F3J2NMeLxbUq6lcl2N3Isho1q2AF5bOCpCXVM04k1+PgoQLwNzGYtnjw==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -4481,8 +4462,8 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64/0.15.5: - resolution: {integrity: sha512-2JQQ5Qs9J0440F/n/aUBNvY6lTo4XP/4lt1TwDfHuo0DY3w5++anw+jTjfouLzbJmFFiwmX7SmUhMnysocx96w==} + /esbuild-freebsd-arm64/0.15.3: + resolution: {integrity: sha512-E0LkWSz7Ch1B2WFXbGvfN3q9uUlQCahBi3S7wTSJO2T41x0BPnIFHw79/RuGKVyA17mX/I7RVOSRnrla2D4tag==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -4507,8 +4488,8 @@ packages: dev: true optional: true - /esbuild-linux-32/0.15.5: - resolution: {integrity: sha512-gO9vNnIN0FTUGjvTFucIXtBSr1Woymmx/aHQtuU+2OllGU6YFLs99960UD4Dib1kFovVgs59MTXwpFdVoSMZoQ==} + /esbuild-linux-32/0.15.3: + resolution: {integrity: sha512-af7BhXXKwzXL83bfJX8vkxsyDbOr9T5auxyBJnBfkd2w7VwXC1heDT2TQ1cWCWyjqVatyKudW5RCSAySDKDW2Q==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -4533,8 +4514,8 @@ packages: dev: true optional: true - /esbuild-linux-64/0.15.5: - resolution: {integrity: sha512-ne0GFdNLsm4veXbTnYAWjbx3shpNKZJUd6XpNbKNUZaNllDZfYQt0/zRqOg0sc7O8GQ+PjSMv9IpIEULXVTVmg==} + /esbuild-linux-64/0.15.3: + resolution: {integrity: sha512-Wwq+5ZF2IPE/6W2kJLPnh7eXqtz5XtdPBRB77nhm02my6PsZR3aa/q/fRkJhwO6ExM+t9l3kFhWL4pMwk3wREA==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -4559,8 +4540,8 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.15.5: - resolution: {integrity: sha512-wvAoHEN+gJ/22gnvhZnS/+2H14HyAxM07m59RSLn3iXrQsdS518jnEWRBnJz3fR6BJa+VUTo0NxYjGaNt7RA7Q==} + /esbuild-linux-arm/0.15.3: + resolution: {integrity: sha512-88ycpH4GrbOzaZIIXIzljbeCUkzoaJ5luP6+LATa5hk/Wl+OHkAieDfjAHdH8KuHkGYTojKE1npQq9gll9efUA==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -4585,8 +4566,8 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.15.5: - resolution: {integrity: sha512-7EgFyP2zjO065XTfdCxiXVEk+f83RQ1JsryN1X/VSX2li9rnHAt2swRbpoz5Vlrl6qjHrCmq5b6yxD13z6RheA==} + /esbuild-linux-arm64/0.15.3: + resolution: {integrity: sha512-qNvYyYjNm4JPXJcCJv7gXEnyqw2k9W+SeYMoG7RiwWHWv1cMX6xlxPLGz5yIxjH9+VBXkA1nrY/YohaiKq2O3g==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -4611,8 +4592,8 @@ packages: dev: true optional: true - /esbuild-linux-mips64le/0.15.5: - resolution: {integrity: sha512-KdnSkHxWrJ6Y40ABu+ipTZeRhFtc8dowGyFsZY5prsmMSr1ZTG9zQawguN4/tunJ0wy3+kD54GaGwdcpwWAvZQ==} + /esbuild-linux-mips64le/0.15.3: + resolution: {integrity: sha512-t5TXW6Cw8S9Lts7SDZ8rlx/dqPJx8hndYKL6xEgA2vdlrE60eIYTAYWJqsGN0dgePtFC1RPyH6To15l7s9WdYA==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -4637,8 +4618,8 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.15.5: - resolution: {integrity: sha512-QdRHGeZ2ykl5P0KRmfGBZIHmqcwIsUKWmmpZTOq573jRWwmpfRmS7xOhmDHBj9pxv+6qRMH8tLr2fe+ZKQvCYw==} + /esbuild-linux-ppc64le/0.15.3: + resolution: {integrity: sha512-TXxPgEWOPCY4F6ZMf7+915+H0eOB6AlcZBwjeBs+78ULpzvcmMzZ2ujF2IejKZXYWuMTORPNoG+MuVGBuyUysA==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -4663,8 +4644,8 @@ packages: dev: true optional: true - /esbuild-linux-riscv64/0.15.5: - resolution: {integrity: sha512-p+WE6RX+jNILsf+exR29DwgV6B73khEQV0qWUbzxaycxawZ8NE0wA6HnnTxbiw5f4Gx9sJDUBemh9v49lKOORA==} + /esbuild-linux-riscv64/0.15.3: + resolution: {integrity: sha512-04tvrbHA83N+tg+qQeJmUQ3jWStUP7+rw+v/l2h3PsNGbcH3WmsgR0Tf0e1ext09asV4x2PX2b2Nm/gBIOrpqg==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -4689,8 +4670,8 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.15.5: - resolution: {integrity: sha512-J2ngOB4cNzmqLHh6TYMM/ips8aoZIuzxJnDdWutBw5482jGXiOzsPoEF4j2WJ2mGnm7FBCO4StGcwzOgic70JQ==} + /esbuild-linux-s390x/0.15.3: + resolution: {integrity: sha512-LHxnvvFMhA/uy9CSrnlCtPZnTfWahR9NPLKwXBgfg16YqpKbRHty+mek1o7l+2G5qLeFEEvhB0a7c+hYgbW/3w==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -4715,8 +4696,8 @@ packages: dev: true optional: true - /esbuild-netbsd-64/0.15.5: - resolution: {integrity: sha512-MmKUYGDizYjFia0Rwt8oOgmiFH7zaYlsoQ3tIOfPxOqLssAsEgG0MUdRDm5lliqjiuoog8LyDu9srQk5YwWF3w==} + /esbuild-netbsd-64/0.15.3: + resolution: {integrity: sha512-8W0UxNuNsgBBa1SLjwqbbDLJF9mf+lvytaYPt5kXbBrz0DI4mKYFlujLQrxLKh8tvs2zRdFNy9HVqmMdbZ1OIQ==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -4741,8 +4722,8 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.15.5: - resolution: {integrity: sha512-2mMFfkLk3oPWfopA9Plj4hyhqHNuGyp5KQyTT9Rc8hFd8wAn5ZrbJg+gNcLMo2yzf8Uiu0RT6G9B15YN9WQyMA==} + /esbuild-openbsd-64/0.15.3: + resolution: {integrity: sha512-QL7xYQ4noukuqh8UGnsrk1m+ShPMYIXjOnAQl3siA7VV6cjuUoCxx6cThgcUDzih8iL5u2xgsGRhsviQIMsUuA==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -4767,8 +4748,8 @@ packages: dev: true optional: true - /esbuild-sunos-64/0.15.5: - resolution: {integrity: sha512-2sIzhMUfLNoD+rdmV6AacilCHSxZIoGAU2oT7XmJ0lXcZWnCvCtObvO6D4puxX9YRE97GodciRGDLBaiC6x1SA==} + /esbuild-sunos-64/0.15.3: + resolution: {integrity: sha512-vID32ZCZahWDqlEoq9W7OAZDtofAY8aW0V58V5l+kXEvaKvR0m99FLNRuGGY3IDNwjUoOkvoFiMMiy+ONnN7GA==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -4793,8 +4774,8 @@ packages: dev: true optional: true - /esbuild-windows-32/0.15.5: - resolution: {integrity: sha512-e+duNED9UBop7Vnlap6XKedA/53lIi12xv2ebeNS4gFmu7aKyTrok7DPIZyU5w/ftHD4MUDs5PJUkQPP9xJRzg==} + /esbuild-windows-32/0.15.3: + resolution: {integrity: sha512-dnrlwu6T85QU9fO0a35HAzgAXm3vVqg+3Kr9EXkmnf5PHv9t7hT/EYW6g/8YYu91DDyGTk9JSyN32YzQ3OS9Lw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -4819,8 +4800,8 @@ packages: dev: true optional: true - /esbuild-windows-64/0.15.5: - resolution: {integrity: sha512-v+PjvNtSASHOjPDMIai9Yi+aP+Vwox+3WVdg2JB8N9aivJ7lyhp4NVU+J0MV2OkWFPnVO8AE/7xH+72ibUUEnw==} + /esbuild-windows-64/0.15.3: + resolution: {integrity: sha512-HUSlVCpTtOnIKeIn05zz0McNCfZhnu5UgUypmpNrv4Ff1XTvl6vBpQwIZ49eIAkY9zI6oe1Mu6N5ZG7u6X4s7A==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -4845,8 +4826,8 @@ packages: dev: true optional: true - /esbuild-windows-arm64/0.15.5: - resolution: {integrity: sha512-Yz8w/D8CUPYstvVQujByu6mlf48lKmXkq6bkeSZZxTA626efQOJb26aDGLzmFWx6eg/FwrXgt6SZs9V8Pwy/aA==} + /esbuild-windows-arm64/0.15.3: + resolution: {integrity: sha512-sk6fVXCzGB0uW089+8LdeanZkQUZ+3/xdbWshgLGRawV0NyjSFH4sZPIy+DJnhEnT0pPt1DabZtqrq2DT0FWNw==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -4909,33 +4890,33 @@ packages: esbuild-windows-arm64: 0.14.50 dev: true - /esbuild/0.15.5: - resolution: {integrity: sha512-VSf6S1QVqvxfIsSKb3UKr3VhUCis7wgDbtF4Vd9z84UJr05/Sp2fRKmzC+CSPG/dNAPPJZ0BTBLTT1Fhd6N9Gg==} + /esbuild/0.15.3: + resolution: {integrity: sha512-D1qLizJTYlGIOK5m/1ckH8vR2U573eLMMA57qvWg/9jj8jPIhjpafv4kxb6ra2eeTlVq8tISxjsyRKbTaeF6PA==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/linux-loong64': 0.15.5 - esbuild-android-64: 0.15.5 - esbuild-android-arm64: 0.15.5 - esbuild-darwin-64: 0.15.5 - esbuild-darwin-arm64: 0.15.5 - esbuild-freebsd-64: 0.15.5 - esbuild-freebsd-arm64: 0.15.5 - esbuild-linux-32: 0.15.5 - esbuild-linux-64: 0.15.5 - esbuild-linux-arm: 0.15.5 - esbuild-linux-arm64: 0.15.5 - esbuild-linux-mips64le: 0.15.5 - esbuild-linux-ppc64le: 0.15.5 - esbuild-linux-riscv64: 0.15.5 - esbuild-linux-s390x: 0.15.5 - esbuild-netbsd-64: 0.15.5 - esbuild-openbsd-64: 0.15.5 - esbuild-sunos-64: 0.15.5 - esbuild-windows-32: 0.15.5 - esbuild-windows-64: 0.15.5 - esbuild-windows-arm64: 0.15.5 + '@esbuild/linux-loong64': 0.15.3 + esbuild-android-64: 0.15.3 + esbuild-android-arm64: 0.15.3 + esbuild-darwin-64: 0.15.3 + esbuild-darwin-arm64: 0.15.3 + esbuild-freebsd-64: 0.15.3 + esbuild-freebsd-arm64: 0.15.3 + esbuild-linux-32: 0.15.3 + esbuild-linux-64: 0.15.3 + esbuild-linux-arm: 0.15.3 + esbuild-linux-arm64: 0.15.3 + esbuild-linux-mips64le: 0.15.3 + esbuild-linux-ppc64le: 0.15.3 + esbuild-linux-riscv64: 0.15.3 + esbuild-linux-s390x: 0.15.3 + esbuild-netbsd-64: 0.15.3 + esbuild-openbsd-64: 0.15.3 + esbuild-sunos-64: 0.15.3 + esbuild-windows-32: 0.15.3 + esbuild-windows-64: 0.15.3 + esbuild-windows-arm64: 0.15.3 dev: true /escalade/3.1.1: @@ -6659,7 +6640,7 @@ packages: typescript: optional: true dependencies: - defu: 6.1.0 + defu: 6.0.0 esbuild: 0.14.50 fs-extra: 10.1.0 globby: 11.1.0 @@ -6669,11 +6650,11 @@ packages: typescript: 4.7.4 dev: true - /mlly/0.5.13: - resolution: {integrity: sha512-0SK2fqoan+PMjADs4I2egAtrtNtpjqRez6PDTCeAdGjUQNJCvO5o9v2NEq52WA1jFmMU97qBr/JgdvCquehDbA==} + /mlly/0.5.12: + resolution: {integrity: sha512-8moXGh6Hfy2Nmys3DDEm4CuxDBk5Y7Lk1jQ4JcwW0djO9b+SCKTpw0enIQeZIuEnPljdxHSGmcbXU9hpIIEYeQ==} dependencies: acorn: 8.8.0 - pathe: 0.3.5 + pathe: 0.3.4 pkg-types: 0.3.3 ufo: 0.8.5 dev: true @@ -7134,8 +7115,8 @@ packages: resolution: {integrity: sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==} dev: true - /pathe/0.3.5: - resolution: {integrity: sha512-grU/QeYP0ChuE5kjU2/k8VtAeODzbernHlue0gTa27+ayGIu3wqYBIPGfP9r5xSqgCgDd4nWrjKXEfxMillByg==} + /pathe/0.3.4: + resolution: {integrity: sha512-YWgqEdxf36R6vcsyj0A+yT/rDRPe0wui4J9gRR7T4whjU5Lx/jZOr75ckEgTNaLVQABAwsrlzHRpIKcCdXAQ5A==} dev: true /pathval/1.1.1: @@ -7191,8 +7172,8 @@ packages: resolution: {integrity: sha512-6AJcCMnjUQPQv/Wk960w0TOmjhdjbeaQJoSKWRQv9N3rgkessCu6J0Ydsog/nw1MbpnxHuPzYbfOn2KmlZO1FA==} dependencies: jsonc-parser: 3.0.0 - mlly: 0.5.13 - pathe: 0.3.5 + mlly: 0.5.12 + pathe: 0.3.4 dev: true /playwright-chromium/1.25.0: @@ -7868,8 +7849,8 @@ packages: '@babel/code-frame': 7.18.6 dev: true - /rollup-plugin-esbuild/4.9.3_g2b53jqudjimruv6spqg4ieafm: - resolution: {integrity: sha512-bxfUNYTa9Tw/4kdFfT9gtidDtqXyRdCW11ctZM7D8houCCVqp5qHzQF7hhIr31rqMA0APbG47fgVbbCGXgM49Q==} + /rollup-plugin-esbuild/4.9.1_v7ao6bhciu5nakpgwngk6v5txa: + resolution: {integrity: sha512-qn/x7Wz9p3Xnva99qcb+nopH0d2VJwVnsxJTGEg+Sh2Z3tqQl33MhOwzekVo1YTKgv+yAmosjcBRJygMfGrtLw==} engines: {node: '>=12'} peerDependencies: esbuild: '>=0.10.1' @@ -7878,7 +7859,7 @@ packages: '@rollup/pluginutils': 4.2.1 debug: 4.3.4 es-module-lexer: 0.9.3 - esbuild: 0.15.5 + esbuild: 0.15.3 joycon: 3.1.1 jsonc-parser: 3.0.0 rollup: 2.78.0 @@ -8066,12 +8047,12 @@ packages: resolution: {integrity: sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==} dev: true - /shiki/0.11.1: - resolution: {integrity: sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==} + /shiki/0.10.1: + resolution: {integrity: sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng==} dependencies: jsonc-parser: 3.0.0 vscode-oniguruma: 1.6.2 - vscode-textmate: 6.0.0 + vscode-textmate: 5.2.0 dev: true /side-channel/1.0.4: @@ -8393,8 +8374,8 @@ packages: resolution: {integrity: sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=} dev: false - /systemjs/6.12.3: - resolution: {integrity: sha512-TtYUN86Hs8V1QGAoj9ad1xmJmZS9Lurfi8Iu8QWOKaUDDuTH0Bpfdxz9qZIdxsmvAg3WMQnZ5/pkQvloh2sr/Q==} + /systemjs/6.12.2: + resolution: {integrity: sha512-m8E/zVRcfwPiCVtj7iAtL5JdfewnBVvq1HfnPlg30U3SIRCCj1sH2kDLl/PJJvgGB8rSZI65ZXmeZyQshK4aYg==} dev: false /tailwindcss/3.1.8: @@ -8533,8 +8514,8 @@ packages: engines: {node: '>=14.0.0'} dev: true - /tinyspy/1.0.2: - resolution: {integrity: sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==} + /tinyspy/1.0.0: + resolution: {integrity: sha512-FI5B2QdODQYDRjfuLF+OrJ8bjWRMCXokQPcwKm0W3IzcbUmBNv536cQc7eXGoAuXphZwgx1DFbqImwzz08Fnhw==} engines: {node: '>=14.0.0'} dev: true @@ -8765,8 +8746,8 @@ packages: which-boxed-primitive: 1.0.2 dev: true - /unbuild/0.8.9: - resolution: {integrity: sha512-LCFL/V3Y0UDxal6MNvSTGuyOnTAha467oTCRURZqj4zaW1r/kTDeVNkA9OdP8J/bnsxr0CvkdjRjlvv/K3o7Yw==} + /unbuild/0.8.8: + resolution: {integrity: sha512-BGDDh3BmM+B0Mc1sVSeUDXKykH3h73V7LcGLM2D3v4Tv5Pr3vgxEwxCkxNw1mZlW71sQX/yxMAoBIxnpmr55Tg==} hasBin: true dependencies: '@rollup/plugin-alias': 3.1.9_rollup@2.78.0 @@ -8777,23 +8758,23 @@ packages: '@rollup/pluginutils': 4.2.1 chalk: 5.0.1 consola: 2.15.3 - defu: 6.1.0 - esbuild: 0.15.5 + defu: 6.0.0 + esbuild: 0.15.3 globby: 13.1.2 hookable: 5.1.1 jiti: 1.14.0 magic-string: 0.26.2 mkdirp: 1.0.4 mkdist: 0.3.13_typescript@4.7.4 - mlly: 0.5.13 + mlly: 0.5.12 mri: 1.2.0 - pathe: 0.3.5 + pathe: 0.3.4 pkg-types: 0.3.3 pretty-bytes: 6.0.0 rimraf: 3.0.2 rollup: 2.78.0 rollup-plugin-dts: 4.2.2_nm5mlcuxlwr6samvke7b2fz27i - rollup-plugin-esbuild: 4.9.3_g2b53jqudjimruv6spqg4ieafm + rollup-plugin-esbuild: 4.9.1_v7ao6bhciu5nakpgwngk6v5txa scule: 0.3.2 typescript: 4.7.4 untyped: 0.4.5 @@ -8892,29 +8873,29 @@ packages: engines: {node: '>= 0.8'} dev: true - /vitepress/1.0.0-alpha.9: - resolution: {integrity: sha512-+VxgjflIcssbuyUBRYjZRpQ8w25v6XnIbXFmm9qwLVaqZdC0rN6qViEp7oRwA3HUlrGxj7GEzqQjW7xj4+E83w==} + /vitepress/1.0.0-alpha.5: + resolution: {integrity: sha512-bhUfmTzd+i5fm2rInBR1Q/1RBhT0xTXM+vPqVWJdHmIc8XnWF/O7lT6kai38rOTNTt/KyPDk2SRRourPVhQJMA==} + engines: {node: '>=14.6.0'} hasBin: true dependencies: - '@docsearch/css': 3.2.1 - '@docsearch/js': 3.2.1 + '@docsearch/css': 3.1.0 + '@docsearch/js': 3.1.0 '@vitejs/plugin-vue': link:packages/plugin-vue - '@vue/devtools-api': 6.2.1 - '@vueuse/core': 9.1.0_vue@3.2.37 + '@vue/devtools-api': 6.1.4 + '@vueuse/core': 8.6.0_vue@3.2.37 body-scroll-lock: 4.0.0-beta.0 - shiki: 0.11.1 + shiki: 0.10.1 vite: link:packages/vite vue: 3.2.37 transitivePeerDependencies: - - '@algolia/client-search' - '@types/react' - '@vue/composition-api' - react - react-dom dev: true - /vitest/0.22.1: - resolution: {integrity: sha512-+x28YTnSLth4KbXg7MCzoDAzPJlJex7YgiZbUh6YLp0/4PqVZ7q7/zyfdL0OaPtKTpNiQFPpMC8Y2MSzk8F7dw==} + /vitest/0.22.0: + resolution: {integrity: sha512-BSIro/QOHLaQY08FHwT6THWhqLQ+VPU+N4Rdo4pcP+16XB6oLmNNAXGcSh/MOLUhfUy+mqCwx7AyKmU7Ms5R+g==} engines: {node: '>=v14.16.0'} hasBin: true peerDependencies: @@ -8942,7 +8923,7 @@ packages: debug: 4.3.4 local-pkg: 0.4.2 tinypool: 0.2.4 - tinyspy: 1.0.2 + tinyspy: 1.0.0 vite: link:packages/vite transitivePeerDependencies: - supports-color @@ -8957,8 +8938,8 @@ packages: resolution: {integrity: sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==} dev: true - /vscode-textmate/6.0.0: - resolution: {integrity: sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==} + /vscode-textmate/5.2.0: + resolution: {integrity: sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==} dev: true /vue-demi/0.13.1_vue@3.2.37: