Skip to content

Commit

Permalink
fix(vue-tsc): support volar v1.0.14
Browse files Browse the repository at this point in the history
Fixes fi3ework#193

volar v1.0.14 renamed the `proxy.ts` file in `index.ts` and changed `createProgramProxy` into `createProgram`.
  • Loading branch information
cexbrayat committed Dec 18, 2022
1 parent d1c422c commit 63a1f2a
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 85 deletions.
2 changes: 1 addition & 1 deletion packages/vite-plugin-checker/package.json
Expand Up @@ -104,6 +104,6 @@
"typescript": "~4.5.5",
"vls": "^0.7.6",
"vti": "^0.1.7",
"vue-tsc": "0.38.9"
"vue-tsc": "1.0.14"
}
}
Expand Up @@ -8,7 +8,7 @@ const _require = createRequire(import.meta.url)
const _filename = fileURLToPath(import.meta.url)
const _dirname = dirname(_filename)

const proxyPath = _require.resolve('vue-tsc/out/proxy')
const proxyPath = _require.resolve('vue-tsc/out/index')

const textToReplace: { target: string; replacement: string }[] = [
{
Expand All @@ -34,7 +34,7 @@ const textToReplace: { target: string; replacement: string }[] = [
target: `function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {`,
replacement: `function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { return require(${JSON.stringify(
proxyPath
)}).createProgramProxy(...arguments);`,
)}).createProgram(...arguments);`,
},
{
target: `ts.executeCommandLine(ts.sys, ts.noop, ts.sys.args);`,
Expand Down
2 changes: 1 addition & 1 deletion playground/vue-tsc-vue3/package.json
Expand Up @@ -16,6 +16,6 @@
"typescript": "~4.5.5",
"vite": "^3.0.4",
"vite-plugin-checker": "workspace:*",
"vue-tsc": "^0.39.5"
"vue-tsc": "^1.0.14"
}
}

0 comments on commit 63a1f2a

Please sign in to comment.