@vue/language-core 1.8.21 → 1.9.0-alpha.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/out/generators/script.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.generate = void 0;
|
|
|
4
4
|
const language_core_1 = require("@volar/language-core");
|
|
5
5
|
const source_map_1 = require("@volar/source-map");
|
|
6
6
|
const muggle = require("muggle-string");
|
|
7
|
-
const
|
|
7
|
+
const path = require("path-browserify");
|
|
8
8
|
const shared_1 = require("../utils/shared");
|
|
9
9
|
const transform_1 = require("../utils/transform");
|
|
10
10
|
function generate(ts, fileName, script, scriptSetup, styles, // TODO: computed it
|
|
@@ -91,6 +91,7 @@ lang, scriptRanges, scriptSetupRanges, htmlGen, compilerOptions, vueCompilerOpti
|
|
|
91
91
|
default: D[K]
|
|
92
92
|
}> : P[K]
|
|
93
93
|
};\n`);
|
|
94
|
+
codes.push(`type __VLS_Prettify<T> = { [K in keyof T]: T[K]; } & {};\n`);
|
|
94
95
|
}
|
|
95
96
|
if (usedHelperTypes.WithTemplateSlots) {
|
|
96
97
|
codes.push(`type __VLS_WithTemplateSlots<T, S> = T & { new(): {\n`, `${(0, shared_1.getSlotsPropertyName)(vueCompilerOptions.target)}: S;\n`);
|
|
@@ -673,7 +674,7 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
|
|
|
673
674
|
codes.push(`});\n`); // defineComponent({
|
|
674
675
|
}
|
|
675
676
|
else if (script) {
|
|
676
|
-
codes.push(`let __VLS_internalComponent!: typeof import('./${
|
|
677
|
+
codes.push(`let __VLS_internalComponent!: typeof import('./${path.basename(fileName)}')['default'];\n`);
|
|
677
678
|
}
|
|
678
679
|
else {
|
|
679
680
|
codes.push(`const __VLS_internalComponent = (await import('${vueCompilerOptions.lib}')).defineComponent({});\n`);
|
|
@@ -708,7 +709,7 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
|
|
|
708
709
|
codes.push(`;\n`);
|
|
709
710
|
}
|
|
710
711
|
else if (scriptSetup) {
|
|
711
|
-
codes.push(`let __VLS_name!: '${
|
|
712
|
+
codes.push(`let __VLS_name!: '${path.basename(fileName.substring(0, fileName.lastIndexOf('.')))}';\n`);
|
|
712
713
|
}
|
|
713
714
|
else {
|
|
714
715
|
codes.push(`const __VLS_name = undefined;\n`);
|
|
@@ -742,7 +743,7 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
|
|
|
742
743
|
for (let i = 0; i < styles.length; i++) {
|
|
743
744
|
const style = styles[i];
|
|
744
745
|
const option = vueCompilerOptions.experimentalResolveStyleCssClasses;
|
|
745
|
-
if (
|
|
746
|
+
if (option === 'always' || (option === 'scoped' && style.scoped)) {
|
|
746
747
|
for (const className of style.classNames) {
|
|
747
748
|
generateCssClassProperty(i, className.text.substring(1), { start: className.offset, end: className.offset + className.text.length }, 'boolean', true, !style.module);
|
|
748
749
|
}
|
package/out/languageModule.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export declare function createVueLanguage(ts: typeof import('typescript/lib/tsse
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated planed to remove in 2.0, please use createVueLanguage instead of
|
|
8
8
|
*/
|
|
9
|
-
export declare function createLanguages(compilerOptions?: ts.CompilerOptions, vueCompilerOptions?: Partial<VueCompilerOptions>,
|
|
9
|
+
export declare function createLanguages(ts: typeof import('typescript/lib/tsserverlibrary'), compilerOptions?: ts.CompilerOptions, vueCompilerOptions?: Partial<VueCompilerOptions>, codegenStack?: boolean): Language[];
|
|
10
10
|
//# sourceMappingURL=languageModule.d.ts.map
|
package/out/languageModule.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createLanguages = exports.createVueLanguage = void 0;
|
|
4
|
-
const
|
|
4
|
+
const path = require("path-browserify");
|
|
5
5
|
const plugins_1 = require("./plugins");
|
|
6
6
|
const vueFile_1 = require("./virtualFile/vueFile");
|
|
7
7
|
const sharedTypes = require("./utils/globalTypes");
|
|
@@ -60,7 +60,7 @@ function createVueLanguage(ts, compilerOptions = {}, _vueCompilerOptions = {}, c
|
|
|
60
60
|
},
|
|
61
61
|
resolveHost(host) {
|
|
62
62
|
const sharedTypesSnapshot = ts.ScriptSnapshot.fromString(sharedTypes.getTypesCode(vueCompilerOptions));
|
|
63
|
-
const sharedTypesFileName =
|
|
63
|
+
const sharedTypesFileName = path.join(host.rootPath, sharedTypes.baseName);
|
|
64
64
|
return {
|
|
65
65
|
...host,
|
|
66
66
|
resolveModuleName(moduleName, impliedNodeFormat) {
|
|
@@ -89,7 +89,7 @@ exports.createVueLanguage = createVueLanguage;
|
|
|
89
89
|
/**
|
|
90
90
|
* @deprecated planed to remove in 2.0, please use createVueLanguage instead of
|
|
91
91
|
*/
|
|
92
|
-
function createLanguages(compilerOptions = {}, vueCompilerOptions = {},
|
|
92
|
+
function createLanguages(ts, compilerOptions = {}, vueCompilerOptions = {}, codegenStack = false) {
|
|
93
93
|
return [
|
|
94
94
|
createVueLanguage(ts, compilerOptions, vueCompilerOptions, codegenStack),
|
|
95
95
|
...vueCompilerOptions.experimentalAdditionalLanguageModules?.map(module => require(module)) ?? [],
|
package/out/plugins/vue-tsx.js
CHANGED
|
@@ -131,7 +131,7 @@ function createTsx(fileName, _sfc, { vueCompilerOptions, compilerOptions, codege
|
|
|
131
131
|
}
|
|
132
132
|
for (const style of _sfc.styles) {
|
|
133
133
|
const option = vueCompilerOptions.experimentalResolveStyleCssClasses;
|
|
134
|
-
if (
|
|
134
|
+
if (option === 'always' || (option === 'scoped' && style.scoped)) {
|
|
135
135
|
for (const className of style.classNames) {
|
|
136
136
|
classes.add(className.text.substring(1));
|
|
137
137
|
}
|
package/out/utils/ts.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveVueCompilerOptions = exports.createParsedCommandLine = exports.createParsedCommandLineByJson = void 0;
|
|
4
|
-
const path = require("path");
|
|
4
|
+
const path = require("path-browserify");
|
|
5
5
|
function createParsedCommandLineByJson(ts, parseConfigHost, rootDir, json, configFileName = rootDir + '/jsconfig.json') {
|
|
6
6
|
const proxyHost = proxyParseConfigHostForExtendConfigPaths(parseConfigHost);
|
|
7
7
|
ts.parseJsonConfigFileContent(json, proxyHost.host, rootDir, {}, configFileName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0-alpha.0",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -13,17 +13,20 @@
|
|
|
13
13
|
"directory": "packages/language-core"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/language-core": "~1.10.
|
|
17
|
-
"@volar/source-map": "~1.10.
|
|
16
|
+
"@volar/language-core": "~1.10.9",
|
|
17
|
+
"@volar/source-map": "~1.10.9",
|
|
18
18
|
"@vue/compiler-dom": "^3.3.0",
|
|
19
19
|
"@vue/shared": "^3.3.0",
|
|
20
20
|
"computeds": "^0.0.1",
|
|
21
21
|
"minimatch": "^9.0.3",
|
|
22
22
|
"muggle-string": "^0.3.1",
|
|
23
|
+
"path-browserify": "^1.0.1",
|
|
23
24
|
"vue-template-compiler": "^2.7.14"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
27
|
"@types/minimatch": "^5.1.2",
|
|
28
|
+
"@types/node": "latest",
|
|
29
|
+
"@types/path-browserify": "^1.0.1",
|
|
27
30
|
"@vue/compiler-sfc": "^3.3.0"
|
|
28
31
|
},
|
|
29
32
|
"peerDependencies": {
|
|
@@ -34,5 +37,5 @@
|
|
|
34
37
|
"optional": true
|
|
35
38
|
}
|
|
36
39
|
},
|
|
37
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "d6905e4d4d1208f560a544509494f33f431b602a"
|
|
38
41
|
}
|