You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhancing the Next.js CLI with Route Generator, Component Generator with Tailwind, Unit Test Generator, Project Cleaner, Custom Error Page Generator, Default SEO Configuration, and Maintenance Mode.
#70783
Automate repetitive tasks such as generating routes, components with Tailwind CSS, and unit tests, to increase developer productivity.
Provide tools to improve project structure and maintainability with features like project cleaning and default SEO configuration.
Offer better application management with a built-in maintenance mode feature, allowing developers to easily manage downtime and updates.
Non-Goals
This feature request does not aim to:
Introduce new paradigms for project architecture, as it focuses on automating existing Next.js practices.
Handle advanced SEO strategies, but only to provide a basic configuration.
Provide complex testing setups beyond generating basic unit tests for components.
Background
Currently, Next.js CLI provides a limited set of functionalities primarily focused on scaffolding a project and building/deploying it. However, developers often need to perform several repetitive tasks such as creating routes, components, and unit tests, which the current CLI does not automate.
Frameworks like Laravel offer powerful CLI tools (artisan) that simplify common tasks, such as the ability to manage maintenance mode (php artisan up/down). By adding these features, Next.js developers will benefit from more streamlined workflows without having to rely on additional tooling or manual configurations.
Existing alternatives require developers to either create custom scripts or use third-party libraries to achieve similar functionality (e.g., generating components with Tailwind or creating default SEO). This feature request aims to make these functionalities natively available in the Next.js CLI.
Proposal
To implement this feature, the following CLI commands should be added:
Route Generator
Command: next generate route <route-name>
Generates a new route file with basic boilerplate code.
Component Generator with Tailwind Integration
Command: next generate component <component-name> --tailwind
Creates a new component pre-configured with Tailwind CSS classes.
Unit Test Generator
Command: next generate test <component-name>
Generates a basic unit test file for the specified component.
Project Cleaner
Command: next clean
Removes unnecessary files such as cache, logs, or unused components.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
This feature request does not aim to:
Background
Currently, Next.js CLI provides a limited set of functionalities primarily focused on scaffolding a project and building/deploying it. However, developers often need to perform several repetitive tasks such as creating routes, components, and unit tests, which the current CLI does not automate.
Frameworks like Laravel offer powerful CLI tools (
artisan
) that simplify common tasks, such as the ability to manage maintenance mode (php artisan up/down
). By adding these features, Next.js developers will benefit from more streamlined workflows without having to rely on additional tooling or manual configurations.Existing alternatives require developers to either create custom scripts or use third-party libraries to achieve similar functionality (e.g., generating components with Tailwind or creating default SEO). This feature request aims to make these functionalities natively available in the Next.js CLI.
Proposal
To implement this feature, the following CLI commands should be added:
Route Generator
next generate route <route-name>
Component Generator with Tailwind Integration
next generate component <component-name> --tailwind
Unit Test Generator
next generate test <component-name>
Project Cleaner
next clean
Custom Error Page Generator
next generate error-page <error-code>
Default SEO Configuration
next configure seo --default
Maintenance Mode (Inspired by Laravel’s Artisan up/down)
next down
: Puts the application in maintenance mode, showing a customizable maintenance page.next up
: Brings the application back online.Contribution
I am interested in contributing to the development of these features and would be willing to help with the implementation, testing, and documentation.
Beta Was this translation helpful? Give feedback.
All reactions