@fabrika/canvas-kernel 0.1.44 → 0.1.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabrika/canvas-kernel",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "type": "module",
5
5
  "description": "Host-agnostic canvas SDK: a daemon runtime (WebSocket channel, CLI waiter, process lifecycle), a locator-agnostic annotation surface, and the canvas engine (JSX→Bun.build compiler, session/revision store, watcher).",
6
6
  "license": "MIT",
@@ -15,7 +15,23 @@ import { GlobalRegistrator } from "@happy-dom/global-registrator";
15
15
  // Bun runs every test file in one process, so the second file to import this
16
16
  // must not register over the first.
17
17
  if (!globalThis.document) {
18
+ // happy-dom replaces the whole fetch stack with a Window implementation over
19
+ // node:http. That is not what this harness is for, and because every test
20
+ // file shares one process it reaches code that has nothing to do with the
21
+ // DOM — the daemon lifecycle probes `/health` through the global `fetch` and
22
+ // fails on responses Bun parses fine. Which tests broke depended on file
23
+ // order, so it passed locally and failed in CI. Keep Bun's stack.
24
+ const runtimeFetch = globalThis.fetch;
25
+ const runtimeResponse = globalThis.Response;
26
+ const runtimeRequest = globalThis.Request;
27
+ const runtimeHeaders = globalThis.Headers;
28
+
18
29
  GlobalRegistrator.register();
30
+
31
+ globalThis.fetch = runtimeFetch;
32
+ globalThis.Response = runtimeResponse;
33
+ globalThis.Request = runtimeRequest;
34
+ globalThis.Headers = runtimeHeaders;
19
35
  }
20
36
 
21
37
  /**