@znzb/create-eplature-app
v0.1.0
Published
Eplature 全栈应用脚手架:一行命令拉取 Go+Vue 项目骨架。
Maintainers
Readme
@znzb/create-eplature-app
Eplature 全栈应用脚手架:一行命令拉取 Go + Vue 项目骨架。
用法
npx @znzb/create-eplature-app <项目名>示例:
npx @znzb/create-eplature-app my-app
cd my-app
npm run setup # 初始化开发环境(安装依赖、生成 .env)
npm run dev # 一键启动 API + Web 开发服务选项
| 选项 | 说明 |
| --- | --- |
| --force, -f | 目标目录非空时强制覆盖(删除原有全部内容) |
| --help, -h | 显示帮助 |
环境变量
| 变量 | 说明 |
| --- | --- |
| EPLATURE_TEMPLATE_URL | 覆盖默认模板下载地址(测试 / 私有镜像用) |
EPLATURE_TEMPLATE_URL=http://localhost:8080/eplature-template.tar.gz \
npx @znzb/create-eplature-app my-app工作原理
- 校验项目名与目标目录
- 从下载地址拉取模板
tar.gz(Node 内置fetch流式下载) - 解压并丢弃模板顶层目录(
tar.extract({ strip: 1 })) - 打印后续步骤指引
模板
tar.gz内必须约定单一顶层目录(如template/),所有内容在其下——这是strip: 1成立的前提。
开发
git clone <repo-url>
cd create-eplature-app
npm install
# 本地验证:起一个静态服务托管测试用 tar.gz,再用环境变量覆盖下载地址
EPLATURE_TEMPLATE_URL=http://localhost:8080/eplature-template.tar.gz \
node ./bin/index.js my-app --force发布
npm login
npm publish --dry-run # 预检发布内容
npm publish --access publicLicense
MIT © Shanghai Baosight Software Co., Ltd.
