vue-component-meta 3.0.0-alpha.2 → 3.0.0-alpha.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/lib/base.js +14 -8
- package/package.json +5 -5
package/lib/base.js
CHANGED
|
@@ -356,7 +356,7 @@ ${commandLine.vueOptions.target < 3 ? vue2_1.code : vue_component_type_helpers_1
|
|
|
356
356
|
function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: options, noDeclarations }, ts, language) {
|
|
357
357
|
const visited = new Set();
|
|
358
358
|
function shouldIgnore(subtype) {
|
|
359
|
-
const name =
|
|
359
|
+
const name = getFullyQualifiedName(subtype);
|
|
360
360
|
if (name === 'any') {
|
|
361
361
|
return true;
|
|
362
362
|
}
|
|
@@ -395,7 +395,7 @@ function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: optio
|
|
|
395
395
|
text: tag.text !== undefined ? ts.displayPartsToString(tag.text) : undefined,
|
|
396
396
|
})),
|
|
397
397
|
required: !(prop.flags & ts.SymbolFlags.Optional),
|
|
398
|
-
type:
|
|
398
|
+
type: getFullyQualifiedName(subtype),
|
|
399
399
|
rawType: rawType ? subtype : undefined,
|
|
400
400
|
get declarations() {
|
|
401
401
|
return declarations ??= getDeclarations(prop.declarations ?? []);
|
|
@@ -414,7 +414,7 @@ function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: optio
|
|
|
414
414
|
let declarations;
|
|
415
415
|
return {
|
|
416
416
|
name: prop.getName(),
|
|
417
|
-
type:
|
|
417
|
+
type: getFullyQualifiedName(subtype),
|
|
418
418
|
rawType: rawType ? subtype : undefined,
|
|
419
419
|
description: ts.displayPartsToString(prop.getDocumentationComment(typeChecker)),
|
|
420
420
|
get declarations() {
|
|
@@ -431,7 +431,7 @@ function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: optio
|
|
|
431
431
|
let declarations;
|
|
432
432
|
return {
|
|
433
433
|
name: expose.getName(),
|
|
434
|
-
type:
|
|
434
|
+
type: getFullyQualifiedName(subtype),
|
|
435
435
|
rawType: rawType ? subtype : undefined,
|
|
436
436
|
description: ts.displayPartsToString(expose.getDocumentationComment(typeChecker)),
|
|
437
437
|
get declarations() {
|
|
@@ -451,13 +451,13 @@ function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: optio
|
|
|
451
451
|
if (call.parameters.length >= 2) {
|
|
452
452
|
subtype = typeChecker.getTypeOfSymbolAtLocation(call.parameters[1], symbolNode);
|
|
453
453
|
if (call.parameters[1].valueDeclaration?.dotDotDotToken) {
|
|
454
|
-
subtypeStr =
|
|
454
|
+
subtypeStr = getFullyQualifiedName(subtype);
|
|
455
455
|
getSchema = () => typeChecker.getTypeArguments(subtype).map(resolveSchema);
|
|
456
456
|
}
|
|
457
457
|
else {
|
|
458
458
|
subtypeStr = '[';
|
|
459
459
|
for (let i = 1; i < call.parameters.length; i++) {
|
|
460
|
-
subtypeStr +=
|
|
460
|
+
subtypeStr += getFullyQualifiedName(typeChecker.getTypeOfSymbolAtLocation(call.parameters[i], symbolNode)) + ', ';
|
|
461
461
|
}
|
|
462
462
|
subtypeStr = subtypeStr.slice(0, -2) + ']';
|
|
463
463
|
getSchema = () => {
|
|
@@ -502,7 +502,7 @@ function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: optio
|
|
|
502
502
|
};
|
|
503
503
|
}
|
|
504
504
|
function resolveSchema(subtype) {
|
|
505
|
-
const type =
|
|
505
|
+
const type = getFullyQualifiedName(subtype);
|
|
506
506
|
if (shouldIgnore(subtype)) {
|
|
507
507
|
return type;
|
|
508
508
|
}
|
|
@@ -517,7 +517,6 @@ function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: optio
|
|
|
517
517
|
},
|
|
518
518
|
};
|
|
519
519
|
}
|
|
520
|
-
// @ts-ignore - typescript internal, isArrayLikeType exists
|
|
521
520
|
else if (typeChecker.isArrayLikeType(subtype)) {
|
|
522
521
|
let schema;
|
|
523
522
|
return {
|
|
@@ -544,6 +543,13 @@ function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: optio
|
|
|
544
543
|
}
|
|
545
544
|
return type;
|
|
546
545
|
}
|
|
546
|
+
function getFullyQualifiedName(type) {
|
|
547
|
+
const str = typeChecker.typeToString(type, undefined, ts.TypeFormatFlags.UseFullyQualifiedType | ts.TypeFormatFlags.NoTruncation);
|
|
548
|
+
if (str.includes('import(')) {
|
|
549
|
+
return str.replace(/import\(.*?\)\./g, '');
|
|
550
|
+
}
|
|
551
|
+
return str;
|
|
552
|
+
}
|
|
547
553
|
function getDeclarations(declaration) {
|
|
548
554
|
if (noDeclarations) {
|
|
549
555
|
return [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-component-meta",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"directory": "packages/component-meta"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/typescript": "~2.4.
|
|
17
|
-
"@vue/language-core": "3.0.0-alpha.
|
|
16
|
+
"@volar/typescript": "~2.4.13",
|
|
17
|
+
"@vue/language-core": "3.0.0-alpha.6",
|
|
18
18
|
"path-browserify": "^1.0.1",
|
|
19
|
-
"vue-component-type-helpers": "3.0.0-alpha.
|
|
19
|
+
"vue-component-type-helpers": "3.0.0-alpha.6"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"typescript": "*"
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"@types/node": "^22.10.4",
|
|
31
31
|
"@types/path-browserify": "^1.0.1"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "a7b5649ab4957cd2228f4bbc9205b2008bff58a2"
|
|
34
34
|
}
|