https://github.com/xiaohuoni/oni-cli
一个关于umi with dva 的脚手架 生成器
https://github.com/xiaohuoni/oni-cli
dva oni-cli umi
Last synced: 2 months ago
JSON representation
一个关于umi with dva 的脚手架 生成器
- Host: GitHub
- URL: https://github.com/xiaohuoni/oni-cli
- Owner: xiaohuoni
- Created: 2018-02-24T16:27:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-12T04:12:01.000Z (almost 7 years ago)
- Last Synced: 2025-03-30T00:01:38.471Z (7 months ago)
- Topics: dva, oni-cli, umi
- Language: JavaScript
- Homepage:
- Size: 396 KB
- Stars: 24
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
this readme copy and edit for dva-cli
this code copy and edit for umi
# oni-cli
[](https://npmjs.org/package/oni-cli)
[](https://npmjs.org/package/oni-cli)CLI for [dva](https://github.com/dvajs/dva) [umi](https://github.com/umijs/umi).
## update
### 2018.05.08
- 1.use ejs
- 2.change the app-structure like umi
- 3.crate app (or mobile app) for Git clone
- 4.the template managed to Git [app](https://github.com/xiaohuoni/dva-umi) [mobile](https://github.com/xiaohuoni/dva-umi-mobile)
### 2018.03.24
- 1.update umi1.1
- 2.add Nested Route
## Getting StartedInstall, create and start.
```bash
# Install
$ npm install oni-cli -g# Create app
$ oni new myapp# Start app
$ cd myapp
$ npm i
$ npm start
```## Commands
We have 2 commands: `new` and `generate`(alias `g`).
### oni new appName
Create app with new directory.
#### Usage Examples
```bash
$ oni new myapp$ oni new myapp --mobile (or --web) ( create web app )
```### oni generate (short-cut alias: "g")
Generate page and component.
#### Usage Examples
```bash
$ oni g page home
#generate component '/src/pages/home/components/Table.js'
$ oni g component Table home
#generate component '/src/components/Table.js'
$ oni g component Table
```## Generated File Tree
```bash
.
├── mock # mock data
├── user.js # the mock data test
├── public # index.html
├── src # Source directory
├── assets # Store images, icons, ...
├── components # UI components
├── layouts # layouts
├── models # Dva global models
├── pages # all pages (auto create Route)
├── plugins # umi plugins
├── services # Used for communicate with server
└── utils # Utils
├── request.js # A util wrapped dva/fetch
└── config.js # global config (name,api...)
├── global.less # global less
├── .editorconfig #
├── .eslintrc # Eslint config
├── .umirc.js # umi
├── .umirc.mock.js # umi mock
├── .webpackrc.js # webpackrc extend(lick alias prexy)
├── .gitignore #
└── package.json #
```## Configuration
oni-cli use [umi](https://github.com/umijs/umi) for build and server
## License
[MIT](https://tldrlegal.com/license/mit-license)