@vue/language-core 1.7.4 → 1.7.6
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/out/languageModule.d.ts +2 -2
- package/out/languageModule.js +3 -2
- package/out/utils/ts.d.ts +1 -1
- package/out/utils/ts.js +12 -6
- package/package.json +4 -4
package/out/languageModule.d.ts
CHANGED
|
@@ -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,
|
|
5
|
-
export declare function createLanguages(compilerOptions?: ts.CompilerOptions, vueCompilerOptions?: VueCompilerOptions
|
|
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[];
|
package/out/languageModule.js
CHANGED
|
@@ -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 = {},
|
|
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 =
|
|
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
|
|
20
|
-
|
|
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
|
|
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
|
|
47
|
-
|
|
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
|
|
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.
|
|
3
|
+
"version": "1.7.6",
|
|
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.
|
|
17
|
-
"@volar/source-map": "1.6.
|
|
16
|
+
"@volar/language-core": "1.6.7",
|
|
17
|
+
"@volar/source-map": "1.6.7",
|
|
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": "
|
|
37
|
+
"gitHead": "2a17efdae4ac994aea164dfcdfcfb27b4fa3f27d"
|
|
38
38
|
}
|