Skip to content

liekkas/dvax-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dvax-cli

NPM version NPM downloads

CLI for dva . X-custom

Custom Feature

  • use styled-component
  • add state component boilerplate (eg: dvax g route --state)
  • add generate service
  • add generate module (gen model,route,service together)
  • add dynamic router

Getting Started

Install, create and start.

# Install
$ npm install dvax-cli -g

# Create app
$ dvax new myapp

# Start app
$ cd myapp
$ npm start

Commands

We have 3 commands: new, init and generate(alias g).

dvax new [options]

Create app with new directory.

Usage Examples

$ dvax new myapp
$ dvax new myapp --demo
$ dvax new myapp --no-install

options

  • --demo -- Generate a dead simple project for quick prototype
  • --no-install -- Disable npm install after files created

dvax init [options]

Create app in current directory. It's options is the same as dvax new.

dvax generate (short-cut alias: "g")

Generate route, model and component.

Usage Examples

$ dvax g route product-list
$ dvax g model products
$ dvax g service products
$ dvax g comp Editor
$ dvax g comp Users/UserModal
$ dvax g comp Header --state
$ dvax g module dict

Generated File Tree

.
├── src                    # Source directory
    ├── assets             # Store images, icons, ...
    ├── components         # UI components
    ├── index.css          # CSS for entry file
    ├── index.html         # HTML for entry file
    ├── index.js           # Enry file
    ├── models             # Dva models
    ├── router.js          # Router configuration
    ├── routes             # Route components
    ├── services           # Used for communicate with server
    └── utils              # Utils
        └── request.js     # A util wrapped dva/fetch
├── .editorconfig          #
├── .eslintrc              # Eslint config
├── .gitignore             #
├── .roadhogrc             # Roadhog config
└── package.json           #

Configuration

dvax-cli use roadhog for build and server, view roadhog#Configuration (中文版) for details.

License

MIT

About

The dva command line utility.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 70.3%
  • CSS 27.4%
  • HTML 1.8%
  • Makefile 0.5%