@loradb/lora-wasm 0.14.0 → 0.15.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.
Files changed (2) hide show
  1. package/README.md +36 -20
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -10,11 +10,13 @@ the result.
10
10
 
11
11
  ## Build
12
12
 
13
+ From the repository root:
14
+
13
15
  ```bash
14
- cd crates/bindings/lora-wasm
15
- npm install
16
- npm run build # wasm-pack (node + bundler) + tsc
17
- npm test # vitest
16
+ corepack enable
17
+ yarn install --immutable
18
+ yarn workspace @loradb/lora-wasm build # wasm-pack (node + bundler + web) + tsc
19
+ yarn workspace @loradb/lora-wasm test # vitest
18
20
  ```
19
21
 
20
22
  Build artefacts:
@@ -26,15 +28,21 @@ Build artefacts:
26
28
  | `pkg-web/` | `--target web` | Browser Worker entry — self-fetches the `.wasm` binary |
27
29
  | `dist/` | TypeScript (`tsc`) | Compiled wrapper (`Database`, worker, worker-client, types) |
28
30
 
31
+ The workspace-level `package.json` is the source of truth for the npm
32
+ package name, version, exports, and publish settings. The `pkg-*`
33
+ directories are generated by `wasm-pack`; if their nested manifests look
34
+ stale after a version bump, rebuild with
35
+ `yarn workspace @loradb/lora-wasm build` before testing or packing.
36
+
29
37
  To run the full validation suite (typecheck, vitest, Playwright browser
30
38
  test, npm pack dry-run), add:
31
39
 
32
40
  ```bash
33
- npm run typecheck
34
- npm test
35
- npm run test:browser:install # one-time chromium download
36
- npm run test:browser
37
- npm run pack:dry
41
+ yarn workspace @loradb/lora-wasm typecheck
42
+ yarn workspace @loradb/lora-wasm test
43
+ yarn workspace @loradb/lora-wasm test:browser:install # one-time chromium download
44
+ yarn workspace @loradb/lora-wasm test:browser
45
+ yarn workspace @loradb/lora-wasm pack:dry
38
46
  ```
39
47
 
40
48
  ## Execution modes
@@ -126,7 +134,7 @@ Use this when you need to control the Worker URL, lifecycle, bundler entry, or
126
134
  pooling strategy.
127
135
 
128
136
  ```ts
129
- import { createWorkerDatabase } from "lora-wasm/worker-client";
137
+ import { createWorkerDatabase } from "@loradb/lora-wasm/worker-client";
130
138
 
131
139
  const worker = new Worker(new URL("./worker.js", import.meta.url), {
132
140
  type: "module",
@@ -217,11 +225,19 @@ Common ones:
217
225
  - `LORA_PARSE` — Cypher syntax could not be parsed
218
226
  - `LORA_SEMANTIC` — analysis failure (unknown variable, label, type mismatch, …)
219
227
  - `LORA_INVALID_PARAMS` — a parameter value could not be coerced to a `LoraValue`
228
+ - `LORA_READ_ONLY` — mutating statement issued in a read-only context
229
+ - `LORA_NOT_FOUND` — a named entity does not exist
230
+ - `LORA_CONSTRAINT`, `LORA_UNIQUE_CONSTRAINT`, `LORA_NOT_NULL_CONSTRAINT`,
231
+ `LORA_FOREIGN_KEY`, `LORA_TRANSACTION` — graph constraint or transaction failure
220
232
  - `LORA_INVALID_VECTOR` — vector value failed dimension / coordinate-type validation
221
233
  - `LORA_TIMEOUT` — query exceeded its cooperative deadline
222
- - `LORA_IO`, `LORA_SNAPSHOT_CODEC`, `LORA_SNAPSHOT_CRYPTO` — storage / snapshot failures
234
+ - `LORA_DATABASE_NAME` — logical database name violates the portable-path rules
235
+ - `LORA_CONFIG`, `LORA_VALIDATION` — configuration or validation failure
236
+ - `LORA_IO`, `LORA_CONNECTION`, `LORA_WAL_CORRUPTION`, `LORA_WAL_POISONED` — storage failures
237
+ - `LORA_SNAPSHOT_CODEC`, `LORA_SNAPSHOT_CRYPTO` — snapshot codec / crypto failures
223
238
  - `LORA_INTERNAL` — last-resort fallback when the engine cannot classify the failure
224
239
  - `WORKER_ERROR` — worker transport / lifecycle failure (worker client only)
240
+ - `UNKNOWN` — catch-all for messages without a recognized code
225
241
 
226
242
  See `ts/types.ts` (`LoraErrorCode`) for the full list.
227
243
 
@@ -263,7 +279,7 @@ public surface — consumers can swap backends without rewriting types.
263
279
  - The non-blocking worker-backed path is end-to-end verified: a real
264
280
  Chromium instance spawns a module Worker, loads the `pkg-web` bundle,
265
281
  and runs a CREATE + MATCH round-trip — asserted by a Playwright test
266
- behind `npm run test:browser`.
282
+ behind `yarn workspace @loradb/lora-wasm test:browser`.
267
283
  - `vitest` runs 18 in-process tests against the `nodejs` bundle,
268
284
  covering scalars, nested maps/lists, nodes, relationships, paths,
269
285
  points, all temporal kinds including `date()`/`datetime()` no-arg
@@ -275,15 +291,15 @@ public surface — consumers can swap backends without rewriting types.
275
291
  all three wasm bundles plus the compiled TS wrapper. No `file:` deps,
276
292
  no postinstall scripts.
277
293
 
278
- **What still blocks a real npm publish**
294
+ **Pre-publish checks**
279
295
 
280
- - Package is marked `private: true` and the workspace is pre-1.0.
281
- Publishing needs a final scope decision (e.g. `@lora/wasm`),
282
- a LICENSE file, and a repository URL in `Cargo.toml`/`package.json`.
283
- - The three wasm bundles are each ~2.2 MB. A production publish should
284
- either ship conditional exports that load only the bundle the
285
- consumer imports, or switch to compressed `.wasm` + `fetch` with
286
- `Content-Encoding: br`.
296
+ - Run `yarn workspace @loradb/lora-wasm pack:dry` after every version
297
+ bump. It regenerates the `pkg-*` outputs, copies the root license, and
298
+ shows the exact files that would ship to npm.
299
+ - Check the three wasm bundles before release. They are each about
300
+ 2.2 MB today; the package uses conditional exports so consumers import
301
+ only the target they need, but CDN/browser deployments may still want
302
+ compressed `.wasm` served with `Content-Encoding: br` or `gzip`.
287
303
  - I64 precision is capped at `Number.MAX_SAFE_INTEGER`. For larger
288
304
  integer properties we need a `bigint`-aware serializer on the wasm
289
305
  boundary.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loradb/lora-wasm",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "WebAssembly bindings for the Lora in-memory graph database",
5
5
  "license": "BUSL-1.1",
6
6
  "packageManager": "yarn@4.5.1",