新增 build-mac.js,产出 ad-hoc 签名的 .app 与 DMG。只能在 macOS 上 构建:DMG 依赖 hdiutil,且 Apple Silicon 拒绝执行未签名二进制,改名 与改 plist 后必须用 codesign 重签。 按官方 darwin-arm64 运行时的真实结构处理四处易错点:用 ditto 解压以 保留 framework 符号链接、删除重打包后失效的 ElectronAsarIntegrity、 为改名后的 helper 补上 CFBundleExecutable、签名由内向外且单独签 Squirrel 的 ShipIt。 打包版数据目录改为按平台决定:macOS 走 appData,避免写进 DMG 挂载后 只读的 .app 内部并在升级覆盖时丢失书库;Windows 便携版行为不变。 窗口图标在非 Windows 平台改用 PNG。 .gitignore 的 dist 规则补上前导斜杠。此前它同时匹配 icons/dist/, 导致构建与单测依赖的图标从未入库,新克隆的仓库无法构建。
57 lines
1.4 KiB
JSON
57 lines
1.4 KiB
JSON
{
|
||
"name": "peoplelib",
|
||
"version": "1.3.0",
|
||
"description": "开放获取文献与图书客户端(arXiv / Gutenberg / Open Library / DOAJ / PMC / bioRxiv / Standard Ebooks / Semantic Scholar / LibGen / Z-Library)",
|
||
"main": "main.js",
|
||
"author": "peoplelib",
|
||
"license": "MIT",
|
||
"engines": {
|
||
"node": ">=22.19.0"
|
||
},
|
||
"scripts": {
|
||
"start": "electron .",
|
||
"test": "node --test \"src/_test/*.test.js\"",
|
||
"build": "node build-portable.js",
|
||
"portable": "node build-portable.js",
|
||
"build:mac": "node build-mac.js",
|
||
"icons:icns": "node icons/tools/make-icns.js"
|
||
},
|
||
"dependencies": {
|
||
"foliate-js": "1.0.1",
|
||
"undici": "8.9.0"
|
||
},
|
||
"devDependencies": {
|
||
"dompurify": "3.4.12",
|
||
"electron": "43.2.0",
|
||
"fabric": "7.4.0",
|
||
"jspdf": "4.2.1",
|
||
"jszip": "3.10.1",
|
||
"markdown-it": "15.0.0",
|
||
"pdfjs-dist": "6.2.108",
|
||
"quill": "2.0.2",
|
||
"rcedit": "5.0.2"
|
||
},
|
||
"build": {
|
||
"appId": "com.peoplelib.client",
|
||
"productName": "PeopleLib",
|
||
"directories": {
|
||
"output": "dist"
|
||
},
|
||
"files": [
|
||
"main.js",
|
||
"preload.js",
|
||
"src/**/*",
|
||
"icons/dist/*.ico",
|
||
"icons/dist/dark/icon-32.png",
|
||
"icons/dist/light/icon-32.png"
|
||
],
|
||
"win": {
|
||
"target": "portable",
|
||
"icon": "icons/dist/book-ai-dark.ico"
|
||
},
|
||
"portable": {
|
||
"artifactName": "PeopleLib-${version}.exe"
|
||
}
|
||
}
|
||
}
|