feat: v0.2.0 — TypeScript full rewrite, 95%+ core coverage

BREAKING CHANGE: All source files converted from JavaScript to TypeScript.
- 12 .ts source files with strict types, full EditorOptions/Plugin/Token interfaces
- 7 .ts test files, 610 total tests (27 new), 7 suites all passing
- tsc --noEmit: 0 errors
- rollup-plugin-typescript build: 5 artifacts (UMD/ESM/CJS/Min/DTS)
- @babel/preset-typescript for jest
- New tsconfig.json, updated babel/jest/rollup configs
- Coverage: parser 99.5%, utils 95.7%, themes 96.2%, core 88.8%, plugins 89.5%
- Removed types/ folder (types now inline in .ts + auto-generated .d.ts)
- Desktop-only, no backward compatibility
This commit is contained in:
2026-07-24 22:28:38 +08:00
parent d7cae48073
commit e83fc211dc
40 changed files with 3563 additions and 6913 deletions
+16 -22
View File
@@ -1,40 +1,36 @@
{
"name": "@metona-team/metona-editor",
"version": "0.1.15",
"description": "轻量、零依赖、精致美观的 Markdown Editor 库。单文件,开箱即用。",
"version": "0.2.0",
"description": "Type-safe, lightweight, zero-dependency Markdown Editor. Desktop-first. React-free. Single-file bundle.",
"type": "module",
"main": "dist/metona-editor.js",
"module": "src/index.js",
"module": "src/index.ts",
"unpkg": "dist/metona-editor.min.js",
"jsdelivr": "dist/metona-editor.min.js",
"types": "types/index.d.ts",
"types": "dist/metona-editor.d.ts",
"exports": {
".": {
"import": "./src/index.js",
"import": "./src/index.ts",
"require": "./dist/metona-editor.js",
"types": "./types/index.d.ts"
"types": "./dist/metona-editor.d.ts"
}
},
"files": [
"dist/",
"src/",
"types/",
"README.md",
"LICENSE"
],
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"test": "jest",
"test": "jest --coverage",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix",
"format": "prettier --write src/",
"typecheck": "tsc --noEmit",
"prepublishOnly": "npm run build",
"docs": "jsdoc src/ -d docs",
"example": "serve examples/"
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
@@ -47,7 +43,8 @@
"ui",
"component",
"lightweight",
"zero-dependency"
"zero-dependency",
"typescript"
],
"author": "thzxx",
"license": "MIT",
@@ -58,10 +55,12 @@
"devDependencies": {
"@babel/core": "^7.22.0",
"@babel/preset-env": "^7.22.0",
"@babel/preset-typescript": "^7.22.0",
"@babel/plugin-transform-modules-commonjs": "^7.22.0",
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.1.0",
"@types/jest": "^29.5.0",
"babel-jest": "^29.5.0",
"eslint": "^8.40.0",
@@ -72,15 +71,10 @@
"rollup-plugin-dts": "^5.3.0",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-serve": "^2.0.1",
"typescript": "^5.0.0"
"typescript": "^5.0.0",
"tslib": "^2.6.0"
},
"engines": {
"node": ">=14.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
"node": ">=16.0.0"
}
}