@vue/language-core 1.7.4 → 1.7.5

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.
@@ -1,5 +1,5 @@
1
1
  import type { Language } from '@volar/language-core';
2
2
  import { VueCompilerOptions } from './types';
3
3
  import type * as ts from 'typescript/lib/tsserverlibrary';
4
- export declare function createLanguage(compilerOptions?: ts.CompilerOptions, vueCompilerOptions?: VueCompilerOptions, ts?: typeof import('typescript/lib/tsserverlibrary'), codegenStack?: boolean): Language;
5
- export declare function createLanguages(compilerOptions?: ts.CompilerOptions, vueCompilerOptions?: VueCompilerOptions, ts?: typeof import('typescript/lib/tsserverlibrary'), codegenStack?: boolean): Language[];
4
+ export declare function createLanguage(compilerOptions?: ts.CompilerOptions, _vueCompilerOptions?: Partial<VueCompilerOptions>, ts?: typeof import('typescript/lib/tsserverlibrary'), codegenStack?: boolean): Language;
5
+ export declare function createLanguages(compilerOptions?: ts.CompilerOptions, vueCompilerOptions?: Partial<VueCompilerOptions>, ts?: typeof import('typescript/lib/tsserverlibrary'), codegenStack?: boolean): Language[];
@@ -6,7 +6,8 @@ const plugins_1 = require("./plugins");
6
6
  const sourceFile_1 = require("./sourceFile");
7
7
  const sharedTypes = require("./utils/directorySharedTypes");
8
8
  const ts_1 = require("./utils/ts");
