vue-tsc 1.8.0 → 1.8.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.
Files changed (2) hide show
  1. package/out/index.js +2 -61
  2. package/package.json +5 -6
package/out/index.js CHANGED
@@ -5,8 +5,6 @@ const ts = require("typescript");
5
5
  const vue = require("@vue/language-core");
6
6
  const vueTs = require("@vue/typescript");
7
7
  const shared_1 = require("./shared");
8
- const vscode_uri_1 = require("vscode-uri");
9
- const fs = require("fs");
10
8
  function createProgram(options) {
11
9
  if (!options.options.noEmit && !options.options.emitDeclarationOnly)
12
10
  throw toThrow('js emit is not supported');
@@ -50,65 +48,8 @@ function createProgram(options) {
50
48
  getCurrentDirectory: () => ctx.options.host.getCurrentDirectory().replace(/\\/g, '/'),
51
49
  getCancellationToken: ctx.options.host.getCancellationToken ? () => ctx.options.host.getCancellationToken() : undefined,
52
50
  };
53
- const uriToFileName = (uri) => vscode_uri_1.URI.parse(uri).fsPath.replace(/\\/g, '/');
54
- const fileNameToUri = (fileName) => vscode_uri_1.URI.file(fileName).toString();
55
- const vueTsLs = vueTs.createLanguageService(languageHost, vueCompilerOptions, ts, {
56
- uriToFileName,
57
- fileNameToUri,
58
- rootUri: vscode_uri_1.URI.parse(fileNameToUri(languageHost.getCurrentDirectory())),
59
- fs: {
60
- stat(uri) {
61
- if (uri.startsWith('file://')) {
62
- try {
63
- const stats = fs.statSync(uriToFileName(uri), { throwIfNoEntry: false });
64
- if (stats) {
65
- return {
66
- type: stats.isFile() ? 1
67
- : stats.isDirectory() ? 2
68
- : stats.isSymbolicLink() ? 64
69
- : 0,
70
- ctime: stats.ctimeMs,
71
- mtime: stats.mtimeMs,
72
- size: stats.size,
73
- };
74
- }
75
- }
76
- catch {
77
- return undefined;
78
- }
79
- }
80
- },
81
- readFile(uri, encoding) {
82
- if (uri.startsWith('file://')) {
83
- try {
84
- return fs.readFileSync(uriToFileName(uri), { encoding: encoding ?? 'utf-8' });
85
- }
86
- catch {
87
- return undefined;
88
- }
89
- }
90
- },
91
- readDirectory(uri) {
92
- if (uri.startsWith('file://')) {
93
- try {
94
- const dirName = uriToFileName(uri);
95
- const files = fs.readdirSync(dirName, { withFileTypes: true });
96
- return files.map(file => {
97
- return [file.name, file.isFile() ? 1
98
- : file.isDirectory() ? 2
99
- : file.isSymbolicLink() ? 64
100
- : 0];
101
- });
102
- }
103
- catch {
104
- return [];
105
- }
106
- }
107
- return [];
108
- },
109
- },
110
- });
111
- program = vueTsLs.getProgram();
51
+ const vueTsLs = vueTs.createLanguageService(languageHost, vueCompilerOptions, ts, ts.sys);
52
+ program = vueTs.getProgram(ts, vueTsLs.__internal__.context, vueTsLs, ts.sys);
112
53
  program.__vue = ctx;
113
54
  function getVueCompilerOptions() {
114
55
  const tsConfig = ctx.options.options.configFilePath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-tsc",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -17,13 +17,12 @@
17
17
  "vue-tsc": "./bin/vue-tsc.js"
18
18
  },
19
19
  "dependencies": {
20
- "@vue/language-core": "1.8.0",
21
- "@vue/typescript": "1.8.0",
22
- "semver": "^7.3.8",
23
- "vscode-uri": "^3.0.7"
20
+ "@vue/language-core": "1.8.2",
21
+ "@vue/typescript": "1.8.2",
22
+ "semver": "^7.3.8"
24
23
  },
25
24
  "peerDependencies": {
26
25
  "typescript": "*"
27
26
  },
28
- "gitHead": "6e2e04ea2f0bfed9ab0fce23ad36abb04916b4f2"
27
+ "gitHead": "de0fb3f1be30b495d17e2999aee24fb9ea3e7e0e"
29
28
  }