- ESLint flat config + Prettier + EditorConfig - Markdown处理器LRU缓存 - Zustand选择器优化减少重渲染 - CodeMirror Compartment主题热切换 - Preview防抖(150ms) + IndexedDB去抖(500ms) - 组件拆分: App.tsx 310→104行, Sidebar.tsx 244→90行 - 统一错误处理 errorHandler.ts - ConfirmDialog替代原生confirm - LoadingSpinner加载状态 - Toast多条堆叠+类型区分 - 可访问性增强(ARIA属性、键盘导航) - Vitest测试框架(78个测试用例) - Git hooks(husky + lint-staged) - 项目文档(README.md, CONTRIBUTING.md)
125 lines
3.2 KiB
JSON
125 lines
3.2 KiB
JSON
{
|
|
"name": "marklite",
|
|
"version": "0.2.0",
|
|
"description": "Lightweight Markdown Editor for Windows",
|
|
"main": "./dist/main/index.js",
|
|
"scripts": {
|
|
"dev": "electron-vite dev",
|
|
"build": "electron-vite build && electron-builder --win",
|
|
"build:portable": "electron-vite build && electron-builder --win portable",
|
|
"lint": "eslint src/",
|
|
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"test:coverage": "vitest run --coverage",
|
|
"prepare": "husky"
|
|
},
|
|
"lint-staged": {
|
|
"*.{ts,tsx}": [
|
|
"eslint --fix",
|
|
"tsc --noEmit --pretty"
|
|
],
|
|
"*.{json,css,md}": [
|
|
"prettier --write"
|
|
]
|
|
},
|
|
"author": "MarkLite",
|
|
"license": "MIT",
|
|
"dependencies": {
|
|
"@codemirror/commands": "^6.10.3",
|
|
"@codemirror/lang-markdown": "^6.5.0",
|
|
"@codemirror/language": "^6.12.3",
|
|
"@codemirror/search": "^6.7.0",
|
|
"@codemirror/state": "^6.6.0",
|
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
"@codemirror/view": "^6.43.0",
|
|
"dexie": "^4.0.11",
|
|
"nanoid": "^5.1.5",
|
|
"react": "^18.3.1",
|
|
"react-dom": "^18.3.1",
|
|
"rehype-highlight": "^7.0.2",
|
|
"rehype-raw": "^7.0.0",
|
|
"rehype-sanitize": "^6.0.0",
|
|
"rehype-stringify": "^10.0.0",
|
|
"remark-gfm": "^4.0.1",
|
|
"remark-parse": "^11.0.0",
|
|
"remark-rehype": "^11.1.2",
|
|
"unified": "^11.0.5",
|
|
"unist-util-visit": "^5.1.0",
|
|
"zustand": "^5.0.6"
|
|
},
|
|
"devDependencies": {
|
|
"@testing-library/jest-dom": "^6.9.1",
|
|
"@testing-library/react": "^16.3.2",
|
|
"@types/jsdom": "^28.0.3",
|
|
"@types/react": "^18.3.18",
|
|
"@types/react-dom": "^18.3.5",
|
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
"@vitejs/plugin-react": "^4.3.4",
|
|
"electron": "^28.3.3",
|
|
"electron-builder": "^25.1.8",
|
|
"electron-vite": "^3.0.0",
|
|
"eslint": "^9.22.0",
|
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
"husky": "^9.1.7",
|
|
"jsdom": "^29.1.1",
|
|
"lint-staged": "^17.0.7",
|
|
"prettier": "^3.8.3",
|
|
"typescript": "^5.6.3",
|
|
"typescript-eslint": "^8.60.1",
|
|
"vitest": "^4.1.8"
|
|
},
|
|
"build": {
|
|
"appId": "com.marklite.app",
|
|
"productName": "MarkLite",
|
|
"directories": {
|
|
"output": "dist"
|
|
},
|
|
"files": [
|
|
"dist/**/*",
|
|
"assets/**/*"
|
|
],
|
|
"win": {
|
|
"target": [
|
|
{
|
|
"target": "nsis",
|
|
"arch": [
|
|
"x64"
|
|
]
|
|
}
|
|
],
|
|
"icon": "assets/icon.ico"
|
|
},
|
|
"nsis": {
|
|
"oneClick": false,
|
|
"allowToChangeInstallationDirectory": true,
|
|
"createDesktopShortcut": true,
|
|
"createStartMenuShortcut": true,
|
|
"shortcutName": "MarkLite"
|
|
},
|
|
"fileAssociations": [
|
|
{
|
|
"ext": "md",
|
|
"name": "Markdown",
|
|
"description": "Markdown File",
|
|
"icon": "assets/icon.ico"
|
|
},
|
|
{
|
|
"ext": "markdown",
|
|
"name": "Markdown",
|
|
"description": "Markdown File",
|
|
"icon": "assets/icon.ico"
|
|
},
|
|
{
|
|
"ext": "txt",
|
|
"name": "Text",
|
|
"description": "Text File",
|
|
"icon": "assets/icon.ico"
|
|
}
|
|
]
|
|
}
|
|
}
|