@base44-preview/cli 0.0.41-pr.386.60085e2 → 0.0.41-pr.389.06cb818

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,31 @@
1
+ // deno-runtime/main.ts
2
+ var functionPath = Deno.env.get("FUNCTION_PATH");
3
+ var port = parseInt(Deno.env.get("FUNCTION_PORT") || "8000", 10);
4
+ var functionName = Deno.env.get("FUNCTION_NAME") || "unknown";
5
+ if (!functionPath) {
6
+ console.error("[wrapper] FUNCTION_PATH environment variable is required");
7
+ Deno.exit(1);
8
+ }
9
+ var originalServe = Deno.serve.bind(Deno);
10
+ Deno.serve = (optionsOrHandler, maybeHandler) => {
11
+ const onListen = () => {
12
+ console.log(`[${functionName}] Listening on http://localhost:${port}`);
13
+ };
14
+ if (typeof optionsOrHandler === "function") {
15
+ return originalServe({ port, onListen }, optionsOrHandler);
16
+ }
17
+ if (maybeHandler) {
18
+ return originalServe({ ...optionsOrHandler, port, onListen }, maybeHandler);
19
+ }
20
+ const options = optionsOrHandler;
21
+ return originalServe({ ...options, port, onListen });
22
+ };
23
+ console.log(`[${functionName}] Starting function from ${functionPath}`);
24
+ try {
25
+ await import(functionPath);
26
+ } catch (error) {
27
+ console.error(`[${functionName}] Failed to load function:`, error);
28
+ Deno.exit(1);
29
+ }
30
+
31
+ //# debugId=4C4599C9DDF4C0E464756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../deno-runtime/main.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * Deno Function Wrapper\n *\n * This script is executed by Deno to run user functions.\n * It patches Deno.serve to inject a dynamic port before importing the user's function.\n *\n * Environment variables:\n * - FUNCTION_PATH: Absolute path to the user's function entry file\n * - FUNCTION_PORT: Port number for the function to listen on\n * - FUNCTION_NAME: Name of the function (for logging)\n */\n\n// Make this file a module for top-level await support\nexport {};\n\nconst functionPath = Deno.env.get(\"FUNCTION_PATH\");\nconst port = parseInt(Deno.env.get(\"FUNCTION_PORT\") || \"8000\", 10);\nconst functionName = Deno.env.get(\"FUNCTION_NAME\") || \"unknown\";\n\nif (!functionPath) {\n console.error(\"[wrapper] FUNCTION_PATH environment variable is required\");\n Deno.exit(1);\n}\n\n// Store the original Deno.serve\nconst originalServe = Deno.serve.bind(Deno);\n\n// Patch Deno.serve to inject our port and add onListen callback\n// @ts-expect-error - We're intentionally overriding Deno.serve\nDeno.serve = (\n optionsOrHandler:\n | Deno.ServeOptions\n | Deno.ServeHandler\n | (Deno.ServeOptions & { handler: Deno.ServeHandler }),\n maybeHandler?: Deno.ServeHandler,\n): Deno.HttpServer<Deno.NetAddr> => {\n const onListen = () => {\n // This message is used by FunctionManager to detect when the function is ready\n console.log(`[${functionName}] Listening on http://localhost:${port}`);\n };\n\n // Handle the different Deno.serve signatures:\n // 1. Deno.serve(handler)\n // 2. Deno.serve(options, handler)\n // 3. Deno.serve({ ...options, handler })\n if (typeof optionsOrHandler === \"function\") {\n // Signature: Deno.serve(handler)\n return originalServe({ port, onListen }, optionsOrHandler);\n }\n\n if (maybeHandler) {\n // Signature: Deno.serve(options, handler)\n return originalServe({ ...optionsOrHandler, port, onListen }, maybeHandler);\n }\n\n // Signature: Deno.serve({ ...options, handler })\n const options = optionsOrHandler as Deno.ServeOptions & {\n handler: Deno.ServeHandler;\n };\n return originalServe({ ...options, port, onListen });\n};\n\nconsole.log(`[${functionName}] Starting function from ${functionPath}`);\n\n// Dynamically import the user's function\n// The function will call Deno.serve which is now patched to use our port\ntry {\n await import(functionPath);\n} catch (error) {\n console.error(`[${functionName}] Failed to load function:`, error);\n Deno.exit(1);\n}\n"
6
+ ],
7
+ "mappings": ";AAeA,IAAM,eAAe,KAAK,IAAI,IAAI,eAAe;AACjD,IAAM,OAAO,SAAS,KAAK,IAAI,IAAI,eAAe,KAAK,QAAQ,EAAE;AACjE,IAAM,eAAe,KAAK,IAAI,IAAI,eAAe,KAAK;AAEtD,IAAI,CAAC,cAAc;AAAA,EACjB,QAAQ,MAAM,0DAA0D;AAAA,EACxE,KAAK,KAAK,CAAC;AACb;AAGA,IAAM,gBAAgB,KAAK,MAAM,KAAK,IAAI;AAI1C,KAAK,QAAQ,CACX,kBAIA,iBACkC;AAAA,EAClC,MAAM,WAAW,MAAM;AAAA,IAErB,QAAQ,IAAI,IAAI,+CAA+C,MAAM;AAAA;AAAA,EAOvE,IAAI,OAAO,qBAAqB,YAAY;AAAA,IAE1C,OAAO,cAAc,EAAE,MAAM,SAAS,GAAG,gBAAgB;AAAA,EAC3D;AAAA,EAEA,IAAI,cAAc;AAAA,IAEhB,OAAO,cAAc,KAAK,kBAAkB,MAAM,SAAS,GAAG,YAAY;AAAA,EAC5E;AAAA,EAGA,MAAM,UAAU;AAAA,EAGhB,OAAO,cAAc,KAAK,SAAS,MAAM,SAAS,CAAC;AAAA;AAGrD,QAAQ,IAAI,IAAI,wCAAwC,cAAc;AAItE,IAAI;AAAA,EACF,MAAa;AAAA,EACb,OAAO,OAAO;AAAA,EACd,QAAQ,MAAM,IAAI,0CAA0C,KAAK;AAAA,EACjE,KAAK,KAAK,CAAC;AAAA;",
8
+ "debugId": "4C4599C9DDF4C0E464756E2164756E21",
9
+ "names": []
10
+ }
package/dist/cli/index.js CHANGED
@@ -231471,10 +231471,10 @@ var package_default = {
231471
231471
  dev: "./bin/dev.ts",
231472
231472
  start: "./bin/run.js",
231473
231473
  clean: "rm -rf dist && mkdir -p dist",
231474
- lint: "biome check src tests",
231475
- "lint:fix": "biome check --write src tests",
231476
231474
  test: "vitest run",
231477
231475
  "test:watch": "vitest",
231476
+ lint: "cd ../.. && bun run lint",
231477
+ "lint:fix": "cd ../.. && bun run lint:fix",
231478
231478
  "build:binaries": "bun run infra/build-binaries.ts",
231479
231479
  "package:binaries": "bun run infra/package-binaries.ts"
231480
231480
  },
@@ -231490,7 +231490,6 @@ var package_default = {
231490
231490
  url: "https://github.com/base44/cli"
231491
231491
  },
231492
231492
  devDependencies: {
231493
- "@biomejs/biome": "^2.0.0",
231494
231493
  "@clack/prompts": "^1.0.1",
231495
231494
  "@seald-io/nedb": "^4.1.2",
231496
231495
  "@types/bun": "^1.2.15",
@@ -231549,7 +231548,7 @@ function getTemplatesIndexPath() {
231549
231548
  return join7(ASSETS_DIR, "templates", "templates.json");
231550
231549
  }
231551
231550
  function getDenoWrapperPath() {
231552
- return join7(ASSETS_DIR, "deno-runtime", "main.ts");
231551
+ return join7(ASSETS_DIR, "deno-runtime", "main.js");
231553
231552
  }
231554
231553
  function ensureNpmAssets(sourceDir) {
231555
231554
  if (existsSync(ASSETS_DIR))
@@ -248103,4 +248102,4 @@ export {
248103
248102
  CLIExitError
248104
248103
  };
248105
248104
 
248106
- //# debugId=56DB991BD2BD39CD64756E2164756E21
248105
+ //# debugId=8081A1A79F100AB364756E2164756E21