@reddoorla/maintenance 0.89.0 → 0.90.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.
Files changed (70) hide show
  1. package/dist/{announce-OJFAS5JT.js → announce-NDTLRQCN.js} +3 -3
  2. package/dist/{blux-EATHOHKK.js → blux-YGBGS24U.js} +5 -5
  3. package/dist/blux-YGBGS24U.js.map +1 -0
  4. package/dist/{chunk-62NYED6E.js → chunk-DCDF5A7N.js} +3 -3
  5. package/dist/{chunk-AEXJDCJN.js → chunk-DFLN2KO3.js} +4 -4
  6. package/dist/{chunk-3VQWSE3F.js → chunk-DXWLWR4Q.js} +17 -4
  7. package/dist/chunk-DXWLWR4Q.js.map +1 -0
  8. package/dist/{chunk-62CMMGEO.js → chunk-GSWTT2J6.js} +20 -5
  9. package/dist/chunk-GSWTT2J6.js.map +1 -0
  10. package/dist/{chunk-VNB5XBQ4.js → chunk-L5M6G65K.js} +1 -1
  11. package/dist/chunk-L5M6G65K.js.map +1 -0
  12. package/dist/{chunk-73UFRZKY.js → chunk-MLT4QY5X.js} +105 -2
  13. package/dist/chunk-MLT4QY5X.js.map +1 -0
  14. package/dist/cli/bin.js +16 -16
  15. package/dist/cli/commands/audit.js +5 -5
  16. package/dist/{db-DAJX7NNW.js → db-LOSJ74ZJ.js} +1 -1
  17. package/dist/{digest-T6TAZNLF.js → digest-CS6KLCZB.js} +3 -3
  18. package/dist/digest-collectors-NI2M3UTC.js +1 -1
  19. package/dist/{ensure-site-NSNY2QHN.js → ensure-site-FFDUMY6E.js} +2 -2
  20. package/dist/{forms-notify-target-LYSKME5L.js → forms-notify-target-IHJX7NWA.js} +3 -3
  21. package/dist/{github-signals-4YML6NY5.js → github-signals-FCLNHKMF.js} +2 -2
  22. package/dist/{health-mirror-7LKC7Q5Z.js → health-mirror-GMSF3Z5R.js} +2 -2
  23. package/dist/images/index.d.ts +55 -0
  24. package/dist/images/index.js +16 -0
  25. package/dist/images/index.js.map +1 -0
  26. package/dist/index.js +8 -8
  27. package/dist/{init-NHKADHB6.js → init-S4MJ3Y6W.js} +6 -6
  28. package/dist/{launch-VQJ4Z35C.js → launch-7FT4EYEO.js} +7 -7
  29. package/dist/notify-4HP4GZ2H.js +1 -1
  30. package/dist/orchestrate-6HROYTM6.js +1 -1
  31. package/dist/preflight-LIN5NCYU.js +1 -1
  32. package/dist/{prismic-ci-PZ5LCPWT.js → prismic-ci-6YGRIOHT.js} +5 -5
  33. package/dist/{prismic-models-6OYYZUR5.js → prismic-models-VNGIKS2B.js} +3 -3
  34. package/dist/{prospect-audit-DBBXL7EG.js → prospect-audit-JCWTKJTS.js} +1 -1
  35. package/dist/recipes/sync-configs.d.ts +8 -1
  36. package/dist/recipes/sync-configs.js +4 -2
  37. package/dist/{report-2N4PXO3L.js → report-AAY2HZZR.js} +8 -8
  38. package/dist/{report-mirror-3ENU6OOK.js → report-mirror-GMNSH5HF.js} +2 -2
  39. package/dist/{self-updating-NTCCWJYZ.js → self-updating-VQIW24RZ.js} +3 -3
  40. package/dist/selftest-CUX2FIQD.js +1 -1
  41. package/dist/{site-mirror-RQTEAID5.js → site-mirror-GCFLBBWK.js} +2 -2
  42. package/dist/{submissions-TEHPBSZJ.js → submissions-7LGJJSDL.js} +1 -1
  43. package/dist/{sync-configs-LVBITPLU.js → sync-configs-ZYLTMUNX.js} +6 -12
  44. package/dist/sync-configs-ZYLTMUNX.js.map +1 -0
  45. package/package.json +5 -1
  46. package/dist/blux-EATHOHKK.js.map +0 -1
  47. package/dist/chunk-3VQWSE3F.js.map +0 -1
  48. package/dist/chunk-62CMMGEO.js.map +0 -1
  49. package/dist/chunk-73UFRZKY.js.map +0 -1
  50. package/dist/chunk-VNB5XBQ4.js.map +0 -1
  51. package/dist/sync-configs-LVBITPLU.js.map +0 -1
  52. /package/dist/{announce-OJFAS5JT.js.map → announce-NDTLRQCN.js.map} +0 -0
  53. /package/dist/{chunk-62NYED6E.js.map → chunk-DCDF5A7N.js.map} +0 -0
  54. /package/dist/{chunk-AEXJDCJN.js.map → chunk-DFLN2KO3.js.map} +0 -0
  55. /package/dist/{db-DAJX7NNW.js.map → db-LOSJ74ZJ.js.map} +0 -0
  56. /package/dist/{digest-T6TAZNLF.js.map → digest-CS6KLCZB.js.map} +0 -0
  57. /package/dist/{ensure-site-NSNY2QHN.js.map → ensure-site-FFDUMY6E.js.map} +0 -0
  58. /package/dist/{forms-notify-target-LYSKME5L.js.map → forms-notify-target-IHJX7NWA.js.map} +0 -0
  59. /package/dist/{github-signals-4YML6NY5.js.map → github-signals-FCLNHKMF.js.map} +0 -0
  60. /package/dist/{health-mirror-7LKC7Q5Z.js.map → health-mirror-GMSF3Z5R.js.map} +0 -0
  61. /package/dist/{init-NHKADHB6.js.map → init-S4MJ3Y6W.js.map} +0 -0
  62. /package/dist/{launch-VQJ4Z35C.js.map → launch-7FT4EYEO.js.map} +0 -0
  63. /package/dist/{prismic-ci-PZ5LCPWT.js.map → prismic-ci-6YGRIOHT.js.map} +0 -0
  64. /package/dist/{prismic-models-6OYYZUR5.js.map → prismic-models-VNGIKS2B.js.map} +0 -0
  65. /package/dist/{prospect-audit-DBBXL7EG.js.map → prospect-audit-JCWTKJTS.js.map} +0 -0
  66. /package/dist/{report-2N4PXO3L.js.map → report-AAY2HZZR.js.map} +0 -0
  67. /package/dist/{report-mirror-3ENU6OOK.js.map → report-mirror-GMNSH5HF.js.map} +0 -0
  68. /package/dist/{self-updating-NTCCWJYZ.js.map → self-updating-VQIW24RZ.js.map} +0 -0
  69. /package/dist/{site-mirror-RQTEAID5.js.map → site-mirror-GCFLBBWK.js.map} +0 -0
  70. /package/dist/{submissions-TEHPBSZJ.js.map → submissions-7LGJJSDL.js.map} +0 -0
@@ -169,8 +169,111 @@ function templatesByName(which) {
169
169
  return ALL_TEMPLATES.filter((t) => which.includes(t.config));
170
170
  }
171
171
 
