vue-component-meta 1.8.19 → 1.8.21
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/README.md +2 -2
- package/out/index.js +3 -16
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ const componentPath = path.join(__dirname, 'path-to-component');
|
|
|
40
40
|
const meta = checker.getComponentMeta(componentPath);
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
This meta contains really useful stuff like component props, slots, events and more. You can refer to its [type definition](https://github.com/vuejs/language-tools/blob/master/packages/
|
|
43
|
+
This meta contains really useful stuff like component props, slots, events and more. You can refer to its [type definition](https://github.com/vuejs/language-tools/blob/master/packages/component-meta/src/types.ts) for more details.
|
|
44
44
|
|
|
45
45
|
### Extracting prop meta
|
|
46
46
|
|
|
@@ -166,7 +166,7 @@ You need to add `as const` to variable definition:
|
|
|
166
166
|
|
|
167
167
|
## Reference 📚
|
|
168
168
|
|
|
169
|
-
- [tests](https://github.com/vuejs/language-tools/blob/master/packages/
|
|
169
|
+
- [tests](https://github.com/vuejs/language-tools/blob/master/packages/component-meta/tests/index.spec.ts)
|
|
170
170
|
- [Anu's components' API automation](https://github.com/jd-solanki/anu/blob/main/scripts/gen-component-meta.ts)
|
|
171
171
|
- [Discord chat for dynamic usage](https://discord.com/channels/793943652350427136/1027819645677350912)
|
|
172
172
|
|
package/out/index.js
CHANGED
|
@@ -10,25 +10,13 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
15
|
};
|
|
28
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
17
|
exports.baseCreate = exports.createComponentMetaChecker = exports.createComponentMetaCheckerByJsonConfig = void 0;
|
|
30
|
-
const vue =
|
|
31
|
-
const path =
|
|
18
|
+
const vue = require("@vue/language-core");
|
|
19
|
+
const path = require("typesafe-path/posix");
|
|
32
20
|
const vue_component_type_helpers_1 = require("vue-component-type-helpers");
|
|
33
21
|
const typescript_1 = require("@volar/typescript");
|
|
34
22
|
__exportStar(require("./types"), exports);
|
|
@@ -336,7 +324,6 @@ ${vue_component_type_helpers_1.code}
|
|
|
336
324
|
exports.baseCreate = baseCreate;
|
|
337
325
|
function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: options, noDeclarations }, ts, core) {
|
|
338
326
|
const visited = new Set();
|
|
339
|
-
;
|
|
340
327
|
function shouldIgnore(subtype) {
|
|
341
328
|
const name = typeChecker.typeToString(subtype);
|
|
342
329
|
if (name === 'any') {
|
|
@@ -541,7 +528,7 @@ function readVueComponentDefaultProps(vueSourceFile, printer, ts, vueCompilerOpt
|
|
|
541
528
|
return result;
|
|
542
529
|
function scriptSetupWorker() {
|
|
543
530
|
const descriptor = vueSourceFile.sfc;
|
|
544
|
-
const scriptSetupRanges = descriptor.
|
|
531
|
+
const scriptSetupRanges = descriptor.scriptSetup ? vue.parseScriptSetupRanges(ts, descriptor.scriptSetup.ast, vueCompilerOptions) : undefined;
|
|
545
532
|
if (descriptor.scriptSetup && scriptSetupRanges?.props.withDefaults?.arg) {
|
|
546
533
|
const defaultsText = descriptor.scriptSetup.content.substring(scriptSetupRanges.props.withDefaults.arg.start, scriptSetupRanges.props.withDefaults.arg.end);
|
|
547
534
|
const ast = ts.createSourceFile('/tmp.' + descriptor.scriptSetup.lang, '(' + defaultsText + ')', ts.ScriptTarget.Latest);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-component-meta",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.21",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/vuejs/language-tools.git",
|
|
13
|
-
"directory": "packages/
|
|
13
|
+
"directory": "packages/component-meta"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/typescript": "~1.10.
|
|
17
|
-
"@vue/language-core": "1.8.
|
|
16
|
+
"@volar/typescript": "~1.10.5",
|
|
17
|
+
"@vue/language-core": "1.8.21",
|
|
18
18
|
"typesafe-path": "^0.2.2",
|
|
19
|
-
"vue-component-type-helpers": "1.8.
|
|
19
|
+
"vue-component-type-helpers": "1.8.21"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"typescript": "*"
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"optional": true
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "46ae2ff1c155e51291fd584c0c3a32ed3dace7a5"
|
|
30
30
|
}
|