vue-tsc 0.28.7 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/bin/vue-tsc.js +2 -2
- package/out/proxy.js +13 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -23,6 +23,8 @@ Build dts:
|
|
|
23
23
|
|
|
24
24
|
`vue-tsc --declaration --emitDeclarationOnly`
|
|
25
25
|
|
|
26
|
+
Check out https://github.com/johnsoncodehk/volar/discussions/640#discussioncomment-1555479 for example repo.
|
|
27
|
+
|
|
26
28
|
## Sponsors
|
|
27
29
|
|
|
28
30
|
This company is [sponsoring this project](https://github.com/sponsors/johnsoncodehk) to improve your DX. 💪
|
package/bin/vue-tsc.js
CHANGED
|
@@ -9,11 +9,11 @@ fs.readFileSync = (...args) => {
|
|
|
9
9
|
let tsc = readFileSync(...args);
|
|
10
10
|
tsc = tsc.replace(
|
|
11
11
|
`function createIncrementalProgram(_a) {`,
|
|
12
|
-
`function createIncrementalProgram(_a) { throw 'incremental mode is not yet support';`,
|
|
12
|
+
`function createIncrementalProgram(_a) { console.error('incremental mode is not yet support'); throw 'incremental mode is not yet support';`,
|
|
13
13
|
);
|
|
14
14
|
tsc = tsc.replace(
|
|
15
15
|
`function createWatchProgram(host) {`,
|
|
16
|
-
`function createWatchProgram(host) { throw 'watch mode is not yet support';`,
|
|
16
|
+
`function createWatchProgram(host) { console.error('watch mode is not yet support'); throw 'watch mode is not yet support';`,
|
|
17
17
|
);
|
|
18
18
|
tsc = tsc.replace(
|
|
19
19
|
`function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {`,
|
package/out/proxy.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.createProgramProxy = void 0;
|
|
|
4
4
|
const ts = require("typescript/lib/tsserverlibrary");
|
|
5
5
|
const vue = require("vscode-vue-languageservice");
|
|
6
6
|
const path = require("path");
|
|
7
|
+
const shared = require("@volar/shared");
|
|
7
8
|
function createProgramProxy(options) {
|
|
8
9
|
if (!options.options.noEmit && !options.options.emitDeclarationOnly)
|
|
9
10
|
return doThrow('js emit is not support');
|
|
@@ -28,15 +29,19 @@ function createProgramProxy(options) {
|
|
|
28
29
|
...options.rootNames.map(rootName => realpath(rootName)),
|
|
29
30
|
...getVueFileNames(),
|
|
30
31
|
];
|
|
32
|
+
const vueCompilerOptions = getVueCompilerOptions();
|
|
31
33
|
const scriptSnapshots = new Map();
|
|
32
34
|
const vueLsHost = {
|
|
33
35
|
...host,
|
|
34
36
|
writeFile: undefined,
|
|
35
37
|
getCompilationSettings: () => options.options,
|
|
38
|
+
getVueCompilationSettings: () => vueCompilerOptions,
|
|
36
39
|
getScriptFileNames: () => fileNames,
|
|
37
40
|
getScriptVersion: () => '',
|
|
38
41
|
getScriptSnapshot,
|
|
39
42
|
getProjectVersion: () => '',
|
|
43
|
+
getVueProjectVersion: () => '',
|
|
44
|
+
getProjectReferences: () => options.projectReferences,
|
|
40
45
|
};
|
|
41
46
|
const vueLs = vue.createLanguageService({ typescript: ts }, vueLsHost);
|
|
42
47
|
const program = vueLs.__internal__.tsProgramProxy;
|
|
@@ -50,6 +55,14 @@ function createProgramProxy(options) {
|
|
|
50
55
|
}
|
|
51
56
|
return [];
|
|
52
57
|
}
|
|
58
|
+
function getVueCompilerOptions() {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
const tsConfig = options.options.configFilePath;
|
|
61
|
+
if (typeof tsConfig === 'string') {
|
|
62
|
+
return (_b = (_a = shared.createParsedCommandLine(ts, ts.sys, tsConfig).raw) === null || _a === void 0 ? void 0 : _a.vueCompilerOptions) !== null && _b !== void 0 ? _b : {};
|
|
63
|
+
}
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
53
66
|
function getScriptSnapshot(fileName) {
|
|
54
67
|
const scriptSnapshot = scriptSnapshots.get(fileName);
|
|
55
68
|
if (scriptSnapshot) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-tsc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"bin",
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
"vue-tsc": "./bin/vue-tsc.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"
|
|
18
|
+
"@volar/shared": "0.29.0",
|
|
19
|
+
"vscode-vue-languageservice": "0.29.0"
|
|
19
20
|
},
|
|
20
21
|
"peerDependencies": {
|
|
21
22
|
"typescript": "*"
|
|
22
23
|
},
|
|
23
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "3a2f1db33d92410455811bc119041e800de115ab"
|
|
24
25
|
}
|