base44 0.0.38 → 0.0.40
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/bin/binary-entry.ts +40 -0
- package/dist/{deno-runtime → assets/deno-runtime}/main.js.map +1 -1
- package/dist/cli/index.js +484 -483
- package/dist/cli/index.js.map +1 -1
- package/package.json +7 -4
- /package/dist/{deno-runtime → assets/deno-runtime}/main.js +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/.nvmrc +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/README.md +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/base44/agents/task_manager.jsonc +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/base44/app.jsonc.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/base44/config.jsonc.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/base44/entities/task.jsonc +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/components.json +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/gitignore.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/index.html +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/jsconfig.json +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/package.json +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/postcss.config.js +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/App.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/api/base44Client.js.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/components/Base44Logo.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/button.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/checkbox.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/input.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/index.css +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/main.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/tailwind.config.js +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/vite.config.js +0 -0
- /package/dist/{templates → assets/templates}/backend-only/base44/app.jsonc.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-only/base44/config.jsonc.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-only/base44/gitignore.ejs +0 -0
- /package/dist/{templates → assets/templates}/templates.json +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entry point for standalone compiled binaries (built with `bun build --compile`).
|
|
3
|
+
*
|
|
4
|
+
* This file embeds a single assets tarball (templates + deno-runtime) into the
|
|
5
|
+
* binary and extracts it to ~/.base44/assets/<version>/ on first run.
|
|
6
|
+
* The npm distribution uses bin/run.js instead — this file is only used
|
|
7
|
+
* for the compiled binary path.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, mkdirSync } from "node:fs";
|
|
10
|
+
import { homedir } from "node:os";
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
import { runCLI } from "../src/cli/index.js";
|
|
13
|
+
// Bun embeds this file into the compiled binary.
|
|
14
|
+
// At runtime, it resolves to a path inside the $bunfs virtual filesystem.
|
|
15
|
+
// Only Bun.file() can read these paths — Node.js fs APIs and external
|
|
16
|
+
// processes cannot access them directly.
|
|
17
|
+
// @ts-expect-error -- import attributes with type "file" are a Bun-specific feature
|
|
18
|
+
import assetsTarball from "../dist/assets.tar.gz" with { type: "file" };
|
|
19
|
+
import packageJson from "../package.json";
|
|
20
|
+
|
|
21
|
+
const VERSION = packageJson.version;
|
|
22
|
+
|
|
23
|
+
const assetsDir = join(homedir(), ".base44", "assets", VERSION);
|
|
24
|
+
|
|
25
|
+
// Extract assets if this version hasn't been unpacked yet.
|
|
26
|
+
// Bun.file() reads from the virtual $bunfs, then we write to real disk
|
|
27
|
+
// so the rest of the CLI can access these files normally.
|
|
28
|
+
if (!existsSync(assetsDir)) {
|
|
29
|
+
mkdirSync(assetsDir, { recursive: true });
|
|
30
|
+
const bytes = await Bun.file(assetsTarball).bytes();
|
|
31
|
+
const archive = new Bun.Archive(bytes);
|
|
32
|
+
await archive.extract(assetsDir);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Disable Clack spinners and animations in non-interactive environments.
|
|
36
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
37
|
+
process.env.CI = "true";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
await runCLI();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../deno-runtime/main.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
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
6
|
],
|