**refactor: improve FileSystemStorage compatibility and remove outdated test**

- Modified `storageFactory` to ensure `FileSystemStorage` gracefully degrades to `MemoryStorage` in browser environments, with proper warnings added.
- Enhanced `opfsStorage` adapter to support recursive directory removal with the `recursive` option.
- Removed `test-fix.js` script, as it is no longer relevant with recent storage fixes and updates.

**Purpose**: Streamline and ensure cross-environment compatibility for `FileSystemStorage`, while removing outdated test artifacts for better maintainability.
This commit is contained in:
David Snelling 2025-07-30 11:25:36 -07:00
parent 116d6cea79
commit db67ccd34f
3 changed files with 17 additions and 24 deletions

View file

@ -632,7 +632,8 @@ export class OPFSStorage extends BaseStorage {
): Promise<void> => {
try {
for await (const [name, handle] of dirHandle.entries()) {
await dirHandle.removeEntry(name)
// Use recursive option to handle directories that may contain files
await dirHandle.removeEntry(name, { recursive: true })
}
} catch (error) {
console.error(`Error removing directory contents:`, error)