nuxtlabs / nuxt-component-meta

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

Issue with components from node_modules #37

Closed farnabaz closed 1 year ago

farnabaz commented 1 year ago

It seems that vue-component-meta could not load components from node_modules.

Can be reproduced in this branch

Screenshot 2022-08-29 at 13 53 58

/cc @stafyniaksacha

stafyniaksacha commented 1 year ago

I think this comes from default exclude (or from skipLibCheck?) from tsconfig even if we've added:

 "include": [
    "**/*"
 ]

I will check if we can have something clean

stafyniaksacha commented 1 year ago

In addition, we should have NuxtLink/NuxtLayout/NuxtPage/... components too

farnabaz commented 1 year ago

I think they are excluded from the hook, we should add them manually to the components list

stafyniaksacha commented 1 year ago

@farnabaz the example you provided is a bit tricky, node_modules is in upper scope of nuxt.options.rootDir, we may need a workspace to have correct tree, what do you think?

farnabaz commented 1 year ago

Do you think there is any way to resolve these files without creating a workspace? We have a similar structure in multiple packages, mainly for development environments and playgrounds. Most likely nuxt-component-meta will be installed and used on lots of projects, forcing users to have a workspace may not bring good DX

Atinux commented 1 year ago

Agree with @farnabaz it should work whatever their project structure

stafyniaksacha commented 1 year ago

Do you think there is any way to resolve these files without creating a workspace?

Done in #38, let me know your feedback