tlf-cli
v2.0.3
Published
talefun-framework 的命令行脚手架 用于创建和更新 talefun-framework 的核心文件
Downloads
4
Readme
TaleFun
tlf-cli
_____ _ _____ ____ _ _
|_ _| | | ___| / ___| (_)
| | | | | |_ | | | | |
| | | |___| _| | |___| | |
|_| |_____|_| \____|_|_|
Usage: index [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
gulp [tasks...] 使用 cli 内置 gulp 执行任务 例如 tlf-cli gulp [任务名]
create <dirname> 创建项目 tlf-cli create [项目文件夹名]
update 更新脚手架核心资源 请在项目根目录使用
clean 清除配置中心的配置 目录 ~/.tlfcli
config 重新配置配置中心的 个人信息
doc [options] 通过 jsdoc 生成项目文档 请在项目更目录使用
help [command] display help for command
初始化
第一种方法初始化
cd workspace tlf-cli create .
第二种方法初始化
tlf-cli create projectName
命令细节
_____ _ _____ ____ _ _
|_ _| | | ___| / ___| (_)
| | | | | |_ | | | | |
| | | |___| _| | |___| | |
|_| |_____|_| \____|_|_|
? 请选择初始化模板类型: TaleFun Thinkjs 脚手架
? 是否初始化 TSLint: Yes
? 项目说明 Description:
? 包管理器选择: npm
? TaleFun JSON 配置中心的个人私钥: [hidden] // 第一次使用会需要配置中心的个人私钥请参考上面图片
? 应用类型: server // 选择项 目前有 (server client serverless)
? 应用名(请以纯字母命名): testApp // 自己命名的 项目名
? 秘钥令牌 TOKEN: [hidden]
? 是否使用 IO Redis: Yes
? 是否使用 TypeOrm: Yes
? 是否使用 Bull MQ 消息队列: Yes
? 配置已存在(是否沿用该配置 com.talefun.server.testApp): Yes // 如果检测到该 项目以后配置 会提示是否沿用已有配置 注意这里一个项目只能有一个配置
Cloning into '/Users/yihuaqing/.tlf/talefun-framework-template'...
template download success ...
正在同步文件 ...
create: /Users/yihuaqing/Desktop/work/testApp/test
create: /Users/yihuaqing/Desktop/work/testApp/test
create: /Users/yihuaqing/Desktop/work/testApp/test/www
create: /Users/yihuaqing/Desktop/work/testApp/test/www/static
create: /Users/yihuaqing/Desktop/work/testApp/test/www/static/debugger_jsonschema.json
create: /Users/yihuaqing/Desktop/work/testApp/test/view
create: /Users/yihuaqing/Desktop/work/testApp/test/view/home
create: /Users/yihuaqing/Desktop/work/testApp/test/view/home/index_index.html
create: /Users/yihuaqing/Desktop/work/testApp/test/tslint.json
create: /Users/yihuaqing/Desktop/work/testApp/test/tsconfig.json
create: /Users/yihuaqing/Desktop/work/testApp/test/tasks
create: /Users/yihuaqing/Desktop/work/testApp/test/tasks/index.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/tasks/core.tasks.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/service
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/service/user.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/model
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/model/userbind.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/model/user.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/logic
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/logic/v1
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/logic/v1/user.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/logic/user.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/defines.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/controller
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/controller/v1
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/controller/v1/user.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/user/controller/user.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/mq
create: /Users/yihuaqing/Desktop/work/testApp/test/src/mq/app2.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/mq/app1.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/index.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/service
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/service/redis.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/service/daily.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/service/bull.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/logic
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/logic/typeorm.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/logic/router.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/logic/redis.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/logic/permission.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/logic/bull.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/entity
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/entity/index.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/entity/dailys1.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/entity/dailys.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/controller
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/controller/typeorm.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/controller/router.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/controller/redis.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/controller/permission.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/example/controller/bull.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/tale
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/tale/Utils.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/tale/TaleDefine.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/tale/JsonRPCController.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/tale/BaseService.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/tale/BaseModel.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/tale/BaseLogic.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/tale/BaseController.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/service
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/service/token.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/service/jsonrpc.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/logic
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/logic/main.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/extend
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/extend/think.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/config
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/config/router.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/config/middleware.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/config/extend.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/config/config.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/config/adapter.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/bootstrap
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/bootstrap/worker.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/src/common/bootstrap/master.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/pm2startup
create: /Users/yihuaqing/Desktop/work/testApp/test/pm2startup/usa-main.json
create: /Users/yihuaqing/Desktop/work/testApp/test/pm2startup/usa-main-pre.json
create: /Users/yihuaqing/Desktop/work/testApp/test/pm2startup/usa-main-pre
create: /Users/yihuaqing/Desktop/work/testApp/test/pm2startup/usa-main
create: /Users/yihuaqing/Desktop/work/testApp/test/pm2startup/starter
create: /Users/yihuaqing/Desktop/work/testApp/test/pm2startup/local.json
create: /Users/yihuaqing/Desktop/work/testApp/test/pm2startup/local
create: /Users/yihuaqing/Desktop/work/testApp/test/pm2startup/develop.json
create: /Users/yihuaqing/Desktop/work/testApp/test/pm2startup/develop
create: /Users/yihuaqing/Desktop/work/testApp/test/package.json
create: /Users/yihuaqing/Desktop/work/testApp/test/package-lock.json
create: /Users/yihuaqing/Desktop/work/testApp/test/gulpfile.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/docs
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/static
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/static/request.xmind
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/static/request.png
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/static/local.xmind
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/static/local.png
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/static/framework.xmind
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/static/framework.png
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/static/Frameworkstratum.xmind
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/static/Frameworkstratum.png
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/static/.DS_Store
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/jsonwebtoken.md
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/expain.md
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/README.md
create: /Users/yihuaqing/Desktop/work/testApp/test/docs/.DS_Store
create: /Users/yihuaqing/Desktop/work/testApp/test/docker-compose.yml
create: /Users/yihuaqing/Desktop/work/testApp/test/docker-compose.local.yml
create: /Users/yihuaqing/Desktop/work/testApp/test/docker
create: /Users/yihuaqing/Desktop/work/testApp/test/docker/sql
create: /Users/yihuaqing/Desktop/work/testApp/test/docker/sql/test.sql
create: /Users/yihuaqing/Desktop/work/testApp/test/bootstrap
create: /Users/yihuaqing/Desktop/work/testApp/test/bootstrap/usa-main.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/bootstrap/usa-main-pre.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/bootstrap/starter.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/bootstrap/local.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/bootstrap/docs
create: /Users/yihuaqing/Desktop/work/testApp/test/bootstrap/docs/jsdoc.conf
create: /Users/yihuaqing/Desktop/work/testApp/test/bootstrap/docs/documents.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/bootstrap/develop.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/README.md
create: /Users/yihuaqing/Desktop/work/testApp/test/Dockerfile
create: /Users/yihuaqing/Desktop/work/testApp/test/@types
create: /Users/yihuaqing/Desktop/work/testApp/test/@types/thinkjs.d.ts
create: /Users/yihuaqing/Desktop/work/testApp/test/.gitignore
create: /Users/yihuaqing/Desktop/work/testApp/test/.DS_Store
template init success ...
开始安装项目依赖 ...
npm WARN using --force I sure hope you know what you are doing.
npm WARN using --force I sure hope you know what you are doing.
> [email protected] install /Users/yihuaqing/Desktop/work/testApp/test/node_modules/@types/gulp/node_modules/fsevents
> node-gyp rebuild
> [email protected] install /Users/yihuaqing/Desktop/work/testApp/test/node_modules/@types/gulp/node_modules/fsevents
> node-gyp rebuild
SOLINK_MODULE(target) Release/.node
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
SOLINK_MODULE(target) Release/fse.node
> [email protected] install /Users/yihuaqing/Desktop/work/testApp/test/node_modules/glob-watcher/node_modules/fsevents
> node-gyp rebuild
> [email protected] install /Users/yihuaqing/Desktop/work/testApp/test/node_modules/glob-watcher/node_modules/fsevents
> node-gyp rebuild
SOLINK_MODULE(target) Release/.node
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
SOLINK_MODULE(target) Release/fse.node
> [email protected] install /Users/yihuaqing/Desktop/work/testApp/test/node_modules/watchpack-chokidar2/node_modules/fsevents
> node-gyp rebuild
> [email protected] install /Users/yihuaqing/Desktop/work/testApp/test/node_modules/watchpack-chokidar2/node_modules/fsevents
> node-gyp rebuild
SOLINK_MODULE(target) Release/.node
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
SOLINK_MODULE(target) Release/fse.node
> [email protected] postinstall /Users/yihuaqing/Desktop/work/testApp/test/node_modules/core-js
> node postinstall || echo "ignore"
> [email protected] postinstall /Users/yihuaqing/Desktop/work/testApp/test/node_modules/core-js
> node postinstall || echo "ignore"
npm WARN [email protected] No repository field.
added 1455 packages from 1135 contributors in 41.577s
added 1455 packages from 1135 contributors in 41.577s
39 packages are looking for funding
run `npm fund` for details
39 packages are looking for funding
run `npm fund` for details
项目初始化完毕 ...
升级项目
tlf-cli update
编译项目
npm run build
启动项目
npm run start
清除个人配置
root$ tlf-cli clean
_____ _ _____ ____ _ _
|_ _| | | ___| / ___| (_)
| | | | | |_ | | | | |
| | | |___| _| | |___| | |
|_| |_____|_| \____|_|_|
配置清除成功 ~/.tlfcli
可执行 tlf-cli config 更新配置, 或者 使用 tlf-cil create 项目 是重新填入配置
手动配置配置中心
root$ tlf-cli config
_____ _ _____ ____ _ _
|_ _| | | ___| / ___| (_)
| | | | | |_ | | | | |
| | | |___| _| | |___| | |
|_| |_____|_| \____|_|_|
? 配置中心地址: http://cp.talefun.com
? 配置中心个人私钥: [hidden]
? 配置中心 API 超时时间: 300000
配置创建成功 ~/.tlfcli