Skip to content

Commit

Permalink
feat!: use VTI in vls build mode
Browse files Browse the repository at this point in the history
BREAKING CHANGE: use VTI in vls build mode. `vti` is required as a peerDependency if `vls` is enabled.
  • Loading branch information
fi3ework committed Aug 26, 2022
1 parent 810c173 commit c017c65
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 78 deletions.
2 changes: 0 additions & 2 deletions packages/vite-plugin-checker/bin/vls.js

This file was deleted.

13 changes: 7 additions & 6 deletions packages/vite-plugin-checker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
"description": "Vite plugin that runs TypeScript type checker on a separate process.",
"main": "lib/main.js",
"type": "module",
"bin": {
"vite-plugin-checker-vls": "./bin/vls.js"
},
"types": "lib/main.d.ts",
"files": [
"lib",
Expand Down Expand Up @@ -51,10 +48,10 @@
"vscode-uri": "^3.0.2"
},
"peerDependencies": {
"vite": "^2.0.0 || ^3.0.0-0",
"eslint": ">=7",
"vls": "*",
"typescript": "*"
"typescript": "*",
"vite": "^2.0.0 || ^3.0.0-0",
"vls": "*"
},
"peerDependenciesMeta": {
"eslint": {
Expand All @@ -65,6 +62,9 @@
},
"vls": {
"optional": true
},
"vti": {
"optional": true
}
},
"devDependencies": {
Expand All @@ -78,6 +78,7 @@
"tsup": "^5.12.3",
"typescript": "~4.5.5",
"vls": "^0.7.6",
"vti": "^0.1.7",
"vue-tsc": "0.38.9"
}
}
63 changes: 0 additions & 63 deletions packages/vite-plugin-checker/src/checkers/vls/cli.ts

This file was deleted.

6 changes: 2 additions & 4 deletions packages/vite-plugin-checker/src/checkers/vls/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,16 @@ export class VlsChecker extends Checker<'vls'> {
buildBin: (config) => {
if (typeof config.vls === 'object') {
return [
'vite-plugin-checker-vls',
'vti',
[
'diagnostics',
'--checker-config',
// Escape quotes so that the system shell doesn't strip them out:
'"' + JSON.stringify(config.vls).replace(/[\\"]/g, '\\$&') + '"',
],
]
}

return ['vite-plugin-checker-vls', ['diagnostics']]
return ['vti', ['diagnostics']]
},
},
createDiagnostic,
Expand All @@ -94,7 +93,6 @@ export class VlsChecker extends Checker<'vls'> {

public init() {
const _createServeAndBuild = super.initMainThread()
// module.exports.createServeAndBuild = createServeAndBuild
createServeAndBuild = _createServeAndBuild
super.initWorkerThread()
}
Expand Down
1 change: 0 additions & 1 deletion playground/vls-vue2/__tests__/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ describe('vue2-vls', () => {

describe.runIf(isBuild)('build', () => {
it('enableBuild: true', async () => {
console.log('👰', log)
expectStderrContains(log, `Property 'msg1' does not exist on type`)
})
})
Expand Down
5 changes: 3 additions & 2 deletions playground/vls-vue2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@
"eslint-plugin-vue": "^7.6.0",
"prettier": "2.6.0",
"sass": "^1.32.7",
"typescript": "~4.3.2",
"vite": "^3.0.4",
"vite-plugin-checker": "workspace:*",
"vite-plugin-components": "^0.12.2",
"vite-plugin-vue2": "^1.9.0",
"typescript": "~4.3.2",
"vite-plugin-checker": "workspace:*",
"vls": "^0.8.1",
"vti": "^0.1.7",
"vue-template-compiler": "^2.6.14"
}
}
14 changes: 14 additions & 0 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 c017c65

Please sign in to comment.