Commit Graph
3 Commits
Author SHA1 Message Date
tianhao bbff631f4f release: v0.4.0 — React 适配器、loading链式id稳定、dragThreshold、RTL适配、dedupe插件
- React 适配器子包:@metona-team/metona-toast/react — useToast() hook + 声明式 <Toast /> 组件,组件卸载自动清理;react 为 optional peerDependency,主包保持零依赖
- loading 链式转换改原地 update:id 稳定不重建 DOM,转换后 duration 恢复默认自动关闭;update() 支持 duration 变更动态重启计时器
- _emit 幽灵实例修复:beforeShow 拦截后的 toast 不再注册进 _toasts
- dragThreshold 配置项(默认 120px,原硬编码);RTL 容器 dir 属性 + 进度条/side 条/色条镜像
- dedupe 预设插件:相同 type+message 自动去重,支持 uninstall
- jest 环境隔离测试独立成 tests/ssr.test.ts(resetModules 不再污染共享模块状态);新增 tests/setup.ts 补 TextEncoder
- 文档:README/docs.html 补 React 适配器、dedupe、dragThreshold;CHANGELOG 更新;328 测试全过
2026-08-08 14:45:19 +08:00
tianhao cca2675fb4 refactor: 对齐 MetonaEditor — babel-jest 替代 ts-jest
CI / test (18.x) (push) Successful in 9m50s
CI / test (20.x) (push) Successful in 9m49s
CI / test (22.x) (push) Successful in 9m56s
CI / test (24.x) (push) Successful in 9m55s
### Changed
- 测试框架: ts-jest → babel-jest (对齐 MetonaEditor 生产方案)
- jest.config.cjs: babel-jest transform + moduleNameMapper
- test 脚本: jest → jest --coverage (对齐 MetonaEditor)
- 移除 ts-jest, 新增 @babel/core/preset-env/preset-typescript/babel-jest

### Added
- babel.config.cjs (对齐 MetonaEditor)

### Fixed
- 恢复 tslib (@rollup/plugin-typescript 必需依赖)

### Verified
- tsc --noEmit: 零错误
- jest --no-coverage: 136/136 passed
- rollup build: 5 outputs
2026-07-25 11:52:01 +08:00
tianhao 9a6cd33d90 release: v0.2.0 — TypeScript 源码重构
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
### 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