@super-line/tanstack-db 0.1.0 → 0.1.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.
- package/dist/index.cjs +5 -2
- package/dist/index.js +5 -2
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -23,9 +23,12 @@ __export(index_exports, {
|
|
|
23
23
|
superLineCollectionOptions: () => superLineCollectionOptions
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
var import_core = require("@super-line/core");
|
|
26
27
|
function superLineCollectionOptions(client, contract, name, opts = {}) {
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
28
|
+
const def = contract.collections?.[name];
|
|
29
|
+
if (!def) throw new Error(`superLineCollectionOptions: collection '${String(name)}' is not declared on the contract`);
|
|
30
|
+
if ((0, import_core.isCrdtCollection)(def)) throw new Error(`superLineCollectionOptions: collection '${String(name)}' is a CRDT document collection \u2014 TanStack DB serves LWW row collections only`);
|
|
31
|
+
const key = def.key;
|
|
29
32
|
const handle = client.collection(name);
|
|
30
33
|
return {
|
|
31
34
|
id: `superline:${String(name)}`,
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
+
import { isCrdtCollection } from "@super-line/core";
|
|
2
3
|
function superLineCollectionOptions(client, contract, name, opts = {}) {
|
|
3
|
-
const
|
|
4
|
-
if (!
|
|
4
|
+
const def = contract.collections?.[name];
|
|
5
|
+
if (!def) throw new Error(`superLineCollectionOptions: collection '${String(name)}' is not declared on the contract`);
|
|
6
|
+
if (isCrdtCollection(def)) throw new Error(`superLineCollectionOptions: collection '${String(name)}' is a CRDT document collection \u2014 TanStack DB serves LWW row collections only`);
|
|
7
|
+
const key = def.key;
|
|
5
8
|
const handle = client.collection(name);
|
|
6
9
|
return {
|
|
7
10
|
id: `superline:${String(name)}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@super-line/tanstack-db",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TanStack DB collection adapter for super-line — use super-line collections as a TanStack DB sync source with client-side live queries and joins.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@super-line/
|
|
50
|
-
"@super-line/
|
|
49
|
+
"@super-line/client": "^0.9.0",
|
|
50
|
+
"@super-line/core": "^0.11.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@tanstack/db": ">=0.1"
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"@tanstack/db": "^0.5.0",
|
|
57
57
|
"ws": "^8.18.0",
|
|
58
58
|
"zod": "^3.24.1",
|
|
59
|
-
"@super-line/server": "0.10.2",
|
|
60
59
|
"@super-line/collections-memory": "0.1.0",
|
|
60
|
+
"@super-line/server": "0.11.0",
|
|
61
61
|
"@super-line/transport-websocket": "0.6.0"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|