framework
framework copied to clipboard
feat(nuxi): manage modules via cli
🔗 Linked issue
https://github.com/nuxt/rfcs/issues/31 https://github.com/nuxt/framework/discussions/569 #3915
❓ Type of change
- [x] 📖 Documentation (updates to the documentation or readme)
- [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
- [ ] 👌 Enhancement (improving an existing functionality like performance)
- [x] ✨ New feature (a non-breaking change that adds functionality)
- [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
📚 Description
With the new commands you can now add different Nuxt 3 modules (& bridge) to the project via Nuxi. The given module name is matched with a list that is currently still done manually (maybe in the future an API?), the name is matched to prevent that not Nuxt modules are installed. The module is added to the .nuxtrc
file which is merged with the normal nuxt config.
📝 Checklist
- [x] I have linked an issue or discussion.
- [x] I have updated the documentation accordingly.
Deploy Preview for nuxt3-docs failed.
Name | Link |
---|---|
Latest commit | 0836c8646060aaa4cbf25b69e23ac3e1618496a2 |
Latest deploy log | https://app.netlify.com/sites/nuxt3-docs/deploys/63445478cbc3a500089b552a |
@Baroshem
Thanks for the PR @Intevel. Some notes:
- Please disable local linter (prettier) and run
yarn lint --fix
- We can start with
nuxi module add <npm name>
syntax (later integrate with nuxt modules DB but is not straight forward) -
lmify
is deprecated. Working on a new package. It is not safe to rely on.
Thank you @pi0. I had already talked with @Atinux that we draft this PR for now. I fixed the linting & disabled prettier. Currently have some kind of manual DB inserted with names, similar to slugs. That would be just an idea.
Thank you for the PR :)
Agree to start with nuxi module add <npm name>
since it allow anyone to use new packages that are not officially listed.
Thanks for the PR @Intevel. Some notes:
Please disable local linter (prettier) and run
yarn lint --fix
We can start with
nuxi module add <npm name>
syntax (later integrate with nuxt modules DB but is not straight forward)
lmify
is deprecated. Working on a new package. It is not safe to rely on.
@pi0 https://github.com/Intevel/qpind Maybe this instead of lmify
for this?
Nice work on qpind @Intevel 💚 However we already have antfu/install-pkg and other solutions, I would still wait for new unjs package designed for nuxi and nuxt universal integration.
Folks, can we start working on this feature again? I think this would be an awesome DX improvement to the Nuxi tool. I can help with implementing this as well :)
Surely, so the package installing can we do with install-pkg but where do we get the data from to check if this is a nuxt module or not?
Can't we just parse the user input against a regexp and if it includes the nuxt
keywoard assume that it is a module? @nuxt/@nuxtjs/nuxt-something should all work with that. I think even right now, you will only handle properly the modules that are in the modules array so we can always log to the user (Module not found in the supported modules DB/array, please configure the module by yourself)
@pi0 What do you think? Is a regex in this case the best way?
@Baroshem pushed some new stuff, what are you're thoughts about it? (btw i know its not an regex, wrong commit message)
@Intevel
Yes, this is what I meant in my proposition in the Discord channel. Nice work! Now, let's wait for Pio, Daniel, or Sebastien to give their opinion and recommend next steps :)
@Intevel Did you close this intentionally?
@Intevel Did you close this intentionally?
This PR is now 8 months old. i doubt we'll get this feature in yet, if so i'll redevelop it. For PR #9055 I have synced my fork and so the old changes are lost. All good
Supporting module management from CLI is definitely one thing we always dreamt of having but has been tricky so far because we lacked the CLI infra and AST modification tool to make it happen.
Would be happy to have you on board in next weeks on this feature @Intevel and sorry was delayed in the roadmap.
Supporting module management from CLI is definitely one thing we always dreamt of having but has been tricky so far because we lacked the CLI infra and AST modification tool to make it happen.
Would be happy to have you on board in next weeks on this feature @Intevel and sorry was delayed in the roadmap.
All right, I'm happy to be there. We can talk about it again as soon as it goes to the feature. I find the module management via the CLI quite good, maybe I open this PR again with a new PoC.
I can help with this as well. Just let me know :)
Nice to hear, thank you.