local-lite 0.0.4 → 0.0.6
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/dist/adapters/local/better-sqlite3.d.ts +4 -1
- package/dist/adapters/local/better-sqlite3.js +34 -14
- package/dist/adapters/local/expo-sqlite.d.ts +10 -2
- package/dist/adapters/local/expo-sqlite.js +36 -20
- package/dist/adapters/local/node-sqlite.d.ts +4 -1
- package/dist/adapters/local/node-sqlite.js +29 -12
- package/dist/adapters/remote/firestore.js +39 -32
- package/dist/adapters/remote/supabase.d.ts +7 -2
- package/dist/adapters/remote/supabase.js +192 -85
- package/dist/config/types.d.ts +1 -1
- package/dist/core/client.d.ts +52 -15
- package/dist/core/client.js +195 -208
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/outbox-store.d.ts +5 -0
- package/dist/core/outbox-store.js +29 -4
- package/dist/core/query-builder.d.ts +120 -0
- package/dist/core/query-builder.js +441 -0
- package/dist/core/query.js +28 -32
- package/dist/core/schema-manager.d.ts +4 -15
- package/dist/core/schema-manager.js +48 -103
- package/dist/core/sync-worker.js +7 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/react/SyncInspector.js +0 -70
- package/dist/react/index.d.ts +39 -0
- package/dist/react/index.js +232 -34
- package/dist/react/status.d.ts +5 -0
- package/dist/react/status.js +20 -12
- package/dist/schema/generator.d.ts +49 -0
- package/dist/schema/generator.js +209 -0
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +17 -0
- package/dist/utils/uuid.d.ts +1 -1
- package/dist/utils/uuid.js +7 -16
- package/package.json +7 -2
package/dist/utils/uuid.js
CHANGED
|
@@ -4,24 +4,15 @@ exports.uuidv4 = void 0;
|
|
|
4
4
|
exports.generateUUID = generateUUID;
|
|
5
5
|
const uuid_1 = require("uuid");
|
|
6
6
|
Object.defineProperty(exports, "uuidv4", { enumerable: true, get: function () { return uuid_1.v4; } });
|
|
7
|
+
// Detect once at module load — avoids 3 typeof checks per UUID call
|
|
8
|
+
const nativeRandomUUID = typeof globalThis !== 'undefined' &&
|
|
9
|
+
typeof globalThis.crypto?.randomUUID === 'function'
|
|
10
|
+
? () => globalThis.crypto.randomUUID()
|
|
11
|
+
: null;
|
|
7
12
|
/**
|
|
8
13
|
* Generates an RFC4122 v4 compliant UUID.
|
|
9
|
-
* Uses native crypto.randomUUID() when
|
|
14
|
+
* Uses native crypto.randomUUID() when available (detected once at import), with uuid.v4 fallback.
|
|
10
15
|
*/
|
|
11
16
|
function generateUUID() {
|
|
12
|
-
|
|
13
|
-
if (typeof globalThis !== 'undefined' &&
|
|
14
|
-
globalThis.crypto &&
|
|
15
|
-
typeof globalThis.crypto.randomUUID === 'function') {
|
|
16
|
-
return globalThis.crypto.randomUUID();
|
|
17
|
-
}
|
|
18
|
-
return (0, uuid_1.v4)();
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
22
|
-
const r = (Math.random() * 16) | 0;
|
|
23
|
-
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
24
|
-
return v.toString(16);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
17
|
+
return nativeRandomUUID ? nativeRandomUUID() : (0, uuid_1.v4)();
|
|
27
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "local-lite",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Never let a lost connection break a promise. Local-first sync that faithfully keeps data safe until you're back online.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"import": "./dist/config/index.js",
|
|
27
27
|
"default": "./dist/config/index.js"
|
|
28
28
|
},
|
|
29
|
+
"./schema": {
|
|
30
|
+
"types": "./dist/schema/index.d.ts",
|
|
31
|
+
"import": "./dist/schema/index.js",
|
|
32
|
+
"default": "./dist/schema/index.js"
|
|
33
|
+
},
|
|
29
34
|
"./supabase": {
|
|
30
35
|
"types": "./dist/adapters/remote/supabase.d.ts",
|
|
31
36
|
"import": "./dist/adapters/remote/supabase.js",
|
|
@@ -127,7 +132,7 @@
|
|
|
127
132
|
"@supabase/supabase-js": "^2.118.0",
|
|
128
133
|
"@types/react": "^19.3.0",
|
|
129
134
|
"@types/uuid": "^11.0.0",
|
|
130
|
-
"expo-sqlite": "^
|
|
135
|
+
"expo-sqlite": "^58.0.13",
|
|
131
136
|
"react": "^19.3.1",
|
|
132
137
|
"typescript": "^7.0.2",
|
|
133
138
|
"vitest": "^5.0.5"
|