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: modules db integration with nuxi module add #197

Merged
merged 13 commits into from
Sep 19, 2023
Merged

feat: modules db integration with nuxi module add #197

merged 13 commits into from
Sep 19, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Sep 18, 2023


Beta Testing:

npx nuxi-edge@latst module add <name>


Search in nuxt/modules database when adding a new module. This allows installing modules as easy as nuxt module add tailwindcss.

Compatibility Checker

This feature checks for possible compatibility issues and confirms whether to continue or not.

nuxi module add axios on a nuxt 3 project:

image

Offline Usage

In case of network issues, we fall back with a warning and use the input as npm package name without validation. This could be improved later with --preferOffline and a disk cache of modules (to be used also for search functionality). (PR welcome!)

Automatically choosing the right version

Some Nuxt modules use different major versions for different Nuxt versions (such as image Module).

With the introduction of compatibility.versionMap in modules DB (nuxt/modules#770), we can now even match the corresponding version compatible with the local Nuxt version.

nuxi module add image on a nuxt 3 project:

image

Validate (npm) input

Users can choose to directly use an npm package name (with optional @ constraint) to be installed.

Also in this mode, we try to match explicitly provided npm package names against DB and provide recommendations!

nuxi module add @nuxt/image@^0.6.0 on a nuxt 3 project:

image

@pi0 pi0 changed the title feat: search in nuxt/modules for nuxt module add <name> feat: nuxt modules lookup for nuxt module add <name> Sep 19, 2023
@pi0 pi0 changed the title feat: nuxt modules lookup for nuxt module add <name> feat: modules db integration with nuxt module add <name> Sep 19, 2023
@pi0 pi0 requested review from atinux and danielroe September 19, 2023 09:37
@pi0 pi0 marked this pull request as ready for review September 19, 2023 10:58
@pi0 pi0 changed the title feat: modules db integration with nuxt module add <name> feat: modules db integration with nuxi module add Sep 19, 2023
This was referenced Apr 3, 2024
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.

nuxt module add with shortcut for @nuxt Add nuxt add/rm commands
2 participants