magic-cli
v1.2.4
Published
A tools to help you easily develop react(vue) project
Maintainers
Readme
magic-cli
A tools to help you easily develop react(vue) project
install
With npm do:
$ npm install -g magic-cliWith yarn do:
$ yarn global add magic-clicommands
new
Init a project base on templates
options:
> -c, --clone # Use git clone to download template
> -r, --remote # Download remote template even if the local has a cache note: We render file use Handlebars.js. You can see it to write template
alias
Add an alias to the template
options:
> -l, --list # List all alias
> -a, --absolute # If local add absolute path
> -d, --desc [desc] # Add some description for alias unalias:
Delete an alias to the template
g/generate:
Generate files base on blueprint
options:
> -l, --list # list all blueprints
> -c, --cwd [path] # Assign generate start path(work dir)
> -f, --force # overwrite the exsits file instead of ask example:
if you set a blueprint like this
└── route
├── index.js
└── files
└── __name__
├── __name__Containers.js
├── __name__Components.js
└── __name__Reducers.jsthen use
magic g
$ magic g route homeyou will get result like this:
└── home
├── homeContainers.js
├── homeComponents.js
└── homeReducers.jsnote Formats:
__name.cap__or__name.capitalize__=> home to Home__name.low__or__name.lowercase__=> Home to home__name.up__or__name.uppercase__=> home to HOME__name.dash__or__name.dashcase__=> homeName to home-name
The files content also render by this rule , so you can write __name__ will be replaced
Contents
Templates :
Not finish, wait a moment, you can use vue-cli template first, we has the same api like it.
Blueprints :
|Name|Description|
|---|---|
|magic g blueprint <name>|generates a blueprint template file|
