vue-tsc 0.28.7 → 0.28.8

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/proxy.js +13 -0
  2. package/package.json +4 -3
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.28.7",
3
+ "version": "0.28.8",
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
- "vscode-vue-languageservice": "0.28.7"
18
+ "@volar/shared": "0.28.8",
19
+ "vscode-vue-languageservice": "0.28.8"
19
20
  },
20
21
  "peerDependencies": {
21
22
  "typescript": "*"
22
23
  },
23
- "gitHead": "f0a3c905979eb17765cff2facb128463a7600be5"
24
+ "gitHead": "a2c73bf4ad69fc0038f00f1bd849c26eed28e1f3"
24
25
  }