gloomberb 0.10.0 → 0.10.1

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": "gloomberb",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Market research and portfolio tracker for the terminal",
5
5
  "module": "src/index.tsx",
6
6
  "type": "module",
@@ -10,11 +10,22 @@ export interface NativeOccluder {
10
10
  zIndex: number;
11
11
  }
12
12
 
13
+ export interface NativeLocalOccluder {
14
+ id: string;
15
+ paneId: string;
16
+ rect: { x: number; y: number; width: number; height: number };
17
+ }
18
+
19
+ // Must expose every public method of the terminal manager: the desktop view
20
+ // bundle swaps this module in, so a missing method is a runtime crash.
21
+ // native-stubs.test.ts guards the drift.
13
22
  export class NativeSurfaceManager {
14
23
  setWindowState(): void {}
15
24
  upsertSurface(): void {}
16
25
  updateSurfaceGeometry(): void {}
17
26
  removeSurface(): void {}
27
+ upsertLocalOccluder(): void {}
28
+ removeLocalOccluder(): void {}
18
29
  destroy(): void {}
19
30
  }
20
31
 
@@ -0,0 +1,47 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { Glob } from "bun";
3
+ import * as realSurfaceSync from "../../../../components/chart/native/surface/sync";
4
+ import * as realKittySupport from "../../../../components/chart/native/kitty/support";
5
+ import { NativeSurfaceManager as StubNativeSurfaceManager } from "./chart/surface-manager";
6
+ import * as stubSurfaceSync from "./chart/surface-sync";
7
+ import * as stubKittySupport from "./chart/kitty-support";
8
+
9
+ // The desktop view bundle aliases these modules to the stubs in this directory
10
+ // (see build-assets.ts COMMON_ALIAS_RULES). A method the app calls but the stub
11
+ // lacks is a desktop startup crash, not a type error, so check the shapes here.
12
+
13
+ function exportedFunctions(module: Record<string, unknown>): string[] {
14
+ return Object.keys(module)
15
+ .filter((name) => typeof module[name] === "function")
16
+ .sort();
17
+ }
18
+
19
+ async function calledSurfaceManagerMethods(): Promise<string[]> {
20
+ const calls = new Set<string>();
21
+ const pattern = /\b\w*[sS]urfaceManager(?:\.current)?\.([a-zA-Z]\w*)\s*\(/g;
22
+ for await (const path of new Glob("src/**/*.{ts,tsx}").scan(".")) {
23
+ if (path.includes("native-stubs") || path.includes("native/surface/manager")) continue;
24
+ for (const match of (await Bun.file(path).text()).matchAll(pattern)) {
25
+ calls.add(match[1]!);
26
+ }
27
+ }
28
+ return [...calls].sort();
29
+ }
30
+
31
+ describe("desktop view native stubs", () => {
32
+ test("surface manager stub answers every method the app calls on it", async () => {
33
+ const called = await calledSurfaceManagerMethods();
34
+ expect(called.length).toBeGreaterThan(3);
35
+ const stub = StubNativeSurfaceManager.prototype as unknown as Record<string, unknown>;
36
+ expect(called.filter((name) => typeof stub[name] !== "function")).toEqual([]);
37
+ });
38
+
39
+ test("module stubs export every function of the modules they replace", () => {
40
+ expect(
41
+ exportedFunctions(realSurfaceSync).filter((name) => !exportedFunctions(stubSurfaceSync).includes(name)),
42
+ ).toEqual([]);
43
+ expect(
44
+ exportedFunctions(realKittySupport).filter((name) => !exportedFunctions(stubKittySupport).includes(name)),
45
+ ).toEqual([]);
46
+ });
47
+ });
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.10.0";
1
+ export const VERSION = "0.10.1";