Skip to content

Commit

Permalink
refactor(tsc): removed handling for TS 5.7
Browse files Browse the repository at this point in the history
TS 5.7 issue is fixed by upstream: volarjs/volar.js#252
  • Loading branch information
johnsoncodehk committed Dec 23, 2024
1 parent dcb0e35 commit 98489a1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
14 changes: 1 addition & 13 deletions packages/tsc/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { runTsc } from '@volar/typescript/lib/quickstart/runTsc';
import * as vue from '@vue/language-core';
import * as semver from 'semver';

const windowsPathReg = /\\/g;

export function run(tscPath = getTscPath()) {
export function run(tscPath = require.resolve('typescript/lib/tsc')) {

let runExtensions = ['.vue'];

Expand Down Expand Up @@ -47,14 +46,3 @@ export function run(tscPath = getTscPath()) {
}
}
}

function getTscPath() {
const version = require('typescript/package.json').version as string;

if (semver.gte(version, '5.7.0')) {
return require.resolve('typescript/lib/_tsc');
}
else {
return require.resolve('typescript/lib/tsc');
}
}
6 changes: 2 additions & 4 deletions packages/tsc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
},
"dependencies": {
"@volar/typescript": "~2.4.11",
"@vue/language-core": "2.1.10",
"semver": "^7.5.4"
"@vue/language-core": "2.1.10"
},
"peerDependencies": {
"typescript": ">=5.0.0"
},
"devDependencies": {
"@types/node": "latest",
"@types/semver": "^7.5.4"
"@types/node": "latest"
}
}
6 changes: 0 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 98489a1

Please sign in to comment.