From 0308f2df48a72caeb2b988196ec5f4208c173559 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Thu, 14 May 2026 00:35:43 +0900 Subject: [PATCH] fix(unplugin-vue-i18n): bypass builtin:vite-json on Vite 8 via virtual ids --- .github/workflows/ci.yml | 6 +- eslint.config.ts | 2 + package.json | 2 + packages/bundle-utils/src/js.ts | 1 + packages/unplugin-vue-i18n/package.json | 2 +- .../unplugin-vue-i18n/src/core/resource.ts | 194 +- packages/unplugin-vue-i18n/test/utils.ts | 23 +- ...s.snap => custom-block.test.ts.vite6.snap} | 0 .../custom-block.test.ts.vite8.snap | 1608 +++++++++++++++++ ...t.ts.snap => sourcemap.test.ts.vite6.snap} | 0 ... translation-directive.test.ts.vite6.snap} | 0 .../translation-directive.test.ts.vite8.snap | 79 + pnpm-lock.yaml | 573 +++++- pnpm-workspace.yaml | 7 +- tsconfig.json | 3 +- vitest.config.ts | 18 +- 16 files changed, 2450 insertions(+), 68 deletions(-) rename packages/unplugin-vue-i18n/test/vite/__snapshots__/{custom-block.test.ts.snap => custom-block.test.ts.vite6.snap} (100%) create mode 100644 packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.vite8.snap rename packages/unplugin-vue-i18n/test/vite/__snapshots__/{sourcemap.test.ts.snap => sourcemap.test.ts.vite6.snap} (100%) rename packages/unplugin-vue-i18n/test/vite/__snapshots__/{translation-directive.test.ts.snap => translation-directive.test.ts.vite6.snap} (100%) create mode 100644 packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.vite8.snap diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf512f27..c804ec07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,10 @@ jobs: matrix: os: [ubuntu-latest] node: [22, 24] - framework: ['vite', 'webpack'] + include: + - { framework: 'vite', vite_type: 'vite8' } + - { framework: 'vite', vite_type: 'vite6' } + - { framework: 'webpack', vite_type: '' } steps: - name: Checkout @@ -137,3 +140,4 @@ jobs: run: pnpm test env: TEST_FRAMEWORK: ${{ matrix.framework }} + TEST_VITE_TYPE: ${{ matrix.vite_type }} diff --git a/eslint.config.ts b/eslint.config.ts index c27145b3..f77e5e4f 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -59,6 +59,8 @@ export default defineConfig( 'examples/**', 'CHANGELOG.md', '.unmaintained/**', + '.claude/**', + '.plans/**', 'packages/**/CHANGELOG.md', 'packages/unplugin-vue-i18n/README.md', '**/*.md/*.ts', diff --git a/package.json b/package.json index d46744dc..25b8e2ae 100644 --- a/package.json +++ b/package.json @@ -89,6 +89,8 @@ "test:unit:utils": "vitest run packages/bundle-utils", "test:unit:unplugin": "vitest run packages/unplugin-vue-i18n/test", "test:unit:unplugin:vite": "TEST_FRAMEWORK=vite vitest run packages/unplugin-vue-i18n/test", + "test:unit:unplugin:vite:vite8": "TEST_FRAMEWORK=vite TEST_VITE_TYPE=vite8 vitest run packages/unplugin-vue-i18n/test/vite", + "test:unit:unplugin:vite:vite6": "TEST_FRAMEWORK=vite TEST_VITE_TYPE=vite6 vitest run packages/unplugin-vue-i18n/test/vite", "test:e2e": "pnpm check-install && vitest -c ./vitest.e2e.config.ts run", "test:e2e:unplugin": "pnpm --filter @intlify/unplugin-vue-i18n test:e2e" }, diff --git a/packages/bundle-utils/src/js.ts b/packages/bundle-utils/src/js.ts index 772ace6e..79097905 100644 --- a/packages/bundle-utils/src/js.ts +++ b/packages/bundle-utils/src/js.ts @@ -5,6 +5,7 @@ import { isBoolean, isNumber, isString } from '@intlify/shared' import { parse as parseJavaScript } from 'acorn' import { generate as generateJavaScript } from 'escodegen' +// @ts-ignore -- estree-walker package.json `exports` field lacks a `types` subpath; works at runtime import { walk } from 'estree-walker' import { createCodeGenerator, diff --git a/packages/unplugin-vue-i18n/package.json b/packages/unplugin-vue-i18n/package.json index 82ad89d7..21486872 100644 --- a/packages/unplugin-vue-i18n/package.json +++ b/packages/unplugin-vue-i18n/package.json @@ -53,7 +53,7 @@ "source-map-js": "catalog:", "ts-loader": "catalog:webpack", "unbuild": "catalog:", - "vite": "catalog:vite", + "vite": "catalog:vite8", "rollup-vite": "npm:vite@6.3.5", "vue-loader": "catalog:webpack", "webpack": "catalog:webpack", diff --git a/packages/unplugin-vue-i18n/src/core/resource.ts b/packages/unplugin-vue-i18n/src/core/resource.ts index 05436a87..f77400df 100644 --- a/packages/unplugin-vue-i18n/src/core/resource.ts +++ b/packages/unplugin-vue-i18n/src/core/resource.ts @@ -9,7 +9,7 @@ import { createFilter } from '@rollup/pluginutils' import createDebug from 'debug' import fg from 'fast-glob' import { promises as fs } from 'node:fs' -import { parse as parsePath } from 'node:path' +import { dirname, parse as parsePath, resolve } from 'pathe' import { parse } from 'vue/compiler-sfc' import { checkVuePlugin, error, getVitePlugin, raiseError, resolveNamespace, warn } from '../utils' import { getVueCompiler, parseVueRequest } from '../vue' @@ -23,13 +23,10 @@ import type { VueQuery } from '../vue' const INTLIFY_BUNDLE_IMPORT_ID = '@intlify/unplugin-vue-i18n/messages' const VIRTUAL_PREFIX = '\0' -const RE_INTLIFY_BUNDLE_IMPORT_ID = new RegExp(`^${INTLIFY_BUNDLE_IMPORT_ID}$`) -const RE_VIRTUAL_PREFIXED_INTLIFY_BUNDLE_IMPORT_ID = new RegExp( - `^${VIRTUAL_PREFIX}${INTLIFY_BUNDLE_IMPORT_ID}$` -) const RE_RESOURCE_FORMAT = /\.(json5?|ya?ml|[c|m]?[j|t]s)$/ const RE_SFC_I18N_CUSTOM_BLOCK = /\?vue&type=i18n/ const RE_SFC_I18N_WEBPACK_CUSTOM_BLOCK = /blockType=i18n/ +const VITE_VIRTUAL_PREFIX = '\0intlify-i18n-' const debug = createDebug(resolveNamespace('resource')) @@ -109,6 +106,39 @@ export function resourcePlugin( return vuePlugin ? getVueCompiler(vuePlugin).parse : parse } + /** + * Virtual id machinery for vite 8+ (rolldown-based) builds. + * + * vite 8 ships `builtin:vite-json` as a Rust plugin whose `transform` cannot + * be overridden from JS — replacing the JS-side `.transform` is silently + * ignored because rolldown invokes the native binding directly. Without + * intervention, our `enforce: 'pre'` transform converts JSON to JS and then + * `builtin:vite-json` runs anyway and fails to parse our JS as JSON. + * + * Workaround: in `resolveId`, remap each matching resource file to a + * virtual id like `\0intlify-i18n-N`. The virtual id has no `.json` / + * `.json5` suffix, so `builtin:vite-json` (which matches by extension) does + * not claim it. Our `load` reads the original file from disk, runs the + * generator, and returns the compiled JS. + */ + const virtualIdToRealPath = new Map() + const realPathToVirtualId = new Map() + let virtualCounter = 0 + + function intlifyVirtualize(realPath: string): string { + let virtualId = realPathToVirtualId.get(realPath) + if (!virtualId) { + virtualId = `${VITE_VIRTUAL_PREFIX}${virtualCounter++}` + virtualIdToRealPath.set(virtualId, realPath) + realPathToVirtualId.set(realPath, virtualId) + } + return virtualId + } + + function isIntlifyVirtualId(id: string): boolean { + return virtualIdToRealPath.has(id) + } + return { name: resolveNamespace('resource'), @@ -275,18 +305,52 @@ export function resourcePlugin( }, resolveId: { - filter: { - id: RE_INTLIFY_BUNDLE_IMPORT_ID - }, - handler(id: string) { - return asVirtualId(id, meta.framework) + async handler(id: string, importer: string | undefined) { + if (id === INTLIFY_BUNDLE_IMPORT_ID) { + return asVirtualId(id, meta.framework) + } + + // For vite 8+ (no `vite:json` plugin), virtualize matching resource files + // so `builtin:vite-json` does not claim them. See VITE_VIRTUAL_PREFIX above. + if (meta.framework === 'vite' && !hasViteJsonPlugin) { + // SFC custom-block requests with `lang.json` / `lang.json5` (e.g. + // `Foo.vue?vue&type=i18n&index=0&lang.json`) also end in `.json` and + // would be claimed by `builtin:vite-json`. Virtualize them too — our + // `load` re-parses the SFC and extracts the block content. + if (id.includes('?vue&type=i18n') && /[?&]lang\.(?:json|json5)(?:$|&)/.test(id)) { + return intlifyVirtualize(id) + } + + const idPath = id.split('?')[0] + if (!RE_RESOURCE_FORMAT.test(idPath)) return + + // unplugin v2.x does not expose `this.resolve` reliably across + // bundlers, so resolve relative and absolute paths manually. Bare + // specifiers (package imports, aliases) are left to vite's normal + // resolution. + let resolvedPath: string + if (idPath.startsWith('.')) { + const realImporter = + importer && isIntlifyVirtualId(importer) + ? virtualIdToRealPath.get(importer)! + : importer + if (!realImporter) return + resolvedPath = resolve(dirname(realImporter), idPath) + } else if (idPath.startsWith('/') || /^[a-z]:[/\\]/i.test(idPath)) { + resolvedPath = idPath + } else { + return + } + + const filter = await getFilter() + if (!filter(resolvedPath)) return + + return intlifyVirtualize(resolvedPath) + } } }, load: { - filter: { - id: RE_VIRTUAL_PREFIXED_INTLIFY_BUNDLE_IMPORT_ID - }, async handler(id: string) { debug('load', id) if (INTLIFY_BUNDLE_IMPORT_ID === getVirtualId(id, meta.framework) && include) { @@ -311,11 +375,115 @@ export function resourcePlugin( map: { mappings: '' } } } + + // vite 8+ virtualized resource — read the real file, run the i18n + // generator, and return pre-compiled JS so `builtin:vite-json` never sees it. + if (isIntlifyVirtualId(id)) { + const realId = virtualIdToRealPath.get(id)! + + // SFC custom-block: parse the SFC and extract the block content + // (mirrors what vite-plugin-vue's load would do, but yields a + // virtual id whose extension does not trigger `builtin:vite-json`). + if (realId.includes('?vue&type=i18n')) { + const { filename, query } = parseVueRequest(realId) + this.addWatchFile(filename) + const sfcSource = await fs.readFile(filename, 'utf-8') + const { descriptor } = getSfcParser()(sfcSource, { + sourceMap, + filename + }) + const block = descriptor.customBlocks[query.index!] + if (!block) return + + let source = block.src ? await fs.readFile(block.src, 'utf-8') : block.content + if (typeof transformI18nBlock === 'function') { + const modifiedSource = transformI18nBlock(source) + if (modifiedSource && typeof modifiedSource === 'string') { + source = modifiedSource + } else { + warn('transformI18nBlock should return a string') + } + } + + let langInfo = defaultSFCLang as Required['defaultSFCLang'] + if (isString(query.lang)) { + langInfo = ( + query.src ? (query.lang === 'i18n' ? defaultSFCLang : query.lang) : query.lang + ) as Required['defaultSFCLang'] + } + + // For JS/TS custom blocks, wrap source with `export default` + if (/\.?[cm]?[jt]s$/.test(langInfo)) { + source = `export default ${source.replace(/^[\s;]+/, '')}` + } + + const generate = getGenerator(langInfo, generateYAML) + const isGlobalBlock = globalSFCScope || !!query.global + const parseOptions = getOptions( + filename, + isProduction, + query as Record, + sourceMap, + { + isGlobal: globalSFCScope, + allowDynamic, + jit: true, + strictMessage, + escapeHtml, + onlyLocales, + forceStringify, + usedKeyFilter: + collector && isGlobalBlock + ? (keyPath: string) => collector.shouldKeepKey(keyPath) + : undefined + } + ) as CodeGenOptions + const { code: generatedCode } = await generate(source, parseOptions) + return { + moduleType: 'js', + code: generatedCode, + map: { mappings: '' } + } + } + + // Plain resource file + this.addWatchFile(realId) + const code = await fs.readFile(realId, 'utf-8') + const langInfo = parsePath(realId).ext as Required['defaultSFCLang'] + const generate = getGenerator(langInfo) + const parseOptions = getOptions( + realId, + isProduction, + {} as Record, + sourceMap, + { + isGlobal: globalSFCScope, + allowDynamic, + strictMessage, + escapeHtml, + jit: true, + onlyLocales, + forceStringify, + usedKeyFilter: collector + ? (keyPath: string) => collector.shouldKeepKey(keyPath) + : undefined + } + ) as CodeGenOptions + const { code: generatedCode } = await generate(code, parseOptions) + return { + moduleType: 'js', + code: generatedCode, + map: { mappings: '' } + } + } } }, transform: { async handler(code: string, id: string) { + // Skip vite 8 virtualized resources — already loaded as compiled JS. + if (isIntlifyVirtualId(id)) return + const filter = await getFilter() if (!filter(id)) { return diff --git a/packages/unplugin-vue-i18n/test/utils.ts b/packages/unplugin-vue-i18n/test/utils.ts index 497d8d63..6809e2ea 100644 --- a/packages/unplugin-vue-i18n/test/utils.ts +++ b/packages/unplugin-vue-i18n/test/utils.ts @@ -4,8 +4,8 @@ import fg from 'fast-glob' import { JSDOM, VirtualConsole } from 'jsdom' import memoryfs from 'memory-fs' import { resolve } from 'node:path' -import { build as buildRollupVite } from 'rollup-vite' -import { build as buildRolldownVite } from 'vite' +import { build as buildVite6 } from 'rollup-vite' +import { build as buildVite8 } from 'vite' import { VueLoaderPlugin } from 'vue-loader' import webpack from 'webpack' import merge from 'webpack-merge' @@ -23,23 +23,27 @@ type BundleResolve = { stats?: webpack.Stats } -type ViteBulderType = 'rollup' | 'rolldown' +type ViteBuilderType = 'vite6' | 'vite8' type BundleFunction = ( fixture: string, options: Record, - viteType: ViteBulderType + viteType: ViteBuilderType ) => Promise -const VITE_BUILDERS: Record = { - rollup: buildRollupVite, - rolldown: buildRolldownVite +const VITE_BUILDERS: Record = { + vite6: buildVite6 as unknown as typeof buildVite8, + vite8: buildVite8 +} + +function getCurrentViteType(): ViteBuilderType { + return (process.env.TEST_VITE_TYPE as ViteBuilderType) || 'vite8' } export async function bundleVite( fixture: string, options: Record = {}, - viteType: ViteBulderType = 'rolldown' + viteType: ViteBuilderType = getCurrentViteType() ): Promise { const input = (options.input as string) || './fixtures/entry.ts' const target = (options.target as string) || './fixtures' @@ -187,8 +191,7 @@ export async function bundleAndRun( options.escapeHtml = !!options.escapeHtml options.optimizeTranslationDirective = !!options.optimizeTranslationDirective - const rolldownVersion = ((await import('vite')) as any).rolldownVersion - const { code, map } = await bundler(fixture, options, !!rolldownVersion ? 'rolldown' : 'rollup') + const { code, map } = await bundler(fixture, options, getCurrentViteType()) let dom: JSDOM | null = null let jsdomError diff --git a/packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.snap b/packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.vite6.snap similarity index 100% rename from packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.snap rename to packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.vite6.snap diff --git a/packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.vite8.snap b/packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.vite8.snap new file mode 100644 index 00000000..4c450944 --- /dev/null +++ b/packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.vite8.snap @@ -0,0 +1,1608 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, +] +`; + +exports[`array 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "foo": [ + [ + { + "body": { + "end": 3, + "items": [ + { + "end": 3, + "loc": { + "end": { + "column": 4, + "line": 1, + "offset": 3, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 4, + "line": 1, + "offset": 3, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "bar", + "type": 2, + }, + "end": 3, + "loc": { + "end": { + "column": 4, + "line": 1, + "offset": 3, + }, + "source": "bar", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + ], + { + "body": { + "end": 3, + "items": [ + { + "end": 3, + "loc": { + "end": { + "column": 4, + "line": 1, + "offset": 3, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 4, + "line": 1, + "offset": 3, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "baz", + "type": 2, + }, + "end": 3, + "loc": { + "end": { + "column": 4, + "line": 1, + "offset": 3, + }, + "source": "baz", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + ], + }, + }, + }, +] +`; + +exports[`basic 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, +] +`; + +exports[`default lang 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 20, + "items": [ + { + "end": 20, + "loc": { + "end": { + "column": 21, + "line": 1, + "offset": 20, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 21, + "line": 1, + "offset": 20, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello from defaults!", + "type": 2, + }, + "end": 20, + "loc": { + "end": { + "column": 21, + "line": 1, + "offset": 20, + }, + "source": "hello from defaults!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, +] +`; + +exports[`default lang and global scope 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 20, + "items": [ + { + "end": 20, + "loc": { + "end": { + "column": 21, + "line": 1, + "offset": 20, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 21, + "line": 1, + "offset": 20, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello from defaults!", + "type": 2, + }, + "end": 20, + "loc": { + "end": { + "column": 21, + "line": 1, + "offset": 20, + }, + "source": "hello from defaults!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, +] +`; + +exports[`global 1`] = ` +[ + { + "locale": "ja", + "resource": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello local!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello local!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, +] +`; + +exports[`global 2`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 13, + "items": [ + { + "end": 13, + "loc": { + "end": { + "column": 14, + "line": 1, + "offset": 13, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 14, + "line": 1, + "offset": 13, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello global!", + "type": 2, + }, + "end": 13, + "loc": { + "end": { + "column": 14, + "line": 1, + "offset": 13, + }, + "source": "hello global!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, +] +`; + +exports[`global scope and import 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, +] +`; + +exports[`import 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, +] +`; + +exports[`json: exclude locales 1`] = ` +[ + { + "locale": "", + "resource": {}, + }, +] +`; + +exports[`json: exclude locales when using mixed locales 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, + { + "locale": "", + "resource": {}, + }, +] +`; + +exports[`json5 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, +] +`; + +exports[`json5: exclude locales 1`] = ` +[ + { + "locale": "", + "resource": {}, + }, +] +`; + +exports[`json5: exclude locales when using mixed locales 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, + { + "locale": "", + "resource": {}, + }, +] +`; + +exports[`locale attr 1`] = ` +[ + { + "locale": "ja", + "resource": { + "hello": { + "body": { + "end": 9, + "items": [ + { + "end": 9, + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "こんにちは、世界!", + "type": 2, + }, + "end": 9, + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "source": "こんにちは、世界!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, +] +`; + +exports[`locale attr and basic 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, + { + "locale": "ja", + "resource": { + "hello": { + "body": { + "end": 9, + "items": [ + { + "end": 9, + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "こんにちは、世界!", + "type": 2, + }, + "end": 9, + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "source": "こんにちは、世界!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, +] +`; + +exports[`locale attr and import 1`] = ` +[ + { + "locale": "en", + "resource": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, +] +`; + +exports[`multiple 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, + { + "locale": "", + "resource": { + "ja": { + "hello": { + "body": { + "end": 9, + "items": [ + { + "end": 9, + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "こんにちは、世界!", + "type": 2, + }, + "end": 9, + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "source": "こんにちは、世界!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, +] +`; + +exports[`special characters 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 19, + "items": [ + { + "end": 19, + "loc": { + "end": { + "column": 14, + "line": 2, + "offset": 19, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 14, + "line": 2, + "offset": 19, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello +great "world"", + "type": 2, + }, + "end": 19, + "loc": { + "end": { + "column": 14, + "line": 2, + "offset": 19, + }, + "source": "hello +great "world"", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, +] +`; + +exports[`yaml 1`] = ` +[ + { + "locale": "en", + "resource": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + { + "locale": "ja", + "resource": { + "hello": { + "body": { + "end": 9, + "items": [ + { + "end": 9, + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "こんにちは、世界!", + "type": 2, + }, + "end": 9, + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "source": "こんにちは、世界!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, +] +`; + +exports[`yaml: exclude locales 1`] = ` +[ + { + "locale": "", + "resource": {}, + }, + { + "locale": "ja", + "resource": { + "hello": { + "body": { + "end": 9, + "items": [ + { + "end": 9, + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "こんにちは、世界!", + "type": 2, + }, + "end": 9, + "loc": { + "end": { + "column": 10, + "line": 1, + "offset": 9, + }, + "source": "こんにちは、世界!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, +] +`; + +exports[`yaml: exclude locales when using mixed locales 1`] = ` +[ + { + "locale": "", + "resource": { + "en": { + "hello": { + "body": { + "end": 12, + "items": [ + { + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 3, + }, + ], + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "static": "hello world!", + "type": 2, + }, + "end": 12, + "loc": { + "end": { + "column": 13, + "line": 1, + "offset": 12, + }, + "source": "hello world!", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "start": 0, + "type": 0, + }, + }, + }, + }, + { + "locale": "", + "resource": {}, + }, +] +`; diff --git a/packages/unplugin-vue-i18n/test/vite/__snapshots__/sourcemap.test.ts.snap b/packages/unplugin-vue-i18n/test/vite/__snapshots__/sourcemap.test.ts.vite6.snap similarity index 100% rename from packages/unplugin-vue-i18n/test/vite/__snapshots__/sourcemap.test.ts.snap rename to packages/unplugin-vue-i18n/test/vite/__snapshots__/sourcemap.test.ts.vite6.snap diff --git a/packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.snap b/packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.vite6.snap similarity index 100% rename from packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.snap rename to packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.vite6.snap diff --git a/packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.vite8.snap b/packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.vite8.snap new file mode 100644 index 00000000..d143de11 --- /dev/null +++ b/packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.vite8.snap @@ -0,0 +1,79 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`translation directive > script-setup-alias 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.translation || _ctx.$t)("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.translation("hello")), 1)], 64); +}" +`; + +exports[`translation directive > script-setup-global-option 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.t || _ctx.$t)("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1)], 64); +}" +`; + +exports[`translation directive > script-setup-local-option 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.t || _ctx.$t)("count", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1)], 64); +}" +`; + +exports[`translation directive > script-setup-no-option 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.t || _ctx.$t)("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1)], 64); +}" +`; + +exports[`translation directive > script-setup-no-use 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString(_ctx.$t("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString($setup.count), 1)], 64); +}" +`; + +exports[`translation directive > script-setup-obj 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.i18n.t || _ctx.$t)("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.i18n.t("hello")), 1)], 64); +}" +`; + +exports[`translation directive > setup-alias 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.translation || _ctx.$t)("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.translation("hello")), 1)], 64); +}" +`; + +exports[`translation directive > setup-global-option 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.t || _ctx.$t)("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1)], 64); +}" +`; + +exports[`translation directive > setup-local-option 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.t || _ctx.$t)("count", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1)], 64); +}" +`; + +exports[`translation directive > setup-no-option 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.t || _ctx.$t)("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1)], 64); +}" +`; + +exports[`translation directive > setup-no-use 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString(_ctx.$t("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString($setup.count), 1)], 64); +}" +`; + +exports[`translation directive > setup-return-alias 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.translation || _ctx.$t)("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.translation("hello")), 1)], 64); +}" +`; + +exports[`translation directive > setup-return-alias-with-obj 1`] = ` +"function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("h1", null, toDisplayString$1(($setup.translation || _ctx.$t)("hello", {}, {})), 1), createBaseVNode("p", null, toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.translation("hello")), 1)], 64); +}" +`; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74867ae1..f96bc4f6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,8 +17,15 @@ catalogs: version: 3.6.1 vite: '@vitejs/plugin-vue': - specifier: 5.2.4 - version: 5.2.4 + specifier: ^6.0.6 + version: 6.0.6 + vite: + specifier: 6.3.5 + version: 6.3.5 + vite8: + vite: + specifier: ^8.0.0 + version: 8.0.12 vue: vue: specifier: ~3.5.34 @@ -35,7 +42,6 @@ catalogs: version: 5.106.2 overrides: - vite: 6.3.5 '@intlify/shared': ~11.4.2 '@intlify/message-compiler': ~11.4.2 '@intlify/core-base': ~11.4.2 @@ -51,7 +57,7 @@ importers: version: 8.0.1 '@kazupon/eslint-config': specifier: ^0.45.0 - version: 0.45.0(810f3dbdbd939de281dbc5a6a32ec4f1) + version: 0.45.0(82b3632660cb1e2e2e7a06e3257f2ee6) '@kazupon/prettier-config': specifier: ^0.2.0 version: 0.2.0 @@ -60,7 +66,7 @@ importers: version: 25.7.0 '@vitest/eslint-plugin': specifier: ~1.6.17 - version: 1.6.17(@typescript-eslint/eslint-plugin@8.59.3(@typescript-eslint/parser@8.59.3(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3)(vitest@4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))) + version: 1.6.17(@typescript-eslint/eslint-plugin@8.59.3(@typescript-eslint/parser@8.59.3(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3)(vitest@4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))) bumpp: specifier: ^11.1.0 version: 11.1.0 @@ -129,10 +135,10 @@ importers: version: 8.59.3(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3) vitest: specifier: ^4.1.6 - version: 4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0)) + version: 4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0)) vue-loader: specifier: catalog:webpack - version: 17.4.2(vue@3.5.34(typescript@6.0.3))(webpack@5.106.2) + version: 17.4.2(webpack@5.106.2) examples/vite: dependencies: @@ -148,10 +154,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: catalog:vite - version: 5.2.4(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))(vue@3.5.34(typescript@6.0.3)) + version: 6.0.6(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(lightningcss@1.32.0)(terser@5.47.1)(yaml@2.9.0))(vue@3.5.34(typescript@6.0.3)) vite: - specifier: 6.3.5 - version: 6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0) + specifier: catalog:vite + version: 6.3.5(@types/node@25.7.0)(jiti@2.7.0)(lightningcss@1.32.0)(terser@5.47.1)(yaml@2.9.0) examples/webpack: dependencies: @@ -289,7 +295,7 @@ importers: version: 25.7.0 '@vitejs/plugin-vue': specifier: catalog:vite - version: 5.2.4(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))(vue@3.5.34(typescript@6.0.3)) + version: 6.0.6(vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))(vue@3.5.34(typescript@6.0.3)) jsdom: specifier: ^25.0.1 version: 25.0.1 @@ -298,25 +304,25 @@ importers: version: 0.5.0 rollup-vite: specifier: npm:vite@6.3.5 - version: vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0) + version: vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(lightningcss@1.32.0)(terser@5.47.1)(yaml@2.9.0) source-map-js: specifier: 'catalog:' version: 1.2.1 ts-loader: specifier: catalog:webpack - version: 9.5.7(typescript@6.0.3)(webpack@5.106.2) + version: 9.5.7(typescript@6.0.3)(webpack@5.106.2(lightningcss@1.32.0)) unbuild: specifier: 'catalog:' version: 3.6.1(typescript@6.0.3)(vue@3.5.34(typescript@6.0.3)) vite: - specifier: 6.3.5 - version: 6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0) + specifier: catalog:vite8 + version: 8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0) vue-loader: specifier: catalog:webpack - version: 17.4.2(vue@3.5.34(typescript@6.0.3))(webpack@5.106.2) + version: 17.4.2(vue@3.5.34(typescript@6.0.3))(webpack@5.106.2(lightningcss@1.32.0)) webpack: specifier: catalog:webpack - version: 5.106.2(webpack-cli@5.1.4) + version: 5.106.2(lightningcss@1.32.0) webpack-merge: specifier: ^5.9.0 version: 5.10.0 @@ -1000,6 +1006,9 @@ packages: cpu: [x64] os: [win32] + '@oxc-project/types@0.129.0': + resolution: {integrity: sha512-3oz8m3FGdr2nDXVqmFUw7jolKliC4MoyXYIG2c7gpjBnzUWQpUGIYcXYKxTdTi+N2jusvt610ckTMkxdwHkYEg==} + '@oxc-project/types@0.130.0': resolution: {integrity: sha512-ibD2usx9JRu7f5pu2tMKMI4cpA4NgXJQoYRP4pQ7Pxmn1l6k/53qWtQWZayhYy3X4QZkt90Ot+mJEaeXouio6Q==} @@ -1118,6 +1127,107 @@ packages: '@quansync/fs@1.0.0': resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} + '@rolldown/binding-android-arm64@1.0.0': + resolution: {integrity: sha512-TWMZnRLMe63C2Lhyicviu7ZHaU4kxa6PS3rofvc9GmcvptzNN11BcfQ4Sl7MwTOsisQoa2keB/EBdNCAnUo8vA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0': + resolution: {integrity: sha512-6XcD+8k0gPVItNagEw78/qqcBDwKcwDYS8V2hRmVsfUSIrd8cWe/CBvRDI5toqFyPfj+FJr6t8U6Xj2P2prEew==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0': + resolution: {integrity: sha512-iN/tWVXRQDWvmZlKdceP1Dwug9GDpEymhb9p4xnEe6zvCg5lFmzVljl+1qR1NVx3yfGpr2Na+CuLmv5IU8uzfQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0': + resolution: {integrity: sha512-jjQMDvvwSOuhOwMszD/klSOjyWMM3zI64hWTj9KT5x4MxRbZAf+7vLQ6qouRhtsLVFHr3f0ILaJAfgENPiQdAQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0': + resolution: {integrity: sha512-d//Dtg2x6/m3mbV64yUGNnDGNZaDGRpDLLNGerHQUVObuNaIQaaDp25yUiqGXtHEXX+NP2d0wAlmKgpYgIAJ2A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0': + resolution: {integrity: sha512-n7Ofp0mx+aB2cC+Sdy5YtMnXtY9lchnHbY+3Yt0uq9JsWQExf4f5Whu0tK0R8Jdc9S6RchTHjIFY7uc92puOVQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.0.0': + resolution: {integrity: sha512-EIVjy2cgd7uuMMo94FVkBp7F6DhcZAUwNURkSG3RwUmvAXR6s0ISxM81U+IydcZByPG0pZIHsf1b6kTxoFDgJA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.0.0': + resolution: {integrity: sha512-JEwwOPcwTLAcpDQlqSmjEmfs63xJnSiUNIGvLcDLUHCWK4XowpS/7c7tUsUH6uT/ct6bMUTdXKfI8967FYj6mg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.0.0': + resolution: {integrity: sha512-0wjCFhLrihtAubnT9iA0N++0pSV0z5Hg7tNGdNJ4RFaINceHadoF+kiFGyY1qSSNVIAZtLotG8Ju1bgDPkjnFA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.0.0': + resolution: {integrity: sha512-Dfn7iak9BcMMePxcoJfpSbWqnEyrp/dRF63/8qW/eHBdOZov6x5aShLLEYGYdIeSJ6vMLK/XCVB+lGIxm41bQA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.0.0': + resolution: {integrity: sha512-5/utzzDmD/pD/bmuaUcbTf/sZYy0aztwIVlfpoW1fTjCZ0BaPOMVWGZL1zvgxyi7ZIVYWlxKONHmSbHuiOh8Jw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.0.0': + resolution: {integrity: sha512-ouJs8VcUomfLfpbUECqFMRqdV4x6aeAK3MA4m6vTrJJjKyWTV5KnxZx7Jd9G+GlDaQQxubcba00x16OyJ1meig==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0': + resolution: {integrity: sha512-E+oHKGiDA+lsKMmFtffDDw91EryDT7uJocrIuCHqhm6bCTM6xFK+3gaCkYOHfPwQr0cCNarSM2xaELoQDz9jJg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0': + resolution: {integrity: sha512-yYK02n8Rngo+gbm1y6G0+7jk1sJ/2Wt7K0me0Y7k/ErBpyf+LJ2gFpqWVTcRV1rUepBlQRmpgWkTQCiiwrK0Ow==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0': + resolution: {integrity: sha512-14bpChMahXRRXiTwahSl+zzHPW6qQTXtkMuJBFlbo+pqSAews2d4BdCSHfrJ/MBsCZtpmTafsY+1QhBzitcmdg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.0': + resolution: {integrity: sha512-aKs/3GSWyV0mrhNmt/96/Z3yczC3yvrzYATCiCXQebBsGyYzjNdUphRVLeJQ67ySKVXRfMxt2lm12pmXvbPFQQ==} + + '@rolldown/pluginutils@1.0.0-rc.13': + resolution: {integrity: sha512-3ngTAv6F/Py35BsYbeeLeecvhMKdsKm4AoOETVhAA+Qc8nrA2I0kF7oa93mE9qnIurngOSpMnQ0x2nQY2FPviA==} + '@rollup/plugin-alias@5.1.1': resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} engines: {node: '>=14.0.0'} @@ -1613,11 +1723,11 @@ packages: cpu: [x64] os: [win32] - '@vitejs/plugin-vue@5.2.4': - resolution: {integrity: sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==} - engines: {node: ^18.0.0 || >=20.0.0} + '@vitejs/plugin-vue@6.0.6': + resolution: {integrity: sha512-u9HHgfrq3AjXlysn0eINFnWQOJQLO9WN6VprZ8FXl7A2bYisv3Hui9Ij+7QZ41F/WYWarHjwBbXtD7dKg3uxbg==} + engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: - vite: 6.3.5 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 vue: ^3.2.25 '@vitest/eslint-plugin@1.6.17': @@ -1643,7 +1753,7 @@ packages: resolution: {integrity: sha512-MCFc63czMjEInOlcY2cpQCvCN+KgbAn+60xu9cMgP4sKaLC5JNAKw7JH8QdAnoAC88hW1IiSNZ+GgVXlN1UcMQ==} peerDependencies: msw: ^2.4.9 - vite: 6.3.5 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: msw: optional: true @@ -2280,6 +2390,10 @@ packages: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + detect-node@2.1.0: resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==} @@ -3257,6 +3371,80 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.32.0: + resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} + engines: {node: '>= 12.0.0'} + lilconfig@3.1.3: resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} engines: {node: '>=14'} @@ -4087,6 +4275,11 @@ packages: deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true + rolldown@1.0.0: + resolution: {integrity: sha512-yD986aXDESFGS95spT1LAv0jssywP4npMEjmMHyN2/5+eE8qQJUype2AaKkRiLgBgyD0LFlubwAht7VmY8rGoA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + rollup-plugin-dts@6.4.1: resolution: {integrity: sha512-l//F3Zf7ID5GoOfLfD8kroBjQKEKpy1qfhtAdnpibFZMffPaylrg1CoDC2vGkPeTeyxUe4bVFCln2EFuL7IGGg==} engines: {node: '>=20'} @@ -4648,6 +4841,49 @@ packages: yaml: optional: true + vite@8.0.12: + resolution: {integrity: sha512-w2dDofOWv2QB09ZITZBsvKTVAlYvPR4IAmrY/v0ir9KvLs0xybR7i48wxhM1/oyBWO34wPns+bPGw5ZrZqDpZg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.1.18 + esbuild: ^0.27.0 || ^0.28.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + vitest@4.1.6: resolution: {integrity: sha512-6lvjbS3p9b4CrdCmguzbh2/4uoXhGE2q71R4OX5sqF9R1bo9Xd6fGrMAfvp5wnCzlBnFVdCOp6onuTQVbo8iUQ==} engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} @@ -4664,7 +4900,7 @@ packages: '@vitest/ui': 4.1.6 happy-dom: '*' jsdom: '*' - vite: 6.3.5 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: '@edge-runtime/vm': optional: true @@ -5267,7 +5503,7 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - '@kazupon/eslint-config@0.45.0(810f3dbdbd939de281dbc5a6a32ec4f1)': + '@kazupon/eslint-config@0.45.0(82b3632660cb1e2e2e7a06e3257f2ee6)': dependencies: '@eslint-community/eslint-plugin-eslint-comments': 4.7.1(eslint@10.3.0(jiti@2.7.0)) '@eslint/js': 9.39.4 @@ -5280,7 +5516,7 @@ snapshots: globals: 16.5.0 optionalDependencies: '@eslint/markdown': 8.0.1 - '@vitest/eslint-plugin': 1.6.17(@typescript-eslint/eslint-plugin@8.59.3(@typescript-eslint/parser@8.59.3(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3)(vitest@4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))) + '@vitest/eslint-plugin': 1.6.17(@typescript-eslint/eslint-plugin@8.59.3(@typescript-eslint/parser@8.59.3(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3)(vitest@4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))) eslint-config-prettier: 10.1.8(eslint@10.3.0(jiti@2.7.0)) eslint-import-resolver-typescript: 4.4.4(eslint-plugin-import@2.32.0)(eslint@10.3.0(jiti@2.7.0)) eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint-import-resolver-typescript@4.4.4)(eslint@10.3.0(jiti@2.7.0)) @@ -5401,6 +5637,8 @@ snapshots: '@oxc-parser/binding-win32-x64-msvc@0.130.0': optional: true + '@oxc-project/types@0.129.0': {} + '@oxc-project/types@0.130.0': {} '@oxc-resolver/binding-android-arm-eabi@11.19.1': @@ -5474,6 +5712,59 @@ snapshots: dependencies: quansync: 1.0.0 + '@rolldown/binding-android-arm64@1.0.0': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.0.0': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.0.0': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0': + dependencies: + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0': + optional: true + + '@rolldown/pluginutils@1.0.0': {} + + '@rolldown/pluginutils@1.0.0-rc.13': {} + '@rollup/plugin-alias@5.1.1(rollup@4.60.3)': optionalDependencies: rollup: 4.60.3 @@ -5916,12 +6207,19 @@ snapshots: '@unrs/resolver-binding-win32-x64-msvc@1.11.1': optional: true - '@vitejs/plugin-vue@5.2.4(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))(vue@3.5.34(typescript@6.0.3))': + '@vitejs/plugin-vue@6.0.6(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(lightningcss@1.32.0)(terser@5.47.1)(yaml@2.9.0))(vue@3.5.34(typescript@6.0.3))': + dependencies: + '@rolldown/pluginutils': 1.0.0-rc.13 + vite: 6.3.5(@types/node@25.7.0)(jiti@2.7.0)(lightningcss@1.32.0)(terser@5.47.1)(yaml@2.9.0) + vue: 3.5.34(typescript@6.0.3) + + '@vitejs/plugin-vue@6.0.6(vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))(vue@3.5.34(typescript@6.0.3))': dependencies: - vite: 6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0) + '@rolldown/pluginutils': 1.0.0-rc.13 + vite: 8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0) vue: 3.5.34(typescript@6.0.3) - '@vitest/eslint-plugin@1.6.17(@typescript-eslint/eslint-plugin@8.59.3(@typescript-eslint/parser@8.59.3(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3)(vitest@4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0)))': + '@vitest/eslint-plugin@1.6.17(@typescript-eslint/eslint-plugin@8.59.3(@typescript-eslint/parser@8.59.3(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3)(vitest@4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0)))': dependencies: '@typescript-eslint/scope-manager': 8.59.3 '@typescript-eslint/utils': 8.59.3(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3) @@ -5929,7 +6227,7 @@ snapshots: optionalDependencies: '@typescript-eslint/eslint-plugin': 8.59.3(@typescript-eslint/parser@8.59.3(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.3.0(jiti@2.7.0))(typescript@6.0.3) typescript: 6.0.3 - vitest: 4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0)) + vitest: 4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0)) transitivePeerDependencies: - supports-color @@ -5942,13 +6240,13 @@ snapshots: chai: 6.2.2 tinyrainbow: 3.1.0 - '@vitest/mocker@4.1.6(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))': + '@vitest/mocker@4.1.6(vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0))': dependencies: '@vitest/spy': 4.1.6 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0) + vite: 8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0) '@vitest/pretty-format@4.1.6': dependencies: @@ -6659,6 +6957,8 @@ snapshots: destroy@1.2.0: {} + detect-libc@2.1.2: {} + detect-node@2.1.0: {} devlop@1.1.0: @@ -7809,6 +8109,55 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 + lightningcss-android-arm64@1.32.0: + optional: true + + lightningcss-darwin-arm64@1.32.0: + optional: true + + lightningcss-darwin-x64@1.32.0: + optional: true + + lightningcss-freebsd-x64@1.32.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.32.0: + optional: true + + lightningcss-linux-arm64-gnu@1.32.0: + optional: true + + lightningcss-linux-arm64-musl@1.32.0: + optional: true + + lightningcss-linux-x64-gnu@1.32.0: + optional: true + + lightningcss-linux-x64-musl@1.32.0: + optional: true + + lightningcss-win32-arm64-msvc@1.32.0: + optional: true + + lightningcss-win32-x64-msvc@1.32.0: + optional: true + + lightningcss@1.32.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + lightningcss-win32-arm64-msvc: 1.32.0 + lightningcss-win32-x64-msvc: 1.32.0 + lilconfig@3.1.3: {} lint-staged@17.0.4: @@ -8853,6 +9202,27 @@ snapshots: dependencies: glob: 7.2.3 + rolldown@1.0.0: + dependencies: + '@oxc-project/types': 0.129.0 + '@rolldown/pluginutils': 1.0.0 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0 + '@rolldown/binding-darwin-arm64': 1.0.0 + '@rolldown/binding-darwin-x64': 1.0.0 + '@rolldown/binding-freebsd-x64': 1.0.0 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0 + '@rolldown/binding-linux-arm64-gnu': 1.0.0 + '@rolldown/binding-linux-arm64-musl': 1.0.0 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0 + '@rolldown/binding-linux-s390x-gnu': 1.0.0 + '@rolldown/binding-linux-x64-gnu': 1.0.0 + '@rolldown/binding-linux-x64-musl': 1.0.0 + '@rolldown/binding-openharmony-arm64': 1.0.0 + '@rolldown/binding-wasm32-wasi': 1.0.0 + '@rolldown/binding-win32-arm64-msvc': 1.0.0 + '@rolldown/binding-win32-x64-msvc': 1.0.0 + rollup-plugin-dts@6.4.1(rollup@4.60.3)(typescript@6.0.3): dependencies: '@jridgewell/remapping': 2.3.5 @@ -9230,13 +9600,23 @@ snapshots: tapable@2.3.3: {} + terser-webpack-plugin@5.6.0(lightningcss@1.32.0)(webpack@5.106.2(lightningcss@1.32.0)): + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + jest-worker: 27.5.1 + schema-utils: 4.3.3 + terser: 5.47.1 + webpack: 5.106.2(lightningcss@1.32.0) + optionalDependencies: + lightningcss: 1.32.0 + terser-webpack-plugin@5.6.0(webpack@5.106.2): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 terser: 5.47.1 - webpack: 5.106.2(webpack-cli@5.1.4) + webpack: 5.106.2 terser@5.47.1: dependencies: @@ -9282,6 +9662,16 @@ snapshots: dependencies: typescript: 6.0.3 + ts-loader@9.5.7(typescript@6.0.3)(webpack@5.106.2(lightningcss@1.32.0)): + dependencies: + chalk: 4.1.2 + enhanced-resolve: 5.21.3 + micromatch: 4.0.8 + semver: 7.8.0 + source-map: 0.7.6 + typescript: 6.0.3 + webpack: 5.106.2(lightningcss@1.32.0) + ts-loader@9.5.7(typescript@6.0.3)(webpack@5.106.2): dependencies: chalk: 4.1.2 @@ -9500,7 +9890,7 @@ snapshots: vary@1.1.2: {} - vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0): + vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(lightningcss@1.32.0)(terser@5.47.1)(yaml@2.9.0): dependencies: esbuild: 0.25.12 fdir: 6.5.0(picomatch@4.0.4) @@ -9512,13 +9902,28 @@ snapshots: '@types/node': 25.7.0 fsevents: 2.3.3 jiti: 2.7.0 + lightningcss: 1.32.0 terser: 5.47.1 yaml: 2.9.0 - vitest@4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0)): + vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0): + dependencies: + lightningcss: 1.32.0 + picomatch: 4.0.4 + postcss: 8.5.14 + rolldown: 1.0.0 + tinyglobby: 0.2.16 + optionalDependencies: + '@types/node': 25.7.0 + fsevents: 2.3.3 + jiti: 2.7.0 + terser: 5.47.1 + yaml: 2.9.0 + + vitest@4.1.6(@types/node@25.7.0)(jsdom@25.0.1)(vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0)): dependencies: '@vitest/expect': 4.1.6 - '@vitest/mocker': 4.1.6(vite@6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0)) + '@vitest/mocker': 4.1.6(vite@8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0)) '@vitest/pretty-format': 4.1.6 '@vitest/runner': 4.1.6 '@vitest/snapshot': 4.1.6 @@ -9535,7 +9940,7 @@ snapshots: tinyexec: 1.1.2 tinyglobby: 0.2.16 tinyrainbow: 3.1.0 - vite: 6.3.5(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0) + vite: 8.0.12(@types/node@25.7.0)(jiti@2.7.0)(terser@5.47.1)(yaml@2.9.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 25.7.0 @@ -9551,6 +9956,15 @@ snapshots: '@vue/devtools-api': 6.6.4 vue: 3.5.34(typescript@6.0.3) + vue-loader@17.4.2(vue@3.5.34(typescript@6.0.3))(webpack@5.106.2(lightningcss@1.32.0)): + dependencies: + chalk: 4.1.2 + hash-sum: 2.0.0 + watchpack: 2.5.1 + webpack: 5.106.2(lightningcss@1.32.0) + optionalDependencies: + vue: 3.5.34(typescript@6.0.3) + vue-loader@17.4.2(vue@3.5.34(typescript@6.0.3))(webpack@5.106.2): dependencies: chalk: 4.1.2 @@ -9560,6 +9974,13 @@ snapshots: optionalDependencies: vue: 3.5.34(typescript@6.0.3) + vue-loader@17.4.2(webpack@5.106.2): + dependencies: + chalk: 4.1.2 + hash-sum: 2.0.0 + watchpack: 2.5.1 + webpack: 5.106.2 + vue@3.5.34(typescript@6.0.3): dependencies: '@vue/compiler-dom': 3.5.34 @@ -9666,6 +10087,86 @@ snapshots: webpack-virtual-modules@0.6.2: {} + webpack@5.106.2: + dependencies: + '@types/eslint-scope': 3.7.7 + '@types/estree': 1.0.9 + '@types/json-schema': 7.0.15 + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/wasm-edit': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + acorn: 8.16.0 + acorn-import-phases: 1.0.4(acorn@8.16.0) + browserslist: 4.28.2 + chrome-trace-event: 1.0.4 + enhanced-resolve: 5.21.3 + es-module-lexer: 2.1.0 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + loader-runner: 4.3.2 + mime-db: 1.54.0 + neo-async: 2.6.2 + schema-utils: 4.3.3 + tapable: 2.3.3 + terser-webpack-plugin: 5.6.0(webpack@5.106.2) + watchpack: 2.5.1 + webpack-sources: 3.4.1 + transitivePeerDependencies: + - '@minify-html/node' + - '@swc/core' + - '@swc/css' + - '@swc/html' + - clean-css + - cssnano + - csso + - esbuild + - html-minifier-terser + - lightningcss + - postcss + - uglify-js + + webpack@5.106.2(lightningcss@1.32.0): + dependencies: + '@types/eslint-scope': 3.7.7 + '@types/estree': 1.0.9 + '@types/json-schema': 7.0.15 + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/wasm-edit': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + acorn: 8.16.0 + acorn-import-phases: 1.0.4(acorn@8.16.0) + browserslist: 4.28.2 + chrome-trace-event: 1.0.4 + enhanced-resolve: 5.21.3 + es-module-lexer: 2.1.0 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + loader-runner: 4.3.2 + mime-db: 1.54.0 + neo-async: 2.6.2 + schema-utils: 4.3.3 + tapable: 2.3.3 + terser-webpack-plugin: 5.6.0(lightningcss@1.32.0)(webpack@5.106.2(lightningcss@1.32.0)) + watchpack: 2.5.1 + webpack-sources: 3.4.1 + transitivePeerDependencies: + - '@minify-html/node' + - '@swc/core' + - '@swc/css' + - '@swc/html' + - clean-css + - cssnano + - csso + - esbuild + - html-minifier-terser + - lightningcss + - postcss + - uglify-js + webpack@5.106.2(webpack-cli@5.1.4): dependencies: '@types/eslint-scope': 3.7.7 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1d62719c..bd2bb2fc 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -7,10 +7,10 @@ catalogs: '@intlify/message-compiler': ~11.4.2 vue-i18n: ~11.4.2 vite: - '@vitejs/plugin-vue': 5.2.4 + '@vitejs/plugin-vue': ^6.0.6 vite: 6.3.5 - rolldown-vite: - vite: npm:rolldown-vite@latest + vite8: + vite: ^8.0.0 vue: vue: ~3.5.34 webpack: @@ -26,7 +26,6 @@ allowBuilds: oxc-resolver: true unrs-resolver: true overrides: - vite: catalog:vite '@intlify/shared': ~11.4.2 '@intlify/message-compiler': ~11.4.2 '@intlify/core-base': ~11.4.2 diff --git a/tsconfig.json b/tsconfig.json index a73dbdba..c6c90e3b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -39,8 +39,7 @@ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ /* Module Resolution Options */ - "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - "ignoreDeprecations": "6.0", + "moduleResolution": "bundler", /* Specify module resolution strategy: 'bundler' to support packages with ESM-only `exports` (vite 8+, etc.). */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ /* List of folders to include type definitions from. */ // "typeRoots": [ diff --git a/vitest.config.ts b/vitest.config.ts index 19ce808a..693198df 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,5 +1,20 @@ +import { basename, dirname, join } from 'node:path' import { defineConfig } from 'vitest/config' +const resolveSnapshotPath = (testPath: string, extension: string) => { + // For vite tests, split snapshot files by TEST_VITE_TYPE so the per-bundler + // sourcemap differences (rollup-vite vs rolldown / vite 8) do not collide. + if (testPath.includes('unplugin-vue-i18n/test/vite/')) { + const viteType = process.env.TEST_VITE_TYPE || 'vite8' + return join( + join(dirname(testPath), '__snapshots__'), + `${basename(testPath)}.${viteType}${extension}` + ) + } + + return join(join(dirname(testPath), '__snapshots__'), `${basename(testPath)}${extension}`) +} + export default defineConfig({ resolve: { alias: { @@ -7,6 +22,7 @@ export default defineConfig({ } }, test: { - globals: true + globals: true, + resolveSnapshotPath } })