From 510746e0eafa9de0af30a8b636fd916723a59438 Mon Sep 17 00:00:00 2001
From: Fanfulla <224395883+Fanfulla@users.noreply.github.com>
Date: Sun, 27 Sep 2026 19:59:44 +0200
Subject: [PATCH 1/8] chore: remove dead code and unused dependencies, move
test fixtures
Drops unused components/helpers and the broken browser-fs-access fallback
(directoryOpen returns File[], not a handle), removes jszip/adm-zip/
better-sqlite3, simplifies .gitignore and moves private real-backup
fixtures to ./fixtures (overridable via KOBUP_FIXTURES_DIR).
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
---
.gitignore | 248 +------------
package-lock.json | 549 +----------------------------
package.json | 4 -
src/components/backup/BookCard.jsx | 106 ------
src/components/backup/BookList.jsx | 226 ------------
src/stores/koboStore.js | 17 +-
src/utils/fileSystem.js | 96 +----
src/utils/koboDatabase.js | 31 --
src/utils/realBackup.test.js | 8 +-
src/utils/restore.js | 35 --
src/utils/validation.js | 79 -----
11 files changed, 36 insertions(+), 1363 deletions(-)
delete mode 100644 src/components/backup/BookCard.jsx
delete mode 100644 src/components/backup/BookList.jsx
diff --git a/.gitignore b/.gitignore
index 19553c7..1583903 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,261 +1,49 @@
-# .gitignore for Kobo Backup Manager
-# React + Vite + JavaScript project
-
# Dependencies
node_modules/
-/.pnp
-.pnp.js
+.pnpm-store/
# Build outputs
dist/
dist-ssr/
-build/
*.local
+*.tsbuildinfo
+vite.config.*.timestamp-*
-# Logs
-logs/
+# Logs & caches
*.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-pnpm-debug.log*
-lerna-debug.log*
+.eslintcache
+.cache/
+coverage/
-# Editor directories and files
+# Editors / OS
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
.idea/
.DS_Store
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.sw?
-*.swp
-*.swo
-*~
-
-# IDE - VSCode
-.vscode/
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
-.history/
-
-# IDE - IntelliJ / WebStorm
-.idea/
-*.iml
-*.iws
-out/
-
-# OS files
-.DS_Store
-.DS_Store?
-._*
-.Spotlight-V100
-.Trashes
-ehthumbs.db
Thumbs.db
desktop.ini
-*.zip
+nul
-# Environment variables
+# Environment
.env
-.env.local
-.env.development.local
-.env.test.local
-.env.production.local
-.env*.local
+.env.*
+!.env.example
-# Testing
-coverage/
-.nyc_output/
-*.lcov
-.coverage
-htmlcov/
-test-results/
-playwright-report/
-
-# Temporary files
-tmp/
-temp/
-*.tmp
-*.temp
-.cache/
-
-# Package manager files
-package-lock.json.backup
-yarn.lock.backup
-.pnpm-store/
-.yarn/cache
-.yarn/unplugged
-.yarn/build-state.yml
-.yarn/install-state.gz
-.pnp.*
-
-# Vite specific
-vite.config.js.timestamp-*
-vite.config.ts.timestamp-*
-
-# Build artifacts
-*.tsbuildinfo
-.eslintcache
-
-# Database files (for local testing)
+# Private test fixtures (real Kobo databases / backups contain personal data)
+fixtures/
+*.zip
*.sqlite
*.sqlite3
*.db
*.db-shm
*.db-wal
+*.sqlite-shm
+*.sqlite-wal
-# Backup files
-*.bak
-*.backup
-*~
-
-# Runtime data
-pids/
-*.pid
-*.seed
-*.pid.lock
-
-# TypeScript cache
-*.tsbuildinfo
-
-# Optional npm cache directory
-.npm
-
-# Optional eslint cache
-.eslintcache
-
-# Optional stylelint cache
-.stylelintcache
-
-# Microbundle cache
-.rpt2_cache/
-.rts2_cache_cjs/
-.rts2_cache_es/
-.rts2_cache_umd/
-
-# Optional REPL history
-.node_repl_history
-
-# Output of 'npm pack'
-*.tgz
-
-# Serverless directories
-.serverless/
-
-# FuseBox cache
-.fusebox/
-
-# DynamoDB Local files
-.dynamodb/
-
-# TernJS port file
-.tern-port
-
-# Stores VSCode versions used for testing VSCode extensions
-.vscode-test
-
-# yarn v2
-.yarn/cache
-.yarn/unplugged
-.yarn/build-state.yml
-.yarn/install-state.gz
-.pnp.*
-
-# Analytics and tracking (if using local config files)
-analytics-config.json
-tracking-config.json
-
-# User-specific data (backup history stored in browser, but ignore if exported)
-backups/
-backup-exports/
-kobo-backups/
-
-# Documentation build
-docs/_build/
-docs/.doctrees/
-
-# MacOS
-.AppleDouble
-.LSOverride
-Icon
-.DocumentRevisions-V100
-.fseventsd
-.TemporaryItems
-.VolumeIcon.icns
-.com.apple.timemachine.donotpresent
-.AppleDB
-.AppleDesktop
-Network Trash Folder
-Temporary Items
-.apdisk
-
-# Windows
-Thumbs.db
-Thumbs.db:encryptable
-ehthumbs.db
-ehthumbs_vista.db
-*.stackdump
-[Dd]esktop.ini
-$RECYCLE.BIN/
-*.cab
-*.msi
-*.msix
-*.msm
-*.msp
-*.lnk
-
-# Linux
-.fuse_hidden*
-.directory
-.Trash-*
-.nfs*
-
-# Python (if using Python scripts for development)
-__pycache__/
-*.py[cod]
-*$py.class
-*.so
-.Python
-venv/
-ENV/
-env/
-.venv
-
-# Certificates and keys
-*.pem
-*.key
-*.crt
-*.p12
-*.pfx
-
-# Local development
-.local/
-local/
-scratch/
-
-# Ignore nul file (appears to be an error file)
-nul
-
-# Exclude .claude and .planning (local dev workflow files, not needed on GitHub)
+# Local dev workflow files (not published)
.claude/
.planning/
-
-# Keep public directory for static assets
-!public/
-
-# Keep only README and LICENSE
-!README.md
-!LICENSE
CONTRIBUTING.md
CODE_OF_CONDUCT.md
KOBO_BACKUP_WEBAPP_BLUEPRINT.md
-test-backup.mjs
-
-# Local analysis/testing folders
-_backup_analysis/
diff --git a/package-lock.json b/package-lock.json
index 6155608..d7fceff 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,9 +10,7 @@
"dependencies": {
"@vercel/analytics": "^2.0.1",
"@zip.js/zip.js": "^2.8.26",
- "browser-fs-access": "^0.35.0",
"client-zip": "^2.5.0",
- "jszip": "^3.10.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sql.js": "^1.10.3",
@@ -24,9 +22,7 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
- "adm-zip": "^0.5.16",
"autoprefixer": "^10.4.19",
- "better-sqlite3": "^12.6.2",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
@@ -1719,16 +1715,6 @@
"node": ">=0.4.0"
}
},
- "node_modules/adm-zip": {
- "version": "0.5.16",
- "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz",
- "integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=12.0"
- }
- },
"node_modules/ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
@@ -2035,27 +2021,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/base64-js": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
- "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "license": "MIT"
- },
"node_modules/baseline-browser-mapping": {
"version": "2.9.11",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.11.tgz",
@@ -2066,21 +2031,6 @@
"baseline-browser-mapping": "dist/cli.js"
}
},
- "node_modules/better-sqlite3": {
- "version": "12.6.2",
- "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.6.2.tgz",
- "integrity": "sha512-8VYKM3MjCa9WcaSAI3hzwhmyHVlH8tiGFwf0RlTsZPWJ1I5MkzjiudCo4KC4DxOaL/53A5B1sI/IbldNFDbsKA==",
- "dev": true,
- "hasInstallScript": true,
- "license": "MIT",
- "dependencies": {
- "bindings": "^1.5.0",
- "prebuild-install": "^7.1.1"
- },
- "engines": {
- "node": "20.x || 22.x || 23.x || 24.x || 25.x"
- }
- },
"node_modules/binary-extensions": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
@@ -2094,43 +2044,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/bindings": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
- "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "file-uri-to-path": "1.0.0"
- }
- },
- "node_modules/bl": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
- "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "buffer": "^5.5.0",
- "inherits": "^2.0.4",
- "readable-stream": "^3.4.0"
- }
- },
- "node_modules/bl/node_modules/readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
"node_modules/brace-expansion": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
@@ -2155,12 +2068,6 @@
"node": ">=8"
}
},
- "node_modules/browser-fs-access": {
- "version": "0.35.0",
- "resolved": "https://registry.npmjs.org/browser-fs-access/-/browser-fs-access-0.35.0.tgz",
- "integrity": "sha512-sLoadumpRfsjprP8XzVjpQc0jK8yqHBx0PtUTGYj2fftT+P/t+uyDAQdMgGAPKD011in/O+YYGh7fIs0oG/viw==",
- "license": "Apache-2.0"
- },
"node_modules/browserslist": {
"version": "4.28.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz",
@@ -2195,31 +2102,6 @@
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
}
},
- "node_modules/buffer": {
- "version": "5.7.1",
- "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
- "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "license": "MIT",
- "dependencies": {
- "base64-js": "^1.3.1",
- "ieee754": "^1.1.13"
- }
- },
"node_modules/cac": {
"version": "6.7.14",
"resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
@@ -2408,13 +2290,6 @@
"node": ">= 6"
}
},
- "node_modules/chownr": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
- "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
- "dev": true,
- "license": "ISC"
- },
"node_modules/client-zip": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/client-zip/-/client-zip-2.5.0.tgz",
@@ -2472,12 +2347,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/core-util-is": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
- "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
- "license": "MIT"
- },
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -2592,22 +2461,6 @@
}
}
},
- "node_modules/decompress-response": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
- "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "mimic-response": "^3.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/deep-eql": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz",
@@ -2621,16 +2474,6 @@
"node": ">=6"
}
},
- "node_modules/deep-extend": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
- "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=4.0.0"
- }
- },
"node_modules/deep-is": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
@@ -2684,16 +2527,6 @@
"node": ">=6"
}
},
- "node_modules/detect-libc": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
- "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
- "dev": true,
- "license": "Apache-2.0",
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/didyoumean": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz",
@@ -2761,16 +2594,6 @@
"dev": true,
"license": "ISC"
},
- "node_modules/end-of-stream": {
- "version": "1.4.5",
- "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
- "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "once": "^1.4.0"
- }
- },
"node_modules/es-abstract": {
"version": "1.24.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz",
@@ -3264,16 +3087,6 @@
"url": "https://github.com/sindresorhus/execa?sponsor=1"
}
},
- "node_modules/expand-template": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
- "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==",
- "dev": true,
- "license": "(MIT OR WTFPL)",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@@ -3348,13 +3161,6 @@
"node": "^10.12.0 || >=12.0.0"
}
},
- "node_modules/file-uri-to-path": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
- "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/fill-range": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
@@ -3437,13 +3243,6 @@
"url": "https://github.com/sponsors/rawify"
}
},
- "node_modules/fs-constants": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
- "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@@ -3607,13 +3406,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/github-from-package": {
- "version": "0.0.0",
- "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
- "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
@@ -3806,27 +3598,6 @@
"node": ">=16.17.0"
}
},
- "node_modules/ieee754": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
- "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "license": "BSD-3-Clause"
- },
"node_modules/ignore": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
@@ -3837,12 +3608,6 @@
"node": ">= 4"
}
},
- "node_modules/immediate": {
- "version": "3.0.6",
- "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
- "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==",
- "license": "MIT"
- },
"node_modules/import-fresh": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
@@ -3896,12 +3661,6 @@
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
- "license": "ISC"
- },
- "node_modules/ini": {
- "version": "1.3.8",
- "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
- "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
"dev": true,
"license": "ISC"
},
@@ -4348,12 +4107,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/isarray": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
- "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
- "license": "MIT"
- },
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@@ -4471,18 +4224,6 @@
"node": ">=4.0"
}
},
- "node_modules/jszip": {
- "version": "3.10.1",
- "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz",
- "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==",
- "license": "(MIT OR GPL-3.0-or-later)",
- "dependencies": {
- "lie": "~3.3.0",
- "pako": "~1.0.2",
- "readable-stream": "~2.3.6",
- "setimmediate": "^1.0.5"
- }
- },
"node_modules/keyv": {
"version": "4.5.4",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
@@ -4507,15 +4248,6 @@
"node": ">= 0.8.0"
}
},
- "node_modules/lie": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
- "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
- "license": "MIT",
- "dependencies": {
- "immediate": "~3.0.5"
- }
- },
"node_modules/lilconfig": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
@@ -4683,19 +4415,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/mimic-response": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
- "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/min-indent": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
@@ -4719,23 +4438,6 @@
"node": "*"
}
},
- "node_modules/minimist": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
- "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
- "dev": true,
- "license": "MIT",
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/mkdirp-classic": {
- "version": "0.5.3",
- "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
- "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/mlly": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz",
@@ -4794,13 +4496,6 @@
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
- "node_modules/napi-build-utils": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz",
- "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/natural-compare": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
@@ -4808,32 +4503,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/node-abi": {
- "version": "3.87.0",
- "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.87.0.tgz",
- "integrity": "sha512-+CGM1L1CgmtheLcBuleyYOn7NWPVu0s0EJH2C4puxgEZb9h8QpR9G2dBfZJOAUhi7VQxuBPMd0hiISWcTyiYyQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "semver": "^7.3.5"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/node-abi/node_modules/semver": {
- "version": "7.7.4",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
- "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
- "dev": true,
- "license": "ISC",
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/node-releases": {
"version": "2.0.27",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz",
@@ -5092,12 +4761,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/pako": {
- "version": "1.0.11",
- "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
- "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
- "license": "(MIT AND Zlib)"
- },
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@@ -5418,33 +5081,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/prebuild-install": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz",
- "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "detect-libc": "^2.0.0",
- "expand-template": "^2.0.3",
- "github-from-package": "0.0.0",
- "minimist": "^1.2.3",
- "mkdirp-classic": "^0.5.3",
- "napi-build-utils": "^2.0.0",
- "node-abi": "^3.3.0",
- "pump": "^3.0.0",
- "rc": "^1.2.7",
- "simple-get": "^4.0.0",
- "tar-fs": "^2.0.0",
- "tunnel-agent": "^0.6.0"
- },
- "bin": {
- "prebuild-install": "bin.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@@ -5501,12 +5137,6 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
- "node_modules/process-nextick-args": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
- "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
- "license": "MIT"
- },
"node_modules/prop-types": {
"version": "15.8.1",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
@@ -5526,17 +5156,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/pump": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",
- "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
- }
- },
"node_modules/punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
@@ -5568,32 +5187,6 @@
],
"license": "MIT"
},
- "node_modules/rc": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
- "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
- "dev": true,
- "license": "(BSD-2-Clause OR MIT OR Apache-2.0)",
- "dependencies": {
- "deep-extend": "^0.6.0",
- "ini": "~1.3.0",
- "minimist": "^1.2.0",
- "strip-json-comments": "~2.0.1"
- },
- "bin": {
- "rc": "cli.js"
- }
- },
- "node_modules/rc/node_modules/strip-json-comments": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
- "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/react": {
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
@@ -5647,21 +5240,6 @@
"pify": "^2.3.0"
}
},
- "node_modules/readable-stream": {
- "version": "2.3.8",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
- "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
- "license": "MIT",
- "dependencies": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
- }
- },
"node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
@@ -5882,12 +5460,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/safe-buffer": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
- "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
- "license": "MIT"
- },
"node_modules/safe-push-apply": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz",
@@ -5998,12 +5570,6 @@
"node": ">= 0.4"
}
},
- "node_modules/setimmediate": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
- "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
- "license": "MIT"
- },
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@@ -6123,53 +5689,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/simple-concat": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
- "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "license": "MIT"
- },
- "node_modules/simple-get": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
- "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "license": "MIT",
- "dependencies": {
- "decompress-response": "^6.0.0",
- "once": "^1.3.1",
- "simple-concat": "^1.0.0"
- }
- },
"node_modules/source-map-js": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
@@ -6214,15 +5733,6 @@
"node": ">= 0.4"
}
},
- "node_modules/string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "license": "MIT",
- "dependencies": {
- "safe-buffer": "~5.1.0"
- }
- },
"node_modules/string.prototype.matchall": {
"version": "4.0.12",
"resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz",
@@ -6501,51 +6011,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/tar-fs": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz",
- "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "chownr": "^1.1.1",
- "mkdirp-classic": "^0.5.2",
- "pump": "^3.0.0",
- "tar-stream": "^2.1.4"
- }
- },
- "node_modules/tar-stream": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
- "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "bl": "^4.0.3",
- "end-of-stream": "^1.4.1",
- "fs-constants": "^1.0.0",
- "inherits": "^2.0.3",
- "readable-stream": "^3.1.1"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/tar-stream/node_modules/readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
"node_modules/text-table": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@@ -6671,19 +6136,6 @@
"dev": true,
"license": "Apache-2.0"
},
- "node_modules/tunnel-agent": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
- "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",
- "dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "safe-buffer": "^5.0.1"
- },
- "engines": {
- "node": "*"
- }
- },
"node_modules/type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
@@ -6878,6 +6330,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
+ "dev": true,
"license": "MIT"
},
"node_modules/vite": {
diff --git a/package.json b/package.json
index 89f2e82..d080c1f 100644
--- a/package.json
+++ b/package.json
@@ -14,9 +14,7 @@
"dependencies": {
"@vercel/analytics": "^2.0.1",
"@zip.js/zip.js": "^2.8.26",
- "browser-fs-access": "^0.35.0",
"client-zip": "^2.5.0",
- "jszip": "^3.10.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sql.js": "^1.10.3",
@@ -28,9 +26,7 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
- "adm-zip": "^0.5.16",
"autoprefixer": "^10.4.19",
- "better-sqlite3": "^12.6.2",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
diff --git a/src/components/backup/BookCard.jsx b/src/components/backup/BookCard.jsx
deleted file mode 100644
index 80f451c..0000000
--- a/src/components/backup/BookCard.jsx
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * Book card - displays individual book with cover, title, author, and progress
- */
-
-import PropTypes from 'prop-types';
-import { Icon } from '../common/Icon.jsx';
-import { ProgressBar } from '../common/ProgressBar.jsx';
-
-export function BookCard({ book, variant = 'default' }) {
- const { title, author, progress = 0, coverUrl } = book;
-
- if (variant === 'compact') {
- return (
-
- {/* Book Cover */}
-
- {coverUrl ? (
-

- ) : (
-
- )}
-
-
- {/* Book Info */}
-
-
- {title}
-
-
{author}
-
- {/* Progress */}
- {progress > 0 && (
-
-
-
- {Math.round(progress)}%
-
-
- )}
-
-
- );
- }
-
- return (
-
- {/* Book Cover */}
-
- {coverUrl ? (
-

- ) : (
-
- )}
-
-
- {/* Book Info */}
-
-
- {title}
-
-
{author}
-
- {/* Progress Bar */}
- {progress > 0 && (
-
-
- Reading Progress
-
- {Math.round(progress)}%
-
-
-
-
- )}
-
- {progress === 0 && (
-
-
- Not started
-
- )}
-
- {progress === 100 && (
-
-
- Finished
-
- )}
-
-
- );
-}
-
-BookCard.propTypes = {
- book: PropTypes.shape({
- title: PropTypes.string.isRequired,
- author: PropTypes.string,
- progress: PropTypes.number,
- coverUrl: PropTypes.string,
- }).isRequired,
- variant: PropTypes.oneOf(['default', 'compact']),
-};
diff --git a/src/components/backup/BookList.jsx b/src/components/backup/BookList.jsx
deleted file mode 100644
index 34ca83f..0000000
--- a/src/components/backup/BookList.jsx
+++ /dev/null
@@ -1,226 +0,0 @@
-/**
- * Book list - displays grid of books with search and filter
- */
-
-import { useState, useMemo } from 'react';
-import PropTypes from 'prop-types';
-import { BookCard } from './BookCard.jsx';
-import { Icon } from '../common/Icon.jsx';
-import { Button } from '../common/Button.jsx';
-
-export function BookList({ books, maxDisplay = 6, showSearch = false }) {
- const [searchQuery, setSearchQuery] = useState('');
- const [filterStatus, setFilterStatus] = useState('all'); // all, reading, finished, unread
- const [currentPage, setCurrentPage] = useState(1);
- const itemsPerPage = 12;
-
- // Filter and search books
- const filteredBooks = useMemo(() => {
- let filtered = [...books];
-
- // Apply search filter
- if (searchQuery) {
- const query = searchQuery.toLowerCase();
- filtered = filtered.filter(
- (book) =>
- book.title.toLowerCase().includes(query) ||
- (book.author && book.author.toLowerCase().includes(query))
- );
- }
-
- // Apply status filter
- if (filterStatus === 'reading') {
- filtered = filtered.filter((book) => book.progress > 0 && book.progress < 100);
- } else if (filterStatus === 'finished') {
- filtered = filtered.filter((book) => book.progress === 100);
- } else if (filterStatus === 'unread') {
- filtered = filtered.filter((book) => !book.progress || book.progress === 0);
- }
-
- return filtered;
- }, [books, searchQuery, filterStatus]);
-
- // Paginate books
- const totalPages = Math.ceil(filteredBooks.length / itemsPerPage);
- const paginatedBooks = filteredBooks.slice(
- (currentPage - 1) * itemsPerPage,
- currentPage * itemsPerPage
- );
-
- // For limited display (e.g., in preview)
- const displayBooks = maxDisplay ? filteredBooks.slice(0, maxDisplay) : paginatedBooks;
-
- if (books.length === 0) {
- return (
-
- );
- }
-
- return (
-
- {/* Search and Filter */}
- {showSearch && (
-
- {/* Search Input */}
-
- {
- setSearchQuery(e.target.value);
- setCurrentPage(1); // Reset to first page on search
- }}
- className="w-full px-4 py-3 pl-10 bg-white border-2 border-kobo-cream-dark rounded-lg focus:outline-none focus:border-kobo-accent transition-colors"
- />
-
-
-
- {/* Filter Buttons */}
-
- {
- setFilterStatus('all');
- setCurrentPage(1);
- }}
- >
- All ({books.length})
-
- {
- setFilterStatus('reading');
- setCurrentPage(1);
- }}
- >
- Reading ({books.filter((b) => b.progress > 0 && b.progress < 100).length})
-
- {
- setFilterStatus('finished');
- setCurrentPage(1);
- }}
- >
- Finished ({books.filter((b) => b.progress === 100).length})
-
- {
- setFilterStatus('unread');
- setCurrentPage(1);
- }}
- >
- Unread ({books.filter((b) => !b.progress || b.progress === 0).length})
-
-
-
- )}
-
- {/* Results Count */}
- {filteredBooks.length > 0 && (
-
- Showing {displayBooks.length} of {filteredBooks.length} book
- {filteredBooks.length !== 1 ? 's' : ''}
-
- )}
-
- {/* Books Grid */}
- {filteredBooks.length === 0 ? (
-
-
No books match your search
-
- ) : (
-
- {displayBooks.map((book, index) => (
-
- ))}
-
- )}
-
- {/* Pagination */}
- {!maxDisplay && totalPages > 1 && (
-
-
-
-
- {Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => (
-
- ))}
-
-
-
-
- )}
-
- );
-}
-
-function FilterButton({ active, onClick, children }) {
- return (
-
- );
-}
-
-FilterButton.propTypes = {
- active: PropTypes.bool,
- onClick: PropTypes.func.isRequired,
- children: PropTypes.node.isRequired,
-};
-
-BookList.propTypes = {
- books: PropTypes.arrayOf(
- PropTypes.shape({
- id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
- title: PropTypes.string.isRequired,
- author: PropTypes.string,
- progress: PropTypes.number,
- coverUrl: PropTypes.string,
- })
- ).isRequired,
- maxDisplay: PropTypes.number,
- showSearch: PropTypes.bool,
-};
diff --git a/src/stores/koboStore.js b/src/stores/koboStore.js
index a99a29f..c0f6db1 100644
--- a/src/stores/koboStore.js
+++ b/src/stores/koboStore.js
@@ -18,15 +18,6 @@ export const useKoboStore = create(
// Backup history (persisted to localStorage)
backups: [],
- // User settings
- settings: {
- theme: 'light',
- language: 'en',
- includeAnnotationsByDefault: true,
- includeProgressByDefault: true,
- includeSettingsByDefault: false,
- },
-
// UI state
currentPage: 'home',
@@ -57,11 +48,6 @@ export const useKoboStore = create(
backups: state.backups.filter((b) => b.id !== id),
})),
- updateSettings: (newSettings) =>
- set((state) => ({
- settings: { ...state.settings, ...newSettings },
- })),
-
setCurrentPage: (page) => set({ currentPage: page }),
clearDevice: () =>
@@ -85,10 +71,9 @@ export const useKoboStore = create(
}),
{
name: 'kobo-backup-storage',
- // Only persist backups and settings, not device data
+ // Only persist backups, not device data
partialize: (state) => ({
backups: state.backups,
- settings: state.settings,
}),
}
)
diff --git a/src/utils/fileSystem.js b/src/utils/fileSystem.js
index 3c78616..18aa3f3 100644
--- a/src/utils/fileSystem.js
+++ b/src/utils/fileSystem.js
@@ -3,7 +3,6 @@
* Wraps browser File System Access API with fallbacks
*/
-import { directoryOpen, fileSave } from 'browser-fs-access';
import { FileSystemError, ERROR_CODES } from './errors.js';
/**
@@ -12,23 +11,18 @@ import { FileSystemError, ERROR_CODES } from './errors.js';
* @returns {Promise} Directory handle
*/
export async function selectDirectory(options = {}) {
+ if (!('showDirectoryPicker' in window)) {
+ throw new FileSystemError(
+ 'This browser does not support the File System Access API',
+ ERROR_CODES.FS_NOT_SUPPORTED
+ );
+ }
try {
- if ('showDirectoryPicker' in window) {
- // Modern File System Access API
- const dirHandle = await window.showDirectoryPicker({
- mode: 'read',
- startIn: 'desktop',
- ...options,
- });
- return dirHandle;
- } else {
- // Fallback using browser-fs-access
- const dirHandle = await directoryOpen({
- mode: 'read',
- ...options,
- });
- return dirHandle;
- }
+ return await window.showDirectoryPicker({
+ mode: 'read',
+ startIn: 'desktop',
+ ...options,
+ });
} catch (error) {
if (error.name === 'AbortError') {
return null; // User cancelled
@@ -71,66 +65,6 @@ export async function readFile(fileHandle) {
}
}
-/**
- * Read a file as text
- * @param {FileSystemFileHandle} fileHandle - File handle to read
- * @returns {Promise} File contents as text
- */
-export async function readFileAsText(fileHandle) {
- try {
- const file = await fileHandle.getFile();
- const text = await file.text();
- return text;
- } catch (error) {
- throw new FileSystemError(
- 'Failed to read file as text',
- ERROR_CODES.FS_READ_ERROR,
- { filename: fileHandle.name, originalError: error }
- );
- }
-}
-
-/**
- * Read a file as Blob
- * @param {FileSystemFileHandle} fileHandle - File handle to read
- * @returns {Promise} File contents as Blob
- */
-export async function readFileAsBlob(fileHandle) {
- try {
- const file = await fileHandle.getFile();
- return file;
- } catch (error) {
- throw new FileSystemError(
- 'Failed to read file as blob',
- ERROR_CODES.FS_READ_ERROR,
- { filename: fileHandle.name, originalError: error }
- );
- }
-}
-
-/**
- * Get file metadata (size, modified date, etc.)
- * @param {FileSystemFileHandle} fileHandle - File handle
- * @returns {Promise<{name: string, size: number, lastModified: Date}>} File metadata
- */
-export async function getFileMetadata(fileHandle) {
- try {
- const file = await fileHandle.getFile();
- return {
- name: file.name,
- size: file.size,
- lastModified: new Date(file.lastModified),
- type: file.type,
- };
- } catch (error) {
- throw new FileSystemError(
- 'Failed to get file metadata',
- ERROR_CODES.FS_READ_ERROR,
- { filename: fileHandle.name, originalError: error }
- );
- }
-}
-
/**
* Save a file to the user's system
* @param {Blob} blob - Blob to save
@@ -340,11 +274,3 @@ export async function writeFileToPath(rootHandle, filePath, data) {
);
}
}
-
-/**
- * Check if File System Access API is supported
- * @returns {boolean} True if supported
- */
-export function isFileSystemAccessSupported() {
- return 'showDirectoryPicker' in window || typeof directoryOpen === 'function';
-}
diff --git a/src/utils/koboDatabase.js b/src/utils/koboDatabase.js
index 2170748..43a67cb 100644
--- a/src/utils/koboDatabase.js
+++ b/src/utils/koboDatabase.js
@@ -342,37 +342,6 @@ export class KoboDatabase {
}
}
- /**
- * Get books in a specific collection
- * @param {string} collectionId - Collection ID
- * @returns {Promise>} Array of ContentIDs
- */
- async getBooksInCollection(collectionId) {
- await this.ready;
-
- try {
- const query = `
- SELECT ContentId
- FROM ShelfContent
- WHERE ShelfName = ?
- `;
-
- const stmt = this.db.prepare(query);
- stmt.bind([collectionId]);
-
- const contentIds = [];
- while (stmt.step()) {
- const row = stmt.getAsObject();
- contentIds.push(row.ContentId);
- }
- stmt.free();
-
- return contentIds;
- } catch (error) {
- return [];
- }
- }
-
/**
* Close the database connection
*/
diff --git a/src/utils/realBackup.test.js b/src/utils/realBackup.test.js
index 72ce9b7..0486ad8 100644
--- a/src/utils/realBackup.test.js
+++ b/src/utils/realBackup.test.js
@@ -2,7 +2,7 @@
* Integration tests against the user's two REAL Kobo backups + an in-memory
* File System Access mock so restore.js / fileSystem.js run end-to-end in node.
*
- * Real fixtures (not committed, ~650 MB each):
+ * Real fixtures (not committed, ~650 MB each) live in ./fixtures or $KOBUP_FIXTURES_DIR:
* - kobo_backup_2026-01-11.zip → OLD flat format (books/title.kepub.epub)
* - kobo_backup_2026-02-23.zip → NEW nested format (books/Author/title.kepub.epub)
* If a fixture is missing the corresponding tests skip (CI has no fixtures),
@@ -15,6 +15,7 @@
import { describe, it, expect, beforeAll, afterAll, vi } from 'vitest';
import { openAsBlob, existsSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
+import { join } from 'node:path';
import {
ZipWriter, BlobWriter, TextReader, Uint8ArrayReader,
ZipReader, BlobReader, TextWriter,
@@ -33,8 +34,9 @@ const { openDatabase } = await import('./koboDatabase.js');
const { exportToAnkiCsv, exportToObsidianZip, generateObsidianMarkdown } = await import('./export.js');
const initSqlJs = (await import('sql.js')).default;
-const ZIP_OLD = fileURLToPath(new URL('../../kobo_backup_2026-01-11.zip', import.meta.url));
-const ZIP_NEW = fileURLToPath(new URL('../../kobo_backup_2026-02-23.zip', import.meta.url));
+const FIXTURES = process.env.KOBUP_FIXTURES_DIR || fileURLToPath(new URL('../../fixtures/', import.meta.url));
+const ZIP_OLD = join(FIXTURES, 'kobo_backup_2026-01-11.zip');
+const ZIP_NEW = join(FIXTURES, 'kobo_backup_2026-02-23.zip');
const haveOld = existsSync(ZIP_OLD);
const haveNew = existsSync(ZIP_NEW);
diff --git a/src/utils/restore.js b/src/utils/restore.js
index 1cc42ab..c1142f3 100644
--- a/src/utils/restore.js
+++ b/src/utils/restore.js
@@ -422,41 +422,6 @@ export function previewBackup(backupData) {
};
}
-export async function extractAnnotations(backupData) {
- let zipReader;
- try {
- // Check if annotations folder exists
- zipReader = new ZipReader(new BlobReader(backupData.file));
- const entries = await zipReader.getEntries();
- const annotationsEntry = entries.find(e => e.filename === 'annotations/all-annotations.md');
-
- if (annotationsEntry) {
- const markdown = await annotationsEntry.getData(new TextWriter());
- return {
- format: 'markdown',
- content: markdown,
- };
- }
-
- // If no pre-exported annotations, would need to parse database
- // For now, return empty
- return {
- format: 'none',
- content: '',
- };
- } catch (error) {
- return {
- format: 'none',
- content: '',
- error: error.message,
- };
- } finally {
- if (zipReader) {
- await zipReader.close();
- }
- }
-}
-
/**
* Validate restore target device
* @param {FileSystemDirectoryHandle} deviceHandle - Device directory handle
diff --git a/src/utils/validation.js b/src/utils/validation.js
index fafe350..dddfd6f 100644
--- a/src/utils/validation.js
+++ b/src/utils/validation.js
@@ -106,85 +106,6 @@ export function validateBackupMetadata(metadata) {
return { valid: true };
}
-/**
- * Sanitize filename for safe download
- * @param {string} filename - Original filename
- * @returns {string} Sanitized filename
- */
-export function sanitizeFilename(filename) {
- if (!filename) return 'backup.zip';
-
- return filename
- .replace(/[^a-z0-9_\-\.]/gi, '_') // Replace invalid chars with underscore
- .replace(/_{2,}/g, '_') // Replace multiple underscores with single
- .replace(/^_|_$/g, '') // Remove leading/trailing underscores
- .toLowerCase();
-}
-
-/**
- * Validate book data structure
- * @param {object} book - Book object to validate
- * @returns {boolean} True if valid book structure
- */
-export function isValidBook(book) {
- if (!book || typeof book !== 'object') return false;
-
- // Check required fields
- const requiredFields = ['ContentID', 'Title'];
- for (const field of requiredFields) {
- if (!(field in book)) return false;
- }
-
- return true;
-}
-
-/**
- * Validate annotation data structure
- * @param {object} annotation - Annotation object to validate
- * @returns {boolean} True if valid annotation structure
- */
-export function isValidAnnotation(annotation) {
- if (!annotation || typeof annotation !== 'object') return false;
-
- // Must have either highlighted text or note
- if (!annotation.Text && !annotation.Annotation) return false;
-
- return true;
-}
-
-/**
- * Check if browser supports required features
- * @returns {{supported: boolean, missing: string[]}} Support check result
- */
-export function checkBrowserSupport() {
- const missing = [];
-
- // Check File System Access API
- if (!('showDirectoryPicker' in window)) {
- missing.push('File System Access API');
- }
-
- // Check FileReader API
- if (!('FileReader' in window)) {
- missing.push('FileReader API');
- }
-
- // Check WebAssembly
- if (typeof WebAssembly === 'undefined') {
- missing.push('WebAssembly');
- }
-
- // Check Blob
- if (typeof Blob === 'undefined') {
- missing.push('Blob API');
- }
-
- return {
- supported: missing.length === 0,
- missing,
- };
-}
-
/**
* Validate file extension
* @param {string} filename - Filename to check
From 138dcab1043058da7c62b7d3caa280d503c7c084 Mon Sep 17 00:00:00 2001
From: Fanfulla <224395883+Fanfulla@users.noreply.github.com>
Date: Sun, 27 Sep 2026 20:17:44 +0200
Subject: [PATCH 2/8] build: upgrade toolchain and migrate core to TypeScript
- React 19, Vite 8 (Rolldown/Oxc), Vitest 5, Tailwind 4 (CSS-first config),
Zustand 5, ESLint 10 flat config + typescript-eslint + react-hooks 7 +
jsx-a11y, Prettier config, GitHub Actions CI (typecheck/lint/format/test/build)
- utils, hooks, store and tests rewritten in strict TypeScript with shared
domain types; common UI components (Button, Modal on native