strata-storage 1.6.0 → 2.0.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.
Files changed (61) hide show
  1. package/Readme.md +66 -20
  2. package/android/build.gradle +58 -0
  3. package/android/proguard-rules.pro +11 -0
  4. package/android/settings.gradle +2 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/dist/README.md +66 -20
  7. package/dist/adapters/web/MemoryAdapter.js +1 -1
  8. package/dist/android/build.gradle +58 -0
  9. package/dist/android/proguard-rules.pro +11 -0
  10. package/dist/android/settings.gradle +2 -0
  11. package/dist/android/src/main/AndroidManifest.xml +2 -0
  12. package/dist/capacitor.d.ts +20 -0
  13. package/dist/capacitor.d.ts.map +1 -0
  14. package/dist/capacitor.js +48 -0
  15. package/dist/core/Strata.d.ts +28 -3
  16. package/dist/core/Strata.d.ts.map +1 -1
  17. package/dist/core/Strata.js +51 -52
  18. package/dist/features/compression/index.d.ts +2 -0
  19. package/dist/features/compression/index.d.ts.map +1 -0
  20. package/dist/features/compression/index.js +1 -0
  21. package/dist/features/encryption/index.d.ts +2 -0
  22. package/dist/features/encryption/index.d.ts.map +1 -0
  23. package/dist/features/encryption/index.js +1 -0
  24. package/dist/features/observer/index.d.ts +2 -0
  25. package/dist/features/observer/index.d.ts.map +1 -0
  26. package/dist/features/observer/index.js +1 -0
  27. package/dist/features/observer.d.ts +20 -0
  28. package/dist/features/observer.d.ts.map +1 -0
  29. package/dist/features/observer.js +32 -0
  30. package/dist/features/query/index.d.ts +2 -0
  31. package/dist/features/query/index.d.ts.map +1 -0
  32. package/dist/features/query/index.js +1 -0
  33. package/dist/features/query.d.ts.map +1 -1
  34. package/dist/features/query.js +8 -1
  35. package/dist/features/sync/index.d.ts +2 -0
  36. package/dist/features/sync/index.d.ts.map +1 -0
  37. package/dist/features/sync/index.js +1 -0
  38. package/dist/features/ttl/index.d.ts +2 -0
  39. package/dist/features/ttl/index.d.ts.map +1 -0
  40. package/dist/features/ttl/index.js +1 -0
  41. package/dist/firebase.d.ts +26 -0
  42. package/dist/firebase.d.ts.map +1 -0
  43. package/dist/firebase.js +147 -0
  44. package/dist/index.d.ts +13 -47
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +46 -50
  47. package/dist/package.json +11 -2
  48. package/dist/plugin/definitions.d.ts +2 -2
  49. package/dist/plugin/definitions.d.ts.map +1 -1
  50. package/dist/plugin/index.d.ts +2 -1
  51. package/dist/plugin/index.d.ts.map +1 -1
  52. package/dist/plugin/index.js +76 -10
  53. package/dist/types/index.d.ts +190 -0
  54. package/dist/types/index.d.ts.map +1 -1
  55. package/dist/types/index.js +13 -0
  56. package/dist/utils/index.d.ts +20 -0
  57. package/dist/utils/index.d.ts.map +1 -1
  58. package/dist/utils/index.js +34 -0
  59. package/package.json +12 -2
  60. package/scripts/build.js +8 -0
  61. package/scripts/postinstall.js +15 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strata-storage",
3
- "version": "1.6.0",
3
+ "version": "2.0.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": "dist/index.js",
@@ -19,6 +19,14 @@
19
19
  ".": {
20
20
  "types": "./dist/index.d.ts",
21
21
  "default": "./dist/index.js"
22
+ },
23
+ "./capacitor": {
24
+ "types": "./dist/capacitor.d.ts",
25
+ "default": "./dist/capacitor.js"
26
+ },
27
+ "./firebase": {
28
+ "types": "./dist/firebase.d.ts",
29
+ "default": "./dist/firebase.js"
22
30
  }
23
31
  },
24
32
  "scripts": {
@@ -90,6 +98,7 @@
90
98
  "eslint": "^9.32.0",
91
99
  "eslint-config-prettier": "^10.1.8",
92
100
  "eslint-plugin-prettier": "^5.5.3",
101
+ "jsdom": "^26.1.0",
93
102
  "prettier": "^3.6.2",
94
103
  "typescript": "^5.9.2",
95
104
  "typescript-eslint": "^8.38.0",
@@ -103,7 +112,8 @@
103
112
  "src": "ios"
104
113
  },
105
114
  "android": {
106
- "src": "android"
115
+ "src": "android",
116
+ "androidModule": "strata-storage"
107
117
  }
108
118
  }
109
119
  }
package/scripts/build.js CHANGED
@@ -133,6 +133,14 @@ const distPackageJson = {
133
133
  '.': {
134
134
  types: './index.d.ts',
135
135
  default: './index.js'
136
+ },
137
+ './capacitor': {
138
+ types: './capacitor.d.ts',
139
+ default: './capacitor.js'
140
+ },
141
+ './firebase': {
142
+ types: './firebase.d.ts',
143
+ default: './firebase.js'
136
144
  }
137
145
  },
138
146
  author: packageJson.author,
@@ -9,6 +9,12 @@ const __dirname = path.dirname(__filename);
9
9
 
10
10
  console.log('\nšŸš€ Strata Storage - Zero Dependencies, Infinite Possibilities!\n');
11
11
 
12
+ console.log('šŸ“š Quick Start:');
13
+ console.log(' import { Strata } from "strata-storage";');
14
+ console.log(' const storage = new Strata();');
15
+ console.log(' await storage.initialize();');
16
+ console.log(' await storage.set("key", "value");\n');
17
+
12
18
  // Check if this is a Capacitor project
13
19
  const capacitorConfigPaths = [
14
20
  'capacitor.config.json',
@@ -21,17 +27,18 @@ const isCapacitorProject = capacitorConfigPaths.some(configPath =>
21
27
  );
22
28
 
23
29
  if (isCapacitorProject) {
24
- console.log('šŸ“± Capacitor project detected!');
30
+ console.log('šŸ“± Capacitor Support Available (Optional):');
31
+ console.log(' import { registerCapacitorAdapters } from "strata-storage/capacitor";');
32
+ console.log(' await registerCapacitorAdapters(storage);');
25
33
  console.log(' Run "npx cap sync" to sync native code\n');
26
- } else {
27
- console.log('🌐 Web project detected!');
28
- console.log(' Strata works perfectly in web-only projects too!\n');
29
34
  }
30
35
 
31
- console.log('šŸ“š Quick Start:');
32
- console.log(' import { Strata } from "strata-storage";');
33
- console.log(' const storage = new Strata();');
34
- console.log(' await storage.set("key", "value");\n');
36
+ console.log('✨ Features:');
37
+ console.log(' • Works everywhere - Web, Node.js, Mobile');
38
+ console.log(' • Zero runtime dependencies');
39
+ console.log(' • Optional Capacitor integration');
40
+ console.log(' • Built-in encryption & compression');
41
+ console.log(' • Cross-tab synchronization\n');
35
42
 
36
43
  console.log('šŸ“– Documentation: https://github.com/aoneahsan/strata-storage');
37
44
  console.log('⭐ Star us on GitHub: https://github.com/aoneahsan/strata-storage\n');