@lunora/db 1.0.0-alpha.15 → 1.0.0-alpha.17

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.
@@ -1,2 +1,2 @@
1
- export { createCheckpointRegistry, lunoraCollectionOptions } from '../packem_shared/createCheckpointRegistry-SvwBczzv.mjs';
2
- export { defineCollections } from '../packem_shared/defineCollections-BWB7CJzY.mjs';
1
+ export { createCheckpointRegistry, lunoraCollectionOptions } from '../packem_shared/createCheckpointRegistry-DkfPWFWz.mjs';
2
+ export { defineCollections } from '../packem_shared/defineCollections--aaoqJCd.mjs';
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- export { createCheckpointRegistry, lunoraCollectionOptions } from './packem_shared/createCheckpointRegistry-SvwBczzv.mjs';
2
- export { defineCollections } from './packem_shared/defineCollections-BWB7CJzY.mjs';
3
- export { bindMutators, defineMutator } from './packem_shared/bindMutators-DNhICkoy.mjs';
1
+ export { createCheckpointRegistry, lunoraCollectionOptions } from './packem_shared/createCheckpointRegistry-DkfPWFWz.mjs';
2
+ export { defineCollections } from './packem_shared/defineCollections--aaoqJCd.mjs';
3
+ export { bindMutators, defineMutator } from './packem_shared/bindMutators-BseARPYg.mjs';
4
4
  export { OUTBOX_MUTATION_FN_NAME, createExecutorOutboxSink, createOptimisticOnlineDetector, makeDiffEmit, runOutboxMutation, toMap } from './packem_shared/OUTBOX_MUTATION_FN_NAME-Cf8iP6Wa.mjs';
5
5
 
6
6
  const VERSION = "0.0.0";
@@ -1 +1 @@
1
- export { bindMutators, defineMutator } from '../packem_shared/bindMutators-DNhICkoy.mjs';
1
+ export { bindMutators, defineMutator } from '../packem_shared/bindMutators-BseARPYg.mjs';
@@ -1,3 +1,4 @@
1
+ import { LunoraError } from '@lunora/errors';
1
2
  import { createTransaction } from '@tanstack/db';
2
3
  import { runOutboxMutation } from './OUTBOX_MUTATION_FN_NAME-Cf8iP6Wa.mjs';
3
4
 
@@ -28,7 +29,10 @@ const bindMutators = (client, context, mutators) => {
28
29
  return clientSeq;
29
30
  }
30
31
  if (attempt >= maxReissues) {
31
- throw new Error(`lunora: custom mutator "${serverRef}" could not claim a fresh client sequence after ${String(maxReissues)} attempts`);
32
+ throw new LunoraError(
33
+ "INTERNAL",
34
+ `lunora: custom mutator "${serverRef}" could not claim a fresh client sequence after ${String(maxReissues)} attempts`
35
+ );
32
36
  }
33
37
  }
34
38
  });
@@ -1,3 +1,4 @@
1
+ import { LunoraError } from '@lunora/errors';
1
2
  import { BTreeIndex } from '@tanstack/db';
2
3
  import { toMap, makeDiffEmit } from './OUTBOX_MUTATION_FN_NAME-Cf8iP6Wa.mjs';
3
4
 
@@ -46,7 +47,7 @@ const createCheckpointRegistry = () => {
46
47
  };
47
48
  const lunoraCollectionOptions = (options) => {
48
49
  if (options.list === void 0 === (options.shape === void 0)) {
49
- throw new Error("lunoraCollectionOptions: pass exactly one of `list` or `shape`");
50
+ throw new LunoraError("INTERNAL", "lunoraCollectionOptions: pass exactly one of `list` or `shape`");
50
51
  }
51
52
  const getKey = options.getKey ?? ((row) => row._id);
52
53
  const checkpoints = createCheckpointRegistry();
@@ -1,6 +1,6 @@
1
1
  import { createCollection } from '@tanstack/db';
2
2
  import { startOfflineExecutor, NonRetriableError } from '@tanstack/offline-transactions';
3
- import { lunoraCollectionOptions } from './createCheckpointRegistry-SvwBczzv.mjs';
3
+ import { lunoraCollectionOptions } from './createCheckpointRegistry-DkfPWFWz.mjs';
4
4
  import { createOptimisticOnlineDetector, runOutboxMutation, OUTBOX_MUTATION_FN_NAME } from './OUTBOX_MUTATION_FN_NAME-Cf8iP6Wa.mjs';
5
5
 
6
6
  const defineCollections = (client, defs, options = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/db",
3
- "version": "1.0.0-alpha.15",
3
+ "version": "1.0.0-alpha.17",
4
4
  "description": "TanStack DB binding: typed, live-synced collections and a durable offline outbox over the Lunora client",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -54,7 +54,8 @@
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
- "@lunora/client": "1.0.0-alpha.15"
57
+ "@lunora/client": "1.0.0-alpha.17",
58
+ "@lunora/errors": "1.0.0-alpha.1"
58
59
  },
59
60
  "peerDependencies": {
60
61
  "@tanstack/db": "^0.6.0",