deploro 0.6.0 → 0.6.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.
Files changed (2) hide show
  1. package/dist/index.js +32 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ function clearConfig() {
55
55
  }
56
56
 
57
57
  // src/commands/login.ts
58
- var DEFAULT_BASE_URL = "https://gallium-worker.calebmensah.workers.dev";
58
+ var DEFAULT_BASE_URL = "https://api.deploro.com";
59
59
  function ask(rl, question) {
60
60
  return new Promise((resolve) => rl.question(question, resolve));
61
61
  }
@@ -1473,8 +1473,38 @@ async function deployStatusCommand() {
1473
1473
  console.log(` Branch : ${latest.git_branch ?? "(none)"}`);
1474
1474
  console.log(` Started : ${new Date(latest.created_at).toLocaleString()}`);
1475
1475
  console.log(` Finished: ${latest.finished_at ? new Date(latest.finished_at).toLocaleString() : "(in progress)"}`);
1476
+ if (latest.status === "failed") {
1477
+ const reason = await failureReason(config.projectId, latest.id);
1478
+ if (reason) {
1479
+ console.log("");
1480
+ console.log(` Reason : ${reason}`);
1481
+ }
1482
+ console.log("");
1483
+ console.log(` Full output: deploro deploy logs ${latest.id}`);
1484
+ }
1476
1485
  console.log("");
1477
1486
  }
1487
+ async function failureReason(projectId, deploymentId) {
1488
+ try {
1489
+ const data = await apiRequest(
1490
+ `/api/projects/${projectId}/deployments/${deploymentId}`
1491
+ );
1492
+ const d = data.deployment;
1493
+ if (typeof d.ai_error_summary === "string" && d.ai_error_summary.trim()) {
1494
+ return collapse(d.ai_error_summary);
1495
+ }
1496
+ if (typeof d.logs !== "string" || !d.logs.trim()) return null;
1497
+ const lines = d.logs.split("\n").map((l) => l.trim()).filter(Boolean);
1498
+ const explicit = [...lines].reverse().find((l) => l.includes("[deploro] Deploy failed:"));
1499
+ return collapse(explicit ?? lines[lines.length - 1]);
1500
+ } catch {
1501
+ return null;
1502
+ }
1503
+ }
1504
+ function collapse(text) {
1505
+ const one = text.replace(/\s+/g, " ").trim();
1506
+ return one.length > 300 ? `${one.slice(0, 297)}...` : one;
1507
+ }
1478
1508
  async function deployLogsCommand(deploymentId) {
1479
1509
  const config = requireProject();
1480
1510
  let id = deploymentId;
@@ -1766,7 +1796,7 @@ async function vpsLogsCommand(service, opts) {
1766
1796
  var pkg = createRequire(import.meta.url)("../package.json");
1767
1797
  var program = new Command();
1768
1798
  program.name("deploro").description("Deploro developer platform CLI").version(pkg.version);
1769
- program.command("login").description("Log in to Deploro").option("--url <url>", "Worker base URL").option("--token <token>", "Personal access token from the Deploro dashboard").action(loginCommand);
1799
+ program.command("login").description("Log in to Deploro").option("--url <url>", "Worker base URL (default: https://api.deploro.com)").option("--token <token>", "Personal access token from the Deploro dashboard").action(loginCommand);
1770
1800
  program.command("logout").description("Log out and clear local credentials").action(logoutCommand);
1771
1801
  program.command("projects").description("List projects").action(projectsListCommand);
1772
1802
  program.command("create <name>").description("Create a new project (and set it active)").option("--slug <slug>", "Project slug (derived from name if omitted)").option("--repo <url>", "Public repo URL to link for deployments (no embedded tokens/credentials \u2014 for a private repo or auto-deploy on push, use 'deploro github connect' + 'deploro repo link' instead)").option("--branch <branch>", "Git branch to deploy from").action(projectsCreateCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deploro",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Command-line interface for the Deploro developer platform — manage projects, databases, deployments, and hosting from your terminal.",
5
5
  "type": "module",
6
6
  "bin": {