From 2fd1f8a545994a0c2e3750ff4dfaf6e4ca777fe3 Mon Sep 17 00:00:00 2001 From: Ivan Demchuk Date: Mon, 28 Jul 2025 22:36:09 +0300 Subject: [PATCH 1/4] Prevent extra Vue warning --- src/composition.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/composition.ts b/src/composition.ts index b349af47..e91feff6 100644 --- a/src/composition.ts +++ b/src/composition.ts @@ -9,7 +9,7 @@ export function useFluent(): TranslationContext { const instance = getCurrentInstance() assert(instance != null, 'useFluent called outside of setup') - const rootContext = inject(RootContextSymbol) + const rootContext = inject(RootContextSymbol, undefined) assert(rootContext != null, 'useFluent called without installing plugin') return getContext(rootContext, instance.proxy, true) From 0d95e4ed90dfb598477b00f470f3cc0e07e99a57 Mon Sep 17 00:00:00 2001 From: Ivan Demchuk Date: Mon, 28 Jul 2025 22:36:51 +0300 Subject: [PATCH 2/4] Prevent warning log during test --- __tests__/vue/ssr.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/vue/ssr.spec.ts b/__tests__/vue/ssr.spec.ts index ee744505..beb07058 100644 --- a/__tests__/vue/ssr.spec.ts +++ b/__tests__/vue/ssr.spec.ts @@ -69,7 +69,7 @@ describe.skipIf(!isVue3)('ssr directive', () => { it('warns when missing translation key', async () => { // Arrange - const warnSpy = vi.spyOn(console, 'warn') + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}) const component = { template: '', From 64d96ef565f25c3a93b6fd947f98007624dd6db6 Mon Sep 17 00:00:00 2001 From: Ivan Demchuk Date: Mon, 28 Jul 2025 22:48:21 +0300 Subject: [PATCH 3/4] Simplity swap-vue script --- package.json | 10 +++++----- pnpm-lock.yaml | 28 +++++++++++++++++++++++----- pnpm-workspace.yaml | 12 ++++++++++++ scripts/swap-vue.mjs | 18 +++++++++--------- 4 files changed, 49 insertions(+), 19 deletions(-) create mode 100644 pnpm-workspace.yaml diff --git a/package.json b/package.json index f48b29b9..4a147031 100644 --- a/package.json +++ b/package.json @@ -87,8 +87,8 @@ "@release-it-plugins/lerna-changelog": "^8.0.1", "@types/node": "^22.15.27", "@vitest/coverage-istanbul": "^3.1.4", - "@vue/compiler-sfc": "^3.5.13", - "@vue/test-utils": "^2.4.6", + "@vue/compiler-sfc": "catalog:vue3", + "@vue/test-utils": "catalog:vue3", "esbuild-plugin-globals": "^0.2.0", "eslint": "^9.32.0", "execa": "^9.6.0", @@ -101,9 +101,9 @@ "typescript": "^5.8.3", "vite": "^7.0.2", "vitest": "^3.1.4", - "vue": "npm:vue@^3.5.13", - "vue-2": "npm:vue@^2.7.16", - "vue-3": "npm:vue@^3.5.13" + "vue": "catalog:vue3", + "vue-2": "catalog:vue3", + "vue-3": "catalog:vue3" }, "lint-staged": { "*.js": "eslint --fix", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fab0ec94..733e071e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,24 @@ settings: autoInstallPeers: false excludeLinksFromLockfile: false +catalogs: + vue3: + '@vue/compiler-sfc': + specifier: ^3.5.16 + version: 3.5.16 + '@vue/test-utils': + specifier: ^2.4.6 + version: 2.4.6 + vue: + specifier: npm:vue@^3.5.16 + version: 3.5.16 + vue-2: + specifier: npm:vue@^2.7.16 + version: 2.7.16 + vue-3: + specifier: npm:vue@^3.5.16 + version: 3.5.16 + importers: .: @@ -43,10 +61,10 @@ importers: specifier: ^3.1.4 version: 3.1.4(vitest@3.1.4(@types/debug@4.1.12)(@types/node@22.15.27)(happy-dom@18.0.1)(jiti@2.4.2)(yaml@2.8.0)) '@vue/compiler-sfc': - specifier: ^3.5.13 + specifier: catalog:vue3 version: 3.5.16 '@vue/test-utils': - specifier: ^2.4.6 + specifier: catalog:vue3 version: 2.4.6 esbuild-plugin-globals: specifier: ^0.2.0 @@ -85,13 +103,13 @@ importers: specifier: ^3.1.4 version: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.27)(happy-dom@18.0.1)(jiti@2.4.2)(yaml@2.8.0) vue: - specifier: npm:vue@^3.5.13 + specifier: catalog:vue3 version: 3.5.16(typescript@5.8.3) vue-2: - specifier: npm:vue@^2.7.16 + specifier: catalog:vue3 version: vue@2.7.16 vue-3: - specifier: npm:vue@^3.5.13 + specifier: catalog:vue3 version: vue@3.5.16(typescript@5.8.3) packages: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 00000000..290ed6fd --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,12 @@ +catalogs: + vue2: + vue: npm:vue@^2.7.16 + vue-template-compiler: ^2.7.16 + '@vue/test-utils': ^1.3.5 + '@vue/composition-api': ^1.7.0 + vue3: + vue: npm:vue@^3.5.16 + vue-2: npm:vue@^2.7.16 + vue-3: npm:vue@^3.5.16 + '@vue/compiler-sfc': ^3.5.16 + '@vue/test-utils': ^2.4.6 diff --git a/scripts/swap-vue.mjs b/scripts/swap-vue.mjs index 7d27769e..f25cb148 100644 --- a/scripts/swap-vue.mjs +++ b/scripts/swap-vue.mjs @@ -3,18 +3,18 @@ import process from 'node:process' import { execa } from 'execa' const vue3packages = { - 'vue': 'npm:vue@^3.5.13', - 'vue-2': 'npm:vue@^2.7.16', - 'vue-3': 'npm:vue@^3.5.13', - '@vue/compiler-sfc': '^3.5.13', - '@vue/test-utils': '^2.4.6', + 'vue': 'catalog:vue3', + 'vue-2': 'catalog:vue3', + 'vue-3': 'catalog:vue3', + '@vue/compiler-sfc': 'catalog:vue3', + '@vue/test-utils': 'catalog:vue3', } const vue2packages = { - 'vue': 'npm:vue@^2.7.16', - 'vue-template-compiler': '^2.7.16', - '@vue/test-utils': '^1.3.5', - '@vue/composition-api': '^1.7.0', + 'vue': 'catalog:vue2', + 'vue-template-compiler': 'catalog:vue2', + '@vue/test-utils': 'catalog:vue2', + '@vue/composition-api': 'catalog:vue2', } const packageFile = './package.json' From 69ec28d7d37de14b48003a96e7e7174b65d49548 Mon Sep 17 00:00:00 2001 From: Ivan Demchuk Date: Mon, 28 Jul 2025 23:14:58 +0300 Subject: [PATCH 4/4] Fix eslint warnings --- pnpm-workspace.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 290ed6fd..fe79d4f3 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,12 +1,12 @@ catalogs: vue2: + '@vue/composition-api': ^1.7.0 + '@vue/test-utils': ^1.3.5 vue: npm:vue@^2.7.16 vue-template-compiler: ^2.7.16 - '@vue/test-utils': ^1.3.5 - '@vue/composition-api': ^1.7.0 vue3: + '@vue/compiler-sfc': ^3.5.16 + '@vue/test-utils': ^2.4.6 vue: npm:vue@^3.5.16 vue-2: npm:vue@^2.7.16 vue-3: npm:vue@^3.5.16 - '@vue/compiler-sfc': ^3.5.16 - '@vue/test-utils': ^2.4.6