114 lines
2.3 KiB
Markdown
114 lines
2.3 KiB
Markdown
# @lingshu/lowcode-create
|
|
|
|
低代码创建工具,用于生成表单 API 类型定义。
|
|
|
|
## 功能特性
|
|
|
|
- 🎯 表单 API 类型定义生成
|
|
- 📦 自动发布 `@types/cisdi-form-api` 包
|
|
- 🔧 完整的构建和发布流程
|
|
- 🏷️ 自动版本管理和 Git 标签
|
|
|
|
## 安装
|
|
|
|
```bash
|
|
npm install @lingshu/lowcode-create
|
|
```
|
|
|
|
## 使用方法
|
|
|
|
### 构建类型文件
|
|
|
|
```bash
|
|
npm run build:types
|
|
```
|
|
|
|
这将生成 TypeScript 类型定义文件到 `types` 目录。
|
|
|
|
### 发布包
|
|
|
|
```bash
|
|
# 完整发布流程
|
|
npx tsx scripts/ReleaseTypeLib.ts
|
|
|
|
# 试运行模式
|
|
npx tsx scripts/ReleaseTypeLib.ts --dry-run
|
|
|
|
# 跳过构建步骤
|
|
npx tsx scripts/ReleaseTypeLib.ts --skip-build
|
|
|
|
# 跳过版本更新
|
|
npx tsx scripts/ReleaseTypeLib.ts --skip-version
|
|
|
|
# 跳过发布步骤
|
|
npx tsx scripts/ReleaseTypeLib.ts --skip-publish
|
|
```
|
|
|
|
### 命令行选项
|
|
|
|
| 选项 | 描述 |
|
|
| ---------------- | ---------------------- |
|
|
| `--dry-run` | 试运行模式,不实际发布 |
|
|
| `--skip-build` | 跳过构建步骤 |
|
|
| `--skip-version` | 跳过版本更新 |
|
|
| `--skip-publish` | 跳过发布步骤 |
|
|
| `--help`, `-h` | 显示帮助信息 |
|
|
|
|
## 发布流程
|
|
|
|
发布脚本会自动执行以下步骤:
|
|
|
|
1. **前置条件检查**
|
|
- 检查当前 Git 分支
|
|
- 检查是否有未提交的更改
|
|
- 检查 bumpp 是否已安装
|
|
|
|
2. **构建类型文件**
|
|
- 复制 `dist/apis` 目录到 `types` 目录
|
|
- 生成 `package.json` 和 `README.md`
|
|
|
|
3. **版本管理**
|
|
- 使用 bumpp 更新版本号
|
|
- 支持 patch、minor、major 版本更新
|
|
|
|
4. **发布包**
|
|
- 发布到 npm 注册表
|
|
- 创建 Git 标签
|
|
|
|
## 开发
|
|
|
|
### 项目结构
|
|
|
|
```
|
|
packages/lowcode-create/
|
|
├── src/ # 源代码
|
|
├── scripts/ # 构建脚本
|
|
│ ├── BuildFormApiTypes.ts # 类型文件构建脚本
|
|
│ ├── ReleaseTypeLib.ts # 发布脚本
|
|
│ └── TypeLib.pkg.json # 类型包配置
|
|
├── types/ # 生成的类型文件
|
|
└── package.json # 包配置
|
|
```
|
|
|
|
### 开发命令
|
|
|
|
```bash
|
|
# 构建项目
|
|
npm run build
|
|
|
|
# 开发模式构建
|
|
npm run dev
|
|
|
|
# 构建类型文件
|
|
npm run build:types
|
|
|
|
# 清理构建文件
|
|
npm run clean
|
|
```
|
|
|
|
## 依赖
|
|
|
|
- Vue >= 3.0.0
|
|
- element-plus-cisdi >= 1.0.0
|
|
- bumpp (用于版本管理)
|