clawfire 0.6.12 → 0.6.14

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-BX2DLQQB.js");
272
+ const { startDevServer } = await import("./dev-server-IKWE6UJT.js");
273
273
  await startDevServer({
274
274
  projectDir,
275
275
  port,
@@ -1456,6 +1456,24 @@ function generateDashboardHtml(options) {
1456
1456
  <div style="font-size:11px;color:#a3a3a3;margin-bottom:4px;">Live URL</div>
1457
1457
  <a id="deploy-hosting-link" href="#" target="_blank" style="color:#22c55e;font-family:monospace;font-size:14px;text-decoration:none;word-break:break-all;"></a>
1458
1458
  </div>
1459
+ <div id="deploy-billing-note" style="display:none;margin-top:10px;padding:14px;border-radius:8px;background:#1a1400;border:1px solid #f59e0b;">
1460
+ <div style="display:flex;align-items:center;gap:6px;margin-bottom:8px;">
1461
+ <span style="font-size:16px;">&#9888;&#65039;</span>
1462
+ <span style="font-weight:700;color:#fbbf24;font-size:14px;">Blaze Plan Required for API</span>
1463
+ </div>
1464
+ <div style="font-size:13px;color:#d4d4d4;line-height:1.6;">
1465
+ <div style="margin-bottom:6px;"><strong style="color:#fbbf24;">Current Plan:</strong> <span style="color:#ef4444;">Spark (Free)</span></div>
1466
+ <div style="margin-bottom:6px;"><strong style="color:#fbbf24;">Required Plan:</strong> <span style="color:#22c55e;">Blaze (Pay-as-you-go)</span></div>
1467
+ <div style="margin-bottom:10px;color:#a3a3a3;font-size:12px;">
1468
+ Static pages (HTML/CSS/JS) are deployed and working.<br>
1469
+ API routes (<code style="background:#2a2a2a;padding:2px 6px;border-radius:3px;color:#f97316;">/api/*</code>) require Cloud Functions, which need the Blaze plan.<br>
1470
+ Blaze plan has a generous free tier \u2014 you only pay for actual usage beyond free limits.
1471
+ </div>
1472
+ <a id="deploy-upgrade-link" href="#" target="_blank" style="display:inline-block;padding:8px 16px;background:#f59e0b;color:#000;border-radius:6px;font-size:13px;font-weight:700;text-decoration:none;">
1473
+ Upgrade to Blaze Plan &#8594;
1474
+ </a>
1475
+ </div>
1476
+ </div>
1459
1477
  </div>
1460
1478
  </div>
1461
1479
  </div>
@@ -2342,6 +2360,9 @@ function generateDashboardHtml(options) {
2342
2360
  status.style.cssText = 'display:block;margin-top:10px;font-size:13px;padding:10px 14px;border-radius:6px;background:#0a0a1a;border:1px solid #3b82f6;color:#3b82f6;';
2343
2361
  urlBox.style.display = 'none';
2344
2362
 
2363
+ var billingNote = document.getElementById('deploy-billing-note');
2364
+ billingNote.style.display = 'none';
2365
+
2345
2366
  fetch(API + '/__dev/deploy/hosting', { method: 'POST' })
2346
2367
  .then(function(r) { return r.json(); })
2347
2368
  .then(function(data) {
@@ -2354,9 +2375,22 @@ function generateDashboardHtml(options) {
2354
2375
  link.textContent = data.url;
2355
2376
  urlBox.style.display = 'block';
2356
2377
  }
2378
+ // Show Blaze plan notice if needed
2379
+ if (data.blazeRequired) {
2380
+ billingNote.style.display = 'block';
2381
+ if (data.upgradeUrl) {
2382
+ var upgradeLink = document.getElementById('deploy-upgrade-link');
2383
+ upgradeLink.href = data.upgradeUrl;
2384
+ }
2385
+ }
2357
2386
  } else {
2358
2387
  status.textContent = data.message;
2359
2388
  status.style.cssText = 'display:block;margin-top:10px;font-size:13px;padding:10px 14px;border-radius:6px;background:#1c0808;border:1px solid #ef4444;color:#ef4444;';
2389
+ // Check if error is about billing \u2014 show upgrade notice
2390
+ var errMsg = (data.message || '').toLowerCase();
2391
+ if (errMsg.indexOf('blaze') >= 0 || errMsg.indexOf('pay-as-you-go') >= 0 || errMsg.indexOf('upgrade') >= 0 || errMsg.indexOf('artifactregistry') >= 0) {
2392
+ billingNote.style.display = 'block';
2393
+ }
2360
2394
  }
2361
2395
  btn.disabled = false;
2362
2396
  btn.textContent = 'Deploy Hosting';
@@ -4604,14 +4638,57 @@ ${liveReloadScript}
4604
4638
  steps.push("Functions build failed \u2014 hosting only");
4605
4639
  }
4606
4640
  }
4607
- const targets = deployFunctions ? "hosting,functions" : "hosting";
4608
- console.log(` Deploying ${targets}...`);
4609
- const result = await this.firebaseSetup.deployHosting(targets);
4641
+ console.log(" Deploying hosting...");
4642
+ const hostingResult = await this.firebaseSetup.deployHosting("hosting");
4643
+ if (!hostingResult.success) {
4644
+ clearFirebaseStatusCache();
4645
+ sendJson({
4646
+ ...hostingResult,
4647
+ message: hostingResult.message + (steps.length > 0 ? ` (${steps.join(", ")})` : "")
4648
+ });
4649
+ return;
4650
+ }
4651
+ steps.push("Hosting deployed");
4652
+ let blazeRequired = false;
4653
+ let projectId = "";
4654
+ if (deployFunctions) {
4655
+ console.log(" Deploying functions...");
4656
+ const funcResult = await this.firebaseSetup.deployHosting("functions");
4657
+ if (funcResult.success) {
4658
+ console.log(` \x1B[32m\u2713\x1B[0m Functions deployed`);
4659
+ steps.push("Functions deployed");
4660
+ } else {
4661
+ const msg = funcResult.message.toLowerCase();
4662
+ if (msg.includes("blaze") || msg.includes("pay-as-you-go") || msg.includes("upgrade") || msg.includes("billing") || msg.includes("artifactregistry")) {
4663
+ blazeRequired = true;
4664
+ const state = this.firebaseSetup.loadState();
4665
+ projectId = state.projectId || firebaseConfig.projectId || "";
4666
+ console.log(" \x1B[33m\u26A0\x1B[0m Functions require Blaze (pay-as-you-go) plan");
4667
+ steps.push("Functions skipped (Blaze plan required)");
4668
+ } else {
4669
+ console.log(` \x1B[31m\u2717\x1B[0m Functions deploy failed: ${funcResult.message}`);
4670
+ steps.push("Functions deploy failed");
4671
+ }
4672
+ }
4673
+ }
4610
4674
  clearFirebaseStatusCache();
4611
- sendJson({
4612
- ...result,
4613
- message: result.message + (steps.length > 0 ? ` (${steps.join(", ")})` : "")
4614
- });
4675
+ const stepsStr = steps.length > 0 ? ` (${steps.join(", ")})` : "";
4676
+ if (blazeRequired) {
4677
+ const upgradeUrl = projectId ? `https://console.firebase.google.com/project/${projectId}/usage/details` : "https://console.firebase.google.com";
4678
+ sendJson({
4679
+ success: true,
4680
+ url: hostingResult.url,
4681
+ blazeRequired: true,
4682
+ upgradeUrl,
4683
+ message: `Hosting deployed successfully!${stepsStr}`,
4684
+ billingNote: `Static pages are live, but API routes (/api/*) require Cloud Functions which need the Blaze (pay-as-you-go) plan. Upgrade at: ${upgradeUrl}`
4685
+ });
4686
+ } else {
4687
+ sendJson({
4688
+ ...hostingResult,
4689
+ message: hostingResult.message + stepsStr
4690
+ });
4691
+ }
4615
4692
  } catch (err) {
4616
4693
  sendJson({ success: false, message: err instanceof Error ? err.message : "Failed" }, 500);
4617
4694
  }
package/dist/dev.cjs CHANGED
@@ -1868,6 +1868,24 @@ function generateDashboardHtml(options) {
1868
1868
  <div style="font-size:11px;color:#a3a3a3;margin-bottom:4px;">Live URL</div>
1869
1869
  <a id="deploy-hosting-link" href="#" target="_blank" style="color:#22c55e;font-family:monospace;font-size:14px;text-decoration:none;word-break:break-all;"></a>
1870
1870
  </div>
1871
+ <div id="deploy-billing-note" style="display:none;margin-top:10px;padding:14px;border-radius:8px;background:#1a1400;border:1px solid #f59e0b;">
1872
+ <div style="display:flex;align-items:center;gap:6px;margin-bottom:8px;">
1873
+ <span style="font-size:16px;">&#9888;&#65039;</span>
1874
+ <span style="font-weight:700;color:#fbbf24;font-size:14px;">Blaze Plan Required for API</span>
1875
+ </div>
1876
+ <div style="font-size:13px;color:#d4d4d4;line-height:1.6;">
1877
+ <div style="margin-bottom:6px;"><strong style="color:#fbbf24;">Current Plan:</strong> <span style="color:#ef4444;">Spark (Free)</span></div>
1878
+ <div style="margin-bottom:6px;"><strong style="color:#fbbf24;">Required Plan:</strong> <span style="color:#22c55e;">Blaze (Pay-as-you-go)</span></div>
1879
+ <div style="margin-bottom:10px;color:#a3a3a3;font-size:12px;">
1880
+ Static pages (HTML/CSS/JS) are deployed and working.<br>
1881
+ API routes (<code style="background:#2a2a2a;padding:2px 6px;border-radius:3px;color:#f97316;">/api/*</code>) require Cloud Functions, which need the Blaze plan.<br>
1882
+ Blaze plan has a generous free tier \u2014 you only pay for actual usage beyond free limits.
1883
+ </div>
1884
+ <a id="deploy-upgrade-link" href="#" target="_blank" style="display:inline-block;padding:8px 16px;background:#f59e0b;color:#000;border-radius:6px;font-size:13px;font-weight:700;text-decoration:none;">
1885
+ Upgrade to Blaze Plan &#8594;
1886
+ </a>
1887
+ </div>
1888
+ </div>
1871
1889
  </div>
1872
1890
  </div>
1873
1891
  </div>
@@ -2754,6 +2772,9 @@ function generateDashboardHtml(options) {
2754
2772
  status.style.cssText = 'display:block;margin-top:10px;font-size:13px;padding:10px 14px;border-radius:6px;background:#0a0a1a;border:1px solid #3b82f6;color:#3b82f6;';
2755
2773
  urlBox.style.display = 'none';
2756
2774
 
2775
+ var billingNote = document.getElementById('deploy-billing-note');
2776
+ billingNote.style.display = 'none';
2777
+
2757
2778
  fetch(API + '/__dev/deploy/hosting', { method: 'POST' })
2758
2779
  .then(function(r) { return r.json(); })
2759
2780
  .then(function(data) {
@@ -2766,9 +2787,22 @@ function generateDashboardHtml(options) {
2766
2787
  link.textContent = data.url;
2767
2788
  urlBox.style.display = 'block';
2768
2789
  }
2790
+ // Show Blaze plan notice if needed
2791
+ if (data.blazeRequired) {
2792
+ billingNote.style.display = 'block';
2793
+ if (data.upgradeUrl) {
2794
+ var upgradeLink = document.getElementById('deploy-upgrade-link');
2795
+ upgradeLink.href = data.upgradeUrl;
2796
+ }
2797
+ }
2769
2798
  } else {
2770
2799
  status.textContent = data.message;
2771
2800
  status.style.cssText = 'display:block;margin-top:10px;font-size:13px;padding:10px 14px;border-radius:6px;background:#1c0808;border:1px solid #ef4444;color:#ef4444;';
2801
+ // Check if error is about billing \u2014 show upgrade notice
2802
+ var errMsg = (data.message || '').toLowerCase();
2803
+ if (errMsg.indexOf('blaze') >= 0 || errMsg.indexOf('pay-as-you-go') >= 0 || errMsg.indexOf('upgrade') >= 0 || errMsg.indexOf('artifactregistry') >= 0) {
2804
+ billingNote.style.display = 'block';
2805
+ }
2772
2806
  }
2773
2807
  btn.disabled = false;
2774
2808
  btn.textContent = 'Deploy Hosting';
@@ -5016,14 +5050,57 @@ ${liveReloadScript}
5016
5050
  steps.push("Functions build failed \u2014 hosting only");
5017
5051
  }
5018
5052
  }
5019
- const targets = deployFunctions ? "hosting,functions" : "hosting";
5020
- console.log(` Deploying ${targets}...`);
5021
- const result = await this.firebaseSetup.deployHosting(targets);
5053
+ console.log(" Deploying hosting...");
5054
+ const hostingResult = await this.firebaseSetup.deployHosting("hosting");
5055
+ if (!hostingResult.success) {
5056
+ clearFirebaseStatusCache();
5057
+ sendJson({
5058
+ ...hostingResult,
5059
+ message: hostingResult.message + (steps.length > 0 ? ` (${steps.join(", ")})` : "")
5060
+ });
5061
+ return;
5062
+ }
5063
+ steps.push("Hosting deployed");
5064
+ let blazeRequired = false;
5065
+ let projectId = "";
5066
+ if (deployFunctions) {
5067
+ console.log(" Deploying functions...");
5068
+ const funcResult = await this.firebaseSetup.deployHosting("functions");
5069
+ if (funcResult.success) {
5070
+ console.log(` \x1B[32m\u2713\x1B[0m Functions deployed`);
5071
+ steps.push("Functions deployed");
5072
+ } else {
5073
+ const msg = funcResult.message.toLowerCase();
5074
+ if (msg.includes("blaze") || msg.includes("pay-as-you-go") || msg.includes("upgrade") || msg.includes("billing") || msg.includes("artifactregistry")) {
5075
+ blazeRequired = true;
5076
+ const state = this.firebaseSetup.loadState();
5077
+ projectId = state.projectId || firebaseConfig.projectId || "";
5078
+ console.log(" \x1B[33m\u26A0\x1B[0m Functions require Blaze (pay-as-you-go) plan");
5079
+ steps.push("Functions skipped (Blaze plan required)");
5080
+ } else {
5081
+ console.log(` \x1B[31m\u2717\x1B[0m Functions deploy failed: ${funcResult.message}`);
5082
+ steps.push("Functions deploy failed");
5083
+ }
5084
+ }
5085
+ }
5022
5086
  clearFirebaseStatusCache();
5023
- sendJson({
5024
- ...result,
5025
- message: result.message + (steps.length > 0 ? ` (${steps.join(", ")})` : "")
5026
- });
5087
+ const stepsStr = steps.length > 0 ? ` (${steps.join(", ")})` : "";
5088
+ if (blazeRequired) {
5089
+ const upgradeUrl = projectId ? `https://console.firebase.google.com/project/${projectId}/usage/details` : "https://console.firebase.google.com";
5090
+ sendJson({
5091
+ success: true,
5092
+ url: hostingResult.url,
5093
+ blazeRequired: true,
5094
+ upgradeUrl,
5095
+ message: `Hosting deployed successfully!${stepsStr}`,
5096
+ billingNote: `Static pages are live, but API routes (/api/*) require Cloud Functions which need the Blaze (pay-as-you-go) plan. Upgrade at: ${upgradeUrl}`
5097
+ });
5098
+ } else {
5099
+ sendJson({
5100
+ ...hostingResult,
5101
+ message: hostingResult.message + stepsStr
5102
+ });
5103
+ }
5027
5104
  } catch (err) {
5028
5105
  sendJson({ success: false, message: err instanceof Error ? err.message : "Failed" }, 500);
5029
5106
  }