Files
foliate-js/package.json
T
john-okeefe 2a9a11adb3 Move panel detection dependencies to optionalDependencies
Fix npm install errors and make ML/CV libraries truly optional.

Changes:
- Move dependencies from "dependencies" to "optionalDependencies"
- Fix @techstark/opencv-js version from "^4.12.0" to "4.12.0-release.1"
  - The caret syntax (^) doesn't work with suffix versions like -release.1
  - Use exact version match instead

Why optionalDependencies:
- Installation won't fail if these packages fail to install
- Users can opt-out with: npm install foliate-js --omit=optional
- Maintains the library's "no hard dependencies" philosophy
- Graceful degradation: panel detection falls back to grid-only mode

Behavior:
- Default: npm attempts to install OpenCV, TensorFlow, COCO-SSD (~4.5MB)
- With --omit=optional: skips heavy ML/CV libraries
- Either way: library works, panel detection gracefully adapts

This resolves npm install errors where "^4.12.0" couldn't be found
because the actual version is "4.12.0-release.1".
2026-04-13 17:00:45 -04:00

53 lines
1.1 KiB
JSON

{
"name": "foliate-js",
"version": "0.0.0",
"description": "Render e-books in the browser",
"repository": {
"type": "git",
"url": "git+https://github.com/johnfactotum/foliate-js.git"
},
"bugs": {
"url": "https://github.com/johnfactotum/foliate-js/issues"
},
"homepage": "https://github.com/johnfactotum/foliate-js#readme",
"author": "John Factotum",
"license": "MIT",
"type": "module",
"exports": {
"./*.js": "./*.js"
},
"optionalDependencies": {
"@techstark/opencv-js": "4.12.0-release.1",
"@tensorflow/tfjs": "^4.22.0",
"@tensorflow-models/coco-ssd": "^2.2.3"
},
"devDependencies": {
"@eslint/js": "^9.9.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@zip.js/zip.js": "^2.7.52",
"fflate": "^0.8.2",
"fs-extra": "^11.2.0",
"globals": "^15.9.0",
"pdfjs-dist": "^5.5.207",
"rollup": "^4.22.4"
},
"scripts": {
"build": "npx rollup -c"
},
"keywords": [
"ebook",
"reader",
"epub",
"cfi",
"mobi",
"azw",
"azw3",
"fb2",
"cbz",
"dictd",
"stardict",
"opds"
]
}