Files
MetonaToast/build.sh
T
tianhao 9a6cd33d90
CI / test (18.x) (push) Successful in 9m52s
CI / test (22.x) (push) Canceled after 0s
CI / test (24.x) (push) Canceled after 0s
CI / test (20.x) (push) Canceled after 2m49s
release: v0.2.0 — TypeScript 源码重构
### Changed
- 全部源码从 JavaScript 迁移到 TypeScript (strict mode)
- core.js (1244行) 拆分为 toast.ts + api.ts + templates.ts
- 删除手动维护的 types/index.d.ts,类型从源码自动生成
- 构建工具链: Babel → ts-jest, 新增 @rollup/plugin-typescript
- 新增 rollup-plugin-dts 生成合并 .d.ts

### Added
- tsconfig.json (strict: true)
- src/types.ts 核心类型模块 (39 个导出类型)
- .eslintrc.json (@typescript-eslint)
- .gitea/workflows/ci.yml (Node 18/20/22/24 矩阵)
- CHANGELOG.md

### Aligned with metona-starter
- package.json: type:module, engines≥16, prepublishOnly
- rollup.config.js: dts plugin, port 3001
- jest.config.cjs, build.sh, serve.sh, .gitignore (.npmrc)

### Removed
- babel.config.js, types/ 目录, 所有 src/*.js
2026-07-25 11:22:07 +08:00

26 lines
417 B
Bash

#!/bin/bash
# 构建脚本 — 安装依赖 → 测试 → 构建
echo "🔨 MetonaToast 构建脚本"
if ! command -v node &> /dev/null; then
echo "❌ 未找到 Node.js"
exit 1
fi
echo "✅ Node.js: $(node -v)"
echo "📦 安装依赖..."
npm install || exit 1
echo "🧪 运行测试..."
npm test || exit 1
echo "🔨 构建..."
npm run build || exit 1
echo ""
echo "✅ 构建完成"
ls -lh dist/