From c9852766b013d6932b2a7cdadf969230cbfc59cc Mon Sep 17 00:00:00 2001 From: edison Date: Mon, 9 Sep 2024 20:44:26 +0800 Subject: [PATCH] fix(language-tools): only override vue version >3.5 (#15) --- tests/language-tools.ts | 1 + types.d.ts | 1 + utils.ts | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/language-tools.ts b/tests/language-tools.ts index 0af1b99..10c90eb 100644 --- a/tests/language-tools.ts +++ b/tests/language-tools.ts @@ -10,5 +10,6 @@ export async function test(options: RunOptions) { beforeBuild: `pnpm dedupe --registry=${REGISTRY_ADDRESS}`, build: 'build', test: 'test', + overrideVueVersion: '>3.5', }) } diff --git a/types.d.ts b/types.d.ts index 50fe8de..0b71219 100644 --- a/types.d.ts +++ b/types.d.ts @@ -13,6 +13,7 @@ export interface RunOptions { root: string vuePath: string vueVersion: string + overrideVueVersion?: string verify?: boolean skipGit?: boolean release?: string diff --git a/utils.ts b/utils.ts index a8b6426..516789a 100644 --- a/utils.ts +++ b/utils.ts @@ -239,6 +239,7 @@ export async function runInRepo(options: RunOptions & RepoOptions) { beforeBuild, beforeTest, patchFiles, + overrideVueVersion = '', } = options const dir = path.resolve( options.workspace, @@ -316,7 +317,7 @@ export async function runInRepo(options: RunOptions & RepoOptions) { } config. Use either one or the other`, ) } else { - overrides[pkg.name] = version + overrides[`${pkg.name}${overrideVueVersion}`] = version } } } else {