pomegranate-db 0.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/LICENSE +21 -0
- package/NOTICE.md +38 -0
- package/PomegranateDB.podspec +67 -0
- package/README.md +122 -0
- package/dist/adapters/expo-sqlite/ExpoSQLiteDriver.d.ts +34 -0
- package/dist/adapters/expo-sqlite/ExpoSQLiteDriver.js +155 -0
- package/dist/adapters/expo-sqlite/index.d.ts +2 -0
- package/dist/adapters/expo-sqlite/index.js +6 -0
- package/dist/adapters/index.d.ts +7 -0
- package/dist/adapters/index.js +13 -0
- package/dist/adapters/loki/LokiAdapter.d.ts +100 -0
- package/dist/adapters/loki/LokiAdapter.js +144 -0
- package/dist/adapters/loki/index.d.ts +6 -0
- package/dist/adapters/loki/index.js +12 -0
- package/dist/adapters/loki/worker/LokiDispatcher.d.ts +21 -0
- package/dist/adapters/loki/worker/LokiDispatcher.js +63 -0
- package/dist/adapters/loki/worker/LokiExecutor.d.ts +96 -0
- package/dist/adapters/loki/worker/LokiExecutor.js +462 -0
- package/dist/adapters/loki/worker/SynchronousWorker.d.ts +22 -0
- package/dist/adapters/loki/worker/SynchronousWorker.js +76 -0
- package/dist/adapters/loki/worker/loki.worker.d.ts +14 -0
- package/dist/adapters/loki/worker/loki.worker.js +112 -0
- package/dist/adapters/loki/worker/types.d.ts +44 -0
- package/dist/adapters/loki/worker/types.js +11 -0
- package/dist/adapters/native-sqlite/NativeSQLiteDriver.d.ts +55 -0
- package/dist/adapters/native-sqlite/NativeSQLiteDriver.js +145 -0
- package/dist/adapters/native-sqlite/index.d.ts +2 -0
- package/dist/adapters/native-sqlite/index.js +6 -0
- package/dist/adapters/op-sqlite/OpSQLiteDriver.d.ts +49 -0
- package/dist/adapters/op-sqlite/OpSQLiteDriver.js +140 -0
- package/dist/adapters/op-sqlite/index.d.ts +2 -0
- package/dist/adapters/op-sqlite/index.js +6 -0
- package/dist/adapters/sqlite/SQLiteAdapter.d.ts +70 -0
- package/dist/adapters/sqlite/SQLiteAdapter.js +264 -0
- package/dist/adapters/sqlite/index.d.ts +2 -0
- package/dist/adapters/sqlite/index.js +6 -0
- package/dist/adapters/sqlite/sql.d.ts +35 -0
- package/dist/adapters/sqlite/sql.js +258 -0
- package/dist/adapters/types.d.ts +93 -0
- package/dist/adapters/types.js +9 -0
- package/dist/collection/Collection.d.ts +103 -0
- package/dist/collection/Collection.js +245 -0
- package/dist/collection/index.d.ts +2 -0
- package/dist/collection/index.js +6 -0
- package/dist/database/Database.d.ts +128 -0
- package/dist/database/Database.js +245 -0
- package/dist/database/index.d.ts +2 -0
- package/dist/database/index.js +6 -0
- package/dist/encryption/index.d.ts +62 -0
- package/dist/encryption/index.js +276 -0
- package/dist/encryption/nodeCrypto.d.ts +18 -0
- package/dist/encryption/nodeCrypto.js +25 -0
- package/dist/encryption/nodeCrypto.native.d.ts +13 -0
- package/dist/encryption/nodeCrypto.native.js +26 -0
- package/dist/expo.d.ts +12 -0
- package/dist/expo.js +32 -0
- package/dist/hooks/index.d.ts +115 -0
- package/dist/hooks/index.js +285 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +57 -0
- package/dist/model/Model.d.ts +92 -0
- package/dist/model/Model.js +251 -0
- package/dist/model/index.d.ts +2 -0
- package/dist/model/index.js +7 -0
- package/dist/observable/Subject.d.ts +60 -0
- package/dist/observable/Subject.js +132 -0
- package/dist/observable/index.d.ts +2 -0
- package/dist/observable/index.js +10 -0
- package/dist/query/QueryBuilder.d.ts +51 -0
- package/dist/query/QueryBuilder.js +165 -0
- package/dist/query/index.d.ts +2 -0
- package/dist/query/index.js +7 -0
- package/dist/query/types.d.ts +60 -0
- package/dist/query/types.js +9 -0
- package/dist/schema/builder.d.ts +68 -0
- package/dist/schema/builder.js +168 -0
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.js +7 -0
- package/dist/schema/types.d.ts +108 -0
- package/dist/schema/types.js +9 -0
- package/dist/sync/index.d.ts +2 -0
- package/dist/sync/index.js +6 -0
- package/dist/sync/sync.d.ts +15 -0
- package/dist/sync/sync.js +182 -0
- package/dist/sync/types.d.ts +41 -0
- package/dist/sync/types.js +6 -0
- package/dist/utils/index.d.ts +45 -0
- package/dist/utils/index.js +99 -0
- package/expo-plugin/index.d.ts +68 -0
- package/expo-plugin/index.js +83 -0
- package/native/android-jsi/build.gradle +45 -0
- package/native/android-jsi/src/main/AndroidManifest.xml +2 -0
- package/native/android-jsi/src/main/cpp/CMakeLists.txt +73 -0
- package/native/android-jsi/src/main/cpp/DatabasePlatformAndroid.cpp +107 -0
- package/native/android-jsi/src/main/cpp/DatabasePlatformAndroid.h +16 -0
- package/native/android-jsi/src/main/cpp/JSIInstaller.cpp +27 -0
- package/native/android-jsi/src/main/java/com/pomegranate/jsi/JSIInstaller.kt +43 -0
- package/native/android-jsi/src/main/java/com/pomegranate/jsi/PomegranateJSIModule.kt +39 -0
- package/native/android-jsi/src/main/java/com/pomegranate/jsi/PomegranateJSIPackage.kt +17 -0
- package/native/ios/DatabasePlatformIOS.mm +83 -0
- package/native/ios/PomegranateJSI.h +15 -0
- package/native/ios/PomegranateJSI.mm +59 -0
- package/native/shared/Database.cpp +283 -0
- package/native/shared/Database.h +84 -0
- package/native/shared/Sqlite.cpp +61 -0
- package/native/shared/Sqlite.h +67 -0
- package/native/shared/sqlite3/sqlite3.c +260493 -0
- package/native/shared/sqlite3/sqlite3.h +13583 -0
- package/package.json +127 -0
- package/react-native.config.js +28 -0
package/package.json
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pomegranate-db",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Reactive offline-first database with sync support",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist/",
|
|
9
|
+
"expo-plugin/index.js",
|
|
10
|
+
"expo-plugin/index.d.ts",
|
|
11
|
+
"native/shared/*.cpp",
|
|
12
|
+
"native/shared/*.h",
|
|
13
|
+
"native/shared/sqlite3/sqlite3.c",
|
|
14
|
+
"native/shared/sqlite3/sqlite3.h",
|
|
15
|
+
"native/android-jsi/src/",
|
|
16
|
+
"native/android-jsi/build.gradle",
|
|
17
|
+
"native/android-jsi/CMakeLists.txt",
|
|
18
|
+
"native/ios/**/*.{h,m,mm}",
|
|
19
|
+
"PomegranateDB.podspec",
|
|
20
|
+
"react-native.config.js",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"NOTICE.md",
|
|
23
|
+
"!dist/integrationTests/",
|
|
24
|
+
"!dist/index.integrationTests*",
|
|
25
|
+
"!dist/**/*.js.map"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"default": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./expo": {
|
|
33
|
+
"types": "./dist/expo.d.ts",
|
|
34
|
+
"default": "./dist/expo.js"
|
|
35
|
+
},
|
|
36
|
+
"./expo-plugin": {
|
|
37
|
+
"types": "./expo-plugin/index.d.ts",
|
|
38
|
+
"default": "./expo-plugin/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./op-sqlite": {
|
|
41
|
+
"types": "./dist/adapters/op-sqlite/index.d.ts",
|
|
42
|
+
"default": "./dist/adapters/op-sqlite/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./native-sqlite": {
|
|
45
|
+
"types": "./dist/adapters/native-sqlite/index.d.ts",
|
|
46
|
+
"default": "./dist/adapters/native-sqlite/index.js"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsc && tsc -p expo-plugin/tsconfig.json",
|
|
51
|
+
"build:lib": "tsc",
|
|
52
|
+
"build:expo-plugin": "tsc -p expo-plugin/tsconfig.json",
|
|
53
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
54
|
+
"test": "jest",
|
|
55
|
+
"test:web": "jest --testPathPattern='web\\.test' --no-cache",
|
|
56
|
+
"test:web:native": "jest --testPathPattern='web-native\\.test' --no-cache",
|
|
57
|
+
"test:watch": "jest --watch",
|
|
58
|
+
"test:android": "./scripts/test-android",
|
|
59
|
+
"test:android:expo": "./scripts/test-android-expo",
|
|
60
|
+
"setup:sqlite": "./scripts/setup-sqlite",
|
|
61
|
+
"docs": "cd docs-website && npm start",
|
|
62
|
+
"docs:build": "cd docs-website && npm run build",
|
|
63
|
+
"lint": "eslint src/",
|
|
64
|
+
"lint:fix": "eslint src/ --fix",
|
|
65
|
+
"typecheck": "tsc --noEmit",
|
|
66
|
+
"format": "eslint src/ --fix",
|
|
67
|
+
"format:native": "find native/shared native/android-jsi/src/main/cpp native/ios -name '*.cpp' -o -name '*.h' -o -name '*.mm' | grep -v sqlite3 | xargs clang-format -i --style=file:native/.clang-format && ./ktlint --format 'native/android-jsi/**/*.kt' 'native/androidTest/**/*.kt'",
|
|
68
|
+
"check": "npm run typecheck && npm run lint",
|
|
69
|
+
"clean": "rm -rf dist expo-plugin/index.js expo-plugin/index.d.ts"
|
|
70
|
+
},
|
|
71
|
+
"keywords": [
|
|
72
|
+
"database",
|
|
73
|
+
"offline-first",
|
|
74
|
+
"reactive",
|
|
75
|
+
"sync",
|
|
76
|
+
"sqlite",
|
|
77
|
+
"react-native",
|
|
78
|
+
"expo",
|
|
79
|
+
"expo-sqlite"
|
|
80
|
+
],
|
|
81
|
+
"license": "MIT",
|
|
82
|
+
"peerDependencies": {
|
|
83
|
+
"expo-sqlite": ">=14.0.0",
|
|
84
|
+
"react": ">=17.0.0",
|
|
85
|
+
"react-native": ">=0.71.0"
|
|
86
|
+
},
|
|
87
|
+
"peerDependenciesMeta": {
|
|
88
|
+
"react": {
|
|
89
|
+
"optional": true
|
|
90
|
+
},
|
|
91
|
+
"react-native": {
|
|
92
|
+
"optional": true
|
|
93
|
+
},
|
|
94
|
+
"expo-sqlite": {
|
|
95
|
+
"optional": true
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"devDependencies": {
|
|
99
|
+
"@eslint/js": "^9.0.0",
|
|
100
|
+
"@react-native-community/cli": "^20.1.2",
|
|
101
|
+
"@react-native-community/cli-platform-android": "^20.1.2",
|
|
102
|
+
"@react-native/babel-preset": "0.81.6",
|
|
103
|
+
"@react-native/metro-config": "0.81.6",
|
|
104
|
+
"@stylistic/eslint-plugin": "^5.9.0",
|
|
105
|
+
"@testing-library/dom": "^10.4.1",
|
|
106
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
107
|
+
"@testing-library/react": "^16.3.2",
|
|
108
|
+
"@types/jest": "^29.5.0",
|
|
109
|
+
"@types/react": "^19.1.4",
|
|
110
|
+
"@types/react-dom": "^19.1.0",
|
|
111
|
+
"eslint": "^9.39.3",
|
|
112
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
113
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
114
|
+
"jest": "^29.7.0",
|
|
115
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
116
|
+
"react": "^19.2.0",
|
|
117
|
+
"react-dom": "^19.2.0",
|
|
118
|
+
"react-native": "0.81.6",
|
|
119
|
+
"ts-jest": "^29.1.0",
|
|
120
|
+
"typescript": "^5.4.0",
|
|
121
|
+
"typescript-eslint": "^8.56.1"
|
|
122
|
+
},
|
|
123
|
+
"dependencies": {
|
|
124
|
+
"lokijs": "^1.5.12",
|
|
125
|
+
"uuid": "^9.0.0"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Native configuration for PomegranateDB.
|
|
3
|
+
*
|
|
4
|
+
* This is used by the RN autolinking system when building
|
|
5
|
+
* the Android / iOS test apps in native/androidTest/ and native/iosTest/.
|
|
6
|
+
*/
|
|
7
|
+
module.exports = {
|
|
8
|
+
project: {
|
|
9
|
+
android: {
|
|
10
|
+
sourceDir: './native/androidTest',
|
|
11
|
+
appName: 'app',
|
|
12
|
+
},
|
|
13
|
+
ios: {
|
|
14
|
+
sourceDir: './native/iosTest',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
// Pomegranate ships a native module — expose it for autolinking in consuming apps.
|
|
18
|
+
dependency: {
|
|
19
|
+
platforms: {
|
|
20
|
+
ios: {},
|
|
21
|
+
android: {
|
|
22
|
+
sourceDir: './native/android-jsi',
|
|
23
|
+
packageImportPath: 'import com.pomegranate.jsi.PomegranateJSIPackage;',
|
|
24
|
+
packageInstance: 'new PomegranateJSIPackage()',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|