Skip to content

feat: implement Storage Plugin with multi-backend support - #27

Merged
prosdev merged 1 commit into
mainfrom
feature/storage-plugin
Dec 17, 2025
Merged

prosdev merged 1 commit into
mainfrom
feature/storage-plugin

Conversation

@prosdev

@prosdev prosdev commented Dec 17, 2025

Copy link
Copy Markdown
Collaborator

📋 Task

Implements Task #1: Storage Plugin from Phase 2 (#16)

✨ Features

  • 4 Storage Backends:

    • localStorage - Persistent storage
    • sessionStorage - Session-scoped storage
    • cookie - Browser cookies with full options (domain, path, secure, sameSite)
    • memory - In-memory fallback
  • TTL/Expiration: Automatic expiration of stored values

  • Namespace Isolation: Prevent key collisions in multi-tenant apps

  • JSON Serialization: Store any JSON-serializable value

  • Automatic Fallback: Gracefully falls back to memory when storage unavailable

  • Type-Safe: Full TypeScript support with generics

🧪 Testing

  • 32 unit tests - All passing ✅
  • Tests cover all backends, TTL, namespaces, events, and error handling
  • Mocked console warnings for clean test output

📚 Documentation

  • Comprehensive README with examples
  • API reference for all methods
  • Usage examples for common scenarios

🔗 Related

- Add universal storage abstraction with 4 backends:
  - localStorage (persistent)
  - sessionStorage (session-scoped)
  - cookie (with full options support)
  - memory (fallback)
- Implement TTL/expiration support
- Add namespace isolation for multi-tenant apps
- JSON serialization for all value types
- Automatic fallback when storage unavailable
- Comprehensive unit tests (32 tests, all passing)
- Full documentation in README

Closes #16
@prosdev
prosdev merged commit 64ee5d3 into main Dec 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Storage Plugin

2 participants