@monolayer/sdk 1.2.4 → 1.3.0-canary.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/dist/bin/cli.js CHANGED
@@ -21535,7 +21535,7 @@ A new version of @monolayer/sdk is available. Current version: ${installedVersio
21535
21535
  }
21536
21536
 
21537
21537
  // src/bin/cli.ts
21538
- var CURRENT_VERSION = "1.2.3";
21538
+ var CURRENT_VERSION = "1.2.5";
21539
21539
  function isCommanderError(error) {
21540
21540
  return error instanceof CommanderError;
21541
21541
  }
@@ -1,4 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
- export declare function Broadcast({ children }: {
2
+ export declare function Broadcast({ children, url, host, }: {
3
3
  children: ReactNode;
4
+ url?: string;
5
+ host?: string;
4
6
  }): import("react/jsx-runtime").JSX.Element;
@@ -3,9 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Broadcast = Broadcast;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const broadcast_provider_js_1 = require("./broadcast-provider.js");
6
- function Broadcast({ children }) {
7
- return ((0, jsx_runtime_1.jsx)(broadcast_provider_js_1.BroadcastContextProvider, { urlAndHost: {
8
- url: process.env.ML_BROADCAST_URL ?? "ws://localhost:9311",
9
- host: process.env.ML_BROADCAST_HOST ?? "localhost",
10
- }, children: children }));
6
+ function Broadcast({ children, url, host, }) {
7
+ return ((0, jsx_runtime_1.jsx)(broadcast_provider_js_1.BroadcastContextProvider, { urlAndHost: broadcastConfig({ url, host }), children: children }));
8
+ }
9
+ function broadcastConfig(opts) {
10
+ return {
11
+ url: opts.url ??
12
+ (typeof window !== "undefined"
13
+ ? undefined
14
+ : process.env.ML_BROADCAST_URL) ??
15
+ "ws://localhost:9311",
16
+ host: opts.host ??
17
+ (typeof window !== "undefined"
18
+ ? undefined
19
+ : process.env.ML_BROADCAST_HOST) ??
20
+ "localhost",
21
+ };
11
22
  }
@@ -1,4 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
- export declare function Broadcast({ children }: {
2
+ export declare function Broadcast({ children, url, host, }: {
3
3
  children: ReactNode;
4
+ url?: string;
5
+ host?: string;
4
6
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,19 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { BroadcastContextProvider } from "./broadcast-provider.js";
3
- export function Broadcast({ children }) {
4
- return (_jsx(BroadcastContextProvider, { urlAndHost: {
5
- url: process.env.ML_BROADCAST_URL ?? "ws://localhost:9311",
6
- host: process.env.ML_BROADCAST_HOST ?? "localhost",
7
- }, children: children }));
3
+ export function Broadcast({ children, url, host, }) {
4
+ return (_jsx(BroadcastContextProvider, { urlAndHost: broadcastConfig({ url, host }), children: children }));
5
+ }
6
+ function broadcastConfig(opts) {
7
+ return {
8
+ url: opts.url ??
9
+ (typeof window !== "undefined"
10
+ ? undefined
11
+ : process.env.ML_BROADCAST_URL) ??
12
+ "ws://localhost:9311",
13
+ host: opts.host ??
14
+ (typeof window !== "undefined"
15
+ ? undefined
16
+ : process.env.ML_BROADCAST_HOST) ??
17
+ "localhost",
18
+ };
8
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolayer/sdk",
3
- "version": "1.2.4",
3
+ "version": "1.3.0-canary.1",
4
4
  "description": "Build and deploy full-stack applications with zero infrastructure overhead.",
5
5
  "author": "Marcos Essindi <marcessindi@me.com>",
6
6
  "license": "MIT",
@@ -13,11 +13,10 @@
13
13
  },
14
14
  "type": "module",
15
15
  "bin": {
16
- "monolayer": "dist/bin/cli.js"
16
+ "monolayer": "dist/bin/cli.js",
17
+ "broadcast-server": "dist/bin/broadcast-server.mjs"
17
18
  },
18
19
  "files": [
19
- "dist/bin/*.js",
20
- "dist/bin/*.mjs",
21
20
  "dist/**/*.js",
22
21
  "dist/**/*.d.ts",
23
22
  "dist/esm/package.json",