strata-storage 2.0.4 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Readme.md CHANGED
@@ -2,14 +2,64 @@
2
2
 
3
3
  ## 📚 Documentation
4
4
 
5
- - **[Getting Started](./docs/getting-started/installation.md)** - Installation and setup
5
+ ### Getting Started
6
+ - **[Installation](./docs/getting-started/installation.md)** - Installation and setup
6
7
  - **[Quick Start Guide](./docs/getting-started/quick-start.md)** - Get running in minutes
7
- - **[API Reference](./docs/api/README.md)** - Complete API documentation
8
8
  - **[Configuration](./docs/getting-started/configuration.md)** - Configuration options
9
- - **[Platform Guides](./docs/guides/platforms/web.md)** - Platform-specific guides
10
- - **[Examples](./docs/examples/README.md)** - Code examples and recipes
9
+
10
+ ### Core Documentation
11
+ - **[API Reference](./docs/api/README.md)** - Complete API documentation
12
+ - **[Core API](./docs/api/core/strata.md)** - Main Strata class
13
+ - **[Type Definitions](./docs/api/core/types.md)** - TypeScript types
14
+ - **[Error Handling](./docs/api/core/errors.md)** - Error types and handling
15
+
16
+ ### Storage Adapters
17
+ - **[Web Adapters](./docs/api/adapters/README.md#web-adapters)** - Browser storage
18
+ - [localStorage](./docs/api/adapters/web/localstorage.md)
19
+ - [sessionStorage](./docs/api/adapters/web/sessionstorage.md)
20
+ - [IndexedDB](./docs/api/adapters/web/indexeddb.md)
21
+ - [Cookies](./docs/api/adapters/web/cookies.md)
22
+ - [Cache API](./docs/api/adapters/web/cache.md)
23
+ - [Memory](./docs/api/adapters/web/memory.md)
24
+ - **[Capacitor Adapters](./docs/api/adapters/README.md#capacitor-adapters)** - Native storage
25
+ - [Preferences](./docs/api/adapters/capacitor/preferences.md)
26
+ - [Secure Storage](./docs/api/adapters/capacitor/secure.md)
27
+ - [SQLite](./docs/api/adapters/capacitor/sqlite.md)
28
+ - [Filesystem](./docs/api/adapters/capacitor/filesystem.md)
29
+
30
+ ### Advanced Features
31
+ - **[Encryption](./docs/guides/features/encryption.md)** - Data encryption guide
32
+ - **[Compression](./docs/guides/features/compression.md)** - Data compression
33
+ - **[TTL Management](./docs/api/features/ttl.md)** - Auto-expiration
34
+ - **[Cross-Tab Sync](./docs/guides/features/sync.md)** - Real-time synchronization
35
+ - **[Query Engine](./docs/guides/features/queries.md)** - MongoDB-like queries
36
+ - **[Migrations](./docs/guides/features/migrations.md)** - Data migration system
37
+
38
+ ### Platform Guides
39
+ - **[Web Platform](./docs/guides/platforms/web.md)** - Browser-specific features
40
+ - **[iOS Platform](./docs/guides/platforms/ios.md)** - iOS implementation
41
+ - **[Android Platform](./docs/guides/platforms/android.md)** - Android implementation
42
+ - **[Capacitor](./docs/guides/platforms/capacitor.md)** - Capacitor integration
43
+
44
+ ### Common Patterns
45
+ - **[Caching Strategies](./docs/guides/patterns/caching.md)** - Caching best practices
46
+ - **[Session Management](./docs/guides/patterns/sessions.md)** - User session handling
47
+
48
+ ### Examples
49
+ - **[Basic Usage](./docs/examples/basic-usage.md)** - Simple examples
50
+ - **[React Integration](./docs/examples/frameworks/react.md)** - React hooks and providers
51
+ - **[Vue Integration](./docs/examples/frameworks/vue.md)** - Vue composables
52
+ - **[Angular Integration](./docs/examples/frameworks/angular.md)** - Angular services
53
+ - **[Authentication](./docs/examples/user-auth.md)** - User authentication
54
+ - **[Shopping Cart](./docs/examples/shopping-cart.md)** - E-commerce example
55
+ - **[Form Persistence](./docs/examples/form-persistence.md)** - Form data saving
56
+ - **[Offline Support](./docs/examples/offline-support.md)** - Offline-first apps
57
+ - **[All Examples](./docs/examples/README.md)** - Complete examples list
58
+
59
+ ### Resources
11
60
  - **[GitHub](https://github.com/aoneahsan/strata-storage)** - Source code
12
61
  - **[NPM](https://www.npmjs.com/package/strata-storage)** - Package registry
62
+ - **[Example App](./examples/react-capacitor-app)** - Full demo application
13
63
 
14
64
  ---
15
65
 
@@ -108,13 +158,13 @@ await storage.set('data', value, { storage: 'firestore' });
108
158
  - ✅ **Filesystem** - File-based storage
109
159
 
110
160
  ### Advanced Features
111
- - ✅ **Encryption** - AES-GCM encryption with Web Crypto API
112
- - ✅ **Compression** - LZ-string compression algorithm
113
- - ✅ **Cross-Tab Sync** - Real-time synchronization across tabs
114
- - ✅ **Query Engine** - MongoDB-like queries for filtering data
115
- - ✅ **TTL Support** - Automatic expiration with sliding TTL
116
- - ✅ **Migration System** - Version-based data migrations
117
- - 🚧 **Framework Integrations** - React, Vue, Angular (coming soon)
161
+ - ✅ **[Encryption](./docs/guides/features/encryption.md)** - AES-GCM encryption with Web Crypto API
162
+ - ✅ **[Compression](./docs/guides/features/compression.md)** - LZ-string compression algorithm
163
+ - ✅ **[Cross-Tab Sync](./docs/guides/features/sync.md)** - Real-time synchronization across tabs
164
+ - ✅ **[Query Engine](./docs/guides/features/queries.md)** - MongoDB-like queries for filtering data
165
+ - ✅ **[TTL Support](./docs/api/features/ttl.md)** - Automatic expiration with sliding TTL
166
+ - ✅ **[Migration System](./docs/guides/features/migrations.md)** - Version-based data migrations
167
+ - **Framework Integrations** - [React](./docs/examples/frameworks/react.md), [Vue](./docs/examples/frameworks/vue.md), [Angular](./docs/examples/frameworks/angular.md)
118
168
 
119
169
  ## 📖 Basic Usage
120
170
 
@@ -135,40 +185,72 @@ await storage.set('key', value, {
135
185
  ttl: 3600000, // Expire in 1 hour
136
186
  encrypt: true, // Encrypt this value
137
187
  compress: true, // Compress if beneficial
138
- tags: ['user-data'] // Tag for grouping
188
+ tags: ['user-data'], // Tag for grouping
189
+ metadata: { // Attach metadata
190
+ version: 1,
191
+ source: 'api'
192
+ }
139
193
  });
140
194
 
141
- // Query data
195
+ // Query data with MongoDB-like syntax
142
196
  const results = await storage.query({
143
197
  tags: { $in: ['user-data'] },
144
- 'value.age': { $gte: 18 }
198
+ 'value.age': { $gte: 18 },
199
+ 'metadata.version': 1
145
200
  });
146
201
 
147
202
  // Subscribe to changes
148
203
  storage.subscribe((change) => {
149
204
  console.log(`${change.key} changed from ${change.oldValue} to ${change.newValue}`);
150
205
  });
206
+
207
+ // Check storage size
208
+ const size = await storage.size();
209
+ console.log(`Using ${size.total} bytes for ${size.count} items`);
151
210
  ```
152
211
 
153
- ## 🎯 Provider-less Architecture
212
+ ## 🎯 Why Strata Storage?
213
+
214
+ ### Provider-less Architecture
215
+ Like Zustand, Strata Storage works without providers, contexts, or wrappers. Just import and use - no setup required.
216
+
217
+ ### Zero Dependencies
218
+ Truly zero runtime dependencies. Everything is implemented from scratch for maximum control and minimal bundle size.
219
+
220
+ ### Universal Compatibility
221
+ - **One API** - Same code works on Web, iOS, and Android
222
+ - **Any Framework** - Works with React, Vue, Angular, or vanilla JavaScript
223
+ - **TypeScript First** - Full type safety and excellent IntelliSense
224
+ - **Tree-Shakeable** - Only bundle what you use
154
225
 
155
- Strata Storage follows a provider-less architecture similar to Zustand. The core library works everywhere with zero dependencies, and platform-specific features (like Capacitor) are completely optional.
226
+ ### Intelligent Storage Selection
227
+ Automatically selects the best available storage based on:
228
+ - Platform capabilities
229
+ - Data size and type
230
+ - Performance requirements
231
+ - Persistence needs
156
232
 
157
- - **Minimal by default** - Only includes web storage adapters
158
- - **Opt-in native features** - Explicitly add Capacitor support when needed
159
- - **Better tree-shaking** - Unused adapters are eliminated by bundlers
160
- - **Smaller bundle size** - Web-only projects don't include native code
233
+ ### Enterprise Ready
234
+ - **Encryption** - Built-in AES-GCM encryption
235
+ - **Compression** - Automatic data compression
236
+ - **TTL/Expiration** - Auto-cleanup of expired data
237
+ - **Sync** - Real-time cross-tab/device synchronization
238
+ - **Migrations** - Version-based data migrations
239
+ - **Querying** - MongoDB-like query engine
161
240
 
162
241
  ## 🏗 Project Status
163
242
 
164
- Currently in active development. Phase 1-5 completed:
165
- - ✅ Project setup and core architecture
166
- - ✅ Memory and web storage adapters
167
- - ✅ Capacitor plugin structure (now optional)
243
+ **Production Ready** - All major features implemented:
244
+ - ✅ Zero-dependency architecture
245
+ - ✅ Provider-less design (like Zustand)
246
+ - ✅ All web storage adapters (localStorage, IndexedDB, etc.)
247
+ - ✅ Complete Capacitor integration (iOS/Android)
248
+ - ✅ Native implementations (iOS Swift, Android Java)
168
249
  - ✅ Advanced features (encryption, compression, sync, query, TTL)
169
- - ✅ Provider-less architecture
170
- - 🚧 Native implementations (iOS/Android)
171
- - 🚧 Testing and documentation
250
+ - ✅ Framework integrations (React, Vue, Angular)
251
+ - Comprehensive documentation
252
+ - Full TypeScript support
253
+ - ✅ Example application with all features
172
254
 
173
255
  ## 📄 License
174
256
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strata-storage",
3
- "version": "2.0.4",
3
+ "version": "2.1.0",
4
4
  "description": "Zero-dependency universal storage plugin providing a unified API for all storage operations across web, Android, and iOS platforms",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strata-storage",
3
- "version": "2.0.4",
3
+ "version": "2.1.0",
4
4
  "description": "Zero-dependency universal storage plugin providing a unified API for all storage operations across web, Android, and iOS platforms",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",