vue-component-meta 2.2.2 → 2.2.4
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 +10 -8
- package/package.json +4 -4
package/lib/base.js
CHANGED
|
@@ -561,15 +561,16 @@ function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: optio
|
|
|
561
561
|
}
|
|
562
562
|
function readVueComponentDefaultProps(root, printer, ts) {
|
|
563
563
|
let result = {};
|
|
564
|
+
const { sfc } = root;
|
|
564
565
|
scriptSetupWorker();
|
|
565
566
|
scriptWorker();
|
|
566
567
|
return result;
|
|
567
568
|
function scriptSetupWorker() {
|
|
568
|
-
const ast =
|
|
569
|
+
const ast = sfc.scriptSetup?.ast;
|
|
569
570
|
if (!ast) {
|
|
570
571
|
return;
|
|
571
572
|
}
|
|
572
|
-
const codegen = vue.tsCodegen.get(
|
|
573
|
+
const codegen = vue.tsCodegen.get(sfc);
|
|
573
574
|
const scriptSetupRanges = codegen?.getScriptSetupRanges();
|
|
574
575
|
if (scriptSetupRanges?.withDefaults?.argNode) {
|
|
575
576
|
const obj = findObjectLiteralExpression(scriptSetupRanges.withDefaults.argNode);
|
|
@@ -617,12 +618,13 @@ function readVueComponentDefaultProps(root, printer, ts) {
|
|
|
617
618
|
}
|
|
618
619
|
}
|
|
619
620
|
function scriptWorker() {
|
|
620
|
-
const
|
|
621
|
-
if (
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
621
|
+
const ast = sfc.script?.ast;
|
|
622
|
+
if (!ast) {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
const scriptResult = readTsComponentDefaultProps(ast, 'default', printer, ts);
|
|
626
|
+
for (const [key, value] of Object.entries(scriptResult)) {
|
|
627
|
+
result[key] = value;
|
|
626
628
|
}
|
|
627
629
|
}
|
|
628
630
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-component-meta",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
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.11",
|
|
17
|
-
"@vue/language-core": "2.2.
|
|
17
|
+
"@vue/language-core": "2.2.4",
|
|
18
18
|
"path-browserify": "^1.0.1",
|
|
19
|
-
"vue-component-type-helpers": "2.2.
|
|
19
|
+
"vue-component-type-helpers": "2.2.4"
|
|
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": "c28986596935cb43979c9d437c25f292bdb36cef"
|
|
34
34
|
}
|