### 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
89 lines
2.3 KiB
JSON
89 lines
2.3 KiB
JSON
{
|
|
"name": "@metona-team/metona-toast",
|
|
"version": "0.2.0",
|
|
"description": "轻量、零依赖、精致美观的Toast通知库。TypeScript源码,开箱即用。",
|
|
"type": "module",
|
|
"main": "dist/metona-toast.cjs.js",
|
|
"module": "dist/metona-toast.esm.js",
|
|
"unpkg": "dist/metona-toast.min.js",
|
|
"jsdelivr": "dist/metona-toast.min.js",
|
|
"types": "dist/metona-toast.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"import": "./dist/metona-toast.esm.js",
|
|
"require": "./dist/metona-toast.cjs.js",
|
|
"types": "./dist/metona-toast.d.ts"
|
|
}
|
|
},
|
|
"files": [
|
|
"dist/",
|
|
"src/",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"scripts": {
|
|
"build": "tsc --noEmit && rollup -c",
|
|
"dev": "rollup -c -w",
|
|
"test": "jest",
|
|
"test:watch": "jest --watch",
|
|
"test:coverage": "jest --coverage",
|
|
"lint": "eslint 'src/**/*.ts'",
|
|
"lint:fix": "eslint 'src/**/*.ts' --fix",
|
|
"format": "prettier --write 'src/**/*.ts' 'tests/**/*.ts'",
|
|
"typecheck": "tsc --noEmit",
|
|
"prepublishOnly": "npm run typecheck && npm test && npm run build",
|
|
"docs": "typedoc src/ --out docs",
|
|
"example": "serve examples/"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://git.metona.cn/MetonaTeam/MetonaToast.git"
|
|
},
|
|
"keywords": [
|
|
"toast",
|
|
"notification",
|
|
"alert",
|
|
"message",
|
|
"snackbar",
|
|
"ui",
|
|
"component",
|
|
"lightweight",
|
|
"zero-dependency"
|
|
],
|
|
"author": "thzxx",
|
|
"license": "MIT",
|
|
"bugs": {
|
|
"url": "https://git.metona.cn/MetonaTeam/MetonaToast/issues"
|
|
},
|
|
"homepage": "https://git.metona.cn/MetonaTeam/MetonaToast#readme",
|
|
"devDependencies": {
|
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
"@rollup/plugin-terser": "^0.4.0",
|
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
"@types/jest": "^29.5.0",
|
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
"@typescript-eslint/parser": "^8.0.0",
|
|
"eslint": "^8.40.0",
|
|
"jest": "^29.5.0",
|
|
"jest-environment-jsdom": "^29.5.0",
|
|
"prettier": "^2.8.0",
|
|
"rollup": "^3.20.0",
|
|
"rollup-plugin-dts": "^5.3.0",
|
|
"rollup-plugin-livereload": "^2.0.5",
|
|
"rollup-plugin-serve": "^2.0.1",
|
|
"ts-jest": "^29.4.12",
|
|
"tslib": "^2.8.1",
|
|
"typescript": "^5.0.0"
|
|
},
|
|
"engines": {
|
|
"node": ">=16.0.0"
|
|
},
|
|
"browserslist": [
|
|
"> 1%",
|
|
"last 2 versions",
|
|
"not dead",
|
|
"not ie 11"
|
|
]
|
|
}
|