@spooky-sync/core 0.0.1-canary.70 → 0.0.1-canary.73

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.js CHANGED
@@ -3171,10 +3171,13 @@ function parseBackendInfo(raw) {
3171
3171
 
3172
3172
  //#endregion
3173
3173
  //#region src/modules/devtools/index.ts
3174
+ const CORE_VERSION = "0.0.1-canary.73";
3175
+ const WASM_VERSION = "0.0.1-canary.73";
3176
+ const SURREAL_VERSION = "3.0.3";
3174
3177
  var DevToolsService = class {
3175
3178
  eventsHistory = [];
3176
3179
  eventIdCounter = 0;
3177
- version = "0.0.1-canary.70";
3180
+ version = CORE_VERSION;
3178
3181
  backendInfo = emptyBackendInfo();
3179
3182
  constructor(databaseService, remoteDatabaseService, logger, schema, authService, dataManager) {
3180
3183
  this.databaseService = databaseService;
@@ -3309,9 +3312,9 @@ var DevToolsService = class {
3309
3312
  version: this.version,
3310
3313
  versions: {
3311
3314
  frontend: {
3312
- core: "0.0.1-canary.70",
3313
- wasm: "0.0.1-canary.70",
3314
- surrealdb: "3.0.3"
3315
+ core: CORE_VERSION,
3316
+ wasm: WASM_VERSION,
3317
+ surrealdb: SURREAL_VERSION
3315
3318
  },
3316
3319
  backend: this.backendInfo.versions,
3317
3320
  entities: this.backendInfo.entities
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spooky-sync/core",
3
- "version": "0.0.1-canary.70",
3
+ "version": "0.0.1-canary.73",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -59,8 +59,8 @@
59
59
  }
60
60
  },
61
61
  "dependencies": {
62
- "@spooky-sync/query-builder": "workspace:*",
63
- "@spooky-sync/ssp-wasm": "workspace:*",
62
+ "@spooky-sync/query-builder": "0.0.1-canary.73",
63
+ "@spooky-sync/ssp-wasm": "0.0.1-canary.73",
64
64
  "@surrealdb/wasm": "^3.0.3",
65
65
  "fast-json-patch": "^3.1.1",
66
66
  "loro-crdt": "^1.5.6",
@@ -1,6 +1,12 @@
1
1
  // Build-time string constants injected by tsdown's `define` (see
2
2
  // tsdown.config.ts). They carry the real bundled frontend package versions so
3
3
  // the DevTools can surface frontend/backend version drift.
4
- declare const __SP00KY_CORE_VERSION__: string;
5
- declare const __SP00KY_WASM_VERSION__: string;
6
- declare const __SP00KY_SURREAL_VERSION__: string;
4
+ //
5
+ // Typed as `string | undefined` on purpose: the substitution only happens when
6
+ // `@spooky-sync/core` is built with our tsdown plugin. A downstream app that
7
+ // bundles core from source never runs that plugin, so these identifiers must be
8
+ // guarded with `typeof` (see modules/devtools/index.ts) to avoid a runtime
9
+ // ReferenceError that would break DB initialization.
10
+ declare const __SP00KY_CORE_VERSION__: string | undefined;
11
+ declare const __SP00KY_WASM_VERSION__: string | undefined;
12
+ declare const __SP00KY_SURREAL_VERSION__: string | undefined;
@@ -22,11 +22,23 @@ import {
22
22
  parseBackendInfo,
23
23
  } from './versions';
24
24
 
25
+ // Real bundled frontend versions, injected at build time by tsdown's
26
+ // version-define plugin (see tsdown.config.ts). The `typeof` guard keeps these
27
+ // from throwing a ReferenceError when a downstream app bundles core from source
28
+ // (where the plugin never runs); in that case they fall back to 'unknown' and
29
+ // DevTools simply reports an unknown frontend version instead of crashing.
30
+ const CORE_VERSION =
31
+ typeof __SP00KY_CORE_VERSION__ !== 'undefined' ? __SP00KY_CORE_VERSION__ : 'unknown';
32
+ const WASM_VERSION =
33
+ typeof __SP00KY_WASM_VERSION__ !== 'undefined' ? __SP00KY_WASM_VERSION__ : 'unknown';
34
+ const SURREAL_VERSION =
35
+ typeof __SP00KY_SURREAL_VERSION__ !== 'undefined' ? __SP00KY_SURREAL_VERSION__ : 'unknown';
36
+
25
37
  export class DevToolsService implements StreamUpdateReceiver {
26
38
  private eventsHistory: DevToolsEvent[] = [];
27
39
  private eventIdCounter = 0;
28
40
  // Real bundled frontend version (injected at build time via tsdown `define`).
29
- private version = __SP00KY_CORE_VERSION__;
41
+ private version = CORE_VERSION;
30
42
  // Backend stack info (versions + per-entity status), read via the
31
43
  // `fn::spooky::info()` SurrealQL function; empty/'unavailable' until resolved.
32
44
  private backendInfo: BackendInfo = emptyBackendInfo();
@@ -205,9 +217,9 @@ export class DevToolsService implements StreamUpdateReceiver {
205
217
  version: this.version,
206
218
  versions: {
207
219
  frontend: {
208
- core: __SP00KY_CORE_VERSION__,
209
- wasm: __SP00KY_WASM_VERSION__,
210
- surrealdb: __SP00KY_SURREAL_VERSION__,
220
+ core: CORE_VERSION,
221
+ wasm: WASM_VERSION,
222
+ surrealdb: SURREAL_VERSION,
211
223
  },
212
224
  backend: this.backendInfo.versions,
213
225
  entities: this.backendInfo.entities,