strata-storage 2.8.2 → 2.8.3
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/AI-INTEGRATION-GUIDE.md +21 -5
- package/README.md +21 -21
- package/dist/README.md +21 -21
- package/dist/package.json +2 -2
- package/package.json +2 -2
package/AI-INTEGRATION-GUIDE.md
CHANGED
|
@@ -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.8.
|
|
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.3**.
|
|
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
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://www.typescriptlang.org/)
|
|
10
10
|
[](https://stratastorage.aoneahsan.com)
|
|
11
11
|
|
|
12
|
-
- **Version:** `2.8.
|
|
12
|
+
- **Version:** `2.8.3`
|
|
13
13
|
- **License:** MIT
|
|
14
14
|
- **Node.js:** `>= 24.13.0`
|
|
15
15
|
- **Module format:** ESM only
|
|
@@ -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
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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
|
```
|
|
@@ -478,11 +486,11 @@ Optional peer dependencies (install only the ones you use): `react >= 19.2.3`, `
|
|
|
478
486
|
|
|
479
487
|
## Documentation
|
|
480
488
|
|
|
481
|
-
📚 **
|
|
482
|
-
🤖 **For AI agents
|
|
489
|
+
📚 **Docs:** [stratastorage-docs.aoneahsan.com](https://stratastorage-docs.aoneahsan.com) · site source in [aoneahsan/strata-storage-docs](https://github.com/aoneahsan/strata-storage-docs)
|
|
490
|
+
🤖 **For AI agents:** [`AI-INTEGRATION-GUIDE.md`](./AI-INTEGRATION-GUIDE.md) · hosted [/ai](https://stratastorage-docs.aoneahsan.com/ai) · [`/llms.txt`](https://stratastorage-docs.aoneahsan.com/llms.txt)
|
|
483
491
|
|
|
484
492
|
### Getting Started
|
|
485
|
-
- [Installation](https://stratastorage-docs.aoneahsan.com/installation) · [Quick Start](https://stratastorage-docs.aoneahsan.com/quick-start) · [Configuration](https://stratastorage-docs.aoneahsan.com/configuration)
|
|
493
|
+
- [Introduction](https://stratastorage-docs.aoneahsan.com/) · [Installation](https://stratastorage-docs.aoneahsan.com/installation) · [Quick Start](https://stratastorage-docs.aoneahsan.com/quick-start) · [Configuration](https://stratastorage-docs.aoneahsan.com/configuration)
|
|
486
494
|
|
|
487
495
|
### API
|
|
488
496
|
- [API Reference](https://stratastorage-docs.aoneahsan.com/api) · [Core (`Strata`)](https://stratastorage-docs.aoneahsan.com/api/core/strata) · [Types](https://stratastorage-docs.aoneahsan.com/api/core/types) · [Errors](https://stratastorage-docs.aoneahsan.com/api/core/errors)
|
|
@@ -499,7 +507,7 @@ Optional peer dependencies (install only the ones you use): `react >= 19.2.3`, `
|
|
|
499
507
|
|
|
500
508
|
## Contributing
|
|
501
509
|
|
|
502
|
-
Contributions are welcome — please read the [Contributing Guide](
|
|
510
|
+
Contributions are welcome — please read the [Contributing Guide](./CONTRIBUTING.md). `main` is protected: changes land through an approved pull request (the maintainer is the only direct-push), and you can [request contributor access](./CONTRIBUTING.md#becoming-a-contributor) if you'd like to help regularly.
|
|
503
511
|
|
|
504
512
|
## License
|
|
505
513
|
|
|
@@ -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
|
-
|
|
527
|
-
|
|
528
|
-
|
|
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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://www.typescriptlang.org/)
|
|
10
10
|
[](https://stratastorage.aoneahsan.com)
|
|
11
11
|
|
|
12
|
-
- **Version:** `2.8.
|
|
12
|
+
- **Version:** `2.8.3`
|
|
13
13
|
- **License:** MIT
|
|
14
14
|
- **Node.js:** `>= 24.13.0`
|
|
15
15
|
- **Module format:** ESM only
|
|
@@ -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
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
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
|
```
|
|
@@ -478,11 +486,11 @@ Optional peer dependencies (install only the ones you use): `react >= 19.2.3`, `
|
|
|
478
486
|
|
|
479
487
|
## Documentation
|
|
480
488
|
|
|
481
|
-
📚 **
|
|
482
|
-
🤖 **For AI agents
|
|
489
|
+
📚 **Docs:** [stratastorage-docs.aoneahsan.com](https://stratastorage-docs.aoneahsan.com) · site source in [aoneahsan/strata-storage-docs](https://github.com/aoneahsan/strata-storage-docs)
|
|
490
|
+
🤖 **For AI agents:** [`AI-INTEGRATION-GUIDE.md`](./AI-INTEGRATION-GUIDE.md) · hosted [/ai](https://stratastorage-docs.aoneahsan.com/ai) · [`/llms.txt`](https://stratastorage-docs.aoneahsan.com/llms.txt)
|
|
483
491
|
|
|
484
492
|
### Getting Started
|
|
485
|
-
- [Installation](https://stratastorage-docs.aoneahsan.com/installation) · [Quick Start](https://stratastorage-docs.aoneahsan.com/quick-start) · [Configuration](https://stratastorage-docs.aoneahsan.com/configuration)
|
|
493
|
+
- [Introduction](https://stratastorage-docs.aoneahsan.com/) · [Installation](https://stratastorage-docs.aoneahsan.com/installation) · [Quick Start](https://stratastorage-docs.aoneahsan.com/quick-start) · [Configuration](https://stratastorage-docs.aoneahsan.com/configuration)
|
|
486
494
|
|
|
487
495
|
### API
|
|
488
496
|
- [API Reference](https://stratastorage-docs.aoneahsan.com/api) · [Core (`Strata`)](https://stratastorage-docs.aoneahsan.com/api/core/strata) · [Types](https://stratastorage-docs.aoneahsan.com/api/core/types) · [Errors](https://stratastorage-docs.aoneahsan.com/api/core/errors)
|
|
@@ -499,7 +507,7 @@ Optional peer dependencies (install only the ones you use): `react >= 19.2.3`, `
|
|
|
499
507
|
|
|
500
508
|
## Contributing
|
|
501
509
|
|
|
502
|
-
Contributions are welcome — please read the [Contributing Guide](
|
|
510
|
+
Contributions are welcome — please read the [Contributing Guide](./CONTRIBUTING.md). `main` is protected: changes land through an approved pull request (the maintainer is the only direct-push), and you can [request contributor access](./CONTRIBUTING.md#becoming-a-contributor) if you'd like to help regularly.
|
|
503
511
|
|
|
504
512
|
## License
|
|
505
513
|
|
|
@@ -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
|
-
|
|
527
|
-
|
|
528
|
-
|
|
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.
|
|
3
|
+
"version": "2.8.3",
|
|
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://
|
|
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.
|
|
3
|
+
"version": "2.8.3",
|
|
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://
|
|
90
|
+
"url": "https://github.com/aoneahsan/strata-storage/issues",
|
|
91
91
|
"email": "aoneahsan@gmail.com"
|
|
92
92
|
},
|
|
93
93
|
"homepage": "https://stratastorage.aoneahsan.com",
|