From ff883fe0aabfdee3f1e9989662ed7c09d09b27ec Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 3 Oct 2024 16:54:30 +0800 Subject: [PATCH] fix(language-tools): use the TS versions from the repo lockfile --- tests/language-tools.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/language-tools.ts b/tests/language-tools.ts index d427820..9f5c406 100644 --- a/tests/language-tools.ts +++ b/tests/language-tools.ts @@ -10,6 +10,24 @@ export async function test(options: RunOptions) { beforeBuild: `pnpm dedupe --registry=${REGISTRY_ADDRESS}`, build: 'build', test: 'test', - overrideVueVersion: '@^3.5', + overrideVueVersion: '@^3.5.2', + // As of Oct 3 2024, the language-tools repo is using TypeScript 5.5.4 & 5.7.0-dev.20240904, + // while referring to them as `@latest` and `@next` respectively. + // TODO: infer the TypeScript versions from the cloned lockfile. + patchFiles: { + 'package.json': (content) => { + const pkg = JSON.parse(content) + pkg.devDependencies.typescript = '~5.5.4' + pkg.devDependencies['typescript-stable'] = 'npm:typescript@~5.5.4' + return JSON.stringify(pkg, null, 2) + }, + 'test-workspace/package.json': (content) => { + const pkg = JSON.parse(content) + pkg.devDependencies['typescript-stable'] = 'npm:typescript@~5.5.4' + pkg.devDependencies['typescript-next'] = + 'npm:typescript@5.7.0-dev.20240904' + return JSON.stringify(pkg, null, 2) + }, + }, }) }