172
+ // src/recipes/sync-configs/renovate-action.ts
173
+ var DIGEST_RE = /^[0-9a-f]{40}$/;
174
+ function escapeRegExp(s) {
175
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
176
+ }
177
+ function stripComments(contents) {
178
+ return contents.replace(/^[ \t]*#[^\n]*$/gm, "");
179
+ }
180
+ var USES_LINE_RE = /^([ \t]*(?:- )?)uses:\s*([\w.-]+\/[\w.-]+)@(\S+)(?:[ \t]*#[^\r\n]*)?/gm;
181
+ function usesRefAndComment(contents, slug) {
182
+ const re = new RegExp(
183
+ `^[ \\t]*(?:- )?uses:\\s*${escapeRegExp(slug)}@(\\S+)([ \\t]*#[^\\r\\n]*)?`,
184
+ "m"
185
+ );
186
+ const m = contents.match(re);
187
+ if (!m) return null;
188
+ return { ref: m[1], comment: m[2] ?? "" };
189
+ }
190
+ function pinGap(slug, contents) {
191
+ const found = usesRefAndComment(contents, slug);
192
+ if (!found || !DIGEST_RE.test(found.ref)) {
193
+ return `${slug} is missing or not digest-pinned (needs @<40-hex-sha>) \u2014 this workflow mints a repo-write token, so a mutable tag ref is a supply-chain hole`;
194
+ }
195
+ return null;
196
+ }
197
+ var KNOWN_PINNED_ACTIONS = [
198
+ "renovatebot/github-action",
199
+ "actions/create-github-app-token",
200
+ "actions/checkout"
201
+ ];
202
+ var APP_AUTH_MARKERS = [
203
+ "vars.RENOVATE_APP_ID",
204
+ "secrets.RENOVATE_APP_PRIVATE_KEY",
205
+ "steps.app-token.outputs.token"
206
+ ];
207
+ function renovateActionGaps(contents) {
208
+ const gaps = [];
209
+ const withoutComments = stripComments(contents);
210
+ for (const slug of KNOWN_PINNED_ACTIONS) {
211
+ const gap = pinGap(slug, withoutComments);
212
+ if (gap) gaps.push(gap);
213
+ }
214
+ for (const m of withoutComments.matchAll(USES_LINE_RE)) {
215
+ const slug = m[2];
216
+ const ref = m[3];
217
+ if (KNOWN_PINNED_ACTIONS.includes(slug)) continue;
218
+ if (!DIGEST_RE.test(ref)) {
219
+ gaps.push(
220
+ `${slug}@${ref} is not digest-pinned (needs @<40-hex-sha>) \u2014 this workflow mints a repo-write token, so every action reference must be digest-pinned`
221
+ );
222
+ }
223
+ }
224
+ const missingAuth = APP_AUTH_MARKERS.filter((m) => !withoutComments.includes(m));
225
+ if (missingAuth.length > 0) {
226
+ gaps.push(
227
+ `App auth is not fully wired \u2014 missing ${missingAuth.join(", ")} (Renovate authenticates as the reddoor-renovate GitHub App, not an operator PAT)`
228
+ );
229
+ }
230
+ if (withoutComments.includes("RENOVATE_TOKEN")) {
231
+ gaps.push(
232
+ "contains RENOVATE_TOKEN \u2014 that is the retired operator-PAT identity the App migration replaced"
233
+ );
234
+ }
235
+ if (!/RENOVATE_USERNAME:\s*["']?reddoor-renovate\[bot\]/.test(withoutComments)) {
236
+ gaps.push("RENOVATE_USERNAME does not identify reddoor-renovate[bot]");
237
+ }
238
+ if (!/RENOVATE_GIT_AUTHOR:\s*["']?reddoor-renovate\[bot\]/.test(withoutComments)) {
239
+ gaps.push("RENOVATE_GIT_AUTHOR does not identify reddoor-renovate[bot]");
240
+ }
241
+ if (!/RENOVATE_REPOSITORIES:\s*["']?\$\{\{\s*github\.repository\s*\}\}["']?/.test(withoutComments)) {
242
+ gaps.push(
243
+ "RENOVATE_REPOSITORIES is not scoped to ${{ github.repository }} \u2014 this workflow must only ever touch its own repo"
244
+ );
245
+ }
246
+ if (!/cron:\s*["']?0 \*\/12 \* \* \*["']?/.test(withoutComments)) {
247
+ gaps.push(
248
+ `cron is not the twice-daily "0 */12 * * *" schedule \u2014 this cron IS the fleet's merge cadence (platform auto-merge is disabled fleet-wide, so Renovate merges from inside this run)`
249
+ );
250
+ }
251
+ if (!withoutComments.includes("workflow_dispatch")) {
252
+ gaps.push("missing workflow_dispatch trigger");
253
+ }
254
+ const hasPermissionsKey = withoutComments.includes("permissions:");
255
+ const hasContentsRead = /^[ \t]*contents:\s*["']?read["']?[ \t]*$/m.test(withoutComments);
256
+ if (!hasPermissionsKey || !hasContentsRead) {
257
+ gaps.push("permissions: does not grant contents: read");
258
+ }
259
+ return gaps;
260
+ }
261
+ function withRenovatePinsFrom(template, current) {
262
+ if (current === null) return template;
263
+ const currentWithoutComments = stripComments(current);
264
+ return template.replace(USES_LINE_RE, (full, prefix, slug) => {
265
+ const found = usesRefAndComment(currentWithoutComments, slug);
266
+ if (!found || !DIGEST_RE.test(found.ref)) return full;
267
+ return `${prefix}uses: ${slug}@${found.ref}${found.comment}`;
268
+ });
269
+ }
270
+ var RENOVATE_ACTION_CONFIG = "renovate-action";
271
+
172
272
  export {
173
273
  ALL_TEMPLATES,
174
- templatesByName
274
+ templatesByName,
275
+ renovateActionGaps,
276
+ withRenovatePinsFrom,
277
+ RENOVATE_ACTION_CONFIG
175
278
  };
176
- //# sourceMappingURL=chunk-73UFRZKY.js.map
279
+ //# sourceMappingURL=chunk-MLT4QY5X.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/recipes/sync-configs/templates.ts","../src/recipes/sync-configs/renovate-action.ts"],"sourcesContent":["import type { ConfigName } from \"../../types.js\";\n\nexport type ConfigTemplate = {\n config: ConfigName;\n path: string;\n contents: string;\n};\n\nconst eslint: ConfigTemplate = {\n config: \"eslint\",\n path: \"eslint.config.js\",\n contents: `import { createEslintConfig } from \"@reddoorla/maintenance/configs/eslint\";\nimport svelteConfig from \"./svelte.config.js\";\n\nexport default createEslintConfig({ svelteConfig });\n`,\n};\n\nconst prettier: ConfigTemplate = {\n config: \"prettier\",\n path: \".prettierrc.json\",\n contents: `{\n \"trailingComma\": \"all\",\n \"singleQuote\": false,\n \"printWidth\": 100,\n \"plugins\": [\"prettier-plugin-svelte\"]\n}\n`,\n};\n\nconst prettierIgnore: ConfigTemplate = {\n config: \"prettier-ignore\",\n path: \".prettierignore\",\n contents: `pnpm-lock.yaml\n.svelte-kit/\nbuild/\n.netlify/\ndist/\n`,\n};\n\nconst lighthouse: ConfigTemplate = {\n config: \"lighthouse\",\n path: \"lighthouserc.json\",\n contents: `${JSON.stringify(\n {\n $note:\n \"Generated by @reddoorla/maintenance sync-configs; edit src/configs/lighthouse.ts in the package instead.\",\n extends: \"@reddoorla/maintenance/configs/lighthouse\",\n },\n null,\n 2,\n )}\n`,\n};\n\nconst playwrightA11y: ConfigTemplate = {\n config: \"playwright-a11y\",\n path: \"playwright.config.ts\",\n contents: `export { default } from \"@reddoorla/maintenance/configs/playwright-a11y\";\n`,\n};\n\nconst svelte: ConfigTemplate = {\n config: \"svelte\",\n path: \"svelte.config.js\",\n contents: `import { createSvelteConfig } from \"@reddoorla/maintenance/configs/svelte\";\nimport adapter from \"@sveltejs/adapter-netlify\";\n\n/** @type {import('@sveltejs/kit').Config} */\nexport default createSvelteConfig({\n kit: { adapter: adapter({ edge: false, split: false }) },\n});\n`,\n};\n\n// There is deliberately NO ci.yml template. Every live fleet ci.yml carries\n// per-site values a static template cannot own (`netlify-site:`, plus\n// `permissions:` and `node-version:` inputs) — an exact-match heal against a\n// canonical byte template would strip them fleet-wide in green auto-mergeable\n// PRs (the \"armed clobber\" the 2026-08-02 architecture review flagged; it was\n// this file's `ci` entry). Ownership is split instead: the STARTER clone\n// provides each site's ci.yml shape at bootstrap, and Renovate's\n// github-actions manager bumps the pinned reusable-workflow ref per repo when\n// reddoorla/.github tags a new version. The caller job name `ci` + the\n// reusable workflow's job `ci` produce the check context \"ci / ci\" —\n// REQUIRED_CHECK in src/recipes/self-updating/index.ts depends on that naming.\n\nconst renovateAction: ConfigTemplate = {\n config: \"renovate-action\",\n path: \".github/workflows/renovate.yml\",\n contents: `name: renovate\non:\n schedule:\n # Twice daily. GitHub's platform auto-merge is disabled fleet-wide, so Renovate\n # performs its own merges from inside this run — which means this cron is the\n # MERGE cadence, not just the PR-creation cadence.\n - cron: 0 */12 * * *\n workflow_dispatch:\npermissions:\n contents: read\njobs:\n renovate:\n runs-on: ubuntu-latest\n steps:\n # Renovate authenticates as the reddoor-renovate GitHub App (installed\n # org-wide, \"All repositories\" — future repos are auto-covered), NOT as an\n # operator PAT. Why: the App is a distinct identity, so the audit trail\n # finally distinguishes bot from human (the 2026-07-26 unreviewed-major\n # forensics took hours precisely because it couldn't); the credential is\n # permission-scoped and centrally revocable instead of a fleet-write PAT;\n # and the installation gets its own API-quota pool instead of sharing the\n # operator's. The minted token is scoped to THIS repository only\n # (create-github-app-token's default when owner/repositories are omitted).\n # RENOVATE_APP_ID / RENOVATE_APP_PRIVATE_KEY are org-level (all-repos\n # visibility) — nothing to configure per repo.\n # Digest-pinned: this workflow mints a repo-write token, so a mutable tag\n # ref here is a supply-chain hole — a retagged \\`@v3\\`/\\`@v46\\` would run\n # attacker code with that token. Pin to the commit; Renovate bumps these.\n - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0\n id: app-token\n with:\n app-id: \\${{ vars.RENOVATE_APP_ID }}\n private-key: \\${{ secrets.RENOVATE_APP_PRIVATE_KEY }}\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7\n - uses: renovatebot/github-action@1a96852b0384df1837619d04c60b2d10d1f9ff08 # v46.1.21\n with:\n token: \\${{ steps.app-token.outputs.token }}\n env:\n RENOVATE_REPOSITORIES: \\${{ github.repository }}\n # Commit/PR identity = the App's bot user, so gitAuthor matches the\n # token identity (mismatched authors read as \"operator pushed this\").\n # 312185038 = the bot's user id (gh api 'users/reddoor-renovate[bot]' --jq .id).\n RENOVATE_USERNAME: reddoor-renovate[bot]\n RENOVATE_GIT_AUTHOR: reddoor-renovate[bot] <312185038+reddoor-renovate[bot]@users.noreply.github.com>\n`,\n};\n\nconst renovateConfig: ConfigTemplate = {\n config: \"renovate-config\",\n path: \"renovate.json\",\n contents: `{\n \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n \"extends\": [\"github>reddoorla/.github:renovate-config\"]\n}\n`,\n};\n\nconst netlify: ConfigTemplate = {\n config: \"netlify\",\n path: \"netlify.toml\",\n contents: `[build]\n command = \"pnpm build\"\n publish = \"build/\"\n functions = \"functions/\"\n\n[build.environment]\n NODE_VERSION = \"22\"\n COREPACK_INTEGRITY_KEYS = \"0\"\n\n# Baseline security headers for all responses. CSP is emitted per-response by\n# SvelteKit (see \\`kit.csp\\` in svelte.config.js) so it is intentionally omitted\n# here to avoid conflicting duplicates.\n[[headers]]\n for = \"/*\"\n [headers.values]\n Strict-Transport-Security = \"max-age=63072000; includeSubDomains; preload\"\n X-Content-Type-Options = \"nosniff\"\n X-Frame-Options = \"SAMEORIGIN\"\n Referrer-Policy = \"strict-origin-when-cross-origin\"\n Permissions-Policy = \"camera=(), microphone=(), geolocation=(), interest-cohort=()\"\n Cross-Origin-Opener-Policy = \"same-origin\"\n\n[[headers]]\n for = \"/favicon.png\"\n [headers.values]\n Cache-Control = \"public, max-age=31536000, immutable\"\n\n[[headers]]\n for = \"/_app/immutable/*\"\n [headers.values]\n Cache-Control = \"public, max-age=31536000, immutable\"\n`,\n};\n\nexport const ALL_TEMPLATES: ConfigTemplate[] = [\n eslint,\n prettier,\n prettierIgnore,\n lighthouse,\n playwrightA11y,\n svelte,\n renovateAction,\n renovateConfig,\n netlify,\n];\n\nexport function templatesByName(which: ConfigName[]): ConfigTemplate[] {\n return ALL_TEMPLATES.filter((t) => which.includes(t.config));\n}\n","import type { ConfigName } from \"../../types.js\";\n\n/**\n * `.github/workflows/renovate.yml` (the `renovate-action` template) is\n * compliance-checked, not byte-matched, for the same reason `svelte.config.js`\n * and `netlify.toml` already are (see `isSvelteConfigCompliant` /\n * `isNetlifyConfigCompliant` in `sync-configs.ts`): an exact overwrite is the\n * wrong operation whenever a file legitimately diverges from the template\n * without being wrong. For renovate.yml there are TWO such legitimate\n * divergences, both observed live on 2026-08-31 (issue #651):\n *\n * 1. Renovate bumps its own digest pins. The template pins\n * `renovatebot/github-action@1a96852b...` (# v46.1.21); a site Renovate\n * maintains moves that pin forward on its own (reddoor-starter was already\n * at `@e09d604f...` / v46.2.2). A byte-match recipe reads that as drift and\n * opens a PR that DOWNGRADES the pin — reverting Renovate's own\n * supply-chain update, the exact thing the template's own comment says\n * Renovate is supposed to do. Observed live: it opened\n * `reddoorla/reddoor-starter-blux#1`, closed unmerged.\n * 2. YAML scalar quoting. The template writes an unquoted twice-daily cron and\n * `RENOVATE_USERNAME: reddoor-renovate[bot]` unquoted; a site's prettier\n * may render both quoted instead. Both forms are prettier-clean (verified\n * against the repo's own prettier), so prettier never normalizes one\n * toward the other — once a site's copy diverges in quoting, a byte-match\n * recipe reports drift FOREVER.\n *\n * The fix, following the svelte.config/netlify.toml precedent exactly: stop\n * asking \"is this file byte-identical to the template?\" and ask \"does it\n * still satisfy the invariants we actually own?\". `renovateActionGaps`\n * returns that — a `string[]` of human-readable gaps, empty meaning\n * compliant and left alone, the same shape as `rulesetGaps` (src/github/rulesets.ts)\n * and `renovateGaps` (src/audits/protection-coverage.ts).\n *\n * When a file genuinely IS non-compliant (e.g. its cron changed) the recipe\n * heals it by writing the template — but writing the template verbatim would\n * itself re-introduce the downgrade bug above, overwriting the site's newer\n * digest pins with the template's older ones. `withRenovatePinsFrom` carries\n * the site's own (still-digest-pinned) refs forward onto the template before\n * it is written — see that function's own doc comment for exactly what\n * guarantee this is (and, as importantly, isn't).\n *\n * Every check below runs against a COMMENT-STRIPPED copy of the file (see\n * `stripComments`). A raw-text `.match()`/`.includes()` takes the FIRST hit\n * anywhere in the file, comments included — a canonical pin, cron, or job\n * body sitting in a `#` comment above the real (non-compliant) line reads as\n * compliant, and worse, `withRenovatePinsFrom` would scrape a sha out of a\n * comment like `# old: uses: actions/checkout@1111…1111 # v4` and carry a\n * *commented* pin forward into the healed file — a pin downgrade delivered by\n * the very recipe that exists to prevent pin downgrades.\n */\n\nconst DIGEST_RE = /^[0-9a-f]{40}$/;\n\nfunction escapeRegExp(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Strip full-line `#` comments before any compliance check or ref extraction\n * runs, so a canonical-looking line that exists only in a comment can never\n * read as the real thing.\n *\n * Full-line only: a trailing `# vX.Y.Z` after a real `uses:` line is\n * meaningful (it's the human-readable version tag) and must survive — only\n * strip a line whose first non-whitespace character is `#`. This is safe\n * specifically because this workflow's YAML has no block scalars (`|`/`>`),\n * so there is no line in a compliant or non-compliant renovate.yml where a\n * leading `#` is literal string content rather than a comment.\n */\nfunction stripComments(contents: string): string {\n return contents.replace(/^[ \\t]*#[^\\n]*$/gm, \"\");\n}\n\n/** A `uses:` line, anchored to the start of a line (allowing only leading\n * indentation and an optional `- ` list marker before `uses:`) so a match\n * can only ever land on a real step, never on prose inside a comment that\n * happens to contain the word `uses:`. Always run against comment-stripped\n * text (see `stripComments`) — the anchor alone does not exclude comments,\n * since a full-line comment's content can itself start with `- uses:` at\n * matching indentation. */\nconst USES_LINE_RE = /^([ \\t]*(?:- )?)uses:\\s*([\\w.-]+\\/[\\w.-]+)@(\\S+)(?:[ \\t]*#[^\\r\\n]*)?/gm;\n\n/** The ref (and trailing `# vX.Y.Z` comment, if any) a `uses: <slug>@<ref>`\n * line carries in `contents`, or null if that action isn't referenced.\n * Callers must pass comment-stripped text — see `stripComments`. */\nfunction usesRefAndComment(\n contents: string,\n slug: string,\n): { ref: string; comment: string } | null {\n const re = new RegExp(\n `^[ \\\\t]*(?:- )?uses:\\\\s*${escapeRegExp(slug)}@(\\\\S+)([ \\\\t]*#[^\\\\r\\\\n]*)?`,\n \"m\",\n );\n const m = contents.match(re);\n if (!m) return null;\n return { ref: m[1]!, comment: m[2] ?? \"\" };\n}\n\n/** Gap text for one `uses:` action that must be present AND digest-pinned.\n * This workflow mints a repo-write token (the App-token step), so a mutable\n * tag ref on ANY step here is a supply-chain hole — a retagged `@v3`/`@v46`\n * would run attacker code with that token. (The three actions checked here\n * are the ones this workflow ships with by default; `renovateActionGaps`\n * separately widens this to ANY `uses:` line, so an action added later is\n * covered too.) `contents` must already be comment-stripped. */\nfunction pinGap(slug: string, contents: string): string | null {\n const found = usesRefAndComment(contents, slug);\n if (!found || !DIGEST_RE.test(found.ref)) {\n return `${slug} is missing or not digest-pinned (needs @<40-hex-sha>) — this workflow mints a repo-write token, so a mutable tag ref is a supply-chain hole`;\n }\n return null;\n}\n\n/** The three actions this workflow ships with by default and always requires,\n * present and digest-pinned. Checked individually (via `pinGap`, above) so a\n * gap can say which one of the three is the problem; the widen loop in\n * `renovateActionGaps` then covers every OTHER `uses:` line so a step added\n * later can't slip in on a mutable ref unnoticed. */\nconst KNOWN_PINNED_ACTIONS = [\n \"renovatebot/github-action\",\n \"actions/create-github-app-token\",\n \"actions/checkout\",\n];\n\nconst APP_AUTH_MARKERS = [\n \"vars.RENOVATE_APP_ID\",\n \"secrets.RENOVATE_APP_PRIVATE_KEY\",\n \"steps.app-token.outputs.token\",\n];\n\n/** Gaps in a site's `.github/workflows/renovate.yml`. Empty = compliant,\n * leave it alone — see the module doc comment above for why this is\n * compliance-checked rather than byte-matched. */\nexport function renovateActionGaps(contents: string): string[] {\n const gaps: string[] = [];\n const withoutComments = stripComments(contents);\n\n for (const slug of KNOWN_PINNED_ACTIONS) {\n const gap = pinGap(slug, withoutComments);\n if (gap) gaps.push(gap);\n }\n\n // Widen the pin check to every OTHER `uses:` line in the file — the doc\n // comment on `pinGap` says a mutable ref on ANY step is a supply-chain\n // hole; without this, a step added later (e.g. `pnpm/action-setup@v4`)\n // would pass clean just because it isn't one of the three known actions.\n // A local `uses: ./.github/actions/foo` path ref never matches — the regex\n // requires a literal `@<ref>`, which a bare path reference doesn't have.\n for (const m of withoutComments.matchAll(USES_LINE_RE)) {\n const slug = m[2]!;\n const ref = m[3]!;\n if (KNOWN_PINNED_ACTIONS.includes(slug)) continue; // already covered above\n if (!DIGEST_RE.test(ref)) {\n gaps.push(\n `${slug}@${ref} is not digest-pinned (needs @<40-hex-sha>) — this workflow mints a repo-write token, so every action reference must be digest-pinned`,\n );\n }\n }\n\n const missingAuth = APP_AUTH_MARKERS.filter((m) => !withoutComments.includes(m));\n if (missingAuth.length > 0) {\n gaps.push(\n `App auth is not fully wired — missing ${missingAuth.join(\", \")} (Renovate authenticates as the reddoor-renovate GitHub App, not an operator PAT)`,\n );\n }\n\n if (withoutComments.includes(\"RENOVATE_TOKEN\")) {\n gaps.push(\n \"contains RENOVATE_TOKEN — that is the retired operator-PAT identity the App migration replaced\",\n );\n }\n\n // Checked (and reported) as two independent gaps, not one folded string, so\n // a caller can tell which field actually failed.\n if (!/RENOVATE_USERNAME:\\s*[\"']?reddoor-renovate\\[bot\\]/.test(withoutComments)) {\n gaps.push(\"RENOVATE_USERNAME does not identify reddoor-renovate[bot]\");\n }\n if (!/RENOVATE_GIT_AUTHOR:\\s*[\"']?reddoor-renovate\\[bot\\]/.test(withoutComments)) {\n gaps.push(\"RENOVATE_GIT_AUTHOR does not identify reddoor-renovate[bot]\");\n }\n\n if (\n !/RENOVATE_REPOSITORIES:\\s*[\"']?\\$\\{\\{\\s*github\\.repository\\s*\\}\\}[\"']?/.test(withoutComments)\n ) {\n gaps.push(\n \"RENOVATE_REPOSITORIES is not scoped to ${{ github.repository }} — this workflow must only ever touch its own repo\",\n );\n }\n\n if (!/cron:\\s*[\"']?0 \\*\\/12 \\* \\* \\*[\"']?/.test(withoutComments)) {\n gaps.push(\n 'cron is not the twice-daily \"0 */12 * * *\" schedule — this cron IS the fleet\\'s merge cadence (platform auto-merge is disabled fleet-wide, so Renovate merges from inside this run)',\n );\n }\n\n if (!withoutComments.includes(\"workflow_dispatch\")) {\n gaps.push(\"missing workflow_dispatch trigger\");\n }\n\n // A `permissions:` key is present somewhere AND a `contents: read` line\n // (optionally quoted) exists somewhere — not anchored to top-level-first-key,\n // since this predicate doesn't actually need to assert that shape (a\n // job-level permissions block satisfies the same invariant), and requiring\n // `contents: read` to be the first entry under `permissions:` false-positived\n // on both quoting (`contents: \"read\"`) and ordering (`contents: read` listed\n // after another key, e.g. `pull-requests: write`).\n const hasPermissionsKey = withoutComments.includes(\"permissions:\");\n const hasContentsRead = /^[ \\t]*contents:\\s*[\"']?read[\"']?[ \\t]*$/m.test(withoutComments);\n if (!hasPermissionsKey || !hasContentsRead) {\n gaps.push(\"permissions: does not grant contents: read\");\n }\n\n return gaps;\n}\n\n/**\n * The canonical template with each action's `uses:` ref replaced by the ref\n * the site already has, when the site's is digest-pinned.\n *\n * Why: when a file IS genuinely non-compliant (say its cron changed) the\n * recipe heals it by writing the template — and writing the template verbatim\n * would put the template's OLDER pins over the site's newer ones, re-\n * introducing the downgrade this fix removes. So carry the site's pins\n * forward onto the (otherwise-canonical) healed file.\n *\n * This is PIN-NEUTRAL, not downgrade-avoiding: it substitutes the site's ref\n * whenever it is 40 hex characters, with no notion of \"newer\" — digests are\n * unorderable, so there is no way to tell from the strings alone. It never\n * changes a digest-pinned ref in either direction; some fleet sites carry a\n * pin OLDER than the template's and will heal onto their own older pin\n * (defensible — Renovate re-advances it on its own), so \"pin-neutral\" is the\n * accurate description, not \"downgrade-avoiding\".\n *\n * `current === null` (no existing file) returns the template unchanged — there\n * is nothing to carry forward. A non-digest ref on the site (a mutable tag) is\n * never substituted in, since that would carry the mutable-ref hole forward\n * instead of healing it. Likewise, a ref that appears only inside a `#`\n * comment in `current` is never carried forward (see `stripComments`) — a\n * commented sha must never be scraped and pinned into the healed file.\n */\nexport function withRenovatePinsFrom(template: string, current: string | null): string {\n if (current === null) return template;\n const currentWithoutComments = stripComments(current);\n return template.replace(USES_LINE_RE, (full, prefix: string, slug: string) => {\n const found = usesRefAndComment(currentWithoutComments, slug);\n if (!found || !DIGEST_RE.test(found.ref)) return full;\n return `${prefix}uses: ${slug}@${found.ref}${found.comment}`;\n });\n}\n\n/** The `ConfigName` for `.github/workflows/renovate.yml`. Exported once here\n * (rather than re-declared as a local constant in both `sync-configs.ts` and\n * `self-updating/index.ts`) so the two call sites can't drift apart. */\nexport const RENOVATE_ACTION_CONFIG: ConfigName = \"renovate-action\";\n"],"mappings":";AAQA,IAAM,SAAyB;AAAA,EAC7B,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,UAAU;AAAA;AAAA;AAAA;AAAA;AAKZ;AAEA,IAAM,WAA2B;AAAA,EAC/B,QAAQ;AAAA,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M,yBAAyB,cAAc,OAAO;AACpD,SAAO,SAAS,QAAQ,cAAc,CAAC,MAAM,QAAgB,SAAiB;AAC5E,UAAM,QAAQ,kBAAkB,wBAAwB,IAAI;AAC5D,QAAI,CAAC,SAAS,CAAC,UAAU,KAAK,MAAM,GAAG,EAAG,QAAO;AACjD,WAAO,GAAG,MAAM,SAAS,IAAI,IAAI,MAAM,GAAG,GAAG,MAAM,OAAO;AAAA,EAC5D,CAAC;AACH;AAKO,IAAM,yBAAqC;","names":[]}
package/dist/cli/bin.js CHANGED
@@ -111,7 +111,7 @@ cli.command("sync-configs [site]", "Sync canonical configs into a site.").option
111
111
  'Inventory file (.json or .mjs/.js), or "airtable" to read from Websites table'
112
112
  ).option("--workdir <path>", "Clone target for fleet mode (default ~/.reddoor-maint/sites)").action(
113
113
  async (site, opts) => runOrExit(
114
- async () => (await import("../sync-configs-LVBITPLU.js")).runSyncConfigsCommand(site, opts),
114
+ async () => (await import("../sync-configs-ZYLTMUNX.js")).runSyncConfigsCommand(site, opts),
115
115
  opts
116
116
  )
117
117
  );
@@ -129,7 +129,7 @@ cli.command(
129
129
  "Bootstrap a repo to keep itself updated (Renovate + protection; platform auto-merge off; ci.yml is the starter's, not managed here)."
130
130
  ).option("--dry", "List what would be enabled without writing or opening PRs").option("--fleet <inventory>", 'Inventory file (.json or .mjs/.js), or "airtable"').option("--workdir <path>", "Clone target for fleet mode (default ~/.reddoor-maint/sites)").action(
131
131
  async (site, opts) => runOrExit(
132
- async () => (await import("../self-updating-NTCCWJYZ.js")).runSelfUpdatingCommand(site, opts),
132
+ async () => (await import("../self-updating-VQIW24RZ.js")).runSelfUpdatingCommand(site, opts),
133
133
  opts
134
134
  )
135
135
  );
@@ -138,7 +138,7 @@ cli.command(
138
138
  "Add the Prismic model delivery workflow to a site via PR (one PR per repo; never pushes to main)."
139
139
  ).option("--dry", "List the sites that would be offered the workflow, without opening any PR").option("--fleet <inventory>", 'Inventory file (.json or .mjs/.js), or "airtable"').option("--workdir <path>", "Clone target for fleet mode (default ~/.reddoor-maint/sites)").action(
140
140
  async (site, opts) => runOrExit(
141
- async () => (await import("../prismic-ci-PZ5LCPWT.js")).runPrismicCiCommand(site, opts),
141
+ async () => (await import("../prismic-ci-6YGRIOHT.js")).runPrismicCiCommand(site, opts),
142
142
  opts
143
143
  )
144
144
  );
@@ -153,7 +153,7 @@ cli.command(
153
153
  "Write the report to this file (the CI workflow posts it as a PR comment)"
154
154
  ).action(
155
155
  async (site, opts) => runOrExit(
156
- async () => (await import("../prismic-models-6OYYZUR5.js")).runPrismicModelsCommand(site, opts),
156
+ async () => (await import("../prismic-models-VNGIKS2B.js")).runPrismicModelsCommand(site, opts),
157
157
  opts
158
158
  )
159
159
  );
@@ -230,14 +230,14 @@ cli.command(
230
230
  "--fleet <inventory>",
231
231
  'Inventory file (.json or .mjs/.js), or "airtable" to read from Websites table'
232
232
  ).option("--workdir <path>", "Clone target for fleet mode (default ~/.reddoor-maint/sites)").action(
233
- async (site, opts) => runOrExit(async () => (await import("../init-NHKADHB6.js")).runInitCommand(site, opts), opts)
233
+ async (site, opts) => runOrExit(async () => (await import("../init-S4MJ3Y6W.js")).runInitCommand(site, opts), opts)
234
234
  );
235
235
  cli.command(
236
236
  "launch <site>",
237
237
  "Bootstrap + first-audit a site, then draft its launch email for approval."
238
238
  ).action(
239
239
  async (site, opts) => runOrExit(
240
- async () => (await import("../launch-VQJ4Z35C.js")).runLaunchCommand(site, opts),
240
+ async () => (await import("../launch-7FT4EYEO.js")).runLaunchCommand(site, opts),
241
241
  opts
242
242
  )
243
243
  );
@@ -252,7 +252,7 @@ cli.command(
252
252
  "Draft the monthly-report announcement email for maintenance sites (all, or one) for approval."
253
253
  ).action(
254
254
  async (site, opts) => runOrExit(
255
- async () => (await import("../announce-OJFAS5JT.js")).runAnnounceCommand(site, opts),
255
+ async () => (await import("../announce-NDTLRQCN.js")).runAnnounceCommand(site, opts),
256
256
  opts
257
257
  )
258
258
  );
@@ -261,7 +261,7 @@ cli.command(
261
261
  "Show who a form submission would email, and optionally flip the pre-launch guard (read-back confirmed)."
262
262
  ).option("--set <on|off>", "Flip the guard: on = route to operator, off = restore.").option("--restore <status>", "Status to restore with --set off. Required; never inferred.").action(
263
263
  async (site, opts) => runOrExit(
264
- async () => (await import("../forms-notify-target-LYSKME5L.js")).runFormsNotifyTargetCommand(
264
+ async () => (await import("../forms-notify-target-IHJX7NWA.js")).runFormsNotifyTargetCommand(
265
265
  site,
266
266
  opts
267
267
  ),
@@ -291,7 +291,7 @@ cli.command(
291
291
  );
292
292
  cli.command("ensure-site <slug>", "Create/verify the Airtable Websites row for a new site.").option("--name <display name>", "Human Name for the row (client-facing copy uses it verbatim).").option("--url <url>", "Deployed URL (e.g. the Netlify site URL).").option("--contact <email>", "point of contact \u2014 the client address reports resolve to.").option("--git-repo <owner/repo>", "GitHub identity. Default on create: reddoorla/<slug>.").action(
293
293
  async (slug, opts) => runOrExit(
294
- async () => (await import("../ensure-site-NSNY2QHN.js")).runEnsureSiteCommand(slug, opts),
294
+ async () => (await import("../ensure-site-FFDUMY6E.js")).runEnsureSiteCommand(slug, opts),
295
295
  opts
296
296
  )
297
297
  );
@@ -309,7 +309,7 @@ cli.command(
309
309
  "Email the internal sheet (scores, what wasn't measured, top fixes, the link) to PROSPECT_AUDIT_RECIPIENTS."
310
310
  ).action(
311
311
  async (url, opts) => runOrExit(
312
- async () => (await import("../prospect-audit-DBBXL7EG.js")).runProspectAuditCommand(url, opts),
312
+ async () => (await import("../prospect-audit-JCWTKJTS.js")).runProspectAuditCommand(url, opts),
313
313
  opts
314
314
  )
315
315
  );
@@ -330,7 +330,7 @@ cli.command("report [site]", "Draft or send maintenance/testing reports.").optio
330
330
  "Regenerate one UNSENT report's stored HTML from its current row, so the console preview shows edited commentary. Refuses a sent report."
331
331
  ).action(
332
332
  async (site, opts) => runOrExit(
333
- async () => (await import("../report-2N4PXO3L.js")).runReportCommand(site, opts),
333
+ async () => (await import("../report-AAY2HZZR.js")).runReportCommand(site, opts),
334
334
  opts
335
335
  )
336
336
  );
@@ -339,7 +339,7 @@ cli.command(
339
339
  "Sweep the fleet for GitHub signals (Renovate-failing/CI/last-commit) and write Airtable."
340
340
  ).option("--fleet", "Run across every site in the Airtable inventory.").option("--write-airtable", "Write each site's signals back to its Websites row.").action(
341
341
  async (opts) => runOrExit(
342
- async () => (await import("../github-signals-4YML6NY5.js")).runGitHubSignalsCommand({
342
+ async () => (await import("../github-signals-FCLNHKMF.js")).runGitHubSignalsCommand({
343
343
  fleet: opts.fleet,
344
344
  writeAirtable: opts.writeAirtable
345
345
  }),
@@ -370,7 +370,7 @@ cli.command(
370
370
  "--force",
371
371
  "import-airtable / sync: run despite the freeze (#643) \u2014 a deliberate rollback-window converge from the frozen Airtable shadow. Without it both refuse while Turso is authoritative, because an import overwrites authoritative rows."
372
372
  ).action(
373
- async (action, opts) => runOrExit(async () => (await import("../db-DAJX7NNW.js")).runDbCommand(action, opts), opts)
373
+ async (action, opts) => runOrExit(async () => (await import("../db-LOSJ74ZJ.js")).runDbCommand(action, opts), opts)
374
374
  );
375
375
  cli.command(
376
376
  "submissions <action>",
@@ -380,7 +380,7 @@ cli.command(
380
380
  "Write the re-buckets: status \u2192 spam_auto, spam_score/spam_reason replaced with the new verdict + 'retro-rescore' marker."
381
381
  ).action(
382
382
  async (action, opts) => runOrExit(
383
- async () => (await import("../submissions-TEHPBSZJ.js")).runSubmissionsCommand(action, opts),
383
+ async () => (await import("../submissions-7LGJJSDL.js")).runSubmissionsCommand(action, opts),
384
384
  opts
385
385
  )
386
386
  );
@@ -392,7 +392,7 @@ cli.command(
392
392
  async () => (await import("../renovate-dispatch-6GQWTRKX.js")).runRenovateDispatchCommand({
393
393
  fleet: opts.fleet,
394
394
  // #539 Phase 5: mirror the auto-fix counter into site_health.
395
- siteMirror: await (await import("../site-mirror-RQTEAID5.js")).makeSiteMirror()
395
+ siteMirror: await (await import("../site-mirror-GCFLBBWK.js")).makeSiteMirror()
396
396
  }),
397
397
  opts
398
398
  )
@@ -417,7 +417,7 @@ cli.command(
417
417
  "freeze: JSON declaring slots the template has no token for (video poster, a panel rebuilt from a baked image). Keys must start with 'x.'"
418
418
  ).action(
419
419
  async (action, dir, opts) => runOrExit(
420
- async () => (await import("../blux-EATHOHKK.js")).runBluxCommand(action, dir, opts),
420
+ async () => (await import("../blux-YGBGS24U.js")).runBluxCommand(action, dir, opts),
421
421
  opts
422
422
  )
423
423
  );
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  ALL_AUDIT_NAMES,
14
14
  runOneAudit
15
- } from "../../chunk-AEXJDCJN.js";
15
+ } from "../../chunk-DFLN2KO3.js";
16
16
  import "../../chunk-LKGVSM2O.js";
17
17
  import "../../chunk-GASBX52O.js";
18
18
  import "../../chunk-XHHMM5HX.js";
@@ -20,16 +20,16 @@ import "../../chunk-Z3JXLULD.js";
20
20
  import {
21
21
  recordFleetEventsBestEffort
22
22
  } from "../../chunk-W45FZEGE.js";
23
+ import "../../chunk-WS6NU475.js";
24
+ import "../../chunk-UDRHAQT7.js";
23
25
  import {
24
26
  isHttpUrl
25
27
  } from "../../chunk-RARREDQE.js";
26
- import "../../chunk-WS6NU475.js";
27
28
  import "../../chunk-MFHS7IQ2.js";
28
29
  import "../../chunk-A3WDWNN5.js";
29
30
  import "../../chunk-2OP4JKIQ.js";
30
31
  import "../../chunk-XTK5VIQB.js";
31
32
  import "../../chunk-2NQUCS7O.js";
32
- import "../../chunk-UDRHAQT7.js";
33
33
  import "../../chunk-PTDMVGKL.js";
34
34
  import "../../chunk-LBYOLBW7.js";
35
35
  import "../../chunk-XXTZBPUY.js";
@@ -267,7 +267,7 @@ ${wb.summary}`;
267
267
  task.output = "writing scores\u2026";
268
268
  writeSummary = await writeAuditsToAirtable({ base, websites, slug, results });
269
269
  if (writeSummary.siteId && writeSummary.fields) {
270
- const { makeSiteMirror } = await import("../../site-mirror-RQTEAID5.js");
270
+ const { makeSiteMirror } = await import("../../site-mirror-GCFLBBWK.js");
271
271
  await (await makeSiteMirror()).health(writeSummary.siteId, writeSummary.fields);
272
272
  }
273
273
  task.title = `Wrote to Websites[${writeSummary.siteName}] (${writeSummary.writes.length} audit type${writeSummary.writes.length === 1 ? "" : "s"})`;
@@ -304,7 +304,7 @@ async function runFleetWriteBack(args) {
304
304
  const { listWebsites } = await import("../../websites-D6WYFAES.js");
305
305
  const websites = await listWebsites(base);
306
306
  const makeMirror = deps.makeMirror ?? (async () => {
307
- const { makeHealthMirrorBestEffort } = await import("../../health-mirror-7LKC7Q5Z.js");
307
+ const { makeHealthMirrorBestEffort } = await import("../../health-mirror-GMSF3Z5R.js");
308
308
  return makeHealthMirrorBestEffort();
309
309
  });
310
310
  const mirror = await makeMirror();
@@ -350,4 +350,4 @@ export {
350
350
  freezeGuardsDbWrite,
351
351
  runDbCommand
352
352
  };
353
- //# sourceMappingURL=db-DAJX7NNW.js.map
353
+ //# sourceMappingURL=db-LOSJ74ZJ.js.map
@@ -23,11 +23,11 @@ import {
23
23
  isPendingApproval,
24
24
  listAllReports
25
25
  } from "./chunk-F3JWOPTG.js";
26
+ import "./chunk-VAD43MOR.js";
26
27
  import {
27
28
  diffAttention,
28
29
  writeDigestState
29
30
  } from "./chunk-BRYXFH77.js";
30
- import "./chunk-VAD43MOR.js";
31
31
  import "./chunk-IY6256GK.js";
32
32
  import {
33
33
  openBase,
@@ -48,8 +48,8 @@ import {
48
48
  defaultResendClient
49
49
  } from "./chunk-WEKL2HYJ.js";
50
50
  import "./chunk-W45FZEGE.js";
51
- import "./chunk-RARREDQE.js";
52
51
  import "./chunk-WS6NU475.js";
52
+ import "./chunk-RARREDQE.js";
53
53
  import "./chunk-MFHS7IQ2.js";
54
54
  import "./chunk-6VAL7XJT.js";
55
55
 
@@ -424,4 +424,4 @@ export {
424
424
  renderDigestHtml,
425
425
  runDigest
426
426
  };
427
- //# sourceMappingURL=digest-T6TAZNLF.js.map
427
+ //# sourceMappingURL=digest-CS6KLCZB.js.map
@@ -28,8 +28,8 @@ import "./chunk-BGTYPVLT.js";
28
28
  import "./chunk-7NYN2P6I.js";
29
29
  import "./chunk-WEKL2HYJ.js";
30
30
  import "./chunk-W45FZEGE.js";
31
- import "./chunk-RARREDQE.js";
32
31
  import "./chunk-WS6NU475.js";
32
+ import "./chunk-RARREDQE.js";
33
33
  import "./chunk-MFHS7IQ2.js";
34
34
  import "./chunk-6VAL7XJT.js";
35
35
  export {
@@ -66,7 +66,7 @@ async function runEnsureSiteCommand(slug, opts) {
66
66
  if (!slug) return { output: "Provide a <slug> (e.g. `ensure-site roalson`).", code: 2 };
67
67
  try {
68
68
  const base = openBase(readAirtableConfig());
69
- const { makeSiteMirror } = await import("./site-mirror-RQTEAID5.js");
69
+ const { makeSiteMirror } = await import("./site-mirror-GCFLBBWK.js");
70
70
  const result = await ensureSite(
71
71
  base,
72
72
  {
@@ -93,4 +93,4 @@ async function runEnsureSiteCommand(slug, opts) {
93
93
  export {
94
94
  runEnsureSiteCommand
95
95
  };
96
- //# sourceMappingURL=ensure-site-NSNY2QHN.js.map
96
+ //# sourceMappingURL=ensure-site-FFDUMY6E.js.map
@@ -2,8 +2,8 @@ import {
2
2
  describeNotifyTarget
3
3
  } from "./chunk-SJOXWJ5Y.js";
4
4
  import "./chunk-JRHIFA5R.js";
5
- import "./chunk-NO74DXDP.js";
6
5
  import "./chunk-5ML7FMBD.js";
6
+ import "./chunk-NO74DXDP.js";
7
7
  import {
8
8
  openBase,
9
9
  readAirtableConfig
@@ -143,7 +143,7 @@ async function runFormsNotifyTargetCommand(site, opts) {
143
143
  return { output: `--set must be 'on' or 'off' (got '${opts.set}')`, code: 2 };
144
144
  }
145
145
  try {
146
- const { makeSiteMirror } = await import("./site-mirror-RQTEAID5.js");
146
+ const { makeSiteMirror } = await import("./site-mirror-GCFLBBWK.js");
147
147
  const result = await formsNotifyTarget({
148
148
  siteMirror: await makeSiteMirror(),
149
149
  site: site.trim(),
@@ -163,4 +163,4 @@ export {
163
163
  formatNotifyTarget,
164
164
  runFormsNotifyTargetCommand
165
165
  };
166
- //# sourceMappingURL=forms-notify-target-LYSKME5L.js.map
166
+ //# sourceMappingURL=forms-notify-target-IHJX7NWA.js.map
@@ -91,7 +91,7 @@ async function runGitHubSignalsCommand(opts, deps = {}) {
91
91
  );
92
92
  const sweptAt = (/* @__PURE__ */ new Date()).toISOString();
93
93
  const makeMirror = deps.makeMirror ?? (async () => {
94
- const { makeHealthMirrorBestEffort } = await import("./health-mirror-7LKC7Q5Z.js");
94
+ const { makeHealthMirrorBestEffort } = await import("./health-mirror-GMSF3Z5R.js");
95
95
  return makeHealthMirrorBestEffort();
96
96
  });
97
97
  const mirror = await makeMirror();
@@ -156,4 +156,4 @@ export {
156
156
  githubSignalsExitCode,
157
157
  runGitHubSignalsCommand
158
158
  };
159
- //# sourceMappingURL=github-signals-4YML6NY5.js.map
159
+ //# sourceMappingURL=github-signals-FCLNHKMF.js.map
@@ -2,10 +2,10 @@ import {
2
2
  mirrorHealthFields,
3
3
  mirrorScheduleFields
4
4
  } from "./chunk-QBAAZY7W.js";
5
+ import "./chunk-P6AORG32.js";
5
6
  import {
6
7
  TURSO_IS_AUTHORITATIVE
7
8
  } from "./chunk-SVAAONYB.js";
8
- import "./chunk-P6AORG32.js";
9
9
  import "./chunk-F3JWOPTG.js";
10
10
  import "./chunk-VAD43MOR.js";
11
11
  import "./chunk-7NYN2P6I.js";
@@ -43,4 +43,4 @@ export {
43
43
  makeHealthMirrorBestEffort,
44
44
  makeScheduleMirrorBestEffort
45
45
  };
46
- //# sourceMappingURL=health-mirror-7LKC7Q5Z.js.map
46
+ //# sourceMappingURL=health-mirror-GMSF3Z5R.js.map
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Prismic image helpers for fleet sites.
3
+ *
4
+ * Dependency-free on purpose: consuming sites import this subpath directly, so
5
+ * it must never reach a central-only devDep. The image field is accepted
6
+ * structurally rather than as `@prismicio/client`'s `ImageField`, which keeps
7
+ * `@prismicio/client` out of this package's dependency graph while still
8
+ * type-checking at the call site — a real `ImageField` satisfies the shape.
9
+ */
10
+ /**
11
+ * The srcset widths `<PrismicImage>` emits when no `widths` prop is given.
12
+ * Mirrors `DEFAULT_WIDTHS` in `@prismicio/client`'s `asImageWidthSrcSet()`.
13
+ */
14
+ declare const PRISMIC_DEFAULT_WIDTHS: readonly [640, 828, 1200, 2048, 3840];
15
+ /** The structural shape `cappedWidths()` needs from a Prismic image field. */
16
+ type ImageFieldLike = {
17
+ dimensions?: {
18
+ width?: number | null;
19
+ } | null;
20
+ } | null;
21
+ /**
22
+ * Build a srcset width list that never exceeds the image's own pixel width.
23
+ *
24
+ * Prismic advertises every default width regardless of how big the source asset
25
+ * actually is. Because fleet sites also set `sizes` (or fall back to the `100vw`
26
+ * default), browsers on wide or retina screens genuinely pick those top
27
+ * candidates — so a 558px photo gets upscaled ~7x on demand, and a 40px logo by
28
+ * 96x. Those variants are always a cache MISS, are expensive for Prismic to
29
+ * generate, and are the ones that surface as slow or failed images in production
30
+ * while the same asset's smaller variants serve fine.
31
+ *
32
+ * Capping at the native width keeps the rendered result identical — upscaling
33
+ * adds no detail — while removing the expensive transforms entirely.
34
+ *
35
+ * Sources already at or above the widest candidate keep the default list
36
+ * untouched: appending their native width there would *add* a candidate wider
37
+ * than any previously offered, making large images heavier rather than lighter.
38
+ *
39
+ * @example
40
+ * ```svelte
41
+ * <PrismicImage
42
+ * field={slice.primary.image}
43
+ * widths={cappedWidths(slice.primary.image)}
44
+ * sizes="(min-width: 768px) 50vw, 100vw"
45
+ * />
46
+ * ```
47
+ *
48
+ * @param field - The Prismic image field being rendered. An empty or
49
+ * dimensionless field falls back to the candidate list unchanged.
50
+ * @param widths - Candidate widths to filter. Defaults to Prismic's own list.
51
+ * @returns Widths no larger than the source, ascending.
52
+ */
53
+ declare function cappedWidths(field: ImageFieldLike | undefined, widths?: readonly number[]): number[];
54
+
55
+ export { type ImageFieldLike, PRISMIC_DEFAULT_WIDTHS, cappedWidths };
@@ -0,0 +1,16 @@
1
+ // src/images/index.ts
2
+ var PRISMIC_DEFAULT_WIDTHS = [640, 828, 1200, 2048, 3840];
3
+ function cappedWidths(field, widths = PRISMIC_DEFAULT_WIDTHS) {
4
+ const candidates = [...widths];
5
+ const native = field?.dimensions?.width;
6
+ if (typeof native !== "number" || !Number.isFinite(native) || native <= 0) {
7
+ return candidates;
8
+ }
9
+ if (native >= Math.max(...candidates)) return candidates;
10
+ return [...candidates.filter((w) => w < native), native];
11
+ }
12
+ export {
13
+ PRISMIC_DEFAULT_WIDTHS,
14
+ cappedWidths
15
+ };
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/images/index.ts"],"sourcesContent":["/**\n * Prismic image helpers for fleet sites.\n *\n * Dependency-free on purpose: consuming sites import this subpath directly, so\n * it must never reach a central-only devDep. The image field is accepted\n * structurally rather than as `@prismicio/client`'s `ImageField`, which keeps\n * `@prismicio/client` out of this package's dependency graph while still\n * type-checking at the call site — a real `ImageField` satisfies the shape.\n */\n\n/**\n * The srcset widths `<PrismicImage>` emits when no `widths` prop is given.\n * Mirrors `DEFAULT_WIDTHS` in `@prismicio/client`'s `asImageWidthSrcSet()`.\n */\nexport const PRISMIC_DEFAULT_WIDTHS = [640, 828, 1200, 2048, 3840] as const;\n\n/** The structural shape `cappedWidths()` needs from a Prismic image field. */\nexport type ImageFieldLike = {\n dimensions?: { width?: number | null } | null;\n} | null;\n\n/**\n * Build a srcset width list that never exceeds the image's own pixel width.\n *\n * Prismic advertises every default width regardless of how big the source asset\n * actually is. Because fleet sites also set `sizes` (or fall back to the `100vw`\n * default), browsers on wide or retina screens genuinely pick those top\n * candidates — so a 558px photo gets upscaled ~7x on demand, and a 40px logo by\n * 96x. Those variants are always a cache MISS, are expensive for Prismic to\n * generate, and are the ones that surface as slow or failed images in production\n * while the same asset's smaller variants serve fine.\n *\n * Capping at the native width keeps the rendered result identical — upscaling\n * adds no detail — while removing the expensive transforms entirely.\n *\n * Sources already at or above the widest candidate keep the default list\n * untouched: appending their native width there would *add* a candidate wider\n * than any previously offered, making large images heavier rather than lighter.\n *\n * @example\n * ```svelte\n * <PrismicImage\n * field={slice.primary.image}\n * widths={cappedWidths(slice.primary.image)}\n * sizes=\"(min-width: 768px) 50vw, 100vw\"\n * />\n * ```\n *\n * @param field - The Prismic image field being rendered. An empty or\n * dimensionless field falls back to the candidate list unchanged.\n * @param widths - Candidate widths to filter. Defaults to Prismic's own list.\n * @returns Widths no larger than the source, ascending.\n */\nexport function cappedWidths(\n field: ImageFieldLike | undefined,\n widths: readonly number[] = PRISMIC_DEFAULT_WIDTHS,\n): number[] {\n const candidates = [...widths];\n const native = field?.dimensions?.width;\n\n if (typeof native !== \"number\" || !Number.isFinite(native) || native <= 0) {\n return candidates;\n }\n if (native >= Math.max(...candidates)) return candidates;\n\n return [...candidates.filter((w) => w < native), native];\n}\n"],"mappings":";AAcO,IAAM,yBAAyB,CAAC,KAAK,KAAK,MAAM,MAAM,IAAI;AAuC1D,SAAS,aACd,OACA,SAA4B,wBAClB;AACV,QAAM,aAAa,CAAC,GAAG,MAAM;AAC7B,QAAM,SAAS,OAAO,YAAY;AAElC,MAAI,OAAO,WAAW,YAAY,CAAC,OAAO,SAAS,MAAM,KAAK,UAAU,GAAG;AACzE,WAAO;AAAA,EACT;AACA,MAAI,UAAU,KAAK,IAAI,GAAG,UAAU,EAAG,QAAO;AAE9C,SAAO,CAAC,GAAG,WAAW,OAAO,CAAC,MAAM,IAAI,MAAM,GAAG,MAAM;AACzD;","names":[]}
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  DEFAULT_INIT_STEPS,
11
11
  a11yFixturesPage,
12
12
  init
13
- } from "./chunk-62NYED6E.js";
13
+ } from "./chunk-DCDF5A7N.js";
14
14
  import {
15
15
  convertToPnpm
16
16
  } from "./chunk-XIDUYLSR.js";
@@ -44,13 +44,13 @@ import {
44
44
  import {
45
45
  isPendingApproval
46
46
  } from "./chunk-F3JWOPTG.js";
47
- import "./chunk-BRYXFH77.js";
48
- import "./chunk-NYUYNYQL.js";
49
47
  import {
50
48
  checklistFor,
51
49
  gatingFields,
52
50
  isHealthGateClear
53
51
  } from "./chunk-VAD43MOR.js";
52
+ import "./chunk-BRYXFH77.js";
53
+ import "./chunk-NYUYNYQL.js";
54
54
  import {
55
55
  fromAirtableBase
56
56
  } from "./chunk-PR343K7F.js";
@@ -84,9 +84,9 @@ import {
84
84
  import "./chunk-WEKL2HYJ.js";
85
85
  import {
86
86
  syncConfigs
87
- } from "./chunk-3VQWSE3F.js";
87
+ } from "./chunk-DXWLWR4Q.js";
88
88
  import "./chunk-3G25KIWW.js";
89
- import "./chunk-73UFRZKY.js";
89
+ import "./chunk-MLT4QY5X.js";
90
90
  import "./chunk-OTGB6YQO.js";
91
91
  import {
92
92
  ALL_AUDIT_NAMES,
@@ -96,7 +96,7 @@ import {
96
96
  runAudits,
97
97
  runAuditsAcross,
98
98
  securityAudit
99
- } from "./chunk-AEXJDCJN.js";
99
+ } from "./chunk-DFLN2KO3.js";
100
100
  import "./chunk-LKGVSM2O.js";
101
101
  import "./chunk-GASBX52O.js";
102
102
  import "./chunk-XHHMM5HX.js";
@@ -105,8 +105,9 @@ import {
105
105
  localPath
106
106
  } from "./chunk-Z3JXLULD.js";
107
107
  import "./chunk-W45FZEGE.js";
108
- import "./chunk-RARREDQE.js";
109
108
  import "./chunk-WS6NU475.js";
109
+ import "./chunk-UDRHAQT7.js";
110
+ import "./chunk-RARREDQE.js";
110
111
  import "./chunk-MFHS7IQ2.js";
111
112
  import "./chunk-A3WDWNN5.js";
112
113
  import {
@@ -116,7 +117,6 @@ import "./chunk-XTK5VIQB.js";
116
117
  import {
117
118
  lighthouseAudit
118
119
  } from "./chunk-2NQUCS7O.js";
119
- import "./chunk-UDRHAQT7.js";
120
120
  import "./chunk-PTDMVGKL.js";
121
121
  import "./chunk-LBYOLBW7.js";
122
122
  import "./chunk-XXTZBPUY.js";