1 Star 0 Fork 0

hu-snail / my-cli

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

my-cli

使用nodejs构建前端脚手架工具

安装

# 1.克隆项目
git clone https://github.com/hu-snail/my-cli.git
# 2.进入项目
cd my-cli
# 3.安装依赖
yarn # or npm install
# 4.运行
yarn start

使用

  • 创建react js版本
yarn start create vite app-test --template react
# or npm
npm run start create vite app-test--template react

效果图:

image.png

  • 创建react ts版本
yarn start create vite app-test --template react-ts
# or npm
npm run start create vite app-test --template react-ts

效果图:

image.png

  • 构建方法输入有误

vite1:为错误输入❌ 只支持vite方式构建,可根据自己的需求适配多种构建方式

yarn start create vite1 app-test
# or npm
npm run start create vite1 app-test

效果图:

image.png

  • 项目名称不合规输入

1my-test-project:为不符合规范名称

yarn start create vite 1my-test-project --template react
# or npm
npm run start create vite 1my-test-project --template react

效果图:

image.png

  • 项目名称不输入
yarn start create vite 
# or npm
npm run start create vite 

效果图

image.png

项目名称不输入会提供默认值和输入给用户,同时完成项目框架选择、和是否支持ts选择。完整截图如下:

image.png

  • 项目框架方式不输入
yarn start create vite app-test 
# or npm
npm run start create vite app-test 

效果图:

image.png

  • 不输入项目框架会提供选择,同时选择是否支持ts,完整截图如下:

image.png

MIT License Copyright (c) 2022 hu-snail Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Use your own scaffolding tools 展开 收起
JavaScript 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/hu-snail/my-cli.git
git@gitee.com:hu-snail/my-cli.git
hu-snail
my-cli
my-cli
main

搜索帮助