9
- function createLanguage(compilerOptions = {}, vueCompilerOptions = (0, ts_1.resolveVueCompilerOptions)({}), ts = require('typescript'), codegenStack = false) {
9
+ function createLanguage(compilerOptions = {}, _vueCompilerOptions = {}, ts = require('typescript'), codegenStack = false) {
10
+ const vueCompilerOptions = (0, ts_1.resolveVueCompilerOptions)(_vueCompilerOptions);
10
11
  patchResolveModuleNames(ts, vueCompilerOptions);
11
12
  const vueLanguagePlugin = (0, plugins_1.getDefaultVueLanguagePlugins)(ts, compilerOptions, vueCompilerOptions, codegenStack);
12
13
  const sharedTypesSnapshot = ts.ScriptSnapshot.fromString(sharedTypes.getTypesCode(vueCompilerOptions));
@@ -57,7 +58,7 @@ function createLanguage(compilerOptions = {}, vueCompilerOptions = (0, ts_1.reso
57
58
  return languageModule;
58
59
  }
59
60
  exports.createLanguage = createLanguage;
60
- function createLanguages(compilerOptions = {}, vueCompilerOptions = (0, ts_1.resolveVueCompilerOptions)({}), ts = require('typescript'), codegenStack = false) {
61
+ function createLanguages(compilerOptions = {}, vueCompilerOptions = {}, ts = require('typescript'), codegenStack = false) {
61
62
  return [
62
63
  createLanguage(compilerOptions, vueCompilerOptions, ts, codegenStack),
63
64
  ...vueCompilerOptions.experimentalAdditionalLanguageModules?.map(module => require(module)) ?? [],
package/out/utils/ts.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type * as ts from 'typescript/lib/tsserverlibrary';
2
2
  import type { VueCompilerOptions } from '../types';
3
3
  export type ParsedCommandLine = ts.ParsedCommandLine & {
4
- vueOptions: VueCompilerOptions;
4
+ vueOptions: Partial<VueCompilerOptions>;
5
5
  };
6
6
  export declare function createParsedCommandLineByJson(ts: typeof import('typescript/lib/tsserverlibrary'), parseConfigHost: ts.ParseConfigHost, rootDir: string, json: any): ParsedCommandLine;
7
7
  export declare function createParsedCommandLine(ts: typeof import('typescript/lib/tsserverlibrary'), parseConfigHost: ts.ParseConfigHost, tsConfigPath: string): ParsedCommandLine;
package/out/utils/ts.js CHANGED
@@ -16,15 +16,18 @@ function createParsedCommandLineByJson(ts, parseConfigHost, rootDir, json) {
16
16
  }
17
17
  catch (err) { }
18
18
  }
19
- const resolvedVueOptions = resolveVueCompilerOptions(vueOptions);
20
- const parsed = ts.parseJsonConfigFileContent(json, proxyHost.host, path.dirname(tsConfigPath), {}, tsConfigPath, undefined, resolvedVueOptions.extensions.map(extension => ({ extension, isMixedContent: true, scriptKind: ts.ScriptKind.Deferred })));
19
+ const parsed = ts.parseJsonConfigFileContent(json, proxyHost.host, path.dirname(tsConfigPath), {}, tsConfigPath, undefined, (vueOptions.extensions ?? ['.vue']).map(extension => ({
20
+ extension: extension.slice(1),
21
+ isMixedContent: true,
22
+ scriptKind: ts.ScriptKind.Deferred,
23
+ })));
21
24
  // fix https://github.com/vuejs/language-tools/issues/1786
22
25
  // https://github.com/microsoft/TypeScript/issues/30457
23
26
  // patching ts server broke with outDir + rootDir + composite/incremental
24
27
  parsed.options.outDir = undefined;
25
28
  return {
26
29
  ...parsed,
27
- vueOptions: resolvedVueOptions,
30
+ vueOptions,
28
31
  };
29
32
  }
30
33
  exports.createParsedCommandLineByJson = createParsedCommandLineByJson;
@@ -43,15 +46,18 @@ function createParsedCommandLine(ts, parseConfigHost, tsConfigPath) {
43
46
  }
44
47
  catch (err) { }
45
48
  }
46
- const resolvedVueOptions = resolveVueCompilerOptions(vueOptions);
47
- const parsed = ts.parseJsonSourceFileConfigFileContent(config, proxyHost.host, path.dirname(tsConfigPath), {}, tsConfigPath, undefined, resolvedVueOptions.extensions.map(extension => ({ extension, isMixedContent: true, scriptKind: ts.ScriptKind.Deferred })));
49
+ const parsed = ts.parseJsonSourceFileConfigFileContent(config, proxyHost.host, path.dirname(tsConfigPath), {}, tsConfigPath, undefined, (vueOptions.extensions ?? ['.vue']).map(extension => ({
50
+ extension: extension.slice(1),
51
+ isMixedContent: true,
52
+ scriptKind: ts.ScriptKind.Deferred,
53
+ })));
48
54
  // fix https://github.com/vuejs/language-tools/issues/1786
49
55
  // https://github.com/microsoft/TypeScript/issues/30457
50
56
  // patching ts server broke with outDir + rootDir + composite/incremental
51
57
  parsed.options.outDir = undefined;
52
58
  return {
53
59
  ...parsed,
54
- vueOptions: resolvedVueOptions,
60
+ vueOptions,
55
61
  };
56
62
  }
57
63
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/language-core",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -13,8 +13,8 @@
13
13
  "directory": "packages/vue-language-core"
14
14
  },
15
15
  "dependencies": {
16
- "@volar/language-core": "1.6.5",
17
- "@volar/source-map": "1.6.5",
16
+ "@volar/language-core": "1.6.6",
17
+ "@volar/source-map": "1.6.6",
18
18
  "@vue/compiler-dom": "^3.3.0",
19
19
  "@vue/reactivity": "^3.3.0",
20
20
  "@vue/shared": "^3.3.0",
@@ -34,5 +34,5 @@
34
34
  "optional": true
35
35
  }
36
36
  },
37
- "gitHead": "30fed93ac21d4d4fbf2351b85ebe65acb1216496"
37
+ "gitHead": "9959597f7bc53e9bd09aeabb67f772bf776b0ad1"
38
38
  }