kooni-bot 0.2.4 → 0.2.5
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/kooni.js +15 -5
- package/package.json +1 -1
package/bin/kooni.js
CHANGED
|
@@ -22,7 +22,7 @@ import { execFileSync, spawnSync } from "node:child_process";
|
|
|
22
22
|
import { randomUUID } from "node:crypto";
|
|
23
23
|
import { fileURLToPath } from "node:url";
|
|
24
24
|
|
|
25
|
-
const CLI_VERSION = "0.2.
|
|
25
|
+
const CLI_VERSION = "0.2.5";
|
|
26
26
|
|
|
27
27
|
const REPO = process.env.KOONI_REPO || "iamnocodeveloper/kooni-bot";
|
|
28
28
|
const BRANCH = process.env.KOONI_BRANCH || "main";
|
|
@@ -102,7 +102,7 @@ const DICT = {
|
|
|
102
102
|
migrations: "Aplicando migraciones D1…",
|
|
103
103
|
deploying: "Desplegando el worker…",
|
|
104
104
|
panel: "Panel de administración:",
|
|
105
|
-
next: "
|
|
105
|
+
next: "Abre tu panel → Conexiones para conectar canales (Telegram, Zernio, WhatsApp…) — ahí mismo se activan y quedan en verde.",
|
|
106
106
|
// update
|
|
107
107
|
updRevalidating: "Buscando la versión nueva…",
|
|
108
108
|
updUpToDate: "Ya estás en la última versión.",
|
|
@@ -174,7 +174,7 @@ const DICT = {
|
|
|
174
174
|
migrations: "Applying D1 migrations…",
|
|
175
175
|
deploying: "Deploying the worker…",
|
|
176
176
|
panel: "Admin dashboard:",
|
|
177
|
-
next: "
|
|
177
|
+
next: "Open your panel → Connections to connect channels (Telegram, Zernio, WhatsApp…) — they activate and turn green right there.",
|
|
178
178
|
updRevalidating: "Checking for a new version…",
|
|
179
179
|
updUpToDate: "You're on the latest version.",
|
|
180
180
|
updDone: (v) => `Updated to v${v} (your config and data were preserved)`,
|
|
@@ -527,6 +527,11 @@ function run(file, args = [], opts = {}) {
|
|
|
527
527
|
err.status = r.status;
|
|
528
528
|
throw err;
|
|
529
529
|
}
|
|
530
|
+
// En modo capture, combinamos stdout+stderr: wrangler suele imprimir la URL del
|
|
531
|
+
// worker en stderr (progreso/banners), y necesitamos verla para parsearla.
|
|
532
|
+
if (opts.capture) {
|
|
533
|
+
return `${r.stdout || ""}\n${r.stderr || ""}`;
|
|
534
|
+
}
|
|
530
535
|
return (r.stdout || "").toString();
|
|
531
536
|
}
|
|
532
537
|
|
|
@@ -907,8 +912,11 @@ async function deployBot(dir, { flags = {}, rl } = {}) {
|
|
|
907
912
|
try {
|
|
908
913
|
const dep = runPnpm(dir, ["run", "deploy"], { capture: true });
|
|
909
914
|
url = (dep.match(/https:\/\/[a-z0-9-]+\.workers\.dev/) || [])[0] || "";
|
|
910
|
-
} catch {
|
|
911
|
-
// el deploy
|
|
915
|
+
} catch (e) {
|
|
916
|
+
// Muestra el detalle real del deploy en vez de tragarlo: así el usuario ve
|
|
917
|
+
// qué falló (deploy-check, binding, auth…) y puede corregirlo.
|
|
918
|
+
const tail = ((e && (e.stderr || e.stdout || e.message)) || "").toString().trim().split("\n").slice(-12).join("\n");
|
|
919
|
+
if (tail) console.log(C.red(" ✗ " + tail));
|
|
912
920
|
throw new Error(t().deployFailed);
|
|
913
921
|
}
|
|
914
922
|
if (url) {
|
|
@@ -1093,6 +1101,8 @@ async function cmdInit(flags, rest) {
|
|
|
1093
1101
|
console.log("\n " + C.green(C.b(m("🎉 BOT EN LÍNEA", "🎉 BOT LIVE"))));
|
|
1094
1102
|
console.log(" " + C.cyan(t().panel) + " " + C.b(url + "/admin"));
|
|
1095
1103
|
console.log(" " + C.dim(t().next) + "\n");
|
|
1104
|
+
} else {
|
|
1105
|
+
console.log(" " + C.yellow(m("No detecté la URL automáticamente. Búscala en la salida de `pnpm run deploy` arriba (https://…workers.dev) y abre <url>/admin.", "Couldn't auto-detect the URL. Find it in the `pnpm run deploy` output above (https://…workers.dev) and open <url>/admin.")) + "\n");
|
|
1096
1106
|
}
|
|
1097
1107
|
}
|
|
1098
1108
|
|
package/package.json
CHANGED