UNPKG

net-cli

Version:
114 lines (81 loc) 2.25 kB
# 前端脚手架 <p align="center"> <img src="https://img.shields.io/npm/dw/net-cli"> <img src="https://img.shields.io/npm/unpacked-size/net-cli"> <img src="https://img.shields.io/npm/v/net-cli"> <img src="https://img.shields.io/npm/l/net-cli"> <img src="https://img.shields.io/github/last-commit/novlan1/plugin-light"> <img src="https://img.shields.io/github/created-at/novlan1/plugin-light"> </p> Vue3 项目前端脚手架,支持: - `uni-app` 项目 - 非 `uni-app`,H5 移动端 - 非 `uni-app`,PC 管理端 - 普通 - 非 `uni-app`,PC 管理端 - TGS - 非 `uni-app`,PC 电子流 - 非 `uni-app`,H5 电子流 ## 1. 作者 **novlan1** ## 2. 如何使用 安装: ```bash pnpm add net-cli -g ``` 命令行使用,新建工程: ```bash # Vue3 net-cli init my-project --vueVersion vue3 # Vue3 uni-app net-cli init my-project --vueVersion vue3-cross ``` 命令行使用,新建子工程: ```bash # Vue3 H5 net-cli initSubProject sub-project --type h5 --vueVersion vue3 # Vue3 PC 管理端 net-cli initSubProject sub-project --type admin --vueVersion vue3 # Vue3 uni-app net-cli initSubProject sub-project --vueVersion vue3-cross ``` 脚本中使用: ```ts const { initProject, initSubProject } = require('net-cli'); initProject({ downloadPath: process.cwd(), vueVersion: 'vue3', }); initSubProject({ subProjectName: 'user', downloadPath: process.cwd(), type: 'h5', vueVersion: 'vue3', }); ``` ## 3. 类型 ```ts export type VueVersion = 'vue3-cross' | 'vue3'; export type SubProjectType = 'admin' | 'h5' | 'tgs' | 'match-apply' | 'match-apply-mobile'; export interface InitVue3Options { downloadPath: string; vueVersion: VueVersion; } export interface InitSubProjectOptions { subProjectName: string; downloadPath: string; vueVersion: VueVersion; type?: SubProjectType; } ``` ## 4. 常见问题 ### 4.1. 本地调试 先构建好: ```bash pnpm --filter="./packages/net-cli" build ``` 去一个想创建新工程的父级目录下,执行下面命令: ```bash # 参数参考上面指引 node /Users/xxx/Documents/git-aow/tx-plugin-light/packages/net-cli/bin/index.js init vue3-temp-2 --vueVersion vue3 ``` ## 5. 更新日志 [点此查看](./CHANGELOG.md)