vue-component-meta 1.7.0-alpha.0 → 1.7.1
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/index.d.ts +2 -2
- package/out/index.js +6 -13
- package/package.json +10 -5
package/out/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as vue from '@
|
|
1
|
+
import * as vue from '@vue/language-core';
|
|
2
2
|
import type * as ts from 'typescript/lib/tsserverlibrary';
|
|
3
3
|
import type { MetaCheckerOptions, ComponentMeta } from './types';
|
|
4
4
|
export * from './types';
|
|
@@ -25,7 +25,7 @@ export declare function createComponentMetaChecker(tsconfigPath: string, checker
|
|
|
25
25
|
tsLs: ts.LanguageService;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
export declare function baseCreate(_host: vue.
|
|
28
|
+
export declare function baseCreate(_host: vue.LanguageServiceHost, vueCompilerOptions: vue.VueCompilerOptions, checkerOptions: MetaCheckerOptions, globalComponentName: string, ts: typeof import('typescript/lib/tsserverlibrary')): {
|
|
29
29
|
getExportNames: (componentPath: string) => string[];
|
|
30
30
|
getComponentMeta: (componentPath: string, exportName?: string) => ComponentMeta;
|
|
31
31
|
__internal__: {
|
package/out/index.js
CHANGED
|
@@ -15,22 +15,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.baseCreate = exports.createComponentMetaChecker = exports.createComponentMetaCheckerByJsonConfig = void 0;
|
|
18
|
-
const vue = require("@
|
|
18
|
+
const vue = require("@vue/language-core");
|
|
19
19
|
const language_core_1 = require("@volar/language-core");
|
|
20
20
|
const path = require("typesafe-path/posix");
|
|
21
21
|
const vue_component_type_helpers_1 = require("vue-component-type-helpers");
|
|
22
22
|
__exportStar(require("./types"), exports);
|
|
23
|
-
const extraFileExtensions = [{
|
|
24
|
-
extension: 'vue',
|
|
25
|
-
isMixedContent: true,
|
|
26
|
-
scriptKind: 7 /* ts.ScriptKind.Deferred */,
|
|
27
|
-
}];
|
|
28
23
|
function createComponentMetaCheckerByJsonConfig(root, json, checkerOptions = {}, ts = require('typescript')) {
|
|
29
|
-
return createComponentMetaCheckerWorker(() => vue.createParsedCommandLineByJson(ts, ts.sys, root, json
|
|
24
|
+
return createComponentMetaCheckerWorker(() => vue.createParsedCommandLineByJson(ts, ts.sys, root, json), checkerOptions, path.join(root.replace(/\\/g, '/'), 'jsconfig.json.global.vue'), ts);
|
|
30
25
|
}
|
|
31
26
|
exports.createComponentMetaCheckerByJsonConfig = createComponentMetaCheckerByJsonConfig;
|
|
32
27
|
function createComponentMetaChecker(tsconfigPath, checkerOptions = {}, ts = require('typescript')) {
|
|
33
|
-
return createComponentMetaCheckerWorker(() => vue.createParsedCommandLine(ts, ts.sys, tsconfigPath
|
|
28
|
+
return createComponentMetaCheckerWorker(() => vue.createParsedCommandLine(ts, ts.sys, tsconfigPath), checkerOptions, tsconfigPath.replace(/\\/g, '/') + '.global.vue', ts);
|
|
34
29
|
}
|
|
35
30
|
exports.createComponentMetaChecker = createComponentMetaChecker;
|
|
36
31
|
function createComponentMetaCheckerWorker(loadParsedCommandLine, checkerOptions, globalComponentName, ts) {
|
|
@@ -60,10 +55,9 @@ function createComponentMetaCheckerWorker(loadParsedCommandLine, checkerOptions,
|
|
|
60
55
|
}
|
|
61
56
|
return scriptSnapshots.get(fileName);
|
|
62
57
|
},
|
|
63
|
-
getVueCompilationSettings: () => parsedCommandLine.vueOptions,
|
|
64
58
|
};
|
|
65
59
|
return {
|
|
66
|
-
...baseCreate(_host, checkerOptions, globalComponentName, ts),
|
|
60
|
+
...baseCreate(_host, parsedCommandLine.vueOptions, checkerOptions, globalComponentName, ts),
|
|
67
61
|
updateFile(fileName, text) {
|
|
68
62
|
fileName = fileName.replace(/\\/g, '/');
|
|
69
63
|
scriptSnapshots.set(fileName, ts.ScriptSnapshot.fromString(text));
|
|
@@ -87,7 +81,7 @@ function createComponentMetaCheckerWorker(loadParsedCommandLine, checkerOptions,
|
|
|
87
81
|
},
|
|
88
82
|
};
|
|
89
83
|
}
|
|
90
|
-
function baseCreate(_host, checkerOptions, globalComponentName, ts) {
|
|
84
|
+
function baseCreate(_host, vueCompilerOptions, checkerOptions, globalComponentName, ts) {
|
|
91
85
|
const globalComponentSnapshot = ts.ScriptSnapshot.fromString('<script setup lang="ts"></script>');
|
|
92
86
|
const metaSnapshots = {};
|
|
93
87
|
const host = new Proxy({
|
|
@@ -122,8 +116,7 @@ function baseCreate(_host, checkerOptions, globalComponentName, ts) {
|
|
|
122
116
|
return _host[prop];
|
|
123
117
|
},
|
|
124
118
|
});
|
|
125
|
-
const
|
|
126
|
-
const vueLanguages = ts ? vue.createLanguages(ts, host.getCompilationSettings(), vueCompilerOptions) : [];
|
|
119
|
+
const vueLanguages = ts ? vue.createLanguages(host.getCompilationSettings(), vueCompilerOptions, ts) : [];
|
|
127
120
|
const core = (0, language_core_1.createLanguageContext)({ typescript: ts }, host, vueLanguages);
|
|
128
121
|
const proxyApis = checkerOptions.forceUseTs ? {
|
|
129
122
|
getScriptKind: (fileName) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-component-meta",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -13,13 +13,18 @@
|
|
|
13
13
|
"directory": "packages/vue-component-meta"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/language-core": "1.
|
|
17
|
-
"@
|
|
16
|
+
"@volar/language-core": "1.6.1",
|
|
17
|
+
"@vue/language-core": "1.7.1",
|
|
18
18
|
"typesafe-path": "^0.2.2",
|
|
19
|
-
"vue-component-type-helpers": "1.7.
|
|
19
|
+
"vue-component-type-helpers": "1.7.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"typescript": "*"
|
|
23
23
|
},
|
|
24
|
-
"
|
|
24
|
+
"peerDependenciesMeta": {
|
|
25
|
+
"typescript": {
|
|
26
|
+
"optional": true
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"gitHead": "8555895e2018cb871cceb19f0ff073fcf322d8e5"
|
|
25
30
|
}
|