vue-component-meta 3.0.7-alpha.1 → 3.0.7
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/lib/base.js +5 -5
- package/package.json +4 -4
package/lib/base.js
CHANGED
|
@@ -198,7 +198,7 @@ interface ComponentMeta<T> {
|
|
|
198
198
|
throw `Could not find export ${exportName}`;
|
|
199
199
|
}
|
|
200
200
|
const componentType = typeChecker.getTypeOfSymbolAtLocation(_export, symbolNode);
|
|
201
|
-
const symbolProperties = componentType.getProperties()
|
|
201
|
+
const symbolProperties = componentType.getProperties();
|
|
202
202
|
let _type;
|
|
203
203
|
let _props;
|
|
204
204
|
let _events;
|
|
@@ -321,7 +321,7 @@ interface ComponentMeta<T> {
|
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
function _getExports(program, typeChecker, componentPath) {
|
|
324
|
-
const sourceFile = program
|
|
324
|
+
const sourceFile = program.getSourceFile(getMetaFileName(componentPath));
|
|
325
325
|
if (!sourceFile) {
|
|
326
326
|
throw 'Could not find main source file';
|
|
327
327
|
}
|
|
@@ -333,7 +333,7 @@ interface ComponentMeta<T> {
|
|
|
333
333
|
let symbolNode;
|
|
334
334
|
for (const symbol of exportedSymbols) {
|
|
335
335
|
const [declaration] = symbol.getDeclarations() ?? [];
|
|
336
|
-
if (ts.isExportAssignment(declaration)) {
|
|
336
|
+
if (declaration && ts.isExportAssignment(declaration)) {
|
|
337
337
|
symbolNode = declaration.expression;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
@@ -489,7 +489,7 @@ function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: optio
|
|
|
489
489
|
kind: 'event',
|
|
490
490
|
type: typeChecker.signatureToString(signature),
|
|
491
491
|
get schema() {
|
|
492
|
-
return schema ??= signature.parameters.length
|
|
492
|
+
return schema ??= signature.parameters.length
|
|
493
493
|
? typeChecker
|
|
494
494
|
.getTypeArguments(typeChecker.getTypeOfSymbolAtLocation(signature.parameters[0], symbolNode))
|
|
495
495
|
.map(resolveSchema)
|
|
@@ -728,7 +728,7 @@ function resolvePropsOption(ast, props, printer, ts) {
|
|
|
728
728
|
const result = {};
|
|
729
729
|
for (const prop of props.properties) {
|
|
730
730
|
if (ts.isPropertyAssignment(prop)) {
|
|
731
|
-
const name = prop.name
|
|
731
|
+
const name = prop.name.getText(ast);
|
|
732
732
|
if (ts.isObjectLiteralExpression(prop.initializer)) {
|
|
733
733
|
const defaultProp = prop.initializer.properties.find(p => ts.isPropertyAssignment(p) && p.name.getText(ast) === 'default');
|
|
734
734
|
const requiredProp = prop.initializer.properties.find(p => ts.isPropertyAssignment(p) && p.name.getText(ast) === 'required');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-component-meta",
|
|
3
|
-
"version": "3.0.7
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@volar/typescript": "2.4.23",
|
|
17
|
-
"@vue/language-core": "3.0.7
|
|
17
|
+
"@vue/language-core": "3.0.7",
|
|
18
18
|
"path-browserify": "^1.0.1",
|
|
19
|
-
"vue-component-type-helpers": "3.0.7
|
|
19
|
+
"vue-component-type-helpers": "3.0.7"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"typescript": "*"
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"@types/node": "^22.10.4",
|
|
26
26
|
"@types/path-browserify": "^1.0.1"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "6022b75534487f8a031dfc61a7879f900b64d414"
|
|
29
29
|
}
|