vue-component-meta 3.0.2 → 3.0.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.
Files changed (2) hide show
  1. package/lib/base.js +5 -5
  2. package/package.json +4 -4
package/lib/base.js CHANGED
@@ -37,9 +37,7 @@ function baseCreate(ts, getCommandLine, checkerOptions, rootPath, globalComponen
37
37
  */
38
38
  let fileNames = new Set(commandLine.fileNames.map(path => path.replace(windowsPathReg, '/')));
39
39
  let projectVersion = 0;
40
- if (commandLine.vueOptions.globalTypesPath) {
41
- ts.sys.writeFile(commandLine.vueOptions.globalTypesPath, vue.generateGlobalTypes(commandLine.vueOptions));
42
- }
40
+ vue.writeGlobalTypes(commandLine.vueOptions, ts.sys.writeFile);
43
41
  const projectHost = {
44
42
  getCurrentDirectory: () => rootPath,
45
43
  getProjectVersion: () => projectVersion.toString(),
@@ -189,7 +187,7 @@ interface ComponentMeta<T> {
189
187
  let _events;
190
188
  let _slots;
191
189
  let _exposed;
192
- return {
190
+ const meta = {
193
191
  get type() {
194
192
  return _type ?? (_type = getType());
195
193
  },
@@ -206,6 +204,7 @@ interface ComponentMeta<T> {
206
204
  return _exposed ?? (_exposed = getExposed());
207
205
  },
208
206
  };
207
+ return meta;
209
208
  function getType() {
210
209
  const $type = symbolProperties.find(prop => prop.escapedName === 'type');
211
210
  if ($type) {
@@ -221,12 +220,13 @@ interface ComponentMeta<T> {
221
220
  if ($props) {
222
221
  const type = typeChecker.getTypeOfSymbolAtLocation($props, symbolNode);
223
222
  const properties = type.getProperties();
223
+ const eventProps = new Set(meta.events.map(event => `on${event.name.charAt(0).toUpperCase()}${event.name.slice(1)}`));
224
224
  result = properties
225
225
  .map(prop => {
226
226
  const { resolveNestedProperties, } = createSchemaResolvers(typeChecker, symbolNode, checkerOptions, ts, language);
227
227
  return resolveNestedProperties(prop);
228
228
  })
229
- .filter(prop => !vnodeEventRegex.test(prop.name));
229
+ .filter(prop => !vnodeEventRegex.test(prop.name) && !eventProps.has(prop.name));
230
230
  }
231
231
  // fill global
232
232
  if (componentPath !== globalComponentName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-component-meta",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -13,8 +13,8 @@
13
13
  "directory": "packages/component-meta"
14
14
  },
15
15
  "dependencies": {
16
- "@volar/typescript": "2.4.19",
17
- "@vue/language-core": "3.0.2",
16
+ "@volar/typescript": "2.4.20",
17
+ "@vue/language-core": "3.0.4",
18
18
  "path-browserify": "^1.0.1"
19
19
  },
20
20
  "peerDependencies": {
@@ -26,5 +26,5 @@
26
26
  "@types/path-browserify": "^1.0.1",
27
27
  "vue-component-type-helpers": "3.0.2"
28
28
  },
29
- "gitHead": "7343119e9ca4f6a54f63b57f448f15df4b592a9a"
29
+ "gitHead": "148d386f9779c2de64cdcbd35310e03b36943b05"
30
30
  }