strata-storage 2.8.0 → 2.8.1

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.
@@ -1,6 +1,6 @@
1
1
  # AI Integration Guide - strata-storage
2
2
 
3
- Quick reference for AI development agents (Claude Code, Cursor, Copilot, etc.) to integrate `strata-storage` into web and mobile projects. Current version: **2.7.1**.
3
+ Quick reference for AI development agents (Claude Code, Cursor, Copilot, etc.) to integrate `strata-storage` into web and mobile projects. Current version: **2.8.1**.
4
4
 
5
5
  ## Installation
6
6
 
@@ -209,9 +209,16 @@ const storage = defineStorage();
209
209
 
210
210
  ### Capacitor (native)
211
211
 
212
+ `strata-storage` ships as a Capacitor plugin (native iOS + Android). In a Capacitor
213
+ app, after installing run **`npx cap sync`** so the native module is copied into the
214
+ iOS/Android projects — the native adapters (`secure`, `sqlite`, `preferences`,
215
+ `filesystem`) **do not work on-device without it**. No manual plugin registration in
216
+ JS is needed; Capacitor auto-discovers the `StrataStorage` plugin.
217
+
212
218
  ```typescript
213
219
  import { defineStorage } from 'strata-storage';
214
220
  import {
221
+ registerCapacitorAdapters,
215
222
  PreferencesAdapter,
216
223
  SecureAdapter,
217
224
  SqliteAdapter,
@@ -219,10 +226,15 @@ import {
219
226
  } from 'strata-storage/capacitor';
220
227
 
221
228
  const storage = defineStorage();
222
- storage.registerAdapter(new PreferencesAdapter());
223
- storage.registerAdapter(new SecureAdapter());
224
- storage.registerAdapter(new SqliteAdapter()); // 2.6.0 — multi-store (database + table)
225
- storage.registerAdapter(new FilesystemAdapter()); // 2.6.0 — file-per-key, atomic writes
229
+
230
+ // Easiest — register all four native adapters at once (also refreshes the active set):
231
+ await registerCapacitorAdapters(storage);
232
+
233
+ // …or register individually for fine-grained control / custom adapter config:
234
+ // storage.registerAdapter(new SecureAdapter());
235
+ // storage.registerAdapter(new SqliteAdapter()); // 2.6.0 — multi-store (database + table)
236
+ // storage.registerAdapter(new FilesystemAdapter()); // 2.6.0 — file-per-key, atomic writes
237
+
226
238
  await storage.set('secret', token, { storage: 'secure' });
227
239
  ```
228
240
 
