From 943869e68073ae79a87c28b7e31ebe96fdefb5f1 Mon Sep 17 00:00:00 2001 From: snomiao Date: Fri, 12 Sep 2025 02:36:33 +0000 Subject: [PATCH] fix: Add import attributes to JSON imports for Node.js ES module compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The collect-i18n Playwright tests require explicit 'with { type: json }' import attributes when importing JSON files in Node.js ES module environments. This is mandatory in Node.js 16.14+ for security and clarity. While Vite handles this transformation during build time for the browser app, the Playwright test environment runs directly in Node.js without that layer. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/constants/coreColorPalettes.ts | 12 ++--- src/i18n.ts | 72 +++++++++++++++--------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/constants/coreColorPalettes.ts b/src/constants/coreColorPalettes.ts index 58c7f1522..f20cb260d 100644 --- a/src/constants/coreColorPalettes.ts +++ b/src/constants/coreColorPalettes.ts @@ -1,9 +1,9 @@ -import arc from '@/assets/palettes/arc.json' -import dark from '@/assets/palettes/dark.json' -import github from '@/assets/palettes/github.json' -import light from '@/assets/palettes/light.json' -import nord from '@/assets/palettes/nord.json' -import solarized from '@/assets/palettes/solarized.json' +import arc from '@/assets/palettes/arc.json' with { type: 'json' } +import dark from '@/assets/palettes/dark.json' with { type: 'json' } +import github from '@/assets/palettes/github.json' with { type: 'json' } +import light from '@/assets/palettes/light.json' with { type: 'json' } +import nord from '@/assets/palettes/nord.json' with { type: 'json' } +import solarized from '@/assets/palettes/solarized.json' with { type: 'json' } import type { ColorPalettes, CompletedPalette diff --git a/src/i18n.ts b/src/i18n.ts index 08369af62..2544fc7eb 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,41 +1,41 @@ import { createI18n } from 'vue-i18n' -import arCommands from './locales/ar/commands.json' -import ar from './locales/ar/main.json' -import arNodes from './locales/ar/nodeDefs.json' -import arSettings from './locales/ar/settings.json' -import enCommands from './locales/en/commands.json' -import en from './locales/en/main.json' -import enNodes from './locales/en/nodeDefs.json' -import enSettings from './locales/en/settings.json' -import esCommands from './locales/es/commands.json' -import es from './locales/es/main.json' -import esNodes from './locales/es/nodeDefs.json' -import esSettings from './locales/es/settings.json' -import frCommands from './locales/fr/commands.json' -import fr from './locales/fr/main.json' -import frNodes from './locales/fr/nodeDefs.json' -import frSettings from './locales/fr/settings.json' -import jaCommands from './locales/ja/commands.json' -import ja from './locales/ja/main.json' -import jaNodes from './locales/ja/nodeDefs.json' -import jaSettings from './locales/ja/settings.json' -import koCommands from './locales/ko/commands.json' -import ko from './locales/ko/main.json' -import koNodes from './locales/ko/nodeDefs.json' -import koSettings from './locales/ko/settings.json' -import ruCommands from './locales/ru/commands.json' -import ru from './locales/ru/main.json' -import ruNodes from './locales/ru/nodeDefs.json' -import ruSettings from './locales/ru/settings.json' -import zhTWCommands from './locales/zh-TW/commands.json' -import zhTW from './locales/zh-TW/main.json' -import zhTWNodes from './locales/zh-TW/nodeDefs.json' -import zhTWSettings from './locales/zh-TW/settings.json' -import zhCommands from './locales/zh/commands.json' -import zh from './locales/zh/main.json' -import zhNodes from './locales/zh/nodeDefs.json' -import zhSettings from './locales/zh/settings.json' +import arCommands from './locales/ar/commands.json' with { type: 'json' } +import ar from './locales/ar/main.json' with { type: 'json' } +import arNodes from './locales/ar/nodeDefs.json' with { type: 'json' } +import arSettings from './locales/ar/settings.json' with { type: 'json' } +import enCommands from './locales/en/commands.json' with { type: 'json' } +import en from './locales/en/main.json' with { type: 'json' } +import enNodes from './locales/en/nodeDefs.json' with { type: 'json' } +import enSettings from './locales/en/settings.json' with { type: 'json' } +import esCommands from './locales/es/commands.json' with { type: 'json' } +import es from './locales/es/main.json' with { type: 'json' } +import esNodes from './locales/es/nodeDefs.json' with { type: 'json' } +import esSettings from './locales/es/settings.json' with { type: 'json' } +import frCommands from './locales/fr/commands.json' with { type: 'json' } +import fr from './locales/fr/main.json' with { type: 'json' } +import frNodes from './locales/fr/nodeDefs.json' with { type: 'json' } +import frSettings from './locales/fr/settings.json' with { type: 'json' } +import jaCommands from './locales/ja/commands.json' with { type: 'json' } +import ja from './locales/ja/main.json' with { type: 'json' } +import jaNodes from './locales/ja/nodeDefs.json' with { type: 'json' } +import jaSettings from './locales/ja/settings.json' with { type: 'json' } +import koCommands from './locales/ko/commands.json' with { type: 'json' } +import ko from './locales/ko/main.json' with { type: 'json' } +import koNodes from './locales/ko/nodeDefs.json' with { type: 'json' } +import koSettings from './locales/ko/settings.json' with { type: 'json' } +import ruCommands from './locales/ru/commands.json' with { type: 'json' } +import ru from './locales/ru/main.json' with { type: 'json' } +import ruNodes from './locales/ru/nodeDefs.json' with { type: 'json' } +import ruSettings from './locales/ru/settings.json' with { type: 'json' } +import zhTWCommands from './locales/zh-TW/commands.json' with { type: 'json' } +import zhTW from './locales/zh-TW/main.json' with { type: 'json' } +import zhTWNodes from './locales/zh-TW/nodeDefs.json' with { type: 'json' } +import zhTWSettings from './locales/zh-TW/settings.json' with { type: 'json' } +import zhCommands from './locales/zh/commands.json' with { type: 'json' } +import zh from './locales/zh/main.json' with { type: 'json' } +import zhNodes from './locales/zh/nodeDefs.json' with { type: 'json' } +import zhSettings from './locales/zh/settings.json' with { type: 'json' } function buildLocale(main: M, nodes: N, commands: C, settings: S) { return {