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

feat(kit): support prepend option for addComponentsDir #24309

Merged
merged 1 commit into from Nov 23, 2023

Conversation

sadeghbarati
Copy link
Contributor

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Default Nuxt config for auto-import directories

[
  { priority: 1, path: 'D:/Test/nuxt-test/components/islands', island: true },
  { priority: 1, path: 'D:/Test/nuxt-test/components/global', global: true },
  { priority: 1, path: 'D:/Test/nuxt-test/components' },
]

In Nuxt website it's says

You can also selectively register some components globally by placing them in a ~/components/global directory.

But if I add components.dirs[] options in nuxt.config.ts default config will disposed, and in order to have global directory I have to define it again

components: {
    dirs: [
        {
          path: '~/components/ui',
          prefix: 'Ui',
          pathPrefix: false
        }
    ]
}

I want to add a new dir to auto-import directories, to keep the default auto-import directories I prefer using

  • "components:dirs" hooks (nuxt.config and defineNuxtModule)
  • addComponentsDir in setup function (defineNuxtModule)

In the hook way, I can push/unshift directories but in addComponentsDir way it only has the push method

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

stackblitz bot commented Nov 15, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@sadeghbarati
Copy link
Contributor Author

Sry for trouble πŸ™

BTW how can I change the branch name while in PR?

@danielroe
Copy link
Member

No problem - and don't worry about the branch name...

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests βœ…

❗ No coverage uploaded for pull request base (main@37d64a6). Click here to learn what that means.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #24309   +/-   ##
=======================================
  Coverage        ?   58.76%           
=======================================
  Files           ?        5           
  Lines           ?      861           
  Branches        ?       46           
=======================================
  Hits            ?      506           
  Misses          ?      355           
  Partials        ?        0           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@danielroe danielroe merged commit be11bac into nuxt:main Nov 23, 2023
34 checks passed
@github-actions github-actions bot mentioned this pull request Nov 23, 2023
@sadeghbarati sadeghbarati deleted the feat/support-prepend-opt branch November 24, 2023 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants