@burdenoff/microfe-comradecircle 2026.720.3 → 2026.730.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.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Shell bridge — unified accessor for capabilities exposed by the host app
3
+ * shell on `globalThis.__burdenoffShell`. Each accessor is fully optional:
4
+ * the MFE must work in isolation (Storybook/standalone Vite dev) when the
5
+ * shell global is absent.
6
+ *
7
+ * Capabilities consumed:
8
+ * - `reportError` — central SRE error sink (Rybbit + backend forward)
9
+ * - `graphqlWsClient` — graphql-ws Client instance (probe-only; subs fall
10
+ * back to polling when absent)
11
+ *
12
+ * Ported from `microfe-channel/src/channel/utils/shellBridge.ts` (BOFF-4455)
13
+ * — same shell contract, product-scoped copy per the "no cross-MFE imports"
14
+ * convention.
15
+ */
16
+ export interface ShellReportErrorMeta {
17
+ module: string;
18
+ context?: Record<string, unknown>;
19
+ componentStack?: string;
20
+ }
21
+ /**
22
+ * Minimal subset of a graphql-ws Client we rely on.
23
+ * https://the-guild.dev/graphql/ws/recipes#use-the-client-without-apollo
24
+ */
25
+ export interface GraphqlWsLike {
26
+ subscribe: (payload: {
27
+ query: string;
28
+ variables?: Record<string, unknown>;
29
+ operationName?: string;
30
+ }, sink: {
31
+ next: (value: {
32
+ data?: unknown;
33
+ errors?: readonly unknown[];
34
+ }) => void;
35
+ error: (err: unknown) => void;
36
+ complete: () => void;
37
+ }) => () => void;
38
+ }
39
+ /**
40
+ * Forward an error to the shell's central error sink. Falls back to
41
+ * `console.error` only when the sink is missing.
42
+ */
43
+ export declare function reportShellError(error: unknown, meta: ShellReportErrorMeta, fallbackLabel?: string): void;
44
+ export declare function getGraphqlWsClient(): GraphqlWsLike | undefined;
45
+ //# sourceMappingURL=shellBridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellBridge.d.ts","sourceRoot":"","sources":["../../../src/comradecircle/utils/shellBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,CACT,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,EACvF,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC,KAAK,EAAE;YAAE,IAAI,CAAC,EAAE,OAAO,CAAC;YAAC,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;SAAE,KAAK,IAAI,CAAC;QACvE,KAAK,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;QAC9B,QAAQ,EAAE,MAAM,IAAI,CAAC;KACtB,KACE,MAAM,IAAI,CAAC;CACjB;AAeD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,oBAAoB,EAC1B,aAAa,CAAC,EAAE,MAAM,GACrB,IAAI,CAgBN;AAED,wBAAgB,kBAAkB,IAAI,aAAa,GAAG,SAAS,CAE9D"}
@@ -0,0 +1,19 @@
1
+ //#region src/comradecircle/utils/shellBridge.ts
2
+ function e() {
3
+ return globalThis.__burdenoffShell;
4
+ }
5
+ function t(t, n, r) {
6
+ let i = t instanceof Error ? t : Error(String(t)), a = e();
7
+ if (a?.reportError) try {
8
+ a.reportError(i, n);
9
+ return;
10
+ } catch {}
11
+ console.error(r || `[${n.module}]`, i, n.context ?? {});
12
+ }
13
+ function n() {
14
+ return e()?.graphqlWsClient;
15
+ }
16
+ //#endregion
17
+ export { n as getGraphqlWsClient, t as reportShellError };
18
+
19
+ //# sourceMappingURL=shellBridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellBridge.js","names":[],"sources":["../../../src/comradecircle/utils/shellBridge.ts"],"sourcesContent":["/**\n * Shell bridge — unified accessor for capabilities exposed by the host app\n * shell on `globalThis.__burdenoffShell`. Each accessor is fully optional:\n * the MFE must work in isolation (Storybook/standalone Vite dev) when the\n * shell global is absent.\n *\n * Capabilities consumed:\n * - `reportError` — central SRE error sink (Rybbit + backend forward)\n * - `graphqlWsClient` — graphql-ws Client instance (probe-only; subs fall\n * back to polling when absent)\n *\n * Ported from `microfe-channel/src/channel/utils/shellBridge.ts` (BOFF-4455)\n * — same shell contract, product-scoped copy per the \"no cross-MFE imports\"\n * convention.\n */\n\nexport interface ShellReportErrorMeta {\n module: string;\n context?: Record<string, unknown>;\n componentStack?: string;\n}\n\n/**\n * Minimal subset of a graphql-ws Client we rely on.\n * https://the-guild.dev/graphql/ws/recipes#use-the-client-without-apollo\n */\nexport interface GraphqlWsLike {\n subscribe: (\n payload: { query: string; variables?: Record<string, unknown>; operationName?: string },\n sink: {\n next: (value: { data?: unknown; errors?: readonly unknown[] }) => void;\n error: (err: unknown) => void;\n complete: () => void;\n }\n ) => () => void;\n}\n\ninterface BurdenoffShell {\n reportError?: (\n sourceOrError: string | Error,\n errorOrMeta?: Error | ShellReportErrorMeta,\n meta?: ShellReportErrorMeta | Record<string, unknown>\n ) => void;\n graphqlWsClient?: GraphqlWsLike;\n}\n\nfunction getShell(): BurdenoffShell | undefined {\n return (globalThis as unknown as { __burdenoffShell?: BurdenoffShell }).__burdenoffShell;\n}\n\n/**\n * Forward an error to the shell's central error sink. Falls back to\n * `console.error` only when the sink is missing.\n */\nexport function reportShellError(\n error: unknown,\n meta: ShellReportErrorMeta,\n fallbackLabel?: string\n): void {\n const err = error instanceof Error ? error : new Error(String(error));\n const sink = getShell();\n if (sink?.reportError) {\n try {\n sink.reportError(err, meta);\n return;\n } catch {\n /* fall through to console */\n }\n }\n if (fallbackLabel) {\n console.error(fallbackLabel, err, meta.context ?? {});\n } else {\n console.error(`[${meta.module}]`, err, meta.context ?? {});\n }\n}\n\nexport function getGraphqlWsClient(): GraphqlWsLike | undefined {\n return getShell()?.graphqlWsClient;\n}\n"],"mappings":";AA8CA,SAAS,IAAuC;CAC9C,OAAQ,WAAgE;AAC1E;AAMA,SAAgB,EACd,GACA,GACA,GACM;CACN,IAAM,IAAM,aAAiB,QAAQ,IAAY,MAAM,OAAO,CAAK,CAAC,GAC9D,IAAO,EAAS;CACtB,IAAI,GAAM,aACR,IAAI;EACF,EAAK,YAAY,GAAK,CAAI;EAC1B;CACF,QAAQ,CAER;CAEF,AACE,QAAQ,MADN,KAGY,IAAI,EAAK,OAAO,IAFD,GAAK,EAAK,WAAW,CAAC,CAEM;AAE7D;AAEA,SAAgB,IAAgD;CAC9D,OAAO,EAAS,GAAG;AACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-comradecircle",
3
- "version": "2026.720.3",
3
+ "version": "2026.730.1",
4
4
  "description": "Burdenoff ComradeCircle Microfrontend",
5
5
  "type": "module",
6
6
  "files": [