feat(nuxi): Entity management shortcuts
As outlined in #3903 by @pi0 @Atinux. This POC draft is our first step in introducing Entity management shortcuts to the Nuxi CLI.
Entity Shortcuts are meant to provide a simple yet robust way to quickly manage projects via CLI in this first stage. This functionality will later be leveraged by API Routes (ex: /__nuxi/<entity>/<command>) and Nuxt Devtools to allow for project management directly from the browser.
Nuxt is heavily dependent on proper filesystem structure, hence this PR aims to bridge to the gap making it easier for both newcomers as well as veterans of Nuxt to minimize the time it takes it scan and manage projects.
Upon arrival of a proper unjs templating util, we'll be able to begin full scale extension of this functionality
Initial implementation is as follows (Though the possibilities are vast):
nuxi <entity> <command> <name?>
nuxi modules show
nuxi modules add @unocss/nuxt
nuxi composables new useProfile
nuxi pages new "articles/[slug]"
the show command is meant to display an overview of the filesystem structure for the given entity. We also explored the possibility of using a --resolve-all flag for leveraging a nuxt3 instance to get a fully resolved list of all the entities which may be extended by modules (pages, plugins, composables, middlewares, etc...), Though we've decided for now (performance in mind) that the full resolution would be a better fit for Nuxt Devtools.
Any ideas or suggestions are welcome!
Todo:
- [x] Initial Functionality
- [ ] Refactor code @pi0
- [ ] Update Documentation
- [ ] 📖 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)
📝 Checklist
- [x] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
Deploy Preview for nuxt3-docs canceled.
| Name | Link |
|---|---|
| Latest commit | 456dc1d91712dc2412369c8e8c2bf0cb12258593 |
| Latest deploy log | https://app.netlify.com/sites/nuxt3-docs/deploys/63552e97b04fae0008cafb30 |
Hi dear @Diizzayy. Thanks again for working on this POC. Since we still lack CLI infra and module management has to be implemented separately, i think we should come up with new implementation and also replan nuxt/nuxt.js#13550. I will keep you posted about updated via insiders beforehand 👍🏼