nuxtlabs / nuxt-component-meta

Gather Nuxt components metadata on build time and make them available on production.
69 stars 6 forks source link

feat: add parsed hook #29

Closed farnabaz closed 1 year ago

farnabaz commented 1 year ago
nuxt.callHook('meta:component:parsed', {
  meta: {
    name: string
    global: boolean,
    props: [] as ComponentProp[],
    slots: [] as ComponentSlot[]
  },
  path: string,
  source: string
})
Atinux commented 1 year ago

What about component-meta:parsed to keep the name of the module first.

Also what will be the use case?

farnabaz commented 1 year ago

As we discussed with @Tahul, this hook will allow other modules to extend component meta, maybe detecting global features of Nuxt or theme. He also wanted to detect $theme and $tokens usage for each component