# vtx-cli

> vtx-cli

Latest version **2.3.5** (published 2019-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install vtx-cli
pnpm add vtx-cli
yarn add vtx-cli
bun add vtx-cli
```

Provides the command `vtx`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.5 |
| Published | 2019-11-28 |
| First published | 2017-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 417.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ztq |
| Maintainers | ztq |

## Links

- npm: https://www.npmjs.com/package/vtx-cli
- npm.io page: https://npm.io/package/vtx-cli

## Dependencies (12)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [which](https://npm.io/package/which.md) ^1.2.10
- [dva-ast](https://npm.io/package/dva-ast.md) ^0.3.5
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.30.0
- [left-pad](https://npm.io/package/left-pad.md) ^1.1.3
- [through2](https://npm.io/package/through2.md) ^2.0.1
- [vinyl-fs](https://npm.io/package/vinyl-fs.md) ^2.4.3
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [empty-dir](https://npm.io/package/empty-dir.md) ^0.2.1
- [win-spawn](https://npm.io/package/win-spawn.md) ^2.0.0
- [path-exists](https://npm.io/package/path-exists.md) ^3.0.0
- [simple-uppercamelcase](https://npm.io/package/simple-uppercamelcase.md) ^1.0.0

## Recent versions

- 2.3.5 (latest) — 2019-11-28
- 2.3.4 — 2019-11-08
- 2.3.3 — 2019-05-29
- 2.3.2 — 2019-05-09
- 2.3.1 — 2019-05-09
- 2.2.1 — 2019-03-26
- 2.2.0 — 2018-12-28
- 2.1.0 — 2018-08-29
- 2.0.8 — 2018-08-08
- 2.0.7 — 2018-07-17
- 2.0.6 — 2018-06-11
- 2.0.5 — 2018-04-27
- 2.0.4 — 2018-04-25
- 2.0.3 — 2018-04-24
- 2.0.2 — 2018-04-10
- … 10 more at https://npm.io/package/vtx-cli/versions

## README

## vtx-cli基于dva-cli封装的自用工具

# vtx-cli

相比于[dva-cli](https://github.com/dvajs/dva), vtx-cli做了如下改动：
1. 默认增加css分割工具以兼容IE；
2. 默认配置动态加载 ant-ui 和 [vtx-ui](https://www.npmjs.com/package/vtx-ui) 两个ui库以及lodash函数库；
3. 默认给所有js和css文件添加hash值，避免缓存问题；
4. 打包出的文件将自动去除所有console语句，避免IE出问题；
5. 新增打包命令：
    npm run buildD：打包后的index.js无压缩，便于调试；
6. 修改原有工程少量文件及结构。

## Getting Started

Install, create and start.

```bash
# Install
$ npm install vtx-cli -g

# Create app
$ vtx new myapp

# Start app
$ cd myapp
$ npm start
```

## Commands

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

### vtx new <appName> [options]

Create app with new directory.

#### Usage Examples

```bash
$ vtx new myapp
$ vtx new myapp --demo
$ vtx new myapp --no-install
```

#### options

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

### vtx init [options]

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

### vtx generate <type> <name> (short-cut alias: "g")

Generate route, model and component.

#### Usage Examples

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

## 打包

```bash
# 普通打包
$ npm run build
# 无压缩debug模式打包
$ npm run buildD
```

## Generated File Tree

```bash
.
├── 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](https://github.com/sorrycc/roadhog) for build and server, view [roadhog#Configuration](https://github.com/sorrycc/roadhog/blob/master/README_en-us.md#configuration) ([中文版](https://github.com/sorrycc/roadhog#配置)) for details.

## License

[MIT](https://tldrlegal.com/license/mit-license)

---
_Source: https://npm.io/package/vtx-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
