@reddoorla/maintenance 0.85.2 → 0.87.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/README.md +8 -0
- package/dist/airtable-ZBUPQJSC.js +9 -0
- package/dist/{announce-GIAYN67S.js → announce-I2Z4JN3I.js} +58 -30
- package/dist/announce-I2Z4JN3I.js.map +1 -0
- package/dist/attachments-NLZIJ5NU.js +9 -0
- package/dist/{bump-deps-SWJB6H5V.js → bump-deps-CGVELRLK.js} +9 -9
- package/dist/{chunk-SDUJIANJ.js → chunk-2NJQLSEU.js} +3 -3
- package/dist/chunk-2NQUCS7O.js +243 -0
- package/dist/chunk-2NQUCS7O.js.map +1 -0
- package/dist/{chunk-ZTPPCHDB.js → chunk-3G25KIWW.js} +4 -4
- package/dist/{chunk-DTTIFYAM.js → chunk-3JQ2FO3D.js} +44 -405
- package/dist/chunk-3JQ2FO3D.js.map +1 -0
- package/dist/chunk-3SF7D4DY.js +359 -0
- package/dist/chunk-3SF7D4DY.js.map +1 -0
- package/dist/{chunk-37S6L6G4.js → chunk-5UINJNAJ.js} +72 -2
- package/dist/chunk-5UINJNAJ.js.map +1 -0
- package/dist/{chunk-THEFTZ7F.js → chunk-62CMMGEO.js} +5 -5
- package/dist/{chunk-FDIFTIXC.js → chunk-6TWWY7ZU.js} +2 -2
- package/dist/{chunk-PBWDDDQH.js → chunk-7BZUOZPU.js} +2 -2
- package/dist/{chunk-577HCGZO.js → chunk-7NYN2P6I.js} +44 -26
- package/dist/chunk-7NYN2P6I.js.map +1 -0
- package/dist/{chunk-UYCAF77E.js → chunk-7RJ2HMMJ.js} +3 -3
- package/dist/{chunk-Q276MZ7E.js → chunk-7UAYMAKR.js} +2 -2
- package/dist/{chunk-MGR2H7F4.js → chunk-BBUSGEES.js} +58 -45
- package/dist/chunk-BBUSGEES.js.map +1 -0
- package/dist/chunk-BNM5POSJ.js +284 -0
- package/dist/chunk-BNM5POSJ.js.map +1 -0
- package/dist/{chunk-R6FPFMOS.js → chunk-BQRFQSGY.js} +3 -3
- package/dist/{chunk-NWB4O5EY.js → chunk-C6CLRKPV.js} +5 -5
- package/dist/chunk-C6CLRKPV.js.map +1 -0
- package/dist/{chunk-7J53SUT6.js → chunk-CROKUHJB.js} +4 -4
- package/dist/chunk-DEWJMMG3.js +274 -0
- package/dist/chunk-DEWJMMG3.js.map +1 -0
- package/dist/{chunk-SEEA6RXF.js → chunk-DJZWYIPP.js} +2 -2
- package/dist/chunk-DJZWYIPP.js.map +1 -0
- package/dist/chunk-EVBCK2KC.js +68 -0
- package/dist/chunk-EVBCK2KC.js.map +1 -0
- package/dist/chunk-F3JWOPTG.js +202 -0
- package/dist/chunk-F3JWOPTG.js.map +1 -0
- package/dist/{chunk-GZNBCHAZ.js → chunk-HEWSRXYV.js} +4 -4
- package/dist/chunk-HHMMUR4P.js +335 -0
- package/dist/chunk-HHMMUR4P.js.map +1 -0
- package/dist/chunk-HSI6Q7MI.js +1238 -0
- package/dist/chunk-HSI6Q7MI.js.map +1 -0
- package/dist/{chunk-MPBXOJ3N.js → chunk-IY6256GK.js} +33 -2
- package/dist/chunk-IY6256GK.js.map +1 -0
- package/dist/{chunk-LS6QPANO.js → chunk-IYSEC543.js} +2 -2
- package/dist/{chunk-DC5H7KEQ.js → chunk-JHGHLKFS.js} +2 -2
- package/dist/{chunk-4DHQCN5H.js → chunk-LBYOLBW7.js} +17 -2
- package/dist/chunk-LBYOLBW7.js.map +1 -0
- package/dist/{chunk-6QRLRT3P.js → chunk-MT2JINSS.js} +16 -265
- package/dist/chunk-MT2JINSS.js.map +1 -0
- package/dist/{chunk-TP5M2NQB.js → chunk-NCMZMLY7.js} +3 -3
- package/dist/{chunk-COZPL62X.js → chunk-NDWYJLRF.js} +24 -139
- package/dist/chunk-NDWYJLRF.js.map +1 -0
- package/dist/{chunk-3YXDSCM6.js → chunk-NXNPDCF3.js} +29 -11
- package/dist/chunk-NXNPDCF3.js.map +1 -0
- package/dist/chunk-NYUYNYQL.js +48 -0
- package/dist/chunk-NYUYNYQL.js.map +1 -0
- package/dist/chunk-P6AORG32.js +415 -0
- package/dist/chunk-P6AORG32.js.map +1 -0
- package/dist/chunk-PTDMVGKL.js +31 -0
- package/dist/chunk-PTDMVGKL.js.map +1 -0
- package/dist/{chunk-D4FVAIEJ.js → chunk-PZR4EBPY.js} +5 -2
- package/dist/chunk-PZR4EBPY.js.map +1 -0
- package/dist/{chunk-LTB6KVJW.js → chunk-SDDPUAWH.js} +13 -11
- package/dist/{chunk-LTB6KVJW.js.map → chunk-SDDPUAWH.js.map} +1 -1
- package/dist/{chunk-WYYQK4D3.js → chunk-TD2NNXLZ.js} +13 -13
- package/dist/{chunk-ZMIPG6TR.js → chunk-TVL5MVUF.js} +4 -4
- package/dist/chunk-UDRHAQT7.js +172 -0
- package/dist/chunk-UDRHAQT7.js.map +1 -0
- package/dist/chunk-VAD43MOR.js +72 -0
- package/dist/chunk-VAD43MOR.js.map +1 -0
- package/dist/chunk-VSBFM7DS.js +229 -0
- package/dist/chunk-VSBFM7DS.js.map +1 -0
- package/dist/{chunk-VRWUL4TR.js → chunk-XHHMM5HX.js} +2 -2
- package/dist/{chunk-RJB3QUSP.js → chunk-XIDUYLSR.js} +3 -3
- package/dist/{chunk-QG6OSL4M.js → chunk-XUGSZP7Z.js} +2 -2
- package/dist/{chunk-S56JQJ4F.js → chunk-Y53WOQIJ.js} +3 -3
- package/dist/{chunk-62VF32IC.js → chunk-YFAXOD7Z.js} +10 -6
- package/dist/chunk-YFAXOD7Z.js.map +1 -0
- package/dist/{chunk-ICXV25N7.js → chunk-Z3KYFUN6.js} +3 -3
- package/dist/chunk-ZBDZTJUO.js +129 -0
- package/dist/chunk-ZBDZTJUO.js.map +1 -0
- package/dist/chunk-ZGBEIWSC.js +146 -0
- package/dist/chunk-ZGBEIWSC.js.map +1 -0
- package/dist/cli/bin.js +51 -28
- package/dist/cli/bin.js.map +1 -1
- package/dist/cli/commands/audit.d.ts +30 -1
- package/dist/cli/commands/audit.js +69 -33
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/client-AUE3XUPO.js +11 -0
- package/dist/{convert-to-pnpm-AT52NWZB.js → convert-to-pnpm-QFJOEP5V.js} +9 -9
- package/dist/db-UXNIZ2RG.js +217 -0
- package/dist/db-UXNIZ2RG.js.map +1 -0
- package/dist/{digest-UVHYZUYE.js → digest-FW6QMZZJ.js} +26 -22
- package/dist/{digest-UVHYZUYE.js.map → digest-FW6QMZZJ.js.map} +1 -1
- package/dist/dump-P6EBSIOH.js +68 -0
- package/dist/dump-P6EBSIOH.js.map +1 -0
- package/dist/email-KJXASVH5.js +195 -0
- package/dist/email-KJXASVH5.js.map +1 -0
- package/dist/{ensure-site-S25MDDHW.js → ensure-site-4DCEBAPM.js} +25 -16
- package/dist/ensure-site-4DCEBAPM.js.map +1 -0
- package/dist/fleet-events-cF2Om88w.d.ts +24 -0
- package/dist/fleet-state-7TJ2GYT2.js +39 -0
- package/dist/{forms-notify-target-TWN4EH6K.js → forms-notify-target-2EAWCWBW.js} +42 -133
- package/dist/forms-notify-target-2EAWCWBW.js.map +1 -0
- package/dist/{github-signals-G4ILZAJ6.js → github-signals-E2WPYTBK.js} +42 -21
- package/dist/github-signals-E2WPYTBK.js.map +1 -0
- package/dist/{header-image-T7XD37JL.js → header-image-6IC53W27.js} +36 -13
- package/dist/header-image-6IC53W27.js.map +1 -0
- package/dist/header-images-SQBCE5OD.js +88 -0
- package/dist/header-images-SQBCE5OD.js.map +1 -0
- package/dist/{health-endpoint-242WG2OJ.js → health-endpoint-RFXL2F4A.js} +9 -9
- package/dist/health-mirror-L5JBEJVA.js +41 -0
- package/dist/health-mirror-L5JBEJVA.js.map +1 -0
- package/dist/import-airtable-OHVY344G.js +37 -0
- package/dist/index.d.ts +324 -21
- package/dist/index.js +215 -76
- package/dist/index.js.map +1 -1
- package/dist/{init-JN26NTWF.js → init-XRAQZYID.js} +21 -18
- package/dist/{init-JN26NTWF.js.map → init-XRAQZYID.js.map} +1 -1
- package/dist/{launch-JA7Z4CIM.js → launch-IX4Y5JJC.js} +65 -30
- package/dist/launch-IX4Y5JJC.js.map +1 -0
- package/dist/lighthouse-VHI77PFB.js +11 -0
- package/dist/{lighthouse-airtable-BIPM26SZ.js → lighthouse-airtable-3GUWHETW.js} +3 -3
- package/dist/mailchimp-XYCTEEJY.js +72 -0
- package/dist/mailchimp-XYCTEEJY.js.map +1 -0
- package/dist/migrate-GQH237A6.js +7 -0
- package/dist/migrate-GQH237A6.js.map +1 -0
- package/dist/notify-C645PGD5.js +22 -0
- package/dist/notify-C645PGD5.js.map +1 -0
- package/dist/{onboard-53CITIM7.js → onboard-O4IAHJMO.js} +9 -9
- package/dist/orchestrate-YLWQ6KK2.js +31 -0
- package/dist/orchestrate-YLWQ6KK2.js.map +1 -0
- package/dist/parity-56KA2DGR.js +12 -0
- package/dist/parity-56KA2DGR.js.map +1 -0
- package/dist/pipeline-3AANZFCR.js +12 -0
- package/dist/pipeline-3AANZFCR.js.map +1 -0
- package/dist/{preflight-3XPDUHFJ.js → preflight-TNORKGCX.js} +17 -13
- package/dist/{preflight-3XPDUHFJ.js.map → preflight-TNORKGCX.js.map} +1 -1
- package/dist/{prismic-ci-UTQ6LRR3.js → prismic-ci-G2AK53VL.js} +12 -12
- package/dist/{prismic-models-PVES6R5V.js → prismic-models-O6Z3OK3A.js} +18 -13
- package/dist/prismic-models-O6Z3OK3A.js.map +1 -0
- package/dist/prospect/types.d.ts +267 -0
- package/dist/prospect/types.js +1 -0
- package/dist/prospect/types.js.map +1 -0
- package/dist/prospect-audit-KSXUNQ5J.js +174 -0
- package/dist/prospect-audit-KSXUNQ5J.js.map +1 -0
- package/dist/prospect-audits-3PMIO73D.js +19 -0
- package/dist/prospect-audits-3PMIO73D.js.map +1 -0
- package/dist/{protection-audit-64PLLBLI.js → protection-audit-SJO53MEQ.js} +3 -3
- package/dist/recipes/sync-configs.js +3 -3
- package/dist/render-IFOGFB5T.js +10 -0
- package/dist/render-IFOGFB5T.js.map +1 -0
- package/dist/render-from-row-BWSOIYDS.js +17 -0
- package/dist/render-from-row-BWSOIYDS.js.map +1 -0
- package/dist/{renovate-dispatch-ICJGSFCE.js → renovate-dispatch-6GQWTRKX.js} +12 -12
- package/dist/{renovate-dispatch-ICJGSFCE.js.map → renovate-dispatch-6GQWTRKX.js.map} +1 -1
- package/dist/replay-C2LXMJZP.js +66 -0
- package/dist/replay-C2LXMJZP.js.map +1 -0
- package/dist/{report-6CKSWJNG.js → report-R3E3Y7HR.js} +100 -32
- package/dist/report-R3E3Y7HR.js.map +1 -0
- package/dist/report-mirror-4MNORYQ4.js +49 -0
- package/dist/report-mirror-4MNORYQ4.js.map +1 -0
- package/dist/reports/header-image/assets/headline-announcement.png +0 -0
- package/dist/reports/header-image/assets/headline-launch.png +0 -0
- package/dist/reports/header-image/assets/headline-maintenance.png +0 -0
- package/dist/reports/header-image/assets/headline-testing.png +0 -0
- package/dist/reports/header-image/assets/plate-clean.png +0 -0
- package/dist/rerender-3FM6DNRH.js +32 -0
- package/dist/rerender-3FM6DNRH.js.map +1 -0
- package/dist/{self-updating-PPQVV6UA.js → self-updating-UCIWESAX.js} +9 -9
- package/dist/{selftest-CQ6NOX52.js → selftest-VGHWPN72.js} +31 -24
- package/dist/selftest-VGHWPN72.js.map +1 -0
- package/dist/site-mirror-NIREX5ME.js +52 -0
- package/dist/site-mirror-NIREX5ME.js.map +1 -0
- package/dist/smoke-B2GQOSIZ.js +20 -0
- package/dist/smoke-B2GQOSIZ.js.map +1 -0
- package/dist/{smoke-suite-TMCSOYRK.js → smoke-suite-U3UKD3NS.js} +9 -9
- package/dist/{submissions-GJ6ITBRH.js → submissions-IQEJX6FK.js} +3 -3
- package/dist/{svelte-codemods-ZOBDHIES.js → svelte-codemods-GOKXTBHW.js} +9 -9
- package/dist/sync-CTUVXMCK.js +44 -0
- package/dist/sync-CTUVXMCK.js.map +1 -0
- package/dist/{sync-configs-CJXUX6MD.js → sync-configs-SPTLFJCC.js} +9 -9
- package/dist/{upgrade-WLX27UPC.js → upgrade-W6ZR3FJH.js} +9 -9
- package/dist/webhook-VOGOW3W6.js +38 -0
- package/dist/webhook-VOGOW3W6.js.map +1 -0
- package/dist/{websites-SADZR4XQ.js → websites-D6WYFAES.js} +6 -2
- package/dist/websites-D6WYFAES.js.map +1 -0
- package/dist/{write-audits-to-airtable-7PH75YWY.js → write-audits-to-airtable-CMKHGJNQ.js} +4 -4
- package/dist/write-audits-to-airtable-CMKHGJNQ.js.map +1 -0
- package/package.json +9 -2
- package/dist/airtable-HRKSA7V4.js +0 -9
- package/dist/announce-GIAYN67S.js.map +0 -1
- package/dist/chunk-37S6L6G4.js.map +0 -1
- package/dist/chunk-3YXDSCM6.js.map +0 -1
- package/dist/chunk-4DHQCN5H.js.map +0 -1
- package/dist/chunk-4SOCPK7A.js +0 -108
- package/dist/chunk-4SOCPK7A.js.map +0 -1
- package/dist/chunk-577HCGZO.js.map +0 -1
- package/dist/chunk-62VF32IC.js.map +0 -1
- package/dist/chunk-6QRLRT3P.js.map +0 -1
- package/dist/chunk-COZPL62X.js.map +0 -1
- package/dist/chunk-D4FVAIEJ.js.map +0 -1
- package/dist/chunk-DTTIFYAM.js.map +0 -1
- package/dist/chunk-MGR2H7F4.js.map +0 -1
- package/dist/chunk-MPBXOJ3N.js.map +0 -1
- package/dist/chunk-NWB4O5EY.js.map +0 -1
- package/dist/chunk-SEEA6RXF.js.map +0 -1
- package/dist/chunk-U5SZ4FOP.js +0 -26
- package/dist/chunk-U5SZ4FOP.js.map +0 -1
- package/dist/client-X5WUJWDE.js +0 -11
- package/dist/db-JSIZYT23.js +0 -23
- package/dist/db-JSIZYT23.js.map +0 -1
- package/dist/ensure-site-S25MDDHW.js.map +0 -1
- package/dist/forms-notify-target-TWN4EH6K.js.map +0 -1
- package/dist/github-signals-G4ILZAJ6.js.map +0 -1
- package/dist/header-image-T7XD37JL.js.map +0 -1
- package/dist/launch-JA7Z4CIM.js.map +0 -1
- package/dist/migrate-LJUFGXQZ.js +0 -7
- package/dist/orchestrate-KDNXZQX7.js +0 -27
- package/dist/prismic-models-PVES6R5V.js.map +0 -1
- package/dist/report-6CKSWJNG.js.map +0 -1
- package/dist/reports/header-image/assets/plate.png +0 -0
- package/dist/selftest-CQ6NOX52.js.map +0 -1
- /package/dist/{airtable-HRKSA7V4.js.map → airtable-ZBUPQJSC.js.map} +0 -0
- /package/dist/{client-X5WUJWDE.js.map → attachments-NLZIJ5NU.js.map} +0 -0
- /package/dist/{bump-deps-SWJB6H5V.js.map → bump-deps-CGVELRLK.js.map} +0 -0
- /package/dist/{chunk-SDUJIANJ.js.map → chunk-2NJQLSEU.js.map} +0 -0
- /package/dist/{chunk-ZTPPCHDB.js.map → chunk-3G25KIWW.js.map} +0 -0
- /package/dist/{chunk-THEFTZ7F.js.map → chunk-62CMMGEO.js.map} +0 -0
- /package/dist/{chunk-FDIFTIXC.js.map → chunk-6TWWY7ZU.js.map} +0 -0
- /package/dist/{chunk-PBWDDDQH.js.map → chunk-7BZUOZPU.js.map} +0 -0
- /package/dist/{chunk-UYCAF77E.js.map → chunk-7RJ2HMMJ.js.map} +0 -0
- /package/dist/{chunk-Q276MZ7E.js.map → chunk-7UAYMAKR.js.map} +0 -0
- /package/dist/{chunk-R6FPFMOS.js.map → chunk-BQRFQSGY.js.map} +0 -0
- /package/dist/{chunk-7J53SUT6.js.map → chunk-CROKUHJB.js.map} +0 -0
- /package/dist/{chunk-GZNBCHAZ.js.map → chunk-HEWSRXYV.js.map} +0 -0
- /package/dist/{chunk-LS6QPANO.js.map → chunk-IYSEC543.js.map} +0 -0
- /package/dist/{chunk-DC5H7KEQ.js.map → chunk-JHGHLKFS.js.map} +0 -0
- /package/dist/{chunk-TP5M2NQB.js.map → chunk-NCMZMLY7.js.map} +0 -0
- /package/dist/{chunk-WYYQK4D3.js.map → chunk-TD2NNXLZ.js.map} +0 -0
- /package/dist/{chunk-ZMIPG6TR.js.map → chunk-TVL5MVUF.js.map} +0 -0
- /package/dist/{chunk-VRWUL4TR.js.map → chunk-XHHMM5HX.js.map} +0 -0
- /package/dist/{chunk-RJB3QUSP.js.map → chunk-XIDUYLSR.js.map} +0 -0
- /package/dist/{chunk-QG6OSL4M.js.map → chunk-XUGSZP7Z.js.map} +0 -0
- /package/dist/{chunk-S56JQJ4F.js.map → chunk-Y53WOQIJ.js.map} +0 -0
- /package/dist/{chunk-ICXV25N7.js.map → chunk-Z3KYFUN6.js.map} +0 -0
- /package/dist/{lighthouse-airtable-BIPM26SZ.js.map → client-AUE3XUPO.js.map} +0 -0
- /package/dist/{convert-to-pnpm-AT52NWZB.js.map → convert-to-pnpm-QFJOEP5V.js.map} +0 -0
- /package/dist/{migrate-LJUFGXQZ.js.map → fleet-state-7TJ2GYT2.js.map} +0 -0
- /package/dist/{health-endpoint-242WG2OJ.js.map → health-endpoint-RFXL2F4A.js.map} +0 -0
- /package/dist/{orchestrate-KDNXZQX7.js.map → import-airtable-OHVY344G.js.map} +0 -0
- /package/dist/{websites-SADZR4XQ.js.map → lighthouse-VHI77PFB.js.map} +0 -0
- /package/dist/{write-audits-to-airtable-7PH75YWY.js.map → lighthouse-airtable-3GUWHETW.js.map} +0 -0
- /package/dist/{onboard-53CITIM7.js.map → onboard-O4IAHJMO.js.map} +0 -0
- /package/dist/{prismic-ci-UTQ6LRR3.js.map → prismic-ci-G2AK53VL.js.map} +0 -0
- /package/dist/{protection-audit-64PLLBLI.js.map → protection-audit-SJO53MEQ.js.map} +0 -0
- /package/dist/{self-updating-PPQVV6UA.js.map → self-updating-UCIWESAX.js.map} +0 -0
- /package/dist/{smoke-suite-TMCSOYRK.js.map → smoke-suite-U3UKD3NS.js.map} +0 -0
- /package/dist/{submissions-GJ6ITBRH.js.map → submissions-IQEJX6FK.js.map} +0 -0
- /package/dist/{svelte-codemods-ZOBDHIES.js.map → svelte-codemods-GOKXTBHW.js.map} +0 -0
- /package/dist/{sync-configs-CJXUX6MD.js.map → sync-configs-SPTLFJCC.js.map} +0 -0
- /package/dist/{upgrade-WLX27UPC.js.map → upgrade-W6ZR3FJH.js.map} +0 -0
|
@@ -2,37 +2,40 @@ import {
|
|
|
2
2
|
appendSkipNotice,
|
|
3
3
|
fleetWorkdir,
|
|
4
4
|
prepareFleetSites
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TVL5MVUF.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveSites
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CROKUHJB.js";
|
|
9
9
|
import {
|
|
10
10
|
init
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-J7SZQUCW.js";
|
|
16
|
-
import "./chunk-R6FPFMOS.js";
|
|
17
|
-
import "./chunk-S56JQJ4F.js";
|
|
11
|
+
} from "./chunk-TD2NNXLZ.js";
|
|
12
|
+
import "./chunk-BQRFQSGY.js";
|
|
13
|
+
import "./chunk-Y53WOQIJ.js";
|
|
14
|
+
import "./chunk-7RJ2HMMJ.js";
|
|
18
15
|
import "./chunk-R53VL3RI.js";
|
|
19
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-XIDUYLSR.js";
|
|
17
|
+
import "./chunk-IYSEC543.js";
|
|
18
|
+
import "./chunk-J7SZQUCW.js";
|
|
19
|
+
import "./chunk-7UAYMAKR.js";
|
|
20
20
|
import "./chunk-73UFRZKY.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-3G25KIWW.js";
|
|
22
22
|
import "./chunk-OTGB6YQO.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-3JQ2FO3D.js";
|
|
24
24
|
import "./chunk-LKGVSM2O.js";
|
|
25
25
|
import "./chunk-GASBX52O.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-XHHMM5HX.js";
|
|
27
|
+
import "./chunk-6TWWY7ZU.js";
|
|
28
|
+
import "./chunk-EVBCK2KC.js";
|
|
29
29
|
import "./chunk-A3WDWNN5.js";
|
|
30
30
|
import "./chunk-2OP4JKIQ.js";
|
|
31
|
+
import "./chunk-XTK5VIQB.js";
|
|
32
|
+
import "./chunk-2NQUCS7O.js";
|
|
33
|
+
import "./chunk-UDRHAQT7.js";
|
|
34
|
+
import "./chunk-PTDMVGKL.js";
|
|
35
|
+
import "./chunk-LBYOLBW7.js";
|
|
31
36
|
import {
|
|
32
37
|
siteLabel
|
|
33
38
|
} from "./chunk-XXTZBPUY.js";
|
|
34
|
-
import "./chunk-XTK5VIQB.js";
|
|
35
|
-
import "./chunk-U5SZ4FOP.js";
|
|
36
39
|
import "./chunk-NMAWXBJA.js";
|
|
37
40
|
import "./chunk-C6B4RHXR.js";
|
|
38
41
|
|
|
@@ -107,4 +110,4 @@ async function runInitCommand(site, opts) {
|
|
|
107
110
|
export {
|
|
108
111
|
runInitCommand
|
|
109
112
|
};
|
|
110
|
-
//# sourceMappingURL=init-
|
|
113
|
+
//# sourceMappingURL=init-XRAQZYID.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/init.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { init, type InitResult, type InitStepResult } from \"../../recipes/init.js\";\nimport { resolveSites } from \"../fleet/resolve-sites.js\";\nimport { prepareFleetSites, appendSkipNotice, type SkippedSite } from \"../fleet/prepare-sites.js\";\nimport { fleetWorkdir } from \"../../util/fleet-workdir.js\";\nimport { siteLabel } from \"../../util/site.js\";\n\nexport type InitCommandOptions = {\n fleet?: string;\n workdir?: string;\n cwd?: string;\n};\n\nfunction formatStep(name: string, r: InitStepResult): string {\n if (r.kind === \"error\") return `${name.padEnd(20)} error: ${r.message}`;\n if (r.kind === \"audit\") {\n const lines = r.results.map(\n (a) => ` ${a.audit.padEnd(12)} ${a.status.padEnd(5)} ${a.summary}`,\n );\n return `${name.padEnd(20)} ${r.results.length} audit(s):\\n${lines.join(\"\\n\")}`;\n }\n const rec = r.result;\n if (rec.status === \"noop\") return `${name.padEnd(20)} noop${rec.notes ? ` — ${rec.notes}` : \"\"}`;\n if (rec.status === \"failed\")\n return `${name.padEnd(20)} failed${rec.notes ? ` — ${rec.notes}` : \"\"}`;\n return `${name.padEnd(20)} applied (${rec.commits.length} commit${rec.commits.length === 1 ? \"\" : \"s\"})${rec.notes ? ` — ${rec.notes}` : \"\"}`;\n}\n\nfunction formatResult(r: InitResult): string {\n const header = `[${r.site}] init — ${r.complete ? \"complete\" : \"STOPPED\"}`;\n const body = r.steps.map((s) => formatStep(s.name, s.result)).join(\"\\n\");\n return `${header}\\n${body}`;\n}\n\nfunction exitCodeFor(r: InitResult): number {\n if (!r.complete) return 1;\n // A complete chain can still surface a failing audit at the end. Treat\n // any `fail`-status audit as exit 1 so CI signals a regression even when\n // every recipe applied cleanly.\n for (const step of r.steps) {\n if (step.result.kind === \"audit\" && step.result.results.some((a) => a.status === \"fail\")) {\n return 1;\n }\n }\n return 0;\n}\n\nexport async function runInitCommand(\n site: string | undefined,\n opts: InitCommandOptions,\n): Promise<{ output: string; code: number }> {\n const cwd = opts.cwd ? resolve(opts.cwd) : process.cwd();\n\n let sites = await resolveSites({\n ...(site !== undefined ? { site } : {}),\n ...(opts.fleet !== undefined ? { fleet: opts.fleet } : {}),\n ...(opts.workdir !== undefined ? { workdir: opts.workdir } : {}),\n cwd,\n });\n\n let skipped: SkippedSite[] = [];\n if (opts.fleet) {\n const workdir = opts.workdir ?? fleetWorkdir();\n const prep = await prepareFleetSites(sites, { workdir });\n sites = prep.prepared;\n skipped = prep.skipped;\n }\n\n const results: InitResult[] = [];\n for (const s of sites) {\n try {\n results.push(await init(s));\n } catch (err) {\n // Isolate a per-site throw (e.g. a transient git error) so the rest of the\n // fleet still runs — the same guarantee `runRecipeOverSites` gives the other\n // fleet commands, but `init` returns an `InitResult`, so synthesize a stopped\n // one here rather than reuse the shared helper.\n results.push({\n site: siteLabel(s),\n steps: [\n {\n name: \"init\",\n result: { kind: \"error\", message: err instanceof Error ? err.message : String(err) },\n },\n ],\n complete: false,\n });\n }\n }\n\n const output = results.map(formatResult).join(\"\\n\\n\");\n const code = results.some((r) => exitCodeFor(r) !== 0) ? 1 : 0;\n return { output: appendSkipNotice(output, skipped), code };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/init.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { init, type InitResult, type InitStepResult } from \"../../recipes/init.js\";\nimport { resolveSites } from \"../fleet/resolve-sites.js\";\nimport { prepareFleetSites, appendSkipNotice, type SkippedSite } from \"../fleet/prepare-sites.js\";\nimport { fleetWorkdir } from \"../../util/fleet-workdir.js\";\nimport { siteLabel } from \"../../util/site.js\";\n\nexport type InitCommandOptions = {\n fleet?: string;\n workdir?: string;\n cwd?: string;\n};\n\nfunction formatStep(name: string, r: InitStepResult): string {\n if (r.kind === \"error\") return `${name.padEnd(20)} error: ${r.message}`;\n if (r.kind === \"audit\") {\n const lines = r.results.map(\n (a) => ` ${a.audit.padEnd(12)} ${a.status.padEnd(5)} ${a.summary}`,\n );\n return `${name.padEnd(20)} ${r.results.length} audit(s):\\n${lines.join(\"\\n\")}`;\n }\n const rec = r.result;\n if (rec.status === \"noop\") return `${name.padEnd(20)} noop${rec.notes ? ` — ${rec.notes}` : \"\"}`;\n if (rec.status === \"failed\")\n return `${name.padEnd(20)} failed${rec.notes ? ` — ${rec.notes}` : \"\"}`;\n return `${name.padEnd(20)} applied (${rec.commits.length} commit${rec.commits.length === 1 ? \"\" : \"s\"})${rec.notes ? ` — ${rec.notes}` : \"\"}`;\n}\n\nfunction formatResult(r: InitResult): string {\n const header = `[${r.site}] init — ${r.complete ? \"complete\" : \"STOPPED\"}`;\n const body = r.steps.map((s) => formatStep(s.name, s.result)).join(\"\\n\");\n return `${header}\\n${body}`;\n}\n\nfunction exitCodeFor(r: InitResult): number {\n if (!r.complete) return 1;\n // A complete chain can still surface a failing audit at the end. Treat\n // any `fail`-status audit as exit 1 so CI signals a regression even when\n // every recipe applied cleanly.\n for (const step of r.steps) {\n if (step.result.kind === \"audit\" && step.result.results.some((a) => a.status === \"fail\")) {\n return 1;\n }\n }\n return 0;\n}\n\nexport async function runInitCommand(\n site: string | undefined,\n opts: InitCommandOptions,\n): Promise<{ output: string; code: number }> {\n const cwd = opts.cwd ? resolve(opts.cwd) : process.cwd();\n\n let sites = await resolveSites({\n ...(site !== undefined ? { site } : {}),\n ...(opts.fleet !== undefined ? { fleet: opts.fleet } : {}),\n ...(opts.workdir !== undefined ? { workdir: opts.workdir } : {}),\n cwd,\n });\n\n let skipped: SkippedSite[] = [];\n if (opts.fleet) {\n const workdir = opts.workdir ?? fleetWorkdir();\n const prep = await prepareFleetSites(sites, { workdir });\n sites = prep.prepared;\n skipped = prep.skipped;\n }\n\n const results: InitResult[] = [];\n for (const s of sites) {\n try {\n results.push(await init(s));\n } catch (err) {\n // Isolate a per-site throw (e.g. a transient git error) so the rest of the\n // fleet still runs — the same guarantee `runRecipeOverSites` gives the other\n // fleet commands, but `init` returns an `InitResult`, so synthesize a stopped\n // one here rather than reuse the shared helper.\n results.push({\n site: siteLabel(s),\n steps: [\n {\n name: \"init\",\n result: { kind: \"error\", message: err instanceof Error ? err.message : String(err) },\n },\n ],\n complete: false,\n });\n }\n }\n\n const output = results.map(formatResult).join(\"\\n\\n\");\n const code = results.some((r) => exitCodeFor(r) !== 0) ? 1 : 0;\n return { output: appendSkipNotice(output, skipped), code };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AAaxB,SAAS,WAAW,MAAc,GAA2B;AAC3D,MAAI,EAAE,SAAS,QAAS,QAAO,GAAG,KAAK,OAAO,EAAE,CAAC,WAAW,EAAE,OAAO;AACrE,MAAI,EAAE,SAAS,SAAS;AACtB,UAAM,QAAQ,EAAE,QAAQ;AAAA,M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5
|
import {
|
|
6
6
|
writeAuditsToAirtable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NXNPDCF3.js";
|
|
8
8
|
import {
|
|
9
9
|
hasRealScores,
|
|
10
10
|
lighthouseScoresFromResult
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-5L3FPQIJ.js";
|
|
11
|
+
} from "./chunk-7BZUOZPU.js";
|
|
13
12
|
import {
|
|
14
13
|
resolveSites
|
|
15
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CROKUHJB.js";
|
|
15
|
+
import "./chunk-5L3FPQIJ.js";
|
|
16
16
|
import {
|
|
17
17
|
queueDraft
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YFAXOD7Z.js";
|
|
19
19
|
import {
|
|
20
20
|
createDraft,
|
|
21
21
|
findReportByPeriod,
|
|
22
|
-
renderReportHtml,
|
|
23
|
-
resolveCopy,
|
|
24
22
|
updateReportScores
|
|
25
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-F3JWOPTG.js";
|
|
24
|
+
import "./chunk-VAD43MOR.js";
|
|
26
25
|
import {
|
|
27
26
|
uploadAttachment
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import
|
|
27
|
+
} from "./chunk-IY6256GK.js";
|
|
28
|
+
import {
|
|
29
|
+
openBase,
|
|
30
|
+
readAirtableConfig
|
|
31
|
+
} from "./chunk-HN6I2XWI.js";
|
|
32
|
+
import {
|
|
33
|
+
renderReportHtml,
|
|
34
|
+
resolveCopy
|
|
35
|
+
} from "./chunk-MT2JINSS.js";
|
|
36
|
+
import "./chunk-DJZWYIPP.js";
|
|
37
|
+
import {
|
|
38
|
+
listWebsites,
|
|
39
|
+
siteSlug
|
|
40
|
+
} from "./chunk-7NYN2P6I.js";
|
|
30
41
|
import "./chunk-73UFRZKY.js";
|
|
31
42
|
import {
|
|
32
43
|
runAudits
|
|
33
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-3JQ2FO3D.js";
|
|
34
45
|
import "./chunk-LKGVSM2O.js";
|
|
35
46
|
import "./chunk-GASBX52O.js";
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-XHHMM5HX.js";
|
|
48
|
+
import "./chunk-6TWWY7ZU.js";
|
|
49
|
+
import "./chunk-EVBCK2KC.js";
|
|
39
50
|
import "./chunk-A3WDWNN5.js";
|
|
40
51
|
import "./chunk-2OP4JKIQ.js";
|
|
52
|
+
import "./chunk-XTK5VIQB.js";
|
|
53
|
+
import "./chunk-2NQUCS7O.js";
|
|
54
|
+
import "./chunk-UDRHAQT7.js";
|
|
55
|
+
import "./chunk-PTDMVGKL.js";
|
|
56
|
+
import "./chunk-LBYOLBW7.js";
|
|
41
57
|
import {
|
|
42
58
|
siteLabel
|
|
43
59
|
} from "./chunk-XXTZBPUY.js";
|
|
44
|
-
import "./chunk-XTK5VIQB.js";
|
|
45
|
-
import "./chunk-U5SZ4FOP.js";
|
|
46
|
-
import {
|
|
47
|
-
listWebsites,
|
|
48
|
-
siteSlug
|
|
49
|
-
} from "./chunk-577HCGZO.js";
|
|
50
|
-
import {
|
|
51
|
-
openBase,
|
|
52
|
-
readAirtableConfig
|
|
53
|
-
} from "./chunk-HN6I2XWI.js";
|
|
54
60
|
import "./chunk-6VAL7XJT.js";
|
|
55
61
|
import "./chunk-NMAWXBJA.js";
|
|
56
62
|
import "./chunk-C6B4RHXR.js";
|
|
@@ -107,7 +113,15 @@ async function launch(site, deps = {}) {
|
|
|
107
113
|
return stop();
|
|
108
114
|
}
|
|
109
115
|
try {
|
|
110
|
-
await writeAuditsToAirtable({
|
|
116
|
+
const auditWrite = await writeAuditsToAirtable({
|
|
117
|
+
base,
|
|
118
|
+
websites,
|
|
119
|
+
slug: siteSlug(target.name),
|
|
120
|
+
results
|
|
121
|
+
});
|
|
122
|
+
if (auditWrite.siteId && auditWrite.fields) {
|
|
123
|
+
await deps.siteMirror?.health(auditWrite.siteId, auditWrite.fields);
|
|
124
|
+
}
|
|
111
125
|
} catch (err) {
|
|
112
126
|
steps.push({ name: "audit", result: errorOf(err) });
|
|
113
127
|
return stop();
|
|
@@ -121,9 +135,20 @@ async function launch(site, deps = {}) {
|
|
|
121
135
|
const existing = await findReportByPeriod(base, target.id, "Launch", period);
|
|
122
136
|
if (existing) {
|
|
123
137
|
await updateReportScores(base, existing.id, scores, today);
|
|
138
|
+
await deps.reportMirror?.patch(existing.id, {
|
|
139
|
+
lighthouse_performance: scores.performance,
|
|
140
|
+
lighthouse_accessibility: scores.accessibility,
|
|
141
|
+
lighthouse_best_practices: scores.bestPractices,
|
|
142
|
+
lighthouse_seo: scores.seo,
|
|
143
|
+
completed_on: today.toISOString().slice(0, 10)
|
|
144
|
+
});
|
|
124
145
|
report = existing;
|
|
125
146
|
} else {
|
|
126
|
-
report = await createDraft(
|
|
147
|
+
report = await createDraft(
|
|
148
|
+
base,
|
|
149
|
+
draftInputFor(target, scores, today, period),
|
|
150
|
+
deps.reportMirror?.created
|
|
151
|
+
);
|
|
127
152
|
}
|
|
128
153
|
} catch (err) {
|
|
129
154
|
steps.push({ name: "draft", result: errorOf(err) });
|
|
@@ -149,12 +174,17 @@ async function launch(site, deps = {}) {
|
|
|
149
174
|
`${slug}-${today.toISOString().slice(0, 10)}.html`,
|
|
150
175
|
"text/html"
|
|
151
176
|
);
|
|
177
|
+
await deps.reportMirror?.body(report.id, html);
|
|
152
178
|
} catch (uploadErr) {
|
|
153
179
|
console.warn(
|
|
154
180
|
`\u26A0 Launch preview upload skipped for ${target.name}: ${uploadErr instanceof Error ? uploadErr.message : String(uploadErr)}`
|
|
155
181
|
);
|
|
156
182
|
}
|
|
157
|
-
await queueDraft(
|
|
183
|
+
await queueDraft(
|
|
184
|
+
base,
|
|
185
|
+
{ id: report.id, siteId: target.id, reportType: "Launch" },
|
|
186
|
+
deps.reportMirror
|
|
187
|
+
);
|
|
158
188
|
} catch (err) {
|
|
159
189
|
steps.push({ name: "draft", result: errorOf(err) });
|
|
160
190
|
return stop();
|
|
@@ -210,10 +240,15 @@ async function runLaunchCommand(site, opts) {
|
|
|
210
240
|
if (!target) {
|
|
211
241
|
return { output: `No site resolved for "${site}".`, code: 1 };
|
|
212
242
|
}
|
|
213
|
-
const
|
|
243
|
+
const { makeReportMirror } = await import("./report-mirror-4MNORYQ4.js");
|
|
244
|
+
const { makeSiteMirror } = await import("./site-mirror-NIREX5ME.js");
|
|
245
|
+
const result = await launch(target, {
|
|
246
|
+
reportMirror: await makeReportMirror(),
|
|
247
|
+
siteMirror: await makeSiteMirror()
|
|
248
|
+
});
|
|
214
249
|
return { output: formatResult(result), code: result.complete ? 0 : 1 };
|
|
215
250
|
}
|
|
216
251
|
export {
|
|
217
252
|
runLaunchCommand
|
|
218
253
|
};
|
|
219
|
-
//# sourceMappingURL=launch-
|
|
254
|
+
//# sourceMappingURL=launch-IX4Y5JJC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/launch.ts","../src/recipes/launch.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { launch, type LaunchResult, type LaunchStepResult } from \"../../recipes/launch.js\";\nimport { resolveSites } from \"../fleet/resolve-sites.js\";\n\nexport type LaunchCommandOptions = {\n cwd?: string;\n};\n\nfunction formatStep(name: string, r: LaunchStepResult): string {\n if (r.kind === \"error\") return `${name.padEnd(20)} error: ${r.message}`;\n if (r.kind === \"audit\") {\n const s = r.scores;\n return `${name.padEnd(20)} audited (P=${s.performance} A=${s.accessibility} BP=${s.bestPractices} SEO=${s.seo})`;\n }\n if (r.kind === \"draft\") {\n return `${name.padEnd(20)} drafted ${r.report.reportId}`;\n }\n const rec = r.result;\n if (rec.status === \"noop\") return `${name.padEnd(20)} noop${rec.notes ? ` — ${rec.notes}` : \"\"}`;\n if (rec.status === \"failed\")\n return `${name.padEnd(20)} failed${rec.notes ? ` — ${rec.notes}` : \"\"}`;\n return `${name.padEnd(20)} applied (${rec.commits.length} commit${rec.commits.length === 1 ? \"\" : \"s\"})${rec.notes ? ` — ${rec.notes}` : \"\"}`;\n}\n\nfunction formatResult(r: LaunchResult): string {\n const header = `[${r.site}] launch — ${r.complete ? \"drafted (awaiting approval)\" : \"STOPPED\"}`;\n const body = r.steps.map((s) => formatStep(s.name, s.result)).join(\"\\n\");\n return `${header}\\n${body}`;\n}\n\n/**\n * `launch <site>` — single-site only. Bootstrap (Renovate + protection), first-audit\n * the site, and DRAFT its launch email into the M3 approve queue. Never sends;\n * the operator approves the draft and the next send run delivers the go-live\n * email (flipping Status → maintenance + stamping Launched at).\n */\nexport async function runLaunchCommand(\n site: string,\n opts: LaunchCommandOptions,\n): Promise<{ output: string; code: number }> {\n const cwd = opts.cwd ? resolve(opts.cwd) : process.cwd();\n const sites = await resolveSites({ site, cwd });\n const target = sites[0];\n if (!target) {\n return { output: `No site resolved for \"${site}\".`, code: 1 };\n }\n\n // #539 Phase 5: create-side Turso dual-write, wired at the composition root\n // (see runAnnounceCommand for why it is not defaulted inside the recipe).\n const { makeReportMirror } = await import(\"../../reports/report-mirror.js\");\n const { makeSiteMirror } = await import(\"../../db/site-mirror.js\");\n const result = await launch(target, {\n reportMirror: await makeReportMirror(),\n siteMirror: await makeSiteMirror(),\n });\n return { output: formatResult(result), code: result.complete ? 0 : 1 };\n}\n","import type { AuditResult, RecipeResult, Site } from \"../types.js\";\nimport { siteLabel } from \"../util/site.js\";\nimport { selfUpdating } from \"./self-updating/index.js\";\nimport { runAudits } from \"../audits/index.js\";\nimport { hasRealScores, lighthouseScoresFromResult } from \"../audits/lighthouse-airtable.js\";\nimport { writeAuditsToAirtable } from \"../audits/write-audits-to-airtable.js\";\nimport { openBase, readAirtableConfig } from \"../reports/airtable/client.js\";\nimport type { AirtableBase } from \"../reports/airtable/client.js\";\nimport { listWebsites, siteSlug } from \"../reports/airtable/websites.js\";\nimport type { WebsiteRow } from \"../reports/airtable/websites.js\";\nimport {\n createDraft,\n findReportByPeriod,\n updateReportScores,\n} from \"../reports/airtable/reports.js\";\nimport type { ReportRow } from \"../reports/airtable/reports.js\";\nimport type { ReportMirror } from \"../reports/report-mirror.js\";\nimport type { SiteMirror } from \"../db/site-mirror.js\";\nimport { queueDraft } from \"../reports/queue.js\";\nimport { uploadAttachment } from \"../reports/airtable/attachments.js\";\nimport { renderReportHtml } from \"../reports/render.js\";\nimport { resolveCopy } from \"../reports/copy.js\";\nimport type { LighthouseScores } from \"../reports/types.js\";\n\nexport type LaunchStepResult =\n | { kind: \"recipe\"; result: RecipeResult }\n | { kind: \"audit\"; results: AuditResult[]; scores: LighthouseScores }\n | { kind: \"draft\"; report: ReportRow }\n | { kind: \"error\"; message: string };\n\nexport type LaunchResult = {\n site: string;\n steps: Array<{ name: string; result: LaunchStepResult }>;\n /** True if every step ran (bootstrap + audit + draft); false if a step\n * errored or a recipe `failed` short-circuited the chain. */\n complete: boolean;\n};\n\nexport type LaunchDeps = {\n /** Bootstrap step (Renovate + protection; ci.yml comes from the starter). Defaults to the real `selfUpdating`. */\n bootstrap?: (site: Site) => Promise<RecipeResult>;\n /** Audit step. Defaults to the real `runAudits`. */\n audit?: (site: Site) => Promise<AuditResult[]>;\n /** Airtable handle. Defaults to opening the live base from credentials. */\n base?: AirtableBase;\n /** #539 Phase 5: Turso write-through for everything this recipe writes — the\n * Launch row (or a re-run's refreshed scores), the rendered body, and the\n * queue flag. Wired at the CLI composition root, never defaulted here — the\n * unit suite calls `launch` with a fake base and must not open a real\n * libSQL handle. */\n reportMirror?: ReportMirror;\n /** #539 Phase 5: the Websites-row twin — launch writes the site's FIRST audit\n * results and (on send) its launched status. Injected at the CLI root. */\n siteMirror?: SiteMirror;\n};\n\n/**\n * Launch a site: bootstrap → first-audit → DRAFT a launch email. The M3\n * approve loop is what actually sends; `launch` never sends — it stops at a\n * dashboard-queued draft (`reportType: \"Launch\"`) carrying the just-audited\n * Lighthouse scores, so `sendOne`'s `report.lighthouse` guard passes.\n *\n * Step-chain (mirrors `init`), stopping on the first error or `failed` recipe:\n * 1. selfUpdating — Renovate + protection (platform auto-merge OFF; ci.yml is the starter's).\n * 2. runAudits + write the scores to the site's Websites row (reuses the\n * `audit --write-airtable` writer); the Lighthouse scores feed the draft.\n * 3. createDraft — reportType \"Launch\", today's period, the audited scores.\n */\nexport async function launch(site: Site, deps: LaunchDeps = {}): Promise<LaunchResult> {\n const label = siteLabel(site);\n const bootstrap = deps.bootstrap ?? selfUpdating;\n const audit = deps.audit ?? runAudits;\n const base = deps.base ?? openBase(readAirtableConfig());\n\n const steps: Array<{ name: string; result: LaunchStepResult }> = [];\n const stop = (): LaunchResult => ({ site: label, steps, complete: false });\n\n // 1. Bootstrap.\n let recipe: RecipeResult;\n try {\n recipe = await bootstrap(site);\n } catch (err) {\n steps.push({ name: \"self-updating\", result: errorOf(err) });\n return stop();\n }\n steps.push({ name: \"self-updating\", result: { kind: \"recipe\", result: recipe } });\n if (recipe.status === \"failed\") return stop();\n\n // 2. Audit + write scores back to Airtable.\n let results: AuditResult[];\n try {\n results = await audit(site);\n } catch (err) {\n steps.push({ name: \"audit\", result: errorOf(err) });\n return stop();\n }\n const lhResult = results.find((r) => r.audit === \"lighthouse\");\n if (!lhResult || !hasRealScores(lhResult)) {\n steps.push({\n name: \"audit\",\n result: { kind: \"error\", message: \"lighthouse audit produced no real scores\" },\n });\n return stop();\n }\n // The launch announcement renders a numeric score per category; a metric that\n // errored this run (now null from lighthouseScoresFromResult) keeps the prior\n // 0 behavior here rather than propagating null into the launch-email path. The\n // Airtable write path (write-audits-to-airtable) keeps the null → shows \"—\".\n const rawScores = lighthouseScoresFromResult(lhResult);\n const scores: LighthouseScores = {\n performance: rawScores.performance ?? 0,\n accessibility: rawScores.accessibility ?? 0,\n bestPractices: rawScores.bestPractices ?? 0,\n seo: rawScores.seo ?? 0,\n };\n\n const websites = await listWebsites(base);\n const target = websites.find((w) => siteSlug(w.name) === siteSlug(label));\n if (!target) {\n steps.push({\n name: \"audit\",\n result: { kind: \"error\", message: `no Websites row matched site \"${label}\"` },\n });\n return stop();\n }\n try {\n const auditWrite = await writeAuditsToAirtable({\n base,\n websites,\n slug: siteSlug(target.name),\n results,\n });\n // #539 Phase 5: mirror the first-audit write-back. Launch is the ONE path\n // that writes a brand-new site's health, so without this its row reads empty\n // in the console until the next hourly sync.\n if (auditWrite.siteId && auditWrite.fields) {\n await deps.siteMirror?.health(auditWrite.siteId, auditWrite.fields);\n }\n } catch (err) {\n steps.push({ name: \"audit\", result: errorOf(err) });\n return stop();\n }\n steps.push({ name: \"audit\", result: { kind: \"audit\", results, scores } });\n\n // 3. Draft the launch email (reuses draft.ts's reportId/period scheme). DRAFTS\n // ONLY — the M3 approve loop sends it and flips Status on send.\n const today = new Date();\n const period = today.toISOString().slice(0, 7);\n const slug = siteSlug(target.name);\n\n let report: ReportRow;\n try {\n // Re-run dedupe: reuse an existing Launch row for this (site, period) instead\n // of stacking a second draft. findReportByPeriod is the same idempotency\n // lookup draft.ts documents (dashboard/digest point lookup).\n const existing = await findReportByPeriod(base, target.id, \"Launch\", period);\n if (existing) {\n // Reuse path: the row was created on a prior run with THAT run's scores. This\n // re-run just produced fresh audit scores AND will re-render the preview from\n // them — so refresh the row's Lighthouse cells (+ Completed on) to match,\n // otherwise the sent email (which reads the row) ships stale scores. The\n // create path already writes fresh scores via createDraft.\n await updateReportScores(base, existing.id, scores, today);\n // Mirror the same refresh — see the announce reuse path for why.\n await deps.reportMirror?.patch(existing.id, {\n lighthouse_performance: scores.performance,\n lighthouse_accessibility: scores.accessibility,\n lighthouse_best_practices: scores.bestPractices,\n lighthouse_seo: scores.seo,\n completed_on: today.toISOString().slice(0, 10),\n });\n report = existing;\n } else {\n report = await createDraft(\n base,\n draftInputFor(target, scores, today, period),\n deps.reportMirror?.created,\n );\n }\n } catch (err) {\n steps.push({ name: \"draft\", result: errorOf(err) });\n return stop();\n }\n\n // Mirror draft.ts:135-154 — render → upload \"Rendered HTML\" preview → flip\n // Draft ready. Without setDraftReady the draft never enters the approve queue\n // (every pending-approval gate requires draftReady true), so it can never be\n // approved or sent. The upload is a review convenience; the ready flag is the\n // critical step.\n try {\n const { html } = await renderReportHtml({\n siteName: target.name,\n siteUrl: target.url,\n reportType: \"Launch\",\n completedOn: today,\n lighthouse: scores,\n lastTestedDate: null,\n commentary: null,\n copy: resolveCopy(target),\n headerImageCid: `${slug}-header`,\n });\n // A preview-upload hiccup must NOT fail the launch — log and continue.\n try {\n await uploadAttachment(\n report.id,\n \"Rendered HTML\",\n html,\n `${slug}-${today.toISOString().slice(0, 10)}.html`,\n \"text/html\",\n );\n // The console preview reads the body from Turso, not the attachment.\n await deps.reportMirror?.body(report.id, html);\n } catch (uploadErr) {\n console.warn(\n `⚠ Launch preview upload skipped for ${target.name}: ${\n uploadErr instanceof Error ? uploadErr.message : String(uploadErr)\n }`,\n );\n }\n // Critical: NOT wrapped — a failure here must surface as a failed launch. queueDraft\n // supersedes any lower-tier (Maintenance/Testing) drafts queued for this site; a Launch is\n // top tier so it only stands down if another Launch/Announcement is already queued.\n await queueDraft(\n base,\n { id: report.id, siteId: target.id, reportType: \"Launch\" },\n deps.reportMirror,\n );\n } catch (err) {\n steps.push({ name: \"draft\", result: errorOf(err) });\n return stop();\n }\n\n steps.push({ name: \"draft\", result: { kind: \"draft\", report } });\n\n return { site: label, steps, complete: true };\n}\n\n/** Build the Launch `DraftInput`. reportId/period mirror `draftReportForSite`\n * (draft.ts) — do not invent a new id scheme. `today`/`period` are threaded in\n * from `launch()` so a single timestamp drives the render, the draft, the\n * dedupe lookup, and the preview filename. Launch reports have no period window\n * and no prior maintenance test, so periodStart/periodEnd/completedOn all\n * collapse to \"today\" and `lastTestedDate` is null. */\nfunction draftInputFor(\n target: WebsiteRow,\n scores: LighthouseScores,\n today: Date,\n period: string,\n): Parameters<typeof createDraft>[1] {\n const reportType = \"Launch\" as const;\n const reportId = `${target.name} — ${reportType} — ${today.toISOString().slice(0, 10)}`;\n return {\n reportId,\n siteId: target.id,\n reportType,\n period,\n periodStart: today,\n periodEnd: today,\n completedOn: today,\n lighthouse: scores,\n lastTestedDate: null,\n };\n}\n\nfunction errorOf(err: unknown): LaunchStepResult {\n return { kind: \"error\", message: err instanceof Error ? err.message : String(err) };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;;;ACoExB,eAAsB,OAAO,MAAY,OAAmB,CAAC,GAA0B;AACrF,QAAM,QAAQ,UAAU,IAAI;AAC5B,QAAM,YAAY,KAAK,aAAa;AACpC,QAAM,QAAQ,KAAK,SAAS;AAC5B,QAAM,OAAO,KAAK,QAAQ,SAAS,mBAAmB,CAAC;AAEvD,QAAM,QAA2D,CAAC;AAClE,QAAM,OAAO,OAAqB,EAAE,MAAM,OAAO,OAAO,UAAU,MAAM;AAGxE,MAAI;AACJ,MAAI;AACF,aAAS,MAAM,UAAU,IAAI;AAAA,EAC/B,SAAS,KAAK;AACZ,UAAM,KAAK,EAAE,MAAM,iBAAiB,QAAQ,QAAQ,GAAG,EAAE,CAAC;AAC1D,WAAO,KAAK;AAAA,EACd;AACA,QAAM,KAAK,EAAE,MAAM,iBAAiB,QAAQ,EAAE,MAAM,UAAU,QAAQ,OAAO,EAAE,CAAC;AAChF,MAAI,OAAO,WAAW,SAAU,QAAO,KAAK;AAG5C,MAAI;AACJ,MAAI;AACF,cAAU,MAAM,MAAM,IAAI;AAAA,EAC5B,SAAS,KAAK;AACZ,UAAM,KAAK,EAAE,MAAM,SAAS,QAAQ,QAAQ,GAAG,EAAE,CAAC;AAClD,WAAO,KAAK;AAAA,EACd;AACA,QAAM,WAAW,QAAQ,KAAK,CAAC,MAAM,EAAE,UAAU,YAAY;AAC7D,MAAI,CAAC,YAAY,CAAC,cAAc,QAAQ,GAAG;AACzC,UAAM,KAAK;AAAA,MACT,MAAM;AAAA,MACN,QAAQ,EAAE,MAAM,SAAS,SAAS,2CAA2C;AAAA,I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+
} from "./chunk-2NQUCS7O.js";
|
|
4
|
+
import "./chunk-PTDMVGKL.js";
|
|
5
|
+
import "./chunk-LBYOLBW7.js";
|
|
6
|
+
import "./chunk-XXTZBPUY.js";
|
|
7
|
+
import "./chunk-NMAWXBJA.js";
|
|
8
|
+
export {
|
|
9
|
+
lighthouseAudit
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=lighthouse-VHI77PFB.js.map
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
hasRealScores,
|
|
3
3
|
lighthouseScoresFromResult,
|
|
4
4
|
resolveSlugFromCwd
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-7BZUOZPU.js";
|
|
6
|
+
import "./chunk-7NYN2P6I.js";
|
|
7
7
|
export {
|
|
8
8
|
hasRealScores,
|
|
9
9
|
lighthouseScoresFromResult,
|
|
10
10
|
resolveSlugFromCwd
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=lighthouse-airtable-
|
|
12
|
+
//# sourceMappingURL=lighthouse-airtable-3GUWHETW.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// src/forms/mailchimp.ts
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
function mailchimpTagsFor(formType) {
|
|
4
|
+
return ["Online Form", `form:${formType}`];
|
|
5
|
+
}
|
|
6
|
+
function splitName(name) {
|
|
7
|
+
const n = (name ?? "").trim();
|
|
8
|
+
if (!n) return {};
|
|
9
|
+
const [first = n, ...rest] = n.split(/\s+/);
|
|
10
|
+
const out = { FNAME: first };
|
|
11
|
+
if (rest.length) out.LNAME = rest.join(" ");
|
|
12
|
+
return out;
|
|
13
|
+
}
|
|
14
|
+
async function addMailchimpMember(input) {
|
|
15
|
+
const doFetch = input.fetch ?? fetch;
|
|
16
|
+
const dash = input.apiKey.lastIndexOf("-");
|
|
17
|
+
const dc = dash >= 0 ? input.apiKey.slice(dash + 1) : "";
|
|
18
|
+
const email = input.email.trim();
|
|
19
|
+
if (!dc || !input.audienceId || !email) {
|
|
20
|
+
console.error("[mailchimp] missing datacenter/audience/email \u2014 skipping");
|
|
21
|
+
return { ok: false, status: 0 };
|
|
22
|
+
}
|
|
23
|
+
const hash = createHash("md5").update(email.toLowerCase()).digest("hex");
|
|
24
|
+
const url = `https://${dc}.api.mailchimp.com/3.0/lists/${encodeURIComponent(
|
|
25
|
+
input.audienceId
|
|
26
|
+
)}/members/${hash}`;
|
|
27
|
+
const body = {
|
|
28
|
+
email_address: email,
|
|
29
|
+
status_if_new: input.status ?? "subscribed"
|
|
30
|
+
};
|
|
31
|
+
const merge = splitName(input.name);
|
|
32
|
+
if (Object.keys(merge).length > 0) body.merge_fields = merge;
|
|
33
|
+
const tags = (input.tags ?? []).map((t) => t.trim()).filter((t) => t.length > 0);
|
|
34
|
+
if (tags.length > 0) body.tags = tags;
|
|
35
|
+
const auth = Buffer.from(`anystring:${input.apiKey}`).toString("base64");
|
|
36
|
+
const headers = { "content-type": "application/json", authorization: `Basic ${auth}` };
|
|
37
|
+
try {
|
|
38
|
+
const res = await doFetch(url, {
|
|
39
|
+
method: "PUT",
|
|
40
|
+
headers,
|
|
41
|
+
body: JSON.stringify(body)
|
|
42
|
+
});
|
|
43
|
+
if (!res.ok) {
|
|
44
|
+
console.error(`[mailchimp] add member \u2192 ${res.status} (audience ${input.audienceId})`);
|
|
45
|
+
return { ok: false, status: res.status };
|
|
46
|
+
}
|
|
47
|
+
if (tags.length === 0) return { ok: true, status: res.status };
|
|
48
|
+
let tagged = false;
|
|
49
|
+
try {
|
|
50
|
+
const tagRes = await doFetch(`${url}/tags`, {
|
|
51
|
+
method: "POST",
|
|
52
|
+
headers,
|
|
53
|
+
body: JSON.stringify({ tags: tags.map((name) => ({ name, status: "active" })) })
|
|
54
|
+
});
|
|
55
|
+
tagged = tagRes.ok;
|
|
56
|
+
if (!tagRes.ok) {
|
|
57
|
+
console.error(`[mailchimp] tag member \u2192 ${tagRes.status} (audience ${input.audienceId})`);
|
|
58
|
+
}
|
|
59
|
+
} catch (err) {
|
|
60
|
+
console.error(`[mailchimp] tag member failed: ${String(err)}`);
|
|
61
|
+
}
|
|
62
|
+
return { ok: true, status: res.status, tagged };
|
|
63
|
+
} catch (err) {
|
|
64
|
+
console.error(`[mailchimp] add member failed: ${String(err)}`);
|
|
65
|
+
return { ok: false, status: 0 };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
addMailchimpMember,
|
|
70
|
+
mailchimpTagsFor
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=mailchimp-XYCTEEJY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/forms/mailchimp.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport type { FormType } from \"./types.js\";\n\nexport type MailchimpResult = {\n ok: boolean;\n status: number;\n /** Whether the requested tags were applied. Present ONLY when tags were asked for\n * and the member add itself succeeded — absent means \"no tags requested\", which is\n * not the same as \"tagging failed\". */\n tagged?: boolean;\n};\n\n/** Tags identifying a member the ingest pipeline added, so form signups are\n * distinguishable from imported/manually-added members inside Mailchimp (the\n * audience is otherwise a flat list — every API write shows the same\n * \"API - Generic\" source). \"Online Form\" is the human-facing segment name the\n * gallery asked for; the `form:` tag keeps the specific form machine-readable\n * for later segmentation. PURE. */\nexport function mailchimpTagsFor(formType: FormType): string[] {\n return [\"Online Form\", `form:${formType}`];\n}\n\nexport type AddMailchimpMemberInput = {\n /** Mailchimp Marketing API key, format `key-dc` (e.g. \"abc123-us21\"). */\n apiKey: string;\n /** Audience (list) ID. */\n audienceId: string;\n email: string;\n name?: string | null;\n /** Status for a NEW member. Default \"subscribed\" (immediate, no double opt-in). */\n status?: \"subscribed\" | \"pending\";\n /** Tags to apply (see mailchimpTagsFor). Blank entries are dropped. */\n tags?: string[];\n /** Injectable fetch for tests. */\n fetch?: typeof fetch;\n};\n\n/** Split a full name into Mailchimp FNAME/LNAME merge fields. */\nfunction splitName(name: string | null | undefined): { FNAME?: string; LNAME?: string } {\n const n = (name ?? \"\").trim();\n if (!n) return {};\n const [first = n, ...rest] = n.split(/\\s+/);\n const out: { FNAME?: string; LNAME?: string } = { FNAME: first };\n if (rest.length) out.LNAME = rest.join(\" \");\n return out;\n}\n\n/**\n * Upsert a subscriber into a Mailchimp audience (PUT /members/{md5(lowercased\n * email)} — idempotent, so a repeat signup is a no-op rather than an error). Uses\n * `status_if_new` only, so an already-unsubscribed member is NOT force-resubscribed\n * (compliance-safe). NEVER throws — a missing datacenter, non-2xx, or network error\n * returns `{ok:false}` so the caller treats it as a swallowed side-effect.\n */\nexport async function addMailchimpMember(input: AddMailchimpMemberInput): Promise<MailchimpResult> {\n const doFetch = input.fetch ?? fetch;\n const dash = input.apiKey.lastIndexOf(\"-\");\n const dc = dash >= 0 ? input.apiKey.slice(dash + 1) : \"\";\n const email = input.email.trim();\n if (!dc || !input.audienceId || !email) {\n console.error(\"[mailchimp] missing datacenter/audience/email — skipping\");\n return { ok: false, status: 0 };\n }\n const hash = createHash(\"md5\").update(email.toLowerCase()).digest(\"hex\");\n const url = `https://${dc}.api.mailchimp.com/3.0/lists/${encodeURIComponent(\n input.audienceId,\n )}/members/${hash}`;\n const body: Record<string, unknown> = {\n email_address: email,\n status_if_new: input.status ?? \"subscribed\",\n };\n const merge = splitName(input.name);\n if (Object.keys(merge).length > 0) body.merge_fields = merge;\n const tags = (input.tags ?? []).map((t) => t.trim()).filter((t) => t.length > 0);\n if (tags.length > 0) body.tags = tags;\n const auth = Buffer.from(`anystring:${input.apiKey}`).toString(\"base64\");\n const headers = { \"content-type\": \"application/json\", authorization: `Basic ${auth}` };\n try {\n const res = await doFetch(url, {\n method: \"PUT\",\n headers,\n body: JSON.stringify(body),\n });\n if (!res.ok) {\n console.error(`[mailchimp] add member → ${res.status} (audience ${input.audienceId})`);\n return { ok: false, status: res.status };\n }\n if (tags.length === 0) return { ok: true, status: res.status };\n // The `tags` in the PUT body above only take effect when the member is CREATED —\n // Mailchimp silently ignores them for an already-existing member, which is exactly\n // the repeat-signup case. The dedicated endpoint is what makes tagging reliable, so\n // both are sent: the body covers a brand-new member if this second call is lost,\n // and this call covers everyone else. Additive and idempotent (re-applying an\n // active tag is a no-op), and NEVER fatal — the member is already in the audience,\n // so a tag failure is reported (tagged:false) rather than failing the add.\n let tagged = false;\n try {\n const tagRes = await doFetch(`${url}/tags`, {\n method: \"POST\",\n headers,\n body: JSON.stringify({ tags: tags.map((name) => ({ name, status: \"active\" })) }),\n });\n tagged = tagRes.ok;\n if (!tagRes.ok) {\n console.error(`[mailchimp] tag member → ${tagRes.status} (audience ${input.audienceId})`);\n }\n } catch (err) {\n console.error(`[mailchimp] tag member failed: ${String(err)}`);\n }\n return { ok: true, status: res.status, tagged };\n } catch (err) {\n console.error(`[mailchimp] add member failed: ${String(err)}`);\n return { ok: false, status: 0 };\n }\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAkBpB,SAAS,iBAAiB,UAA8B;AAC7D,SAAO,CAAC,eAAe,QAAQ,QAAQ,EAAE;AAC3C;AAkBA,SAAS,UAAU,MAAqE;AACtF,QAAM,KAAK,QAAQ,IAAI,KAAK;AAC5B,MAAI,CAAC,EAAG,QAAO,CAAC;AAChB,QAAM,CAAC,QAAQ,GAAG,GAAG,IAAI,IAAI,EAAE,MAAM,KAAK;AAC1C,QAAM,MAA0C,EAAE,OAAO,MAAM;AAC/D,MAAI,KAAK,OAAQ,KAAI,QAAQ,KAAK,KAAK,GAAG;AAC1C,SAAO;AACT;AASA,eAAsB,mBAAmB,OAA0D;AACjG,QAAM,UAAU,MAAM,SAAS;AAC/B,QAAM,OAAO,MAAM,OAAO,YAAY,GAAG;AACzC,QAAM,KAAK,QAAQ,IAAI,MAAM,OAAO,MAAM,OAAO,CAAC,IAAI;AACtD,QAAM,QAAQ,MAAM,MAAM,KAAK;AAC/B,MAAI,CAAC,MAAM,CAAC,MAAM,cAAc,CAAC,OAAO;AACtC,YA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IAAI,CAAC,UAAU,EAAE,MAAM,QAAQ,SAAS,EAAE,EAAE,CAAC;AAAA,MACjF,CAAC;AACD,eAAS,OAAO;AAChB,UAAI,CAAC,OAAO,IAAI;AACd,gBAAQ,MAAM,iCAA4B,OAAO,MAAM,cAAc,MAAM,UAAU,GAAG;AAAA,MAC1F;AAAA,IACF,SAAS,KAAK;AACZ,cAAQ,MAAM,kCAAkC,OAAO,GAAG,CAAC,EAAE;AAAA,IAC/D;AACA,WAAO,EAAE,IAAI,MAAM,QAAQ,IAAI,QAAQ,OAAO;AAAA,EAChD,SAAS,KAAK;AACZ,YAAQ,MAAM,kCAAkC,OAAO,GAAG,CAAC,EAAE;AAC7D,WAAO,EAAE,IAAI,OAAO,QAAQ,EAAE;AAAA,EAChC;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildAutoresponder,
|
|
3
|
+
buildPocNotification,
|
|
4
|
+
describeNotifyTarget,
|
|
5
|
+
makeNotify,
|
|
6
|
+
notifySubmission,
|
|
7
|
+
resolveRecipients
|
|
8
|
+
} from "./chunk-VSBFM7DS.js";
|
|
9
|
+
import "./chunk-BNM5POSJ.js";
|
|
10
|
+
import "./chunk-SNSTJLQW.js";
|
|
11
|
+
import "./chunk-5ML7FMBD.js";
|
|
12
|
+
import "./chunk-DJZWYIPP.js";
|
|
13
|
+
import "./chunk-2OP4JKIQ.js";
|
|
14
|
+
export {
|
|
15
|
+
buildAutoresponder,
|
|
16
|
+
buildPocNotification,
|
|
17
|
+
describeNotifyTarget,
|
|
18
|
+
makeNotify,
|
|
19
|
+
notifySubmission,
|
|
20
|
+
resolveRecipients
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=notify-C645PGD5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -5,21 +5,21 @@ import {
|
|
|
5
5
|
appendSkipNotice,
|
|
6
6
|
fleetWorkdir,
|
|
7
7
|
prepareFleetSites
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TVL5MVUF.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveSites
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CROKUHJB.js";
|
|
12
12
|
import {
|
|
13
13
|
onboard
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-7RJ2HMMJ.js";
|
|
15
|
+
import "./chunk-3G25KIWW.js";
|
|
16
16
|
import "./chunk-OTGB6YQO.js";
|
|
17
17
|
import "./chunk-LKGVSM2O.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-XXTZBPUY.js";
|
|
18
|
+
import "./chunk-6TWWY7ZU.js";
|
|
19
|
+
import "./chunk-EVBCK2KC.js";
|
|
21
20
|
import "./chunk-XTK5VIQB.js";
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-LBYOLBW7.js";
|
|
22
|
+
import "./chunk-XXTZBPUY.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/commands/onboard.ts
|
|
25
25
|
import { resolve } from "path";
|
|
@@ -70,4 +70,4 @@ async function runOnboardCommand(site, opts) {
|
|
|
70
70
|
export {
|
|
71
71
|
runOnboardCommand
|
|
72
72
|
};
|
|
73
|
-
//# sourceMappingURL=onboard-
|
|
73
|
+
//# sourceMappingURL=onboard-O4IAHJMO.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GLOBAL_REPORT_CC,
|
|
3
|
+
isProbablyEmail,
|
|
4
|
+
parseAddresses,
|
|
5
|
+
sendApprovedReports,
|
|
6
|
+
withGlobalCc
|
|
7
|
+
} from "./chunk-NDWYJLRF.js";
|
|
8
|
+
import "./chunk-F3JWOPTG.js";
|
|
9
|
+
import "./chunk-VAD43MOR.js";
|
|
10
|
+
import "./chunk-IY6256GK.js";
|
|
11
|
+
import "./chunk-HN6I2XWI.js";
|
|
12
|
+
import "./chunk-ZGBEIWSC.js";
|
|
13
|
+
import "./chunk-GECESMVS.js";
|
|
14
|
+
import "./chunk-MT2JINSS.js";
|
|
15
|
+
import "./chunk-DJZWYIPP.js";
|
|
16
|
+
import "./chunk-5UINJNAJ.js";
|
|
17
|
+
import "./chunk-7NYN2P6I.js";
|
|
18
|
+
import "./chunk-WEKL2HYJ.js";
|
|
19
|
+
import "./chunk-XUGSZP7Z.js";
|
|
20
|
+
import "./chunk-EVBCK2KC.js";
|
|
21
|
+
import "./chunk-JHGHLKFS.js";
|
|
22
|
+
import "./chunk-3SF7D4DY.js";
|
|
23
|
+
import "./chunk-6VAL7XJT.js";
|
|
24
|
+
export {
|
|
25
|
+
GLOBAL_REPORT_CC,
|
|
26
|
+
isProbablyEmail,
|
|
27
|
+
parseAddresses,
|
|
28
|
+
sendApprovedReports,
|
|
29
|
+
withGlobalCc
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=orchestrate-YLWQ6KK2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkFleetParity,
|
|
3
|
+
formatParityResult
|
|
4
|
+
} from "./chunk-ZBDZTJUO.js";
|
|
5
|
+
import "./chunk-P6AORG32.js";
|
|
6
|
+
import "./chunk-VAD43MOR.js";
|
|
7
|
+
import "./chunk-7NYN2P6I.js";
|
|
8
|
+
export {
|
|
9
|
+
checkFleetParity,
|
|
10
|
+
formatParityResult
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=parity-56KA2DGR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
preflight
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-SDDPUAWH.js";
|
|
4
|
+
import "./chunk-PZR4EBPY.js";
|
|
5
|
+
import "./chunk-NDWYJLRF.js";
|
|
6
|
+
import "./chunk-F3JWOPTG.js";
|
|
7
|
+
import "./chunk-VAD43MOR.js";
|
|
8
|
+
import "./chunk-IY6256GK.js";
|
|
9
|
+
import "./chunk-HN6I2XWI.js";
|
|
10
|
+
import "./chunk-ZGBEIWSC.js";
|
|
6
11
|
import "./chunk-GECESMVS.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-MT2JINSS.js";
|
|
13
|
+
import "./chunk-DJZWYIPP.js";
|
|
14
|
+
import "./chunk-5UINJNAJ.js";
|
|
15
|
+
import "./chunk-7NYN2P6I.js";
|
|
10
16
|
import "./chunk-WEKL2HYJ.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-577HCGZO.js";
|
|
16
|
-
import "./chunk-HN6I2XWI.js";
|
|
17
|
+
import "./chunk-XUGSZP7Z.js";
|
|
18
|
+
import "./chunk-EVBCK2KC.js";
|
|
19
|
+
import "./chunk-JHGHLKFS.js";
|
|
20
|
+
import "./chunk-3SF7D4DY.js";
|
|
17
21
|
import "./chunk-6VAL7XJT.js";
|
|
18
22
|
|
|
19
23
|
// src/cli/commands/preflight.ts
|
|
@@ -63,4 +67,4 @@ async function runPreflightCommand(site, opts) {
|
|
|
63
67
|
export {
|
|
64
68
|
runPreflightCommand
|
|
65
69
|
};
|
|
66
|
-
//# sourceMappingURL=preflight-
|
|
70
|
+
//# sourceMappingURL=preflight-TNORKGCX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/preflight.ts"],"sourcesContent":["import {\n preflight,\n type PreflightSiteResult,\n type PreflightFinding,\n} from \"../../reports/preflight.js\";\nimport type { ReportType } from \"../../reports/types.js\";\n\nexport type PreflightCommandOptions = {\n type?: string;\n all?: boolean;\n cwd?: string;\n};\n\nconst TYPES: Record<string, ReportType> = {\n announcement: \"Announcement\",\n maintenance: \"Maintenance\",\n testing: \"Testing\",\n};\n\nconst MARK: Record<PreflightFinding[\"level\"], string> = { fail: \"✗\", warn: \"⚠\", info: \"ℹ\" };\n\nfunction formatSite(r: PreflightSiteResult): string {\n if (r.findings.length === 0) return `[${r.site}] ✓ clean`;\n return r.findings.map((f) => `[${r.site}] ${MARK[f.level]} ${f.check}: ${f.message}`).join(\"\\n\");\n}\n\n/**\n * `preflight [site]` — read-only pre-send checks over the live Airtable rows: everything\n * that would make a report send fail, reach the wrong inbox, or surprise the operator.\n * Exit 0 = safe (warnings allowed, printed), 1 = at least one hard failure, 2 = bad args.\n */\nexport async function runPreflightCommand(\n site: string | undefined,\n opts: PreflightCommandOptions,\n): Promise<{ output: string; code: number }> {\n if (Boolean(site) === Boolean(opts.all)) {\n return { output: \"Provide exactly one of <site> or --all.\", code: 2 };\n }\n const typeKey = (opts.type ?? \"announcement\").toLowerCase();\n const type = TYPES[typeKey];\n if (!type) {\n return {\n output: `Unknown --type '${opts.type}'. Supported: ${Object.keys(TYPES).join(\", \")}`,\n code: 2,\n };\n }\n\n try {\n const { results, fleet } = await preflight({\n ...(site ? { site } : {}),\n ...(opts.all ? { all: true } : {}),\n type,\n });\n if (results.length === 0) return { output: \"No matching sites.\", code: 1 };\n\n const lines = results.map(formatSite);\n for (const f of fleet) lines.push(`[fleet] ${MARK[f.level]} ${f.check}: ${f.message}`);\n\n const all = [...results.flatMap((r) => r.findings), ...fleet];\n const fails = all.filter((f) => f.level === \"fail\").length;\n const warns = all.filter((f) => f.level === \"warn\").length;\n lines.push(\n `Preflight: ${results.length} site(s) — ${fails} fail, ${warns} warn. ${\n fails > 0 ? \"NOT safe to send.\" : \"Safe to send (review warnings).\"\n }`,\n );\n return { output: lines.join(\"\\n\"), code: fails > 0 ? 1 : 0 };\n } catch (err) {\n const e = err as { message?: string; exitCode?: number };\n return { output: e.message ?? String(err), code: e.exitCode ?? 1 };\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/preflight.ts"],"sourcesContent":["import {\n preflight,\n type PreflightSiteResult,\n type PreflightFinding,\n} from \"../../reports/preflight.js\";\nimport type { ReportType } from \"../../reports/types.js\";\n\nexport type PreflightCommandOptions = {\n type?: string;\n all?: boolean;\n cwd?: string;\n};\n\nconst TYPES: Record<string, ReportType> = {\n announcement: \"Announcement\",\n maintenance: \"Maintenance\",\n testing: \"Testing\",\n};\n\nconst MARK: Record<PreflightFinding[\"level\"], string> = { fail: \"✗\", warn: \"⚠\", info: \"ℹ\" };\n\nfunction formatSite(r: PreflightSiteResult): string {\n if (r.findings.length === 0) return `[${r.site}] ✓ clean`;\n return r.findings.map((f) => `[${r.site}] ${MARK[f.level]} ${f.check}: ${f.message}`).join(\"\\n\");\n}\n\n/**\n * `preflight [site]` — read-only pre-send checks over the live Airtable rows: everything\n * that would make a report send fail, reach the wrong inbox, or surprise the operator.\n * Exit 0 = safe (warnings allowed, printed), 1 = at least one hard failure, 2 = bad args.\n */\nexport async function runPreflightCommand(\n site: string | undefined,\n opts: PreflightCommandOptions,\n): Promise<{ output: string; code: number }> {\n if (Boolean(site) === Boolean(opts.all)) {\n return { output: \"Provide exactly one of <site> or --all.\", code: 2 };\n }\n const typeKey = (opts.type ?? \"announcement\").toLowerCase();\n const type = TYPES[typeKey];\n if (!type) {\n return {\n output: `Unknown --type '${opts.type}'. Supported: ${Object.keys(TYPES).join(\", \")}`,\n code: 2,\n };\n }\n\n try {\n const { results, fleet } = await preflight({\n ...(site ? { site } : {}),\n ...(opts.all ? { all: true } : {}),\n type,\n });\n if (results.length === 0) return { output: \"No matching sites.\", code: 1 };\n\n const lines = results.map(formatSite);\n for (const f of fleet) lines.push(`[fleet] ${MARK[f.level]} ${f.check}: ${f.message}`);\n\n const all = [...results.flatMap((r) => r.findings), ...fleet];\n const fails = all.filter((f) => f.level === \"fail\").length;\n const warns = all.filter((f) => f.level === \"warn\").length;\n lines.push(\n `Preflight: ${results.length} site(s) — ${fails} fail, ${warns} warn. ${\n fails > 0 ? \"NOT safe to send.\" : \"Safe to send (review warnings).\"\n }`,\n );\n return { output: lines.join(\"\\n\"), code: fails > 0 ? 1 : 0 };\n } catch (err) {\n const e = err as { message?: string; exitCode?: number };\n return { output: e.message ?? String(err), code: e.exitCode ?? 1 };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAM,QAAoC;AAAA,EACxC,cAAc;AAAA,EACd,aAAa;AAAA,EACb,SAAS;AACX;AAEA,IAAM,OAAkD,EAAE,MAAM,UAAK,MAAM,UAAK,MAAM,SAAI;AAE1F,SAAS,WAAW,GAAgC;AAClD,MAAI,EAAE,SAAS,WAAW,EAAG,QAAO,IAAI,EAAE,IAAI;AAC9C,SAAO,EAAE,SAAS,IAAI,CAAC,MAAM,IAAI,EAAE,IAAI,KAAK,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,IAAI;AACjG;AAOA,eAAsB,oBACpB,MACA,MAC2C;AAC3C,MAAI,QAAQ,IAAI,MAAM,QAAQ,KAAK,GAAG,GAAG;AACvC,WAAO,EAAE,QAAQ,2CAA2C,MAAM,EAAE;AAAA,EACtE;AACA,QAAM,WAAW,KAAK,QAAQ,gBAAgB,YAAY;AAC1D,QAAM,OAAO,MAAM,OAAO;AAC1B,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,MACL,QAAQ,mBAAmB,KA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