@syncular/testkit 0.59.0 → 0.60.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/README.md CHANGED
@@ -37,9 +37,9 @@ test('two clients converge', async () => {
37
37
  const a = await sync.client('a');
38
38
  const b = await sync.client('b');
39
39
 
40
- const sub = { id: 's', table: 'todos', scopes: { list_id: ['groceries'] } };
41
- a.api.subscribe(sub);
42
- b.api.subscribe(sub);
40
+ const list = { list_id: 'groceries' };
41
+ a.api.subscribe(list);
42
+ b.api.subscribe(list);
43
43
 
44
44
  a.api.mutate([
45
45
  { table: 'todos', op: 'upsert', values: { id: 't1', list_id: 'groceries', title: 'hi' } },
@@ -218,7 +218,7 @@ import { syncWrapper } from '@syncular/testkit/react';
218
218
 
219
219
  const sync = await createTestSync({ schema });
220
220
  const client = await sync.client('a');
221
- client.api.subscribe({ id: 's', table: 'todos', scopes: { list_id: ['x'] } });
221
+ client.api.subscribe({ list_id: 'x' });
222
222
  await client.sync();
223
223
 
224
224
  const { result } = renderHook(
@@ -8,8 +8,8 @@
8
8
  * const sync = await createTestSync({ schema });
9
9
  * const a = await sync.client('a');
10
10
  * const b = await sync.client('b');
11
- * a.api.subscribe({ id: 's', table: 'notes', scopes: { list_id: ['x'] } });
12
- * b.api.subscribe({ id: 's', table: 'notes', scopes: { list_id: ['x'] } });
11
+ * a.api.subscribe({ list_id: 'x' });
12
+ * b.api.subscribe({ list_id: 'x' });
13
13
  * a.api.mutate([{ table: 'notes', op: 'upsert', values: … }]);
14
14
  * await sync.syncAll(); // both converge
15
15
  * await sync.dispose();
@@ -8,8 +8,8 @@
8
8
  * const sync = await createTestSync({ schema });
9
9
  * const a = await sync.client('a');
10
10
  * const b = await sync.client('b');
11
- * a.api.subscribe({ id: 's', table: 'notes', scopes: { list_id: ['x'] } });
12
- * b.api.subscribe({ id: 's', table: 'notes', scopes: { list_id: ['x'] } });
11
+ * a.api.subscribe({ list_id: 'x' });
12
+ * b.api.subscribe({ list_id: 'x' });
13
13
  * a.api.mutate([{ table: 'notes', op: 'upsert', values: … }]);
14
14
  * await sync.syncAll(); // both converge
15
15
  * await sync.dispose();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncular/testkit",
3
- "version": "0.59.0",
3
+ "version": "0.60.0",
4
4
  "description": "Syncular test kit: in-process loopback server + clients for integration scenarios",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Benjamin Kniffler",
@@ -64,8 +64,8 @@
64
64
  "test": "bun test --preload ./test/setup.ts"
65
65
  },
66
66
  "dependencies": {
67
- "@syncular/server": "0.59.0",
68
- "@syncular/client": "0.59.0"
67
+ "@syncular/server": "0.60.0",
68
+ "@syncular/client": "0.60.0"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "react": ">=18.0.0"
@@ -77,7 +77,7 @@
77
77
  },
78
78
  "devDependencies": {
79
79
  "@happy-dom/global-registrator": "^20.0.0",
80
- "@syncular/react": "0.59.0",
80
+ "@syncular/react": "0.60.0",
81
81
  "@testing-library/react": "^16.1.0",
82
82
  "@types/react": "^18.3.0",
83
83
  "react": "^18.3.1",
@@ -8,8 +8,8 @@
8
8
  * const sync = await createTestSync({ schema });
9
9
  * const a = await sync.client('a');
10
10
  * const b = await sync.client('b');
11
- * a.api.subscribe({ id: 's', table: 'notes', scopes: { list_id: ['x'] } });
12
- * b.api.subscribe({ id: 's', table: 'notes', scopes: { list_id: ['x'] } });
11
+ * a.api.subscribe({ list_id: 'x' });
12
+ * b.api.subscribe({ list_id: 'x' });
13
13
  * a.api.mutate([{ table: 'notes', op: 'upsert', values: … }]);
14
14
  * await sync.syncAll(); // both converge
15
15
  * await sync.dispose();