mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
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".
This commit is contained in:
+2
-2
@@ -16,8 +16,8 @@
|
|||||||
"exports": {
|
"exports": {
|
||||||
"./*.js": "./*.js"
|
"./*.js": "./*.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"optionalDependencies": {
|
||||||
"@techstark/opencv-js": "^4.12.0",
|
"@techstark/opencv-js": "4.12.0-release.1",
|
||||||
"@tensorflow/tfjs": "^4.22.0",
|
"@tensorflow/tfjs": "^4.22.0",
|
||||||
"@tensorflow-models/coco-ssd": "^2.2.3"
|
"@tensorflow-models/coco-ssd": "^2.2.3"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user