Releases: ckep1/onefs
Releases · ckep1/onefs
v0.6.2
Performance
- Parallel file reads in
openFileacross all adapters — multiple selected files load concurrently viaPromise.all - Batched stat calls in Tauri
readDirectoryandscanDirectory— chunks of 25 viaPromise.allinstead of sequential native bridge calls - Scan mutex on Tauri and Capacitor — serializes concurrent
scanDirectorycalls 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/saveFilereturn immediately, IDB writes happen in background viastoreFileDeferred - Parallel file reads and copies in Capacitor file picker
- Faster base64 encoding — native
Bufferfast path for Node/Bun, increased chunk size (32KB) for browser fallback
Fixed
- Tauri
readDirectorypreserves native entry ordering (files and directories interleaved) instead of grouping by type
v0.6.1
Added
deleteFile(file)— delete files on web-fs-access, Tauri, and CapacitorrenameFile(file, newName)— rename files on web-fs-access, Tauri, and CapacitordeleteFileandrenameFilecapability flags inOneFSCapabilitiesFileSystemFileHandle.remove()and.move()type declarations for web-fs-accessFileSystemDirectoryHandle.removeEntry()type declaration- 87 unit tests covering utilities, IDB storage, adapter selection, and facade methods
Security
- Tauri
deleteFile/renameFilenow verify the file was opened through the adapter (IDB lookup) before allowing destructive operations - Web-fs-access
deleteFile/renameFilerequestreadwritepermission before operating, matching thesaveFilepattern
v0.6.0
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
appNamein IDB storage — reject empty strings and special characters - Add
maxCacheSize(default 50MB) to IDB storage to cap cached file content - Replace
generateId()withcrypto.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 returnsOneFSResult<T>instead of throwingSyntaxErrorgetEntryUrl()now returnsPromise<OneFSResult<string>>instead ofPromise<string | null>
Added
getFileUrl()exposed onOneFSfacade withOneFSResult<string>return typedispose()method onOneFS, all adapters, andIDBStoragefor connection cleanuponErrorcallback inOneFSReadDirectoryOptionsfor stat error reportingnormalizePath,isPathWithin,sanitizeFileName,toArrayBufferutility exports- FSAccessAdapter
readDirectorynow honorsskipStatsandonErroroptions
Fixed
readDirectoryoptions (skipStats,onError) now forwarded from facade to adapters- Capacitor picker default changed from
'audio/*'to'*/*'— was leftover from an audio app - Capacitor capabilities corrected:
canSaveInPlace→false,openDirectory/readDirectory→'limited' getFileName()now handles Windows-style backslash pathscontent.buffer as ArrayBufferreplaced withtoArrayBuffer()that correctly handlesbyteOffsetforUint8Arrayviewsuint8ArrayToBase64rewritten 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:
scanDirectoryandgetEntryUrlavailable on Tauri and Capacitor - Added missing Vite externals for all 6 peer dependencies
v0.5.0
Added
OneFSScanOptions.onErrorcallback for handling subdirectory scan errors (replaces console.error)readFileFromDirectory()now supportsmaxBytesoption for partial file reads- CapacitorAdapter: Partial reads use Range headers via
convertFileSrcfor efficient memory usage
Changed
scanDirectory()errors are now silent by default; useonErrorcallback to handle them- Removed unused
StoredFileimport from CapacitorAdapter
Fixed
- Added
@capacitor/coreto devDependencies for build consistency
v0.4.1
Fixed
- CapacitorAdapter: Fixed file picker filter to allow non-audio files when using
@capawesome/capacitor-file-picker - CapacitorAdapter: Added defensive checks for missing
entry.nameinreadDirectoryandscanDirectory
v0.4.0
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/apias peer dependency forconvertFileSrcsupport - Added defensive check for missing
entry.namein directory scanning
Added
getTauriFileUrl(filePath)utility function for getting efficient asset URLs without loading files into memoryTauriAdapter.getFileUrl(file)method for getting asset URLs from OneFSFile objectsgetEntryUrl(entry)method for getting streaming URLs from directory entries without loading contentscanDirectory(directory, options)for recursive directory scanning with:extensionsfilter (e.g.,['.mp3', '.flac'])onProgresscallback for progress updatessignalfor AbortController cancellation supportskipStatsoption for faster scanning
OneFSReadDirectoryOptions.skipStatsoption 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()andgetEntryUrl()usingCapacitor.convertFileSrc() - CapacitorAdapter: Optional
@capawesome/capacitor-file-pickersupport for proper native picker - CapacitorAdapter: Files copied to Documents on import for Files app visibility
v0.3.1
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
Full Changelog: v0.1.0...v0.2.1
v0.1.0
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.