@base44-preview/cli 0.0.52-pr.529.44a9028 → 0.0.52-pr.533.ff4dead

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.
@@ -25,9 +25,8 @@ if (!functionPath) {
25
25
  // Store the original Deno.serve
26
26
  const originalServe = Deno.serve.bind(Deno);
27
27
 
28
- // Patch Deno.serve to inject our port and add onListen callback
29
- // @ts-expect-error - We're intentionally overriding Deno.serve
30
- Deno.serve = (
28
+ // Patch Deno.serve to inject our port and add onListen callback.
29
+ const patchedServe = (
31
30
  optionsOrHandler:
32
31
  | Deno.ServeOptions
33
32
  | Deno.ServeHandler
@@ -60,6 +59,15 @@ Deno.serve = (
60
59
  return originalServe({ ...options, port, onListen });
61
60
  };
62
61
 
62
+ // Deno 2.8 exposes `Deno.serve` as a getter-only property, so a plain
63
+ // `Deno.serve = ...` assignment throws. Use defineProperty to override it
64
+ // (works on both the old writable property and the new accessor).
65
+ Object.defineProperty(Deno, "serve", {
66
+ value: patchedServe,
67
+ writable: true,
68
+ configurable: true,
69
+ });
70
+
63
71
  console.log(`[${functionName}] Starting function from ${functionPath}`);
64
72
 
65
73
  // Dynamically import the user's function