vue-tsc 0.33.1 → 0.33.2
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/out/apis.js +10 -11
- package/package.json +4 -4
package/out/apis.js
CHANGED
|
@@ -13,9 +13,10 @@ function register(ts, { vueDocuments, templateTsLsRaw, scriptTsLsRaw, templateTs
|
|
|
13
13
|
getBindAndCheckDiagnostics,
|
|
14
14
|
};
|
|
15
15
|
function getRootFileNames() {
|
|
16
|
+
var _a, _b, _c, _d;
|
|
16
17
|
const set = new Set([
|
|
17
|
-
...getProgram('script').getRootFileNames().filter(fileName => { var _a; return (_a = scriptTsHost.fileExists) === null || _a === void 0 ? void 0 : _a.call(scriptTsHost, fileName); }),
|
|
18
|
-
...getProgram('template').getRootFileNames().filter(fileName => { var _a; return (_a = templateTsHost.fileExists) === null || _a === void 0 ? void 0 : _a.call(templateTsHost, fileName); }),
|
|
18
|
+
...(_b = (_a = getProgram('script')) === null || _a === void 0 ? void 0 : _a.getRootFileNames().filter(fileName => { var _a; return (_a = scriptTsHost.fileExists) === null || _a === void 0 ? void 0 : _a.call(scriptTsHost, fileName); })) !== null && _b !== void 0 ? _b : [],
|
|
19
|
+
...(_d = (_c = getProgram('template')) === null || _c === void 0 ? void 0 : _c.getRootFileNames().filter(fileName => { var _a; return (_a = templateTsHost === null || templateTsHost === void 0 ? void 0 : templateTsHost.fileExists) === null || _a === void 0 ? void 0 : _a.call(templateTsHost, fileName); })) !== null && _d !== void 0 ? _d : [],
|
|
19
20
|
]);
|
|
20
21
|
return [...set.values()];
|
|
21
22
|
}
|
|
@@ -41,7 +42,7 @@ function register(ts, { vueDocuments, templateTsLsRaw, scriptTsLsRaw, templateTs
|
|
|
41
42
|
if (sourceMap.lsType === 'nonTs' || !sourceMap.capabilities.diagnostics)
|
|
42
43
|
continue;
|
|
43
44
|
const program = getProgram(sourceMap.lsType);
|
|
44
|
-
const embeddedSourceFile = program.getSourceFile(shared.uriToFsPath(sourceMap.mappedDocument.uri));
|
|
45
|
+
const embeddedSourceFile = program === null || program === void 0 ? void 0 : program.getSourceFile(shared.uriToFsPath(sourceMap.mappedDocument.uri));
|
|
45
46
|
if (embeddedSourceFile) {
|
|
46
47
|
const errors = transformDiagnostics(sourceMap.lsType, program[api](embeddedSourceFile, cancellationToken));
|
|
47
48
|
results = results.concat(errors);
|
|
@@ -56,26 +57,24 @@ function register(ts, { vueDocuments, templateTsLsRaw, scriptTsLsRaw, templateTs
|
|
|
56
57
|
return lsTypes.map(lsType => transformDiagnostics(lsType, getProgram(lsType)[api](sourceFile, cancellationToken))).flat();
|
|
57
58
|
}
|
|
58
59
|
function getGlobalDiagnostics(cancellationToken) {
|
|
59
|
-
return lsTypes.map(lsType => transformDiagnostics(lsType, getProgram(lsType).getGlobalDiagnostics(cancellationToken))).flat();
|
|
60
|
+
return lsTypes.map(lsType => { var _a, _b; return transformDiagnostics(lsType, (_b = (_a = getProgram(lsType)) === null || _a === void 0 ? void 0 : _a.getGlobalDiagnostics(cancellationToken)) !== null && _b !== void 0 ? _b : []); }).flat();
|
|
60
61
|
}
|
|
61
62
|
function emit(targetSourceFile, _writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
62
|
-
var _a;
|
|
63
|
+
var _a, _b, _c;
|
|
63
64
|
const scriptResult = getProgram('script').emit(targetSourceFile, ((_a = vueHost.writeFile) !== null && _a !== void 0 ? _a : ts.sys.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
|
|
64
|
-
const templateResult = getProgram('template').emit(targetSourceFile, undefined, cancellationToken, emitOnlyDtsFiles, customTransformers);
|
|
65
|
+
const templateResult = (_b = getProgram('template')) === null || _b === void 0 ? void 0 : _b.emit(targetSourceFile, undefined, cancellationToken, emitOnlyDtsFiles, customTransformers);
|
|
65
66
|
return {
|
|
66
67
|
emitSkipped: scriptResult.emitSkipped,
|
|
67
68
|
emittedFiles: scriptResult.emittedFiles,
|
|
68
69
|
diagnostics: [
|
|
69
70
|
...transformDiagnostics('script', scriptResult.diagnostics),
|
|
70
|
-
...transformDiagnostics('template', templateResult.diagnostics),
|
|
71
|
+
...transformDiagnostics('template', (_c = templateResult === null || templateResult === void 0 ? void 0 : templateResult.diagnostics) !== null && _c !== void 0 ? _c : []),
|
|
71
72
|
],
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
75
|
function getProgram(lsType) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
throw '!program';
|
|
78
|
-
return program;
|
|
76
|
+
var _a;
|
|
77
|
+
return (_a = (lsType === 'script' ? scriptTsLsRaw : templateTsLsRaw)) === null || _a === void 0 ? void 0 : _a.getProgram();
|
|
79
78
|
}
|
|
80
79
|
// transform
|
|
81
80
|
function transformDiagnostics(lsType, diagnostics) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-tsc",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"bin",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"vue-tsc": "./bin/vue-tsc.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@volar/shared": "0.33.
|
|
20
|
-
"@volar/vue-typescript": "0.33.
|
|
19
|
+
"@volar/shared": "0.33.2",
|
|
20
|
+
"@volar/vue-typescript": "0.33.2"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"typescript": "*"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "31edc9e4c229643fd0594896c6ec63a64a9c1e30"
|
|
26
26
|
}
|