Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(module): only parse global components #52

Merged
merged 5 commits into from
Mar 21, 2023
Merged

Conversation

farnabaz
Copy link
Collaborator

@farnabaz farnabaz commented Mar 7, 2023

resolves #50

@farnabaz farnabaz changed the title fix(module): onlu parse global components fix(module): only parse global components Mar 7, 2023
@farnabaz
Copy link
Collaborator Author

farnabaz commented Mar 7, 2023

I don't understand why slots are not detected when I filter global components

codes are exactly same in both cases:

component.fullPath /Users/far/projects/nuxt/nuxt-component-meta/test/fixtures/basic/components/global/TestContent.vue 
slots: [
  {
    name: 'title',
    type: '{}',
    rawType: undefined,
    description: '',
    schema: { kind: 'object', type: '{}', schema: {} }
  },
  {
    name: 'default',
    type: '{}',
    rawType: undefined,
    description: '',
    schema: { kind: 'object', type: '{}', schema: {} }
  }
] 
<template>
  <div>
    <h1><slot name="title" /></h1>
    <slot  />
  </div>
</template>

<script setup>defineProps()</script>

filtered

component.fullPath /Users/far/projects/nuxt/nuxt-component-meta/test/fixtures/basic/components/global/TestContent.vue 
slots: [] 

<template>
  <div>
    <h1><slot name="title" /></h1>
    <slot  />
  </div>
</template>

<script setup>defineProps()</script>

@Tahul do you have an idea about it?

@Atinux Atinux self-requested a review March 7, 2023 17:13
@Atinux
Copy link
Member

Atinux commented Mar 9, 2023

We need to find a solution for this

@Tahul
Copy link
Contributor

Tahul commented Mar 9, 2023

Looking into it :)

@stafyniaksacha
Copy link
Collaborator

I think this should be configurable

@Tahul
Copy link
Contributor

Tahul commented Mar 21, 2023

Issue is fixed and tests are passing; merging this.

I added the feature behind globalsOnly option that can be enabled from the module config.

@Tahul Tahul merged commit 83b4261 into main Mar 21, 2023
@Tahul Tahul deleted the fix/parse-global-components branch March 21, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only scan global components
4 participants