@@ -315,6 +327,8 @@ const storage = defineStorage({
315
327
  | Issue | Solution |
316
328
  |-------|----------|
317
329
  | Framework import fails | Ensure `strata-storage >= 2.5.0` (earlier versions never shipped the built entry points). |
330
+ | TS can't find types for `strata-storage/react` \| `/vue` \| `/angular` \| `/capacitor` \| `/firebase` | Set `"moduleResolution": "bundler"` (or `"nodenext"`) in `tsconfig.json`. The package is ESM-only and exposes typed `exports` subpaths; classic `"node"` resolution can't see them. Modern Vite / Angular / Vue templates already use `bundler`/`nodenext`. |
331
+ | Native adapters do nothing on device | Run `npx cap sync` after install so the native iOS/Android module is wired in, then register the Capacitor adapters (`registerCapacitorAdapters(storage)`). |
318
332
  | "does not support synchronous operations" | The targeted adapter is async-only; use the async API or a sync-capable adapter. |
319
333
  | Sync set throws on encrypt/compress | Encryption/compression are async — use `await storage.set(...)`. |
320
334
  | `useStrata must be used within <StrataProvider>` | Use `createStrataHooks(instance)` for provider-free code. |
@@ -334,6 +348,8 @@ Full documentation lives at **https://stratastorage-docs.aoneahsan.com**:
334
348
  - [Changelog](https://stratastorage-docs.aoneahsan.com/reference/changelog)
335
349
  - Machine-readable: [`/llms.txt`](https://stratastorage-docs.aoneahsan.com/llms.txt) · [`/llms-full.txt`](https://stratastorage-docs.aoneahsan.com/llms-full.txt)
336
350
 
351
+ Project: [npm](https://www.npmjs.com/package/strata-storage) · [GitHub](https://github.com/aoneahsan/strata-storage) · [Report an issue](https://github.com/aoneahsan/strata-storage/issues)
352
+
337
353
  ---
338
354
 
339
355
  Developed with ❤️ by the **Strata Storage Team** — maintained by [Ahsan Mahmood](https://aoneahsan.com). Questions or integration help: **aoneahsan@gmail.com**.
package/README.md CHANGED
@@ -390,11 +390,14 @@ const active = await storage.query({
390
390
 
391
391
  ### iOS and Android (via Capacitor)
392
392
 
393
+ Strata ships as a Capacitor plugin (native iOS + Android). In a Capacitor app, after `yarn add strata-storage` run **`npx cap sync`** so the native module is copied into your iOS/Android projects — the native adapters (`secure`, `sqlite`, `preferences`, `filesystem`) won't work on-device without it.
394
+
393
395
  Register the native adapters you need when running under Capacitor. All four are zero-runtime-dependency: SQLite is hand-rolled (no plugin dependency) and filesystem uses the platform's native `FileManager` / `java.io.File`.
394
396
 
395
397
  ```typescript
396
398
  import { defineStorage } from 'strata-storage';
397
399
  import {
400
+ registerCapacitorAdapters,
398
401
  PreferencesAdapter,
399
402
  SecureAdapter,
400
403
  SqliteAdapter,
@@ -402,10 +405,15 @@ import {
402
405
  } from 'strata-storage/capacitor';
403
406
 
404
407
  const storage = defineStorage();
405
- storage.registerAdapter(new PreferencesAdapter()); // UserDefaults / SharedPreferences
406
- storage.registerAdapter(new SecureAdapter()); // Keychain / EncryptedSharedPreferences
407
- storage.registerAdapter(new SqliteAdapter()); // native SQLite
408
- storage.registerAdapter(new FilesystemAdapter()); // native files
408
+
409
+ // Easiest: register all native adapters at once (also refreshes the active set).
410
+ await registerCapacitorAdapters(storage);
411
+
412
+ // …or register individually for fine-grained control / custom adapter config:
413
+ // storage.registerAdapter(new PreferencesAdapter()); // UserDefaults / SharedPreferences
414
+ // storage.registerAdapter(new SecureAdapter()); // Keychain / EncryptedSharedPreferences
415
+ // storage.registerAdapter(new SqliteAdapter()); // native SQLite
416
+ // storage.registerAdapter(new FilesystemAdapter()); // native files
409
417
 
410
418
  await storage.set('secret', token, { storage: 'secure' });
411
419
  ```
@@ -518,26 +526,18 @@ MIT License — see [LICENSE](LICENSE). Free for commercial and non-commercial u
518
526
  ## Links
519
527
 
520
528
  - **NPM Package:** https://www.npmjs.com/package/strata-storage
529
+ - **GitHub Repo:** https://github.com/aoneahsan/strata-storage
521
530
  - **Documentation:** https://stratastorage-docs.aoneahsan.com
522
531
  - **Website:** https://stratastorage.aoneahsan.com
523
532
 
524
533
  ## Support
525
534
 
526
- 1. Check the [FAQ](https://stratastorage-docs.aoneahsan.com/reference/faq) and [Troubleshooting](https://stratastorage-docs.aoneahsan.com/reference/troubleshooting)
527
- 2. Browse the [documentation](https://stratastorage-docs.aoneahsan.com)
528
- 3. [Contact us / report an issue](https://stratastorage.aoneahsan.com/contact)
535
+ - 🐛 **Found a bug or have a feature request?** [Open a GitHub issue](https://github.com/aoneahsan/strata-storage/issues).
536
+ - 📖 Read the [FAQ](https://stratastorage-docs.aoneahsan.com/reference/faq) and [Troubleshooting](https://stratastorage-docs.aoneahsan.com/reference/troubleshooting), or browse the full [documentation](https://stratastorage-docs.aoneahsan.com).
537
+ - 💬 Anything else? [Contact us](https://stratastorage.aoneahsan.com/contact).
529
538
 
530
539
  ---
531
540
 
532
541
  Developed with ❤️ by the **Strata Storage Team** — maintained by [Ahsan Mahmood](https://aoneahsan.com) · aoneahsan@gmail.com.
533
542
 
534
543
  **One API. Every Storage. Everywhere.**
535
-
536
- <!-- project-links:start -->
537
- ## Links
538
-
539
- - Live: https://www.npmjs.com/package/strata-storage
540
- - NPM: https://www.npmjs.com/package/strata-storage
541
-
542
- _URL source of truth: `01-code/projects/project-live-urls.json` (auto-generated — do not hand-edit between these markers)._
543
- <!-- project-links:end -->
package/dist/README.md CHANGED
@@ -390,11 +390,14 @@ const active = await storage.query({
390
390
 
391
391
  ### iOS and Android (via Capacitor)
392
392
 
393
+ Strata ships as a Capacitor plugin (native iOS + Android). In a Capacitor app, after `yarn add strata-storage` run **`npx cap sync`** so the native module is copied into your iOS/Android projects — the native adapters (`secure`, `sqlite`, `preferences`, `filesystem`) won't work on-device without it.
394
+
393
395
  Register the native adapters you need when running under Capacitor. All four are zero-runtime-dependency: SQLite is hand-rolled (no plugin dependency) and filesystem uses the platform's native `FileManager` / `java.io.File`.
394
396
 
395
397
  ```typescript
396
398
  import { defineStorage } from 'strata-storage';
397
399
  import {
400
+ registerCapacitorAdapters,
398
401
  PreferencesAdapter,
399
402
  SecureAdapter,
400
403
  SqliteAdapter,
@@ -402,10 +405,15 @@ import {
402
405
  } from 'strata-storage/capacitor';
403
406
 
404
407
  const storage = defineStorage();
405
- storage.registerAdapter(new PreferencesAdapter()); // UserDefaults / SharedPreferences
406
- storage.registerAdapter(new SecureAdapter()); // Keychain / EncryptedSharedPreferences
407
- storage.registerAdapter(new SqliteAdapter()); // native SQLite
408
- storage.registerAdapter(new FilesystemAdapter()); // native files
408
+
409
+ // Easiest: register all native adapters at once (also refreshes the active set).
410
+ await registerCapacitorAdapters(storage);
411
+
412
+ // …or register individually for fine-grained control / custom adapter config:
413
+ // storage.registerAdapter(new PreferencesAdapter()); // UserDefaults / SharedPreferences
414
+ // storage.registerAdapter(new SecureAdapter()); // Keychain / EncryptedSharedPreferences
415
+ // storage.registerAdapter(new SqliteAdapter()); // native SQLite
416
+ // storage.registerAdapter(new FilesystemAdapter()); // native files
409
417
 
410
418
  await storage.set('secret', token, { storage: 'secure' });
411
419
  ```
@@ -518,26 +526,18 @@ MIT License — see [LICENSE](LICENSE). Free for commercial and non-commercial u
518
526
  ## Links
519
527
 
520
528
  - **NPM Package:** https://www.npmjs.com/package/strata-storage
529
+ - **GitHub Repo:** https://github.com/aoneahsan/strata-storage
521
530
  - **Documentation:** https://stratastorage-docs.aoneahsan.com
522
531
  - **Website:** https://stratastorage.aoneahsan.com
523
532
 
524
533
  ## Support
525
534
 
526
- 1. Check the [FAQ](https://stratastorage-docs.aoneahsan.com/reference/faq) and [Troubleshooting](https://stratastorage-docs.aoneahsan.com/reference/troubleshooting)
527
- 2. Browse the [documentation](https://stratastorage-docs.aoneahsan.com)
528
- 3. [Contact us / report an issue](https://stratastorage.aoneahsan.com/contact)
535
+ - 🐛 **Found a bug or have a feature request?** [Open a GitHub issue](https://github.com/aoneahsan/strata-storage/issues).
536
+ - 📖 Read the [FAQ](https://stratastorage-docs.aoneahsan.com/reference/faq) and [Troubleshooting](https://stratastorage-docs.aoneahsan.com/reference/troubleshooting), or browse the full [documentation](https://stratastorage-docs.aoneahsan.com).
537
+ - 💬 Anything else? [Contact us](https://stratastorage.aoneahsan.com/contact).
529
538
 
530
539
  ---
531
540
 
532
541
  Developed with ❤️ by the **Strata Storage Team** — maintained by [Ahsan Mahmood](https://aoneahsan.com) · aoneahsan@gmail.com.
533
542
 
534
543
  **One API. Every Storage. Everywhere.**
535
-
536
- <!-- project-links:start -->
537
- ## Links
538
-
539
- - Live: https://www.npmjs.com/package/strata-storage
540
- - NPM: https://www.npmjs.com/package/strata-storage
541
-
542
- _URL source of truth: `01-code/projects/project-live-urls.json` (auto-generated — do not hand-edit between these markers)._
543
- <!-- project-links:end -->
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strata-storage",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
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",
@@ -43,7 +43,7 @@
43
43
  "url": "https://github.com/aoneahsan/strata-storage.git"
44
44
  },
45
45
  "bugs": {
46
- "url": "https://stratastorage.aoneahsan.com/contact",
46
+ "url": "https://github.com/aoneahsan/strata-storage/issues",
47
47
  "email": "aoneahsan@gmail.com"
48
48
  },
49
49
  "homepage": "https://stratastorage.aoneahsan.com",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strata-storage",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
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
  "packageManager": "yarn@4.17.0",
@@ -87,7 +87,7 @@
87
87
  "url": "https://github.com/aoneahsan/strata-storage.git"
88
88
  },
89
89
  "bugs": {
90
- "url": "https://stratastorage.aoneahsan.com/contact",
90
+ "url": "https://github.com/aoneahsan/strata-storage/issues",
91
91
  "email": "aoneahsan@gmail.com"
92
92
  },
93
93
  "homepage": "https://stratastorage.aoneahsan.com",