Feature request: Ability to overload and customise the templates
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- nuxt, typescript
- Domain
- cli
Research direction
Start with packages/nuxi/src/commands/add.ts at the referenced lines and trace how nuxi add resolves its current templates. Define how a project-level stubs folder should follow Nuxt organization, override built-in templates, and fall back when no custom template exists. Done means nuxi add supports customized components, pages, and APIs without breaking the existing behavior.
Written by the indexing model from the issue text.
Description
Summary
Our project uses Nuxt and also Nuxt UI. We need to add a variety of Nuxt UI parts to our templates and things like Authorization from Nuxt Authorization. We use the npx nuxt add often to make our components, pages and apis and it would be super helpful for us to create our own templates in our project so we can automate much of our daily boilerplate.
This is a feature pattern that I'm familiar with from CakePHP, https://book.cakephp.org/bake/3/en/development.html#creating-a-bake-theme
Proposal
I don't think it needs to be complex, perhaps it follows the Nuxt folder organisation and there is a stubs folder in / of the project, and the code can simply look for that folder and if it exists, it tries to load the template from there, or falls back to the current functionality.
Code
https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/add.ts#L74-L75
Perhaps a resolver is needed to encapsulate the functionality, but a smell change here might work?
- Dominant language
- TypeScript
- Stars
- 401
- Forks
- 123
- Avg merge
- 19h 1m
- Merged PRs (30d)
- 69
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nuxt/cli
-
Difficulty 3/5 1-2 days Newbie friendliness 40/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Support pause HMRMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
discussion
Difficulty 3/5 1-2 days Newbie friendliness 35/100
nuxt/cli#1166 · 7 comments · 2 reactions ·
Maintainers usually reply within 1 day
Similar issues
-
check:failed streams:edit
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
iptv-org/iptv#55901 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
package:ios ships XCFrameworks with absolute symlinks, which SwiftPM refuses to extractPossibly taken @cusnirvladislav claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
callstackincubator/rock#740 ·
-
S: triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
area:workflow bug ready-for-human
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fil-donadoni/tolaria#6108 ·
Maintainers usually reply within 1 day