Skip to content

Releases: ckep1/onefs

v0.6.2

04 Mar 01:24

Choose a tag to compare

Performance

  • Parallel file reads in openFile across all adapters — multiple selected files load concurrently via Promise.all
  • Batched stat calls in Tauri readDirectory and scanDirectory — chunks of 25 via Promise.all instead of sequential native bridge calls
  • Scan mutex on Tauri and Capacitor — serializes concurrent scanDirectory calls to prevent native bridge contention
  • IDB prune batching — all excess entries deleted in a single transaction instead of individual deletes
  • IDB prune buffer — pruning only triggers when count exceeds threshold by 5, avoiding prune on every store
  • Deferred IDB persistence — openFile/saveFile return immediately, IDB writes happen in background via storeFileDeferred
  • Parallel file reads and copies in Capacitor file picker
  • Faster base64 encoding — native Buffer fast path for Node/Bun, increased chunk size (32KB) for browser fallback

Fixed

  • Tauri readDirectory preserves native entry ordering (files and directories interleaved) instead of grouping by type

v0.6.1

04 Mar 01:15

Choose a tag to compare

Added

  • deleteFile(file) — delete files on web-fs-access, Tauri, and Capacitor
  • renameFile(file, newName) — rename files on web-fs-access, Tauri, and Capacitor
  • deleteFile and renameFile capability flags in OneFSCapabilities
  • FileSystemFileHandle.remove() and .move() type declarations for web-fs-access
  • FileSystemDirectoryHandle.removeEntry() type declaration
  • 87 unit tests covering utilities, IDB storage, adapter selection, and facade methods

Security

  • Tauri deleteFile/renameFile now verify the file was opened through the adapter (IDB lookup) before allowing destructive operations
  • Web-fs-access deleteFile/renameFile request readwrite permission before operating, matching the saveFile pattern

v0.6.0

03 Mar 23:38

Choose a tag to compare

Security Hardening

  • Add path sanitization and validation across all adapters (sanitizeFileName, isPathWithin, normalizePath) to defend against path traversal when consuming code passes untrusted data into file/entry objects
  • Validate appName in IDB storage — reject empty strings and special characters
  • Add maxCacheSize (default 50MB) to IDB storage to cap cached file content
  • Replace generateId() with crypto.randomUUID()
  • Make getTauriFileUrl() internal — was unnecessarily exported as a public API
  • Sanitize download filenames in picker-idb adapter
  • Strip null bytes in filename sanitization

Breaking Changes

  • readAsJSON() now returns OneFSResult<T> instead of throwing SyntaxError
  • getEntryUrl() now returns Promise<OneFSResult<string>> instead of Promise<string | null>

Added

  • getFileUrl() exposed on OneFS facade with OneFSResult<string> return type
  • dispose() method on OneFS, all adapters, and IDBStorage for connection cleanup
  • onError callback in OneFSReadDirectoryOptions for stat error reporting
  • normalizePath, isPathWithin, sanitizeFileName, toArrayBuffer utility exports
  • FSAccessAdapter readDirectory now honors skipStats and onError options

Fixed

  • readDirectory options (skipStats, onError) now forwarded from facade to adapters
  • Capacitor picker default changed from 'audio/*' to '*/*' — was leftover from an audio app
  • Capacitor capabilities corrected: canSaveInPlacefalse, openDirectory/readDirectory'limited'
  • getFileName() now handles Windows-style backslash paths
  • content.buffer as ArrayBuffer replaced with toArrayBuffer() that correctly handles byteOffset for Uint8Array views
  • uint8ArrayToBase64 rewritten with chunked processing to avoid stack overflow on large files
  • Stale IDB cache on restore now returns errors instead of silently serving cached content
  • JSDoc corrected: scanDirectory and getEntryUrl available on Tauri and Capacitor
  • Added missing Vite externals for all 6 peer dependencies

v0.5.0

13 Dec 20:36

Choose a tag to compare

Added

  • OneFSScanOptions.onError callback for handling subdirectory scan errors (replaces console.error)
  • readFileFromDirectory() now supports maxBytes option for partial file reads
  • CapacitorAdapter: Partial reads use Range headers via convertFileSrc for efficient memory usage

Changed

  • scanDirectory() errors are now silent by default; use onError callback to handle them
  • Removed unused StoredFile import from CapacitorAdapter

Fixed

  • Added @capacitor/core to devDependencies for build consistency

v0.4.1

08 Dec 22:54

Choose a tag to compare

Fixed

  • CapacitorAdapter: Fixed file picker filter to allow non-audio files when using @capawesome/capacitor-file-picker
  • CapacitorAdapter: Added defensive checks for missing entry.name in readDirectory and scanDirectory

v0.4.0

08 Dec 22:44

Choose a tag to compare

Changed

  • TauriAdapter now only supports Tauri v2 (removed v1 detection)
  • Platform detection simplified to check only __TAURI_INTERNALS__
  • CapacitorAdapter now uses Documents directory (exposed in iOS Files app)
  • Capacitor capabilities upgraded: full directory support, in-place saves

Fixed

  • Added @tauri-apps/api as peer dependency for convertFileSrc support
  • Added defensive check for missing entry.name in directory scanning

Added

  • getTauriFileUrl(filePath) utility function for getting efficient asset URLs without loading files into memory
  • TauriAdapter.getFileUrl(file) method for getting asset URLs from OneFSFile objects
  • getEntryUrl(entry) method for getting streaming URLs from directory entries without loading content
  • scanDirectory(directory, options) for recursive directory scanning with:
    • extensions filter (e.g., ['.mp3', '.flac'])
    • onProgress callback for progress updates
    • signal for AbortController cancellation support
    • skipStats option for faster scanning
  • OneFSReadDirectoryOptions.skipStats option to skip stat() calls for faster scanning
  • Additional audio MIME types: FLAC, AAC, M4A, Opus, AIFF
  • New exported types: OneFSReadDirectoryOptions, OneFSScanOptions
  • CapacitorAdapter: scanDirectory() for recursive file scanning
  • CapacitorAdapter: getFileUrl() and getEntryUrl() using Capacitor.convertFileSrc()
  • CapacitorAdapter: Optional @capawesome/capacitor-file-picker support for proper native picker
  • CapacitorAdapter: Files copied to Documents on import for Files app visibility

v0.3.1

08 Dec 02:55

Choose a tag to compare

BREAKING CHANGES

This release renames all public APIs from FSBridge* to OneFS* for consistency with the package name.

Migration guide:

Old Name New Name
FSBridge OneFS
createFSBridge createOneFS
FSBridgeFile OneFSFile
FSBridgeDirectory OneFSDirectory
FSBridgeEntry OneFSEntry
FSBridgeResult OneFSResult
FSBridgeError OneFSError
FSBridgeErrorCode OneFSErrorCode
FSBridgeCapabilities OneFSCapabilities
FSBridgeConfig OneFSConfig
FSBridgeAdapter OneFSAdapter
FSBridgeOpenOptions OneFSOpenOptions
FSBridgeSaveOptions OneFSSaveOptions
FSBridgeDirectoryOptions OneFSDirectoryOptions

IndexedDB database name changed from fsbridge-{appName} to onefs-{appName}.
Capacitor synthetic paths changed from fsbridge_* to onefs_*.

v0.2.1

30 Nov 21:43

Choose a tag to compare

Full Changelog: v0.1.0...v0.2.1

v0.1.0

28 Nov 05:37

Choose a tag to compare

Initial release of OneFS. Made this because I was tired of setting up File System API and fallbacks for webapps and webview based native apps. Let me know if you encounter issues and enjoy! It will not be perfect at this stage.