clawfire 0.6.15 → 0.6.16

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/dev.js CHANGED
@@ -1143,6 +1143,7 @@ var PageCompiler = class {
1143
1143
  try {
1144
1144
  const compiled = this.compile(fullPath);
1145
1145
  let html = compiled.html;
1146
+ html = this.sanitizeForProduction(html);
1146
1147
  if (scriptToInject) {
1147
1148
  if (html.includes("</body>")) {
1148
1149
  html = html.replace("</body>", scriptToInject + "\n</body>");
@@ -1171,6 +1172,18 @@ var PageCompiler = class {
1171
1172
  walk(this.pagesDir);
1172
1173
  return { pages, errors };
1173
1174
  }
1175
+ // ─── Production Sanitization ─────────────────────────────────────
1176
+ /**
1177
+ * Remove dev-only content from production builds:
1178
+ * - Sections wrapped in <!-- dev-only:start --> / <!-- dev-only:end -->
1179
+ * - Links to http://localhost (API Playground, dev dashboard, etc.)
1180
+ */
1181
+ sanitizeForProduction(html) {
1182
+ html = html.replace(/<!--\s*dev-only:start\s*-->[\s\S]*?<!--\s*dev-only:end\s*-->/g, "");
1183
+ html = html.replace(/<a\s[^>]*href="http:\/\/localhost[^"]*"[^>]*>[\s\S]*?<\/a>/g, "");
1184
+ html = html.replace(/\n{3,}/g, "\n\n");
1185
+ return html;
1186
+ }
1174
1187
  // ─── Internal Methods ────────────────────────────────────────────
1175
1188
  /**
1176
1189
  * Extract <!-- @key: value --> metadata from HTML.
@@ -5030,9 +5043,16 @@ ${liveReloadScript}
5030
5043
  console.log(" \x1B[32m\u2713\x1B[0m Functions deployed");
5031
5044
  steps.push("Functions deployed");
5032
5045
  } else {
5033
- blazeRequired = true;
5034
- console.log(" \x1B[33m\u26A0\x1B[0m Functions deploy failed (Blaze plan likely required)");
5035
- steps.push("Functions skipped (Blaze plan required)");
5046
+ const errMsg = (funcResult.message || "").toLowerCase();
5047
+ const isBillingError = ["billing", "blaze", "pay-as-you-go", "upgrade your project", "budget"].some((kw) => errMsg.includes(kw));
5048
+ if (isBillingError) {
5049
+ blazeRequired = true;
5050
+ console.log(" \x1B[33m\u26A0\x1B[0m Functions deploy failed (Blaze plan required)");
5051
+ steps.push("Functions skipped (Blaze plan required)");
5052
+ } else {
5053
+ console.log(` \x1B[31m\u2717\x1B[0m Functions deploy failed: ${funcResult.message}`);
5054
+ steps.push(`Functions deploy failed: ${funcResult.message}`);
5055
+ }
5036
5056
  }
5037
5057
  }
5038
5058
  clearFirebaseStatusCache();