telbase 0.13.0-beta.2

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/telbase ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+
3
+ "use strict";
4
+
5
+ const { execFileSync } = require("child_process");
6
+ const { getBinaryPath } = require("../lib/main");
7
+
8
+ try {
9
+ const binPath = getBinaryPath();
10
+ execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
11
+ } catch (err) {
12
+ if (err.status !== undefined) {
13
+ // Binary ran but exited with non-zero — preserve exit code
14
+ process.exit(err.status);
15
+ }
16
+ // Binary not found or other setup error
17
+ console.error(err.message);
18
+ process.exit(1);
19
+ }
package/install.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ // postinstall: verify binary exists, warn (don't fail) if missing
4
+ try {
5
+ const { getBinaryPath } = require("./lib/main");
6
+ getBinaryPath();
7
+ } catch (err) {
8
+ console.warn(
9
+ "warn: telbase binary not found for this platform.\n" +
10
+ " Install manually: curl -fsSL https://telbase.ai/install | sh\n"
11
+ );
12
+ }
package/lib/main.js ADDED
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ const path = require("path");
4
+ const fs = require("fs");
5
+
6
+ const PLATFORM_PACKAGES = {
7
+ "darwin-arm64": "@telbase/cli-darwin-arm64",
8
+ "darwin-x64": "@telbase/cli-darwin-x64",
9
+ "linux-arm64": "@telbase/cli-linux-arm64",
10
+ "linux-x64": "@telbase/cli-linux-x64",
11
+ "win32-x64": "@telbase/cli-win32-x64",
12
+ };
13
+
14
+ function getBinaryName() {
15
+ return process.platform === "win32" ? "telbase.exe" : "telbase";
16
+ }
17
+
18
+ function getPlatformPackage() {
19
+ const key = `${process.platform}-${process.arch}`;
20
+ const pkg = PLATFORM_PACKAGES[key];
21
+ if (!pkg) {
22
+ throw new Error(
23
+ `Unsupported platform: ${process.platform}-${process.arch}\n` +
24
+ `Telbase supports: ${Object.keys(PLATFORM_PACKAGES).join(", ")}\n` +
25
+ `Install manually: curl -fsSL https://telbase.ai/install | sh`
26
+ );
27
+ }
28
+ return pkg;
29
+ }
30
+
31
+ function getBinaryPath() {
32
+ // Try the platform-specific npm package first
33
+ const pkg = getPlatformPackage();
34
+ try {
35
+ const pkgJson = require.resolve(`${pkg}/package.json`);
36
+ const pkgDir = path.dirname(pkgJson);
37
+ const binPath = path.join(pkgDir, "bin", getBinaryName());
38
+ if (fs.existsSync(binPath)) {
39
+ return binPath;
40
+ }
41
+ } catch (_) {
42
+ // Package not installed — fall through
43
+ }
44
+
45
+ // Fallback: manual install location
46
+ const home = process.env.HOME || process.env.USERPROFILE;
47
+ if (home) {
48
+ const manualPath = path.join(home, ".telbase", "bin", getBinaryName());
49
+ if (fs.existsSync(manualPath)) {
50
+ return manualPath;
51
+ }
52
+ }
53
+
54
+ throw new Error(
55
+ `Telbase binary not found for ${process.platform}-${process.arch}.\n` +
56
+ `Try reinstalling: npm install -g telbase\n` +
57
+ `Or install manually: curl -fsSL https://telbase.ai/install | sh`
58
+ );
59
+ }
60
+
61
+ module.exports = { getBinaryPath, getPlatformPackage, getBinaryName };
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "telbase",
3
+ "version": "0.13.0-beta.2",
4
+ "description": "Deploy any web project with one command. AI-native deployment platform.",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "telbase": "bin/telbase"
8
+ },
9
+ "scripts": {
10
+ "postinstall": "node install.js"
11
+ },
12
+ "engines": {
13
+ "node": ">=18"
14
+ },
15
+ "files": [
16
+ "bin/*",
17
+ "lib/*",
18
+ "install.js"
19
+ ],
20
+ "optionalDependencies": {
21
+ "@telbase/cli-darwin-arm64": "0.13.0-beta.2",
22
+ "@telbase/cli-darwin-x64": "0.13.0-beta.2",
23
+ "@telbase/cli-linux-arm64": "0.13.0-beta.2",
24
+ "@telbase/cli-linux-x64": "0.13.0-beta.2",
25
+ "@telbase/cli-win32-x64": "0.13.0-beta.2"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/Victor-EU/telbase"
30
+ },
31
+ "homepage": "https://telbase.ai",
32
+ "keywords": [
33
+ "deploy",
34
+ "hosting",
35
+ "vercel",
36
+ "ai",
37
+ "vibe-coding",
38
+ "deployment"
39
+ ]
40
+ }