clawfire 0.6.14 → 0.6.15

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-IKWE6UJT.js");
272
+ const { startDevServer } = await import("./dev-server-3SUUU4D2.js");
273
273
  await startDevServer({
274
274
  projectDir,
275
275
  port,
@@ -1465,9 +1465,9 @@ function generateDashboardHtml(options) {
1465
1465
  <div style="margin-bottom:6px;"><strong style="color:#fbbf24;">Current Plan:</strong> <span style="color:#ef4444;">Spark (Free)</span></div>
1466
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
1467
  <div style="margin-bottom:10px;color:#a3a3a3;font-size:12px;">
1468
- Static pages (HTML/CSS/JS) are deployed and working.<br>
1468
+ Static pages (HTML/CSS/JS) are deployed and live.<br>
1469
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.
1470
+ Blaze plan has a generous free tier \u2014 you only pay for usage beyond free limits.
1471
1471
  </div>
1472
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
1473
  Upgrade to Blaze Plan &#8594;
@@ -2354,13 +2354,12 @@ function generateDashboardHtml(options) {
2354
2354
  var btn = document.getElementById('deploy-hosting-btn');
2355
2355
  var status = document.getElementById('deploy-hosting-status');
2356
2356
  var urlBox = document.getElementById('deploy-hosting-url');
2357
+ var billingNote = document.getElementById('deploy-billing-note');
2357
2358
  btn.disabled = true;
2358
2359
  btn.textContent = 'Deploying...';
2359
- status.textContent = 'Deploying to Firebase Hosting... This may take up to 2 minutes.';
2360
+ status.textContent = 'Deploying to Firebase Hosting... This may take up to 3 minutes.';
2360
2361
  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;';
2361
2362
  urlBox.style.display = 'none';
2362
-
2363
- var billingNote = document.getElementById('deploy-billing-note');
2364
2363
  billingNote.style.display = 'none';
2365
2364
 
2366
2365
  fetch(API + '/__dev/deploy/hosting', { method: 'POST' })
@@ -2375,18 +2374,17 @@ function generateDashboardHtml(options) {
2375
2374
  link.textContent = data.url;
2376
2375
  urlBox.style.display = 'block';
2377
2376
  }
2378
- // Show Blaze plan notice if needed
2377
+ // Show Blaze plan notice when functions deploy failed
2379
2378
  if (data.blazeRequired) {
2380
2379
  billingNote.style.display = 'block';
2381
2380
  if (data.upgradeUrl) {
2382
- var upgradeLink = document.getElementById('deploy-upgrade-link');
2383
- upgradeLink.href = data.upgradeUrl;
2381
+ document.getElementById('deploy-upgrade-link').href = data.upgradeUrl;
2384
2382
  }
2385
2383
  }
2386
2384
  } else {
2387
2385
  status.textContent = data.message;
2388
2386
  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
2387
+ // Also check if error is billing-related
2390
2388
  var errMsg = (data.message || '').toLowerCase();
2391
2389
  if (errMsg.indexOf('blaze') >= 0 || errMsg.indexOf('pay-as-you-go') >= 0 || errMsg.indexOf('upgrade') >= 0 || errMsg.indexOf('artifactregistry') >= 0) {
2392
2390
  billingNote.style.display = 'block';
@@ -3421,7 +3419,8 @@ https://console.developers.google.com/apis/api/firestore.googleapis.com/overview
3421
3419
  return new Promise((resolve6, reject) => {
3422
3420
  const proc = execFile2(command, args, { cwd: cwd || this.projectDir, timeout: timeoutMs }, (err, stdout, stderr) => {
3423
3421
  if (err) {
3424
- const detail = stderr?.trim() || stdout?.trim() || "";
3422
+ const parts = [stderr?.trim(), stdout?.trim()].filter(Boolean);
3423
+ const detail = parts.join("\n");
3425
3424
  const enriched = new Error(`${err.message}${detail ? "\n" + detail : ""}`);
3426
3425
  reject(enriched);
3427
3426
  } else {
@@ -4650,45 +4649,31 @@ ${liveReloadScript}
4650
4649
  }
4651
4650
  steps.push("Hosting deployed");
4652
4651
  let blazeRequired = false;
4653
- let projectId = "";
4654
4652
  if (deployFunctions) {
4655
4653
  console.log(" Deploying functions...");
4656
4654
  const funcResult = await this.firebaseSetup.deployHosting("functions");
4657
4655
  if (funcResult.success) {
4658
- console.log(` \x1B[32m\u2713\x1B[0m Functions deployed`);
4656
+ console.log(" \x1B[32m\u2713\x1B[0m Functions deployed");
4659
4657
  steps.push("Functions deployed");
4660
4658
  } 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
- }
4659
+ blazeRequired = true;
4660
+ console.log(" \x1B[33m\u26A0\x1B[0m Functions deploy failed (Blaze plan likely required)");
4661
+ steps.push("Functions skipped (Blaze plan required)");
4672
4662
  }
4673
4663
  }
4674
4664
  clearFirebaseStatusCache();
4665
+ const state = this.firebaseSetup.loadState();
4666
+ const projectId = state.projectId || firebaseConfig.projectId || "";
4667
+ const upgradeUrl = projectId ? `https://console.firebase.google.com/project/${projectId}/usage/details` : "https://console.firebase.google.com";
4675
4668
  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
- }
4669
+ sendJson({
4670
+ success: true,
4671
+ url: hostingResult.url,
4672
+ blazeRequired,
4673
+ upgradeUrl: blazeRequired ? upgradeUrl : void 0,
4674
+ message: `Hosting deployed successfully!${stepsStr}`,
4675
+ billingNote: blazeRequired ? `Static pages are live! But API routes (/api/*) need Cloud Functions, which require the Blaze (pay-as-you-go) plan. Upgrade: ${upgradeUrl}` : void 0
4676
+ });
4692
4677
  } catch (err) {
4693
4678
  sendJson({ success: false, message: err instanceof Error ? err.message : "Failed" }, 500);
4694
4679
  }
package/dist/dev.cjs CHANGED
@@ -1877,9 +1877,9 @@ function generateDashboardHtml(options) {
1877
1877
  <div style="margin-bottom:6px;"><strong style="color:#fbbf24;">Current Plan:</strong> <span style="color:#ef4444;">Spark (Free)</span></div>
1878
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
1879
  <div style="margin-bottom:10px;color:#a3a3a3;font-size:12px;">
1880
- Static pages (HTML/CSS/JS) are deployed and working.<br>
1880
+ Static pages (HTML/CSS/JS) are deployed and live.<br>
1881
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.
1882
+ Blaze plan has a generous free tier \u2014 you only pay for usage beyond free limits.
1883
1883
  </div>
1884
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
1885
  Upgrade to Blaze Plan &#8594;
@@ -2766,13 +2766,12 @@ function generateDashboardHtml(options) {
2766
2766
  var btn = document.getElementById('deploy-hosting-btn');
2767
2767
  var status = document.getElementById('deploy-hosting-status');
2768
2768
  var urlBox = document.getElementById('deploy-hosting-url');
2769
+ var billingNote = document.getElementById('deploy-billing-note');
2769
2770
  btn.disabled = true;
2770
2771
  btn.textContent = 'Deploying...';
2771
- status.textContent = 'Deploying to Firebase Hosting... This may take up to 2 minutes.';
2772
+ status.textContent = 'Deploying to Firebase Hosting... This may take up to 3 minutes.';
2772
2773
  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;';
2773
2774
  urlBox.style.display = 'none';
2774
-
2775
- var billingNote = document.getElementById('deploy-billing-note');
2776
2775
  billingNote.style.display = 'none';
2777
2776
 
2778
2777
  fetch(API + '/__dev/deploy/hosting', { method: 'POST' })
@@ -2787,18 +2786,17 @@ function generateDashboardHtml(options) {
2787
2786
  link.textContent = data.url;
2788
2787
  urlBox.style.display = 'block';
2789
2788
  }
2790
- // Show Blaze plan notice if needed
2789
+ // Show Blaze plan notice when functions deploy failed
2791
2790
  if (data.blazeRequired) {
2792
2791
  billingNote.style.display = 'block';
2793
2792
  if (data.upgradeUrl) {
2794
- var upgradeLink = document.getElementById('deploy-upgrade-link');
2795
- upgradeLink.href = data.upgradeUrl;
2793
+ document.getElementById('deploy-upgrade-link').href = data.upgradeUrl;
2796
2794
  }
2797
2795
  }
2798
2796
  } else {
2799
2797
  status.textContent = data.message;
2800
2798
  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
2799
+ // Also check if error is billing-related
2802
2800
  var errMsg = (data.message || '').toLowerCase();
2803
2801
  if (errMsg.indexOf('blaze') >= 0 || errMsg.indexOf('pay-as-you-go') >= 0 || errMsg.indexOf('upgrade') >= 0 || errMsg.indexOf('artifactregistry') >= 0) {
2804
2802
  billingNote.style.display = 'block';
@@ -3833,7 +3831,8 @@ https://console.developers.google.com/apis/api/firestore.googleapis.com/overview
3833
3831
  return new Promise((resolve7, reject) => {
3834
3832
  const proc = (0, import_node_child_process2.execFile)(command, args, { cwd: cwd || this.projectDir, timeout: timeoutMs }, (err, stdout, stderr) => {
3835
3833
  if (err) {
3836
- const detail = stderr?.trim() || stdout?.trim() || "";
3834
+ const parts = [stderr?.trim(), stdout?.trim()].filter(Boolean);
3835
+ const detail = parts.join("\n");
3837
3836
  const enriched = new Error(`${err.message}${detail ? "\n" + detail : ""}`);
3838
3837
  reject(enriched);
3839
3838
  } else {
@@ -5062,45 +5061,31 @@ ${liveReloadScript}
5062
5061
  }
5063
5062
  steps.push("Hosting deployed");
5064
5063
  let blazeRequired = false;
5065
- let projectId = "";
5066
5064
  if (deployFunctions) {
5067
5065
  console.log(" Deploying functions...");
5068
5066
  const funcResult = await this.firebaseSetup.deployHosting("functions");
5069
5067
  if (funcResult.success) {
5070
- console.log(` \x1B[32m\u2713\x1B[0m Functions deployed`);
5068
+ console.log(" \x1B[32m\u2713\x1B[0m Functions deployed");
5071
5069
  steps.push("Functions deployed");
5072
5070
  } 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
- }
5071
+ blazeRequired = true;
5072
+ console.log(" \x1B[33m\u26A0\x1B[0m Functions deploy failed (Blaze plan likely required)");
5073
+ steps.push("Functions skipped (Blaze plan required)");
5084
5074
  }
5085
5075
  }
5086
5076
  clearFirebaseStatusCache();
5077
+ const state = this.firebaseSetup.loadState();
5078
+ const projectId = state.projectId || firebaseConfig.projectId || "";
5079
+ const upgradeUrl = projectId ? `https://console.firebase.google.com/project/${projectId}/usage/details` : "https://console.firebase.google.com";
5087
5080
  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
- }
5081
+ sendJson({
5082
+ success: true,
5083
+ url: hostingResult.url,
5084
+ blazeRequired,
5085
+ upgradeUrl: blazeRequired ? upgradeUrl : void 0,
5086
+ message: `Hosting deployed successfully!${stepsStr}`,
5087
+ billingNote: blazeRequired ? `Static pages are live! But API routes (/api/*) need Cloud Functions, which require the Blaze (pay-as-you-go) plan. Upgrade: ${upgradeUrl}` : void 0
5088
+ });
5104
5089
  } catch (err) {
5105
5090
  sendJson({ success: false, message: err instanceof Error ? err.message : "Failed" }, 500);
5106
5091
  }