osra 0.6.10 → 0.6.12

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.
@@ -47,6 +47,10 @@ export declare const box: <T, T2 extends RevivableContext = RevivableContext>(va
47
47
  autoBox?: boolean;
48
48
  }) => BoxedMessagePort<T>;
49
49
  export declare const revive: <T extends Capable, T2 extends RevivableContext>(value: BoxedMessagePort<T>, context: T2) => TypedMessagePort<T>;
50
+ /** Called after a post with its transfer list: replays what the local end of every channel whose
51
+ * peer was in it did while unshipped. A peer that never ships keeps its local end open, and its
52
+ * posts unsent, until garbage collection. */
53
+ export declare const markPortsShipped: (transferables: readonly Transferable[]) => void;
50
54
  /** Factory for revivable-internal channels. Returns a local port that
51
55
  * auto-boxes live values regardless of transport, plus a pre-boxed remote
52
56
  * port the revivable embeds in its Boxed* structure. */
@@ -0,0 +1,10 @@
1
+ /** Base64 for the bytes a JSON transport carries. Internal: module authors get the same behaviour
2
+ * through `boxBuffer`/`reviveBuffer`, so this stays out of the package root.
3
+ *
4
+ * `Uint8Array.prototype.toBase64` and `Uint8Array.fromBase64` are in every current browser, but
5
+ * node 22 and 24, both LTS as of 2026-09, ship neither (node 26 does), and a JSON transport boxes
6
+ * every buffer and typed array through here. So: the native method when present, node's `Buffer`
7
+ * when present, a chunked `btoa`/`atob` otherwise. Measured 2026-09-03 on node 22.23.2, 24.19.0
8
+ * and 26.8.1. */
9
+ export declare const bytesToBase64: (bytes: Uint8Array) => string;
10
+ export declare const base64ToBytes: (base64: string) => Uint8Array<ArrayBuffer>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osra",
3
- "version": "0.6.10",
3
+ "version": "0.6.12",
4
4
  "description": "Easy communication between workers",
5
5
  "homepage": "https://github.com/Banou26/osra#readme",
6
6
  "bugs": {
@@ -40,10 +40,12 @@
40
40
  "prepublishOnly": "npm run clean && npm run build",
41
41
  "build-test": "vp build --config vite.test.config.ts",
42
42
  "build-test-watch": "vp build --config vite.test.config.ts --watch",
43
+ "build-test-node": "vp build --config vite.test-node.config.ts",
43
44
  "dev": "concurrently \"npm run build-test-watch\"",
44
45
  "_dev": "concurrently \"npm run build-watch\" \"npm run build-test-watch\" \"npm run test-watch\"",
45
46
  "dev2": "concurrently \"npm run build-watch\" \"npm run build-test-watch\" \"npm run test-watch-headful\"",
46
47
  "test": "npm run build && npm run build-test && npx playwright test",
48
+ "test-node": "npm run build && npm run build-test-node && node --expose-gc --test --test-force-exit build-test-node/node.js",
47
49
  "test-watch": "set PWTEST_WATCH=1 & npx playwright test",
48
50
  "test-watch-headful": "nodemon --watch build-test --exec \"npx playwright test --headed\"",
49
51
  "test-with-coverage": "VITE_COVERAGE=true npm run build-test && VITE_COVERAGE=true npx playwright test && npm run print-coverage && npm run clean-coverage",
@@ -57,6 +59,7 @@
57
59
  "test-extension": "npm run build-extension-test && npx playwright test -c playwright.extension.config.ts",
58
60
  "check-consumer-types": "npm run build && node ./node_modules/typescript7/bin/tsc --noEmit -p tsconfig.consumer.json",
59
61
  "check-declaration-imports": "node scripts/check-declaration-imports.mjs",
62
+ "check-error-chain": "node scripts/check-error-chain.mjs",
60
63
  "check-consumer-types-legacy-lib": "npm run build && node ./node_modules/typescript7/bin/tsc --noEmit -p tsconfig.consumer-lib.json",
61
64
  "docs-dev": "npm run dev -w docs",
62
65
  "docs-build": "npm run build -w docs",