clawfire 0.6.18 → 0.6.19

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/dist/cli.js CHANGED
@@ -269,7 +269,7 @@ async function runDevServer() {
269
269
  const port = portArg ? parseInt(portArg.split("=")[1], 10) : 3e3;
270
270
  const apiPort = apiPortArg ? parseInt(apiPortArg.split("=")[1], 10) : 3456;
271
271
  const noHotReload = args.includes("--no-hot-reload");
272
- const { startDevServer } = await import("./dev-server-54RXFRNZ.js");
272
+ const { startDevServer } = await import("./dev-server-MLT3ZO5A.js");
273
273
  await startDevServer({
274
274
  projectDir,
275
275
  port,
@@ -3015,40 +3015,41 @@ var FirebaseSetup = class {
3015
3015
  return { success: false, message: "Invalid firebase.json." };
3016
3016
  }
3017
3017
  const timeoutMs = targets.includes("functions") ? 3e5 : 12e4;
3018
+ const args = ["deploy", "--only", targets, "--json"];
3019
+ if (targets.includes("functions")) args.push("--force");
3018
3020
  try {
3019
- const output = await this.execTimeout(
3020
- "firebase",
3021
- ["deploy", "--only", targets, "--json"],
3022
- timeoutMs
3023
- );
3024
- let url = "";
3025
- try {
3026
- const data = JSON.parse(output);
3027
- if (data?.result) {
3028
- for (const key of Object.keys(data.result)) {
3029
- if (key.startsWith("hosting") && typeof data.result[key] === "object") {
3030
- url = data.result[key]?.url || data.result[key]?.site?.url || "";
3031
- if (url) break;
3032
- }
3033
- }
3034
- }
3035
- } catch {
3036
- const urlMatch = output.match(/https:\/\/[a-z0-9-]+\.web\.app/i);
3037
- if (urlMatch) url = urlMatch[0];
3038
- }
3039
- if (!url) {
3040
- const state = this.loadState();
3041
- if (state.projectId) {
3042
- url = `https://${state.projectId}.web.app`;
3043
- }
3044
- }
3045
- const label = targets.includes("functions") ? "Hosting + Functions" : "Hosting";
3046
- return { success: true, url: url || void 0, message: `${label} deployed successfully!` };
3021
+ const output = await this.execTimeout("firebase", args, timeoutMs);
3022
+ return { success: true, url: this.extractDeployUrl(output), message: `${targets.includes("functions") ? "Functions" : "Hosting"} deployed successfully!` };
3047
3023
  } catch (err) {
3048
3024
  const msg = err instanceof Error ? err.message : "Unknown error";
3025
+ if (msg.includes("successfully deployed") || msg.includes("Successful create operation") || msg.includes("Successful update operation")) {
3026
+ return { success: true, url: this.extractDeployUrl(msg), message: `${targets.includes("functions") ? "Functions" : "Hosting"} deployed successfully!` };
3027
+ }
3049
3028
  return { success: false, message: `Deploy failed: ${msg}` };
3050
3029
  }
3051
3030
  }
3031
+ /** Extract hosting URL from deploy output */
3032
+ extractDeployUrl(output) {
3033
+ try {
3034
+ const data = JSON.parse(output);
3035
+ if (data?.result) {
3036
+ for (const key of Object.keys(data.result)) {
3037
+ if (key.startsWith("hosting") && typeof data.result[key] === "object") {
3038
+ const url = data.result[key]?.url || data.result[key]?.site?.url || "";
3039
+ if (url) return url;
3040
+ }
3041
+ }
3042
+ }
3043
+ } catch {
3044
+ const urlMatch = output.match(/https:\/\/[a-z0-9-]+\.web\.app/i);
3045
+ if (urlMatch) return urlMatch[0];
3046
+ }
3047
+ const state = this.loadState();
3048
+ if (state.projectId) {
3049
+ return `https://${state.projectId}.web.app`;
3050
+ }
3051
+ return void 0;
3052
+ }
3052
3053
  // ─── Full Deploy Pipeline ────────────────────────────────────────────
3053
3054
  /**
3054
3055
  * Sync environment variables to functions/.env for production.
package/dist/dev.cjs CHANGED
@@ -3427,40 +3427,41 @@ var FirebaseSetup = class {
3427
3427
  return { success: false, message: "Invalid firebase.json." };
3428
3428
  }
3429
3429
  const timeoutMs = targets.includes("functions") ? 3e5 : 12e4;
3430
+ const args = ["deploy", "--only", targets, "--json"];
3431
+ if (targets.includes("functions")) args.push("--force");
3430
3432
  try {
3431
- const output = await this.execTimeout(
3432
- "firebase",
3433
- ["deploy", "--only", targets, "--json"],
3434
- timeoutMs
3435
- );
3436
- let url = "";
3437
- try {
3438
- const data = JSON.parse(output);
3439
- if (data?.result) {
3440
- for (const key of Object.keys(data.result)) {
3441
- if (key.startsWith("hosting") && typeof data.result[key] === "object") {
3442
- url = data.result[key]?.url || data.result[key]?.site?.url || "";
3443
- if (url) break;
3444
- }
3445
- }
3446
- }
3447
- } catch {
3448
- const urlMatch = output.match(/https:\/\/[a-z0-9-]+\.web\.app/i);
3449
- if (urlMatch) url = urlMatch[0];
3450
- }
3451
- if (!url) {
3452
- const state = this.loadState();
3453
- if (state.projectId) {
3454
- url = `https://${state.projectId}.web.app`;
3455
- }
3456
- }
3457
- const label = targets.includes("functions") ? "Hosting + Functions" : "Hosting";
3458
- return { success: true, url: url || void 0, message: `${label} deployed successfully!` };
3433
+ const output = await this.execTimeout("firebase", args, timeoutMs);
3434
+ return { success: true, url: this.extractDeployUrl(output), message: `${targets.includes("functions") ? "Functions" : "Hosting"} deployed successfully!` };
3459
3435
  } catch (err) {
3460
3436
  const msg = err instanceof Error ? err.message : "Unknown error";
3437
+ if (msg.includes("successfully deployed") || msg.includes("Successful create operation") || msg.includes("Successful update operation")) {
3438
+ return { success: true, url: this.extractDeployUrl(msg), message: `${targets.includes("functions") ? "Functions" : "Hosting"} deployed successfully!` };
3439
+ }
3461
3440
  return { success: false, message: `Deploy failed: ${msg}` };
3462
3441
  }
3463
3442
  }
3443
+ /** Extract hosting URL from deploy output */
3444
+ extractDeployUrl(output) {
3445
+ try {
3446
+ const data = JSON.parse(output);
3447
+ if (data?.result) {
3448
+ for (const key of Object.keys(data.result)) {
3449
+ if (key.startsWith("hosting") && typeof data.result[key] === "object") {
3450
+ const url = data.result[key]?.url || data.result[key]?.site?.url || "";
3451
+ if (url) return url;
3452
+ }
3453
+ }
3454
+ }
3455
+ } catch {
3456
+ const urlMatch = output.match(/https:\/\/[a-z0-9-]+\.web\.app/i);
3457
+ if (urlMatch) return urlMatch[0];
3458
+ }
3459
+ const state = this.loadState();
3460
+ if (state.projectId) {
3461
+ return `https://${state.projectId}.web.app`;
3462
+ }
3463
+ return void 0;
3464
+ }
3464
3465
  // ─── Full Deploy Pipeline ────────────────────────────────────────────
3465
3466
  /**
3466
3467
  * Sync environment variables to functions/.env for production.