@reddoorla/maintenance 0.44.0 → 0.46.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/cli/bin.js CHANGED
@@ -577,7 +577,9 @@ var init_write_audits_to_airtable = __esm({
577
577
 
578
578
  // src/reports/checklist.ts
579
579
  function checklistFor(type) {
580
- return type === "Maintenance" ? MAINTENANCE_CHECKLIST : type === "Testing" ? TESTING_CHECKLIST : [];
580
+ if (type === "Maintenance") return MAINTENANCE_CHECKLIST;
581
+ if (type === "Testing") return [...MAINTENANCE_CHECKLIST, ...TESTING_CHECKLIST];
582
+ return [];
581
583
  }
582
584
  function isChecklistComplete(report) {
583
585
  return checklistFor(report.reportType).every((i) => report.checklist[i.field] === true);
@@ -825,7 +827,6 @@ var init_copy = __esm({
825
827
  announceCadenceHeading: "WHAT TO EXPECT",
826
828
  announceTestingLabel: "Full site testing",
827
829
  announceMaintenanceLabel: "Routine maintenance",
828
- announceMonitorItems: ["Performance", "Accessibility", "Security", "Uptime"],
829
830
  announcePreviewLabel: "From your latest full site test:",
830
831
  announceImprovementResend: "Your contact forms now deliver straight to your inbox through reliable infrastructure, so no inquiry slips through the cracks.",
831
832
  announceImprovementSvelte5: "We've modernized your site to the latest framework \u2014 it's faster, more secure, and built to last.",
@@ -1185,26 +1186,29 @@ function buildAnnouncementMjml(data) {
1185
1186
  </mj-column>
1186
1187
  </mj-section>` : "";
1187
1188
  const cad = data.cadence;
1188
- const cadenceLines = [];
1189
+ const cadenceBlocks = [];
1189
1190
  if (cad && cad.testing !== "None")
1190
- cadenceLines.push(`${copy.announceTestingLabel} \u2014 ${FREQ_PHRASE[cad.testing]}`);
1191
+ cadenceBlocks.push({
1192
+ line: `${copy.announceTestingLabel} \u2014 ${FREQ_PHRASE[cad.testing]}`,
1193
+ checks: copy.testingChecklist
1194
+ });
1191
1195
  if (cad && cad.maintenance !== "None")
1192
- cadenceLines.push(`${copy.announceMaintenanceLabel} \u2014 ${FREQ_PHRASE[cad.maintenance]}`);
1193
- const cadenceSection = cadenceLines.length > 0 ? `
1196
+ cadenceBlocks.push({
1197
+ line: `${copy.announceMaintenanceLabel} \u2014 ${FREQ_PHRASE[cad.maintenance]}`,
1198
+ checks: copy.maintenanceChecks
1199
+ });
1200
+ const cadenceSection = cadenceBlocks.length > 0 ? `
1194
1201
  <mj-section background-color="white">
1195
1202
  <mj-column>
1196
1203
  <mj-text color="${RED2}" font-size="20px" font-weight="700" padding-top="36px">${escapeXml(copy.announceCadenceHeading)}</mj-text>
1197
- ${cadenceLines.map(
1198
- (line) => `
1199
- <mj-text color="${GREY2}" font-family="helvetica, sans-serif" font-size="16px" font-weight="300" line-height="24px" padding-top="4px" padding-bottom="4px">\u2022 ${escapeXml(line)}</mj-text>`
1204
+ ${cadenceBlocks.map(
1205
+ (b) => `
1206
+ <mj-text color="${GREY2}" font-family="helvetica, sans-serif" font-size="16px" font-weight="400" line-height="24px" padding-top="12px" padding-bottom="0px">\u2022 ${escapeXml(b.line)}</mj-text>
1207
+ <mj-text color="${GREY2}" font-family="helvetica, sans-serif" font-size="13px" font-weight="300" line-height="20px" padding-top="2px" padding-bottom="0px" padding-left="16px">${escapeXml(b.checks.join(" \xB7 "))}</mj-text>`
1200
1208
  ).join("")}
1201
- <mj-text color="${GREY2}" font-family="helvetica, sans-serif" font-size="16px" font-weight="300" line-height="24px" padding-top="12px">${escapeXml(copy.announceCadence)}</mj-text>
1209
+ <mj-text color="${GREY2}" font-family="helvetica, sans-serif" font-size="16px" font-weight="300" line-height="24px" padding-top="14px">${escapeXml(copy.announceCadence)}</mj-text>
1202
1210
  </mj-column>
1203
1211
  </mj-section>` : "";
1204
- const monitorRows = copy.announceMonitorItems.map(
1205
- (item) => `
1206
- <mj-text color="${GREY2}" font-family="helvetica, sans-serif" font-size="16px" font-weight="300" line-height="24px" padding-top="4px" padding-bottom="4px">\u2022 ${escapeXml(item)}</mj-text>`
1207
- ).join("");
1208
1212
  const scoreRows = SCORE_PREVIEW.map(
1209
1213
  ({ label, key }) => `
1210
1214
  <mj-text color="${RED2}" font-size="20px" font-weight="300" padding-top="25px">${label}</mj-text>
@@ -1241,12 +1245,6 @@ function buildAnnouncementMjml(data) {
1241
1245
  </mj-section>
1242
1246
  ${cadenceSection}
1243
1247
  ${improvementsSection}
1244
- <mj-section background-color="white">
1245
- <mj-column>
1246
- <mj-text color="${RED2}" font-size="20px" font-weight="700" padding-top="36px">WHAT WE MONITOR</mj-text>
1247
- ${monitorRows}
1248
- </mj-column>
1249
- </mj-section>
1250
1248
  <mj-section background-color="#F4F4F4">
1251
1249
  <mj-column>
1252
1250
  <mj-text color="${RED2}" font-size="20px" font-weight="700" padding-top="55px">${escapeXml(copy.announcePreviewLabel)}</mj-text>
@@ -5965,6 +5963,17 @@ async function derivePeriodStart(base, siteRow, reportType, today) {
5965
5963
  }
5966
5964
 
5967
5965
  // src/cli/commands/report.ts
5966
+ function parseSingleSiteReportType(raw) {
5967
+ if (raw === void 0 || raw.trim() === "") return "Maintenance";
5968
+ const norm = raw.trim().toLowerCase();
5969
+ if (norm === "maintenance") return "Maintenance";
5970
+ if (norm === "testing") return "Testing";
5971
+ const hint = norm === "launch" ? " \u2014 use the `launch <site>` command" : norm === "announcement" ? " \u2014 use the `announce <site>` command" : "";
5972
+ throw Object.assign(
5973
+ new Error(`--type must be Maintenance or Testing (got ${JSON.stringify(raw)})${hint}`),
5974
+ { exitCode: 2 }
5975
+ );
5976
+ }
5968
5977
  function dashboardBaseUrl() {
5969
5978
  return process.env.DASHBOARD_BASE_URL?.trim() || "https://reddoor-maintenance.netlify.app";
5970
5979
  }
@@ -5981,10 +5990,13 @@ async function runReportCommand(slug, opts) {
5981
5990
  return runDueDraft();
5982
5991
  }
5983
5992
  if (slug) {
5984
- return runSingleSiteDraft(slug, { previewOnly: Boolean(opts.preview) });
5993
+ const reportType = parseSingleSiteReportType(opts.type);
5994
+ return runSingleSiteDraft(slug, { previewOnly: Boolean(opts.preview), reportType });
5985
5995
  }
5986
5996
  throw Object.assign(
5987
- new Error("Usage: reddoor-maint report [<slug>] [--due] [--preview] [--send-ready] [--digest]"),
5997
+ new Error(
5998
+ "Usage: reddoor-maint report [<slug>] [--type <Maintenance|Testing>] [--due] [--preview] [--send-ready] [--digest]"
5999
+ ),
5988
6000
  {
5989
6001
  exitCode: 2
5990
6002
  }
@@ -6065,7 +6077,7 @@ async function runSingleSiteDraft(slug, opts) {
6065
6077
  if (!site) {
6066
6078
  throw Object.assign(new Error(`No Websites row matched slug "${slug}"`), { exitCode: 2 });
6067
6079
  }
6068
- const result = await draftReportForSite(opts.previewOnly ? null : base, site, "Maintenance", {
6080
+ const result = await draftReportForSite(opts.previewOnly ? null : base, site, opts.reportType, {
6069
6081
  previewOnly: opts.previewOnly
6070
6082
  });
6071
6083
  if (opts.previewOnly) {
@@ -6784,7 +6796,7 @@ cli.command(
6784
6796
  ).action(
6785
6797
  async (site, opts) => runOrExit(() => runAnnounceCommand(site, opts), opts)
6786
6798
  );
6787
- cli.command("report [site]", "Draft or send maintenance/testing reports.").option("--due", "Scan all Websites and draft overdue reports.").option(
6799
+ cli.command("report [site]", "Draft or send maintenance/testing reports.").option("--due", "Scan all Websites and draft overdue reports.").option("--type <type>", "Single-site draft report type: Maintenance (default) or Testing.").option(
6788
6800
  "--preview",
6789
6801
  "Single-site dry run; writes reports/<slug>/draft.html, never touches Airtable."
6790
6802
  ).option(