vue-tsc 0.33.1 → 0.33.2-patch.1

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.
Files changed (2) hide show
  1. package/out/apis.js +14 -14
  2. package/package.json +4 -5
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
  }
@@ -31,6 +32,7 @@ function register(ts, { vueDocuments, templateTsLsRaw, scriptTsLsRaw, templateTs
31
32
  return getSourceFileDiagnosticsWorker(sourceFile, cancellationToken, 'getSemanticDiagnostics');
32
33
  }
33
34
  function getSourceFileDiagnosticsWorker(sourceFile, cancellationToken, api) {
35
+ var _a, _b, _c;
34
36
  if (sourceFile) {
35
37
  const sourceMap = vueDocuments.fromEmbeddedDocumentUri('script', shared.fsPathToUri(sourceFile.fileName));
36
38
  const vueDocument = sourceMap ? vueDocuments.get(sourceMap.sourceDocument.uri) : undefined;
@@ -41,41 +43,39 @@ function register(ts, { vueDocuments, templateTsLsRaw, scriptTsLsRaw, templateTs
41
43
  if (sourceMap.lsType === 'nonTs' || !sourceMap.capabilities.diagnostics)
42
44
  continue;
43
45
  const program = getProgram(sourceMap.lsType);
44
- const embeddedSourceFile = program.getSourceFile(shared.uriToFsPath(sourceMap.mappedDocument.uri));
46
+ const embeddedSourceFile = program === null || program === void 0 ? void 0 : program.getSourceFile(shared.uriToFsPath(sourceMap.mappedDocument.uri));
45
47
  if (embeddedSourceFile) {
46
- const errors = transformDiagnostics(sourceMap.lsType, program[api](embeddedSourceFile, cancellationToken));
48
+ const errors = transformDiagnostics(sourceMap.lsType, (_a = program === null || program === void 0 ? void 0 : program[api](embeddedSourceFile, cancellationToken)) !== null && _a !== void 0 ? _a : []);
47
49
  results = results.concat(errors);
48
50
  }
49
51
  }
50
52
  return results;
51
53
  }
52
54
  else {
53
- return getProgram('script')[api](sourceFile, cancellationToken);
55
+ return (_c = (_b = getProgram('script')) === null || _b === void 0 ? void 0 : _b[api](sourceFile, cancellationToken)) !== null && _c !== void 0 ? _c : [];
54
56
  }
55
57
  }
56
- return lsTypes.map(lsType => transformDiagnostics(lsType, getProgram(lsType)[api](sourceFile, cancellationToken))).flat();
58
+ return lsTypes.map(lsType => { var _a, _b; return transformDiagnostics(lsType, (_b = (_a = getProgram(lsType)) === null || _a === void 0 ? void 0 : _a[api](sourceFile, cancellationToken)) !== null && _b !== void 0 ? _b : []); }).flat();
57
59
  }
58
60
  function getGlobalDiagnostics(cancellationToken) {
59
- return lsTypes.map(lsType => transformDiagnostics(lsType, getProgram(lsType).getGlobalDiagnostics(cancellationToken))).flat();
61
+ 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
62
  }
61
63
  function emit(targetSourceFile, _writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
62
- var _a;
64
+ var _a, _b, _c;
63
65
  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);
66
+ const templateResult = (_b = getProgram('template')) === null || _b === void 0 ? void 0 : _b.emit(targetSourceFile, undefined, cancellationToken, emitOnlyDtsFiles, customTransformers);
65
67
  return {
66
68
  emitSkipped: scriptResult.emitSkipped,
67
69
  emittedFiles: scriptResult.emittedFiles,
68
70
  diagnostics: [
69
71
  ...transformDiagnostics('script', scriptResult.diagnostics),
70
- ...transformDiagnostics('template', templateResult.diagnostics),
72
+ ...transformDiagnostics('template', (_c = templateResult === null || templateResult === void 0 ? void 0 : templateResult.diagnostics) !== null && _c !== void 0 ? _c : []),
71
73
  ],
72
74
  };
73
75
  }
74
76
  function getProgram(lsType) {
75
- const program = (lsType === 'script' ? scriptTsLsRaw : templateTsLsRaw).getProgram();
76
- if (!program)
77
- throw '!program';
78
- return program;
77
+ var _a;
78
+ return (_a = (lsType === 'script' ? scriptTsLsRaw : templateTsLsRaw)) === null || _a === void 0 ? void 0 : _a.getProgram();
79
79
  }
80
80
  // transform
81
81
  function transformDiagnostics(lsType, diagnostics) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-tsc",
3
- "version": "0.33.1",
3
+ "version": "0.33.2-patch.1",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "bin",
@@ -16,11 +16,10 @@
16
16
  "vue-tsc": "./bin/vue-tsc.js"
17
17
  },
18
18
  "dependencies": {
19
- "@volar/shared": "0.33.1",
20
- "@volar/vue-typescript": "0.33.1"
19
+ "@volar/shared": "0.33.2",
20
+ "@volar/vue-typescript": "0.33.2"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "typescript": "*"
24
- },
25
- "gitHead": "03eaf26e0b1259ffa2b5690168a2d6a8baa81cbc"
24
+ }
26
25
  }