Giter Club home page Giter Club logo

dvax-cli's Introduction

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

dvax-cli's People

Contributors

liekkas avatar sorrycc avatar yesmeck avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.