vue-tsc 0.36.1 → 0.37.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/bin/vue-tsc.js CHANGED
@@ -12,15 +12,15 @@ fs.readFileSync = (...args) => {
12
12
  // add *.vue files to allow extensions
13
13
  tsc = tsc.replace(
14
14
  `ts.supportedTSExtensions = [[".ts", ".tsx", ".d.ts"], [".cts", ".d.cts"], [".mts", ".d.mts"]];`,
15
- `ts.supportedTSExtensions = [[".ts", ".tsx", ".d.ts"], [".cts", ".d.cts"], [".mts", ".d.mts"], [".vue"]];`,
15
+ `ts.supportedTSExtensions = [[".ts", ".tsx", ".d.ts"], [".cts", ".d.cts"], [".mts", ".d.mts"], [".vue", ".md"]];`,
16
16
  );
17
17
  tsc = tsc.replace(
18
18
  `ts.supportedJSExtensions = [[".js", ".jsx"], [".mjs"], [".cjs"]];`,
19
- `ts.supportedJSExtensions = [[".js", ".jsx"], [".mjs"], [".cjs"], [".vue"]];`,
19
+ `ts.supportedJSExtensions = [[".js", ".jsx"], [".mjs"], [".cjs"], [".vue", ".md"]];`,
20
20
  );
21
21
  tsc = tsc.replace(
22
22
  `var allSupportedExtensions = [[".ts", ".tsx", ".d.ts", ".js", ".jsx"], [".cts", ".d.cts", ".cjs"], [".mts", ".d.mts", ".mjs"]];`,
23
- `var allSupportedExtensions = [[".ts", ".tsx", ".d.ts", ".js", ".jsx"], [".cts", ".d.cts", ".cjs"], [".mts", ".d.mts", ".mjs"], [".vue"]];`,
23
+ `var allSupportedExtensions = [[".ts", ".tsx", ".d.ts", ".js", ".jsx"], [".cts", ".d.cts", ".cjs"], [".mts", ".d.mts", ".mjs"], [".vue", ".md"]];`,
24
24
  );
25
25
 
26
26
  // proxy createProgram apis
@@ -32,6 +32,18 @@ fs.readFileSync = (...args) => {
32
32
  `function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {`,
33
33
  `function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { return require(${JSON.stringify(proxyPath)}).createProgramProxy(...arguments);`,
34
34
  );
35
+
36
+ // proxy tracing
37
+ tsc = tsc.replace(
38
+ `ts.startTracing = tracingEnabled.startTracing;`,
39
+ `ts.startTracing = require(${JSON.stringify(proxyPath)}).loadTsLib().startTracing;`,
40
+ );
41
+
42
+ tsc = tsc.replace(
43
+ `ts.dumpTracingLegend = tracingEnabled.dumpLegend;`,
44
+ `ts.dumpTracingLegend = require(${JSON.stringify(proxyPath)}).loadTsLib().dumpTracingLegend;`,
45
+ );
46
+
35
47
  return tsc;
36
48
  }
37
49
  return readFileSync(...args);
package/out/apis.js CHANGED
@@ -108,7 +108,7 @@ function register(ts, context) {
108
108
  }
109
109
  }
110
110
  else {
111
- file = ts.createSourceFile(fileName, docText, fileName.endsWith('.vue') ? ts.ScriptTarget.JSON : ts.ScriptTarget.Latest);
111
+ file = ts.createSourceFile(fileName, docText, fileName.endsWith('.vue') || fileName.endsWith('.md') ? ts.ScriptTarget.JSON : ts.ScriptTarget.Latest);
112
112
  }
113
113
  }
114
114
  const newDiagnostic = Object.assign(Object.assign({}, diagnostic), { file, start: start, length: end - start });
package/out/proxy.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import * as ts from 'typescript/lib/tsserverlibrary';
2
2
  export declare function createProgramProxy(options: ts.CreateProgramOptions, // rootNamesOrOptions: readonly string[] | CreateProgramOptions,
3
3
  _options?: ts.CompilerOptions, _host?: ts.CompilerHost, _oldProgram?: ts.Program, _configFileParsingDiagnostics?: readonly ts.Diagnostic[]): void | ts.Program;
4
+ export declare function loadTsLib(): typeof ts;
package/out/proxy.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createProgramProxy = void 0;
3
+ exports.loadTsLib = exports.createProgramProxy = void 0;
4
4
  const ts = require("typescript/lib/tsserverlibrary");
5
5
  const apis = require("./apis");
6
6
  const vue_typescript_1 = require("@volar/vue-typescript");
@@ -29,8 +29,6 @@ _options, _host, _oldProgram, _configFileParsingDiagnostics) {
29
29
  }, getProjectReferences: () => options.projectReferences });
30
30
  const tsRuntime = (_b = (_a = options.oldProgram) === null || _a === void 0 ? void 0 : _a.__VLS_tsRuntime) !== null && _b !== void 0 ? _b : (0, vue_typescript_1.createTypeScriptRuntime)({
31
31
  typescript: ts,
32
- baseCssModuleType: 'any',
33
- getCssClasses: () => ({}),
34
32
  vueLsHost: vueLsHost,
35
33
  isVueTsc: true,
36
34
  });
@@ -92,6 +90,10 @@ _options, _host, _oldProgram, _configFileParsingDiagnostics) {
92
90
  }
93
91
  }
94
92
  exports.createProgramProxy = createProgramProxy;
93
+ function loadTsLib() {
94
+ return ts;
95
+ }
96
+ exports.loadTsLib = loadTsLib;
95
97
  function doThrow(msg) {
96
98
  console.error(msg);
97
99
  throw msg;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-tsc",
3
- "version": "0.36.1",
3
+ "version": "0.37.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "bin",
@@ -16,10 +16,10 @@
16
16
  "vue-tsc": "./bin/vue-tsc.js"
17
17
  },
18
18
  "dependencies": {
19
- "@volar/vue-typescript": "0.36.1"
19
+ "@volar/vue-typescript": "0.37.0"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "typescript": "*"
23
23
  },
24
- "gitHead": "d0e4dbd21d1c0f28d0015c96390cca535c85bf24"
24
+ "gitHead": "e72a5db00ee63b1ebe239b22733cfc93e304fae6"
25
25
  }