refactor: vendor marked + dompurify 到项目内,实现零外部依赖

- marked (77行 ESM) + dompurify (1398行 ESM) 复制到 src/vendor/
- 包含 LICENSE 文件和类型声明(dompurify 类型去除 trusted-types 外部依赖)
- 移除 package.json 中 marked/dompurify/@types/dompurify 依赖
- 移除 electron-builder files 配置中的 node_modules 引用
- tsconfig.json include 新增 src/vendor/**/*.d.ts
This commit is contained in:
thzxx
2026-04-19 20:54:07 +08:00
parent 419938c667
commit 771a48f35d
11 changed files with 3302 additions and 50 deletions
-41
View File
@@ -9,12 +9,9 @@
"version": "5.1.5",
"license": "MIT",
"dependencies": {
"dompurify": "^3.4.0",
"marked": "^18.0.2",
"sql.js": "^1.11.0"
},
"devDependencies": {
"@types/dompurify": "^3.0.5",
"@types/node": "^20.17.0",
"electron": "^33.4.11",
"electron-builder": "^25.1.8",
@@ -1449,16 +1446,6 @@
"@types/ms": "*"
}
},
"node_modules/@types/dompurify": {
"version": "3.0.5",
"resolved": "https://registry.npmmirror.com/@types/dompurify/-/dompurify-3.0.5.tgz",
"integrity": "sha512-1Wg0g3BtQF7sSb27fJQAKck1HECM6zV1EB66j8JH9i3LCjYabJa0FSdiSgsD5K/RbrsR0SiraKacLB+T8ZVYAg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/trusted-types": "*"
}
},
"node_modules/@types/estree": {
"version": "1.0.8",
"resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.8.tgz",
@@ -1532,13 +1519,6 @@
"@types/node": "*"
}
},
"node_modules/@types/trusted-types": {
"version": "2.0.7",
"resolved": "https://registry.npmmirror.com/@types/trusted-types/-/trusted-types-2.0.7.tgz",
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
"devOptional": true,
"license": "MIT"
},
"node_modules/@types/verror": {
"version": "1.10.11",
"resolved": "https://registry.npmmirror.com/@types/verror/-/verror-1.10.11.tgz",
@@ -2918,15 +2898,6 @@
"node": ">=8"
}
},
"node_modules/dompurify": {
"version": "3.4.0",
"resolved": "https://registry.npmmirror.com/dompurify/-/dompurify-3.4.0.tgz",
"integrity": "sha512-nolgK9JcaUXMSmW+j1yaSvaEaoXYHwWyGJlkoCTghc97KgGDDSnpoU/PlEnw63Ah+TGKFOyY+X5LnxaWbCSfXg==",
"license": "(MPL-2.0 OR Apache-2.0)",
"optionalDependencies": {
"@types/trusted-types": "^2.0.7"
}
},
"node_modules/dotenv": {
"version": "16.6.1",
"resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-16.6.1.tgz",
@@ -4465,18 +4436,6 @@
"node": ">=12"
}
},
"node_modules/marked": {
"version": "18.0.2",
"resolved": "https://registry.npmmirror.com/marked/-/marked-18.0.2.tgz",
"integrity": "sha512-NsmlUYBS/Zg57rgDWMYdnre6OTj4e+qq/JS2ot3KrYLSoHLw+sDu0Nm1ZGpRgYAq6c+b1ekaY5NzVchMCQnzcg==",
"license": "MIT",
"bin": {
"marked": "bin/marked.js"
},
"engines": {
"node": ">= 20"
}
},
"node_modules/matcher": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/matcher/-/matcher-3.0.0.tgz",