@bettercms-ai/convert 0.12.1 → 0.13.0

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/index.d.ts CHANGED
@@ -429,6 +429,16 @@ interface FormsReceipt {
429
429
  pending: PendingForm[];
430
430
  /** Prose a human has to act on — a draft form still 403s every submission. */
431
431
  notes?: string[];
432
+ /**
433
+ * Every form on the site after this run, and the file its `<form>` is in — wired now, or by an
434
+ * earlier run. The server matches the file to the component recorded as that file's owner, so
435
+ * the Forms tab can say which component renders each form. OPTIONAL and ADDITIVE: `wired` stays
436
+ * a number, and a receipt without this list still adds up.
437
+ */
438
+ wiredForms?: {
439
+ id: string;
440
+ file: string;
441
+ }[];
432
442
  }
433
443
  /** Raised when the receipt does not account for every form. Never caught inside this package. */
434
444
  declare class FormInvariantError extends Error {
package/dist/index.js CHANGED
@@ -6521,11 +6521,11 @@ async function wireForms(briefIn, sources) {
6521
6521
  }
6522
6522
  if (attrOf(candidate.el, "data-bcms-form")) {
6523
6523
  alreadyWired++;
6524
- onSite.push(form);
6524
+ onSite.push({ form, file: candidate.file });
6525
6525
  continue;
6526
6526
  }
6527
6527
  matched.push({ form, candidate });
6528
- onSite.push(form);
6528
+ onSite.push({ form, file: candidate.file });
6529
6529
  }
6530
6530
  const contents = new Map(sources.map((s) => [s.path, s.content]));
6531
6531
  const byFile = /* @__PURE__ */ new Map();
@@ -6543,7 +6543,7 @@ ${indent}${scriptFor(last.candidate.dialect)}`);
6543
6543
  }
6544
6544
  files.push({ path, operation: "modify", content: source.toString() });
6545
6545
  }
6546
- const notes = onSite.filter((f) => f.status === "draft").map((f) => `publish form ${f.name} in the Forms tab \u2014 a draft form rejects every submission with 403.`);
6546
+ const notes = onSite.filter(({ form }) => form.status === "draft").map(({ form }) => `publish form ${form.name} in the Forms tab \u2014 a draft form rejects every submission with 403.`);
6547
6547
  return {
6548
6548
  files,
6549
6549
  receipt: {
@@ -6560,7 +6560,9 @@ ${indent}${scriptFor(last.candidate.dialect)}`);
6560
6560
  wired: matched.length,
6561
6561
  alreadyWired,
6562
6562
  pending,
6563
- ...notes.length > 0 ? { notes } : {}
6563
+ ...notes.length > 0 ? { notes } : {},
6564
+ // Always, even empty: a run where every form went pending must retire the files an earlier one named.
6565
+ wiredForms: onSite.map(({ form, file }) => ({ id: form.id, file }))
6564
6566
  })
6565
6567
  }
6566
6568
  };