susanoo-ignite
v1.9.0
Published
A funky CLI tool for creating folder structures with ease.
Maintainers
Readme
Ignite CLI
Ignite CLI is a powerful tool designed to bootstrap entities for projects built using the Susanoo Express Framework. It provides an intuitive way to generate scaffolds for models, DAOs, handlers, controllers, and migrations, helping you kickstart your development process with ease and consistency.
Features
- Generate scaffolds for various entities like models, DAOs, handlers, controllers, and migrations.
- Supports creating scaffolds for all or specific entities at once.
- Allows customization through a templates folder.
- Includes trace and logging capabilities for debugging and clarity.
Installation
npm install susanoo-ignite --save-dev && npm link susanoo-igniteUsage
The Ignite CLI command is ignite. Below are the available commands and their usage:
General Syntax
ignite [options] <command> Options
-t, --trace
Display trace statements for commands. Useful for debugging.
Commands
Generate Scaffolds
ignite g [type] -n <name> [options] Description:
Generate scaffolds for models, DAOs, handlers, controllers, migrations, or all of them.Arguments:
type: The type of scaffold to generate. Possible values:model: Generate a model scaffold.dao: Generate a DAO scaffold.handler: Generate a handler scaffold.handler:create|update|get|list|delete: To generate one handler
controller: Generate a controller scaffold.migration: Generate a migration scaffold.all OR LEAVE IT EMPTY: Generate all scaffolds.
Options:
-n, --name <name>(required): Name of the entity (e.g.,AdvertisingNetwork).-v, --version <version>: API version (default:v1).-e, --entity <entity>: Entity folder (default:app).
Example Commands:
Generate all scaffolds for an entity:ignite g all -n AdvertisingNetworkGenerate a specific scaffold (e.g., model):
ignite g model -n AdvertisingNetworkGenerate multiple scaffolds (e.g., model and handler):
ignite g model,handler -n AdvertisingNetwork
Custom Templates
Ignite CLI creates a templates folder inside an ignite directory in your project. This allows you to customize the default templates for generated scaffolds.
How to Use Custom Templates
Locate the templates folder:
After running the CLI for the first time, you will find a folder structure like this in your project:ignite/ templates/ model.js dao.js handler.js controller.js migration.jsEdit Templates:
- Modify the files within each folder to match your project's coding style or specific requirements.
- Future scaffolds will use these customized templates.
Restore Defaults:
- If you need to restore the default templates, simply delete the customized files. The CLI will fallback to the default version of them.
Debugging and Logs
Use the
--traceoption to enable detailed logs for commands:ignite g all -n AdvertisingNetwork --traceLogs include:
- Command execution details.
- Arguments and options passed.
- Success or error messages for each scaffold.
Contributing
Feel free to contribute to the project by submitting issues or pull requests to the GitHub repository.
License
This project is licensed under the MIT License.
