1.0.12 • Published 5 years ago

harden-cli v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

dva-cli

NPM version NPM downloads

CLI for dva .

Getting Started

Install, create and start.

# Install
$ npm install dva-cli -g

# Create app
$ dva new myapp

# Start app
$ cd myapp
$ npm start

Commands

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

dva new options

Create app with new directory.

Usage Examples

$ dva new myapp
$ dva new myapp --demo
$ dva new myapp --no-install

options

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

dva init options

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

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

Generate route, model and component.

Usage Examples

$ dva g route product-list
$ dva g model products
$ dva g component Editor
$ dva g component Users/UserModal
$ dva g component Header --no-css

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

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

License

MIT

1.0.12

5 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago