-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: pin language-tools to TypeScript 5.4
TypeScript 5.5 is causing snapshot mismatches. BTW I also explicitly set the registry address in the `pnpm dedupe` command, because on my local machine somehow pnpm keeps using the default one for the command.
- Loading branch information
Showing
1 changed file
with
9 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
import { runInRepo } from '../utils.ts' | ||
import { RunOptions } from '../types.ts' | ||
import { REGISTRY_ADDRESS } from '../registry.ts' | ||
|
||
export async function test(options: RunOptions) { | ||
await runInRepo({ | ||
...options, | ||
repo: 'vuejs/language-tools', | ||
branch: 'master', | ||
beforeBuild: 'pnpm dedupe', | ||
beforeBuild: `pnpm dedupe --registry=${REGISTRY_ADDRESS}`, | ||
build: 'build', | ||
test: 'test', | ||
// patchFiles: { | ||
// 'package.json': (content) => { | ||
// const pkg = JSON.parse(content) | ||
// // As of 2024-03-19, | ||
// // the version of TypeScript in the package.json is latest, which resolves to 5.4.2 if we dedupe it. | ||
// // The new feature in TypeScript 5.4, | ||
// // [Preserved Narrowing in Closures Following Last Assignments](https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/#preserved-narrowing-in-closures-following-last-assignments), | ||
// // would cause a type error at <https://github.com/vuejs/language-tools/blob/58a820281d4b4a8b2d484a7fa2a2eb73e5eb4daf/packages/language-service/lib/plugins/vue-document-drop.ts#L88>. | ||
// // There are also other tests broken by TypeScript 5.4. | ||
// // So we need to pin the version to ~5.3.3. | ||
// pkg.devDependencies.typescript = '~5.3.3' | ||
// return JSON.stringify(pkg, null, 2) | ||
// }, | ||
// }, | ||
patchFiles: { | ||
'package.json': (content) => { | ||
const pkg = JSON.parse(content) | ||
pkg.devDependencies.typescript = '~5.4.5' | ||
return JSON.stringify(pkg, null, 2) | ||
}, | ||
}, | ||
}) | ||
} |