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 +1 -1
- package/dist/{dev-server-54RXFRNZ.js → dev-server-MLT3ZO5A.js} +29 -28
- package/dist/dev.cjs +29 -28
- package/dist/dev.cjs.map +1 -1
- package/dist/dev.js +29 -28
- package/dist/dev.js.map +1 -1
- package/package.json +1 -1
package/dist/dev.js
CHANGED
|
@@ -3389,40 +3389,41 @@ var FirebaseSetup = class {
|
|
|
3389
3389
|
return { success: false, message: "Invalid firebase.json." };
|
|
3390
3390
|
}
|
|
3391
3391
|
const timeoutMs = targets.includes("functions") ? 3e5 : 12e4;
|
|
3392
|
+
const args = ["deploy", "--only", targets, "--json"];
|
|
3393
|
+
if (targets.includes("functions")) args.push("--force");
|
|
3392
3394
|
try {
|
|
3393
|
-
const output = await this.execTimeout(
|
|
3394
|
-
|
|
3395
|
-
["deploy", "--only", targets, "--json"],
|
|
3396
|
-
timeoutMs
|
|
3397
|
-
);
|
|
3398
|
-
let url = "";
|
|
3399
|
-
try {
|
|
3400
|
-
const data = JSON.parse(output);
|
|
3401
|
-
if (data?.result) {
|
|
3402
|
-
for (const key of Object.keys(data.result)) {
|
|
3403
|
-
if (key.startsWith("hosting") && typeof data.result[key] === "object") {
|
|
3404
|
-
url = data.result[key]?.url || data.result[key]?.site?.url || "";
|
|
3405
|
-
if (url) break;
|
|
3406
|
-
}
|
|
3407
|
-
}
|
|
3408
|
-
}
|
|
3409
|
-
} catch {
|
|
3410
|
-
const urlMatch = output.match(/https:\/\/[a-z0-9-]+\.web\.app/i);
|
|
3411
|
-
if (urlMatch) url = urlMatch[0];
|
|
3412
|
-
}
|
|
3413
|
-
if (!url) {
|
|
3414
|
-
const state = this.loadState();
|
|
3415
|
-
if (state.projectId) {
|
|
3416
|
-
url = `https://${state.projectId}.web.app`;
|
|
3417
|
-
}
|
|
3418
|
-
}
|
|
3419
|
-
const label = targets.includes("functions") ? "Hosting + Functions" : "Hosting";
|
|
3420
|
-
return { success: true, url: url || void 0, message: `${label} deployed successfully!` };
|
|
3395
|
+
const output = await this.execTimeout("firebase", args, timeoutMs);
|
|
3396
|
+
return { success: true, url: this.extractDeployUrl(output), message: `${targets.includes("functions") ? "Functions" : "Hosting"} deployed successfully!` };
|
|
3421
3397
|
} catch (err) {
|
|
3422
3398
|
const msg = err instanceof Error ? err.message : "Unknown error";
|
|
3399
|
+
if (msg.includes("successfully deployed") || msg.includes("Successful create operation") || msg.includes("Successful update operation")) {
|
|
3400
|
+
return { success: true, url: this.extractDeployUrl(msg), message: `${targets.includes("functions") ? "Functions" : "Hosting"} deployed successfully!` };
|
|
3401
|
+
}
|
|
3423
3402
|
return { success: false, message: `Deploy failed: ${msg}` };
|
|
3424
3403
|
}
|
|
3425
3404
|
}
|
|
3405
|
+
/** Extract hosting URL from deploy output */
|
|
3406
|
+
extractDeployUrl(output) {
|
|
3407
|
+
try {
|
|
3408
|
+
const data = JSON.parse(output);
|
|
3409
|
+
if (data?.result) {
|
|
3410
|
+
for (const key of Object.keys(data.result)) {
|
|
3411
|
+
if (key.startsWith("hosting") && typeof data.result[key] === "object") {
|
|
3412
|
+
const url = data.result[key]?.url || data.result[key]?.site?.url || "";
|
|
3413
|
+
if (url) return url;
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
} catch {
|
|
3418
|
+
const urlMatch = output.match(/https:\/\/[a-z0-9-]+\.web\.app/i);
|
|
3419
|
+
if (urlMatch) return urlMatch[0];
|
|
3420
|
+
}
|
|
3421
|
+
const state = this.loadState();
|
|
3422
|
+
if (state.projectId) {
|
|
3423
|
+
return `https://${state.projectId}.web.app`;
|
|
3424
|
+
}
|
|
3425
|
+
return void 0;
|
|
3426
|
+
}
|
|
3426
3427
|
// ─── Full Deploy Pipeline ────────────────────────────────────────────
|
|
3427
3428
|
/**
|
|
3428
3429
|
* Sync environment variables to functions/.env for production.
|