create-app-page v2.1.0
create-app-page
Description
This command line tool will create a new NextJS app router page in the current directory. In addition, it will optionally create additional files and folders based on the user's input. There are:
- A Next JS route layout file
- A components folder1
- A handlers folder1
- A hooks folder1
- A utilities folder1.
- An API route folder1,4
- A Drizzle ORM schema file2,3
Notes:
- For each of these folders, an empty index.ts will be create in addition to an index.ts folder next to the page.ts file.
- The existing index.ts file will be updated to add the new schema.
- Zod schema and types will be generated for the new schema.
- The existing top-level route handler will be updated to add the new route.
Usage
To create a new page in the current directory, run the following command. The tool will prompt you for the information needed to complete the process that is not provided as command line arguments and options.
npx create-app-page
Environment variables
The tool uses not environment variables.
Command line arguments
This tool uses the following command line arguments:
Argument | Description |
---|---|
pageName | The name of the new page. |
Command line options
This tool uses the following command line options:
Option | Description |
---|---|
-d --defaults | Use default values for all prompts. |
-f --force | Overwrite existing files without prompting. |
-h --help | Display help for command. |
-q --quiet | Suppress all output other than warning and errors. |
-y --yes | Skip confirmation prompt. |
-V --version | Display version number. |
Error codes
The following codes will be displayed if an error occurs: | Code | Description | |------|-------------| | 0 | Use chose to abort the process. | | 1 | The path provided for the new page already exists. | | 2 | An error occurred creating a file or a folder. |
License
GNU General Public License (GPL)
This software is licensed under the GNU General Public License (GPL). The GPL allows users to freely use, copy, modify, and distribute this software under the following conditions:
Any modified versions of this software must also be licensed under the GPL.
The original or modified software cannot be sold or used for profit.
The source code must be made available when distributing the software.
For more detailed information, please visit the official GNU GPL website.
Contributing
To contribute, contact RamonaSteve.
Change Log
Release 2.1.0
- Corrected prompting for page name when not provided as command line argument.
- Updated process exit codes.
- Updated this document.
Release 2.0.0
- Major refactor of codebase.
- Added command line arguments and options.
- Add help information.
- Updated this document.
Release 1.0.0
- Initial release
Know Issues
There are no known issues at this time.
Planned Enhancements
- Add option to update AuthItems for the parent route.
- Add option to update navigation bar items for the parent route.
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago