From b88fce9e3369715ba59e58d936561a652b785f85 Mon Sep 17 00:00:00 2001 From: Danathar Date: Tue, 17 Nov 2026 20:41:13 +0000 Subject: [PATCH 1/5] build(deps): upgrade eslint and @antfu/eslint-config to v10 @antfu/eslint-config 6.7.3 only accepts eslint 9, and v10 of the config needs eslint 10 (through eslint-plugin-unicorn and eslint-plugin-slop), so the two cannot move separately. Lockfile regenerated with npm 11; only lint tooling packages change. Refs #1033 Hive-Run: projectbluefin/website#1033 Hive-Plan: issue-1033 What to change Hive-Spec: issue-1033#acceptance Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 Signed-off-by: Danathar --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 03d5cd3f..7af7885a 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "vue-i18n": "^11.0.1" }, "devDependencies": { - "@antfu/eslint-config": "6.7.3", + "@antfu/eslint-config": "10.0.0", "@tailwindcss/vite": "4.3.2", "@types/node": "26.6.6", "@types/qrcode": "1.5.6", @@ -57,7 +57,7 @@ "@vitest/coverage-v8": "5.1.0", "@vue/test-utils": "2.6.0", "@xmldom/xmldom": "0.9.12", - "eslint": "9.39.5", + "eslint": "10.15.0", "eslint-plugin-format": "2.0.1", "happy-dom": "21.0.4", "playwright": "1.65.1", From 592ba4509d17f542248c4b6ec7b4e9e615f0b96d Mon Sep 17 00:00:00 2001 From: Danathar Date: Tue, 17 Nov 2026 20:41:22 +0000 Subject: [PATCH 2/5] fix(lint): keep the v10 lint config behaviour-neutral Turn off e18e/prefer-array-fill and e18e/prefer-object-has-own: their auto-fixes rewrite code (Object.hasOwn is outside the ES2020 lib in tsconfig.json; the fill() rewrite widens a number[] to unknown[]). Fix the skipped heading level that markdown/heading-increment reports in the Chris Aniszczyk dossier, and record the upgrade procedure in the validation skill. Refs #1033 Hive-Run: projectbluefin/website#1033 Hive-Plan: issue-1033 What to change Hive-Spec: issue-1033#acceptance Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 Signed-off-by: Danathar --- docs/skills/validation/SKILL.md | 9 +++++++++ eslint.config.js | 7 +++++++ src/data/lore/chris-aniszczyk.md | 8 ++++---- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/skills/validation/SKILL.md b/docs/skills/validation/SKILL.md index 3a7d602e..00845faf 100644 --- a/docs/skills/validation/SKILL.md +++ b/docs/skills/validation/SKILL.md @@ -37,6 +37,15 @@ Do not run the full application suite for documentation-only changes. 8. For live-data cache updates, keep the cached file path list identical in order and content across `update-content.yml` (restore and save), `deploy.yml` (restore), and `preview.yml` (restore). 9. When modifying a Vue component under `src/components/`, check `src/tests/` for existing component unit tests and keep test assertions aligned with the runtime contract. 10. For CI concurrency changes, keep pull-request runs grouped by PR and non-PR runs unique; `scripts/tests/workflow-concurrency.test.ts` checks cancellation and group isolation. Assert the parsed YAML expressions directly instead of executing them as JavaScript. +11. For an ESLint or `@antfu/eslint-config` upgrade, move both packages in one + change (each major of the config pins the ESLint major it accepts), and + check that `npm run lint:fix` changed only layout: compare each touched + file with all whitespace stripped against `HEAD`. Turn off a new rule + whose auto-fix rewrites code (for example `e18e/prefer-object-has-own`, + which needs a newer `lib` than `tsconfig.json` sets) instead of letting + the reformat carry it. Lore bodies render Markdown heading markers as + literal text, so a `markdown/heading-increment` fix changes what the + audience reads; keep it to the marker itself. Documentation-only check: diff --git a/eslint.config.js b/eslint.config.js index 3f7793ae..a3a0f3fd 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -27,6 +27,13 @@ export default antfu({ 'style/comma-dangle': 'off', 'curly': ['error', 'all'], 'node/prefer-global/process': ['error', 'always'], + // @antfu/eslint-config v10 adds these e18e rules with auto-fixes that + // change code, not just layout. Object.hasOwn is outside the ES2020 `lib` + // in tsconfig.json, and `Array.from({ length }).fill(x)` widens the + // result to unknown[]. Keep them off so the v10 upgrade stays + // behaviour-neutral; enable them deliberately in a separate change. + 'e18e/prefer-array-fill': 'off', + 'e18e/prefer-object-has-own': 'off', }, formatters: { /** diff --git a/src/data/lore/chris-aniszczyk.md b/src/data/lore/chris-aniszczyk.md index 662b8a9e..e21cf086 100644 --- a/src/data/lore/chris-aniszczyk.md +++ b/src/data/lore/chris-aniszczyk.md @@ -13,7 +13,7 @@ titles: # VANGUARD DOSSIER: CHRIS ANISZCZYK -### **IDENTIFICATION & CLASSIFICATION** +## **IDENTIFICATION & CLASSIFICATION** * **Name:** Chris Aniszczyk * **Designation:** The Last Founder, Architect of the CNCF @@ -23,7 +23,7 @@ titles: --- -### **BIOGRAPHICAL OVERVIEW** +## **BIOGRAPHICAL OVERVIEW** **The Architect of the CNCF** Commander Aniszczyk is the Strategic Commander of the Vanguard and the sole remaining co-founder of the Consensus Network of City Foundries (CNCF). While other founders have fallen or passed the torch, he remains the steadfast architect of the Last City's technical direction. He leaves the day-to-day executive administration to others, focusing instead on macro-level strategy. Alongside Greg KH—his peer and the Vanguard’s most lethal combat maintainer—Aniszczyk has been pivotal in every major systemic event in the history of this world. Where Greg KH executes the code with devastating precision on the battlefield, Aniszczyk writes the underlying engine that makes it possible. @@ -36,7 +36,7 @@ Aniszczyk sees the raw spark of humanity in the youth. To harness this energy, h --- -### **COMBAT LOADOUT & GEAR** +## **COMBAT LOADOUT & GEAR** **Subclass: Prismatic** @@ -55,7 +55,7 @@ Aniszczyk sees the raw spark of humanity in the youth. To harness this energy, h --- -### **NOTABLE RELATIONSHIPS & DYNAMICS** +## **NOTABLE RELATIONSHIPS & DYNAMICS** | Affiliate | Relationship Dynamic | | --- | --- | From 4eb4d18649f02cf0abbd2dc0a50b61f8265701fd Mon Sep 17 00:00:00 2001 From: Danathar Date: Tue, 17 Nov 2026 20:42:03 +0000 Subject: [PATCH 3/5] style: apply the @antfu/eslint-config v10 line-break rules Output of `npm run lint:fix` under the v10 config, mostly the new antfu/reasonable-newline rule. Every touched file is identical to the previous version once whitespace is removed, except one top-level arrow helper in wolves-track-zero-manifest.ts that antfu/top-level-function turned into an equivalent function declaration. No Vue template or style block changes. Refs #1033 Hive-Run: projectbluefin/website#1033 Hive-Plan: issue-1033 What to change Hive-Spec: issue-1033#acceptance Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 Signed-off-by: Danathar --- eslint.config.js | 16 +- record-wolves.cjs | 8 +- scripts/check-docs.mjs | 25 +- scripts/check-git-hygiene.mjs | 35 +- scripts/generate-social-cards.js | 239 ++++++- scripts/generate-wallpapers.js | 28 +- scripts/guardian-cards/capture-scenes.mjs | 15 +- scripts/guardian-cards/generate.mjs | 13 +- scripts/lib/bluefin-version-projection.js | 4 +- scripts/lib/image-sbom-registry.js | 26 +- scripts/lib/image-version-audit.js | 25 +- scripts/lib/oci-sbom.js | 4 +- scripts/lib/sbom-issue-report.js | 6 +- scripts/lib/sbom-issue-sync.js | 4 +- scripts/lib/spdx-version-extractor.js | 12 +- scripts/lib/verified-image-sbom.js | 33 +- scripts/test-baseline.mjs | 11 +- .../tests/bluefin-version-projection.test.ts | 64 +- scripts/tests/check-docs.test.ts | 21 +- scripts/tests/check-git-hygiene.test.ts | 66 +- .../tests/dakota-version-projection.test.ts | 84 ++- .../tests/fixtures/github-script-runner.mjs | 14 +- .../tests/generate-social-card-render.test.ts | 12 +- scripts/tests/generate-wallpapers.test.ts | 28 +- scripts/tests/oci-sbom-pull.test.ts | 24 +- scripts/tests/sbom-issue-report.test.ts | 47 +- scripts/tests/sbom-issue-sync.test.ts | 34 +- scripts/tests/spdx-version-extractor.test.ts | 32 +- scripts/tests/test-baseline.test.ts | 142 +++- scripts/tests/update-back-catalogue.test.ts | 126 +++- scripts/tests/update-contributors.test.ts | 141 +++- scripts/tests/update-dakota-versions.test.ts | 10 +- scripts/tests/update-flickr-photos.test.ts | 116 +++- ...update-image-versions-orchestrator.test.ts | 62 +- scripts/tests/update-image-versions.test.ts | 200 ++++-- scripts/tests/verified-image-sbom.test.ts | 28 +- scripts/tests/wolves-cue-at.test.ts | 40 +- scripts/tests/workflow-cache-parity.test.ts | 4 +- scripts/tests/workflow-concurrency.test.ts | 4 +- scripts/tests/workflow-sbom-policy.test.ts | 11 +- scripts/update-back-catalogue.js | 53 +- scripts/update-contributors.js | 17 +- scripts/update-flickr-photos.js | 20 +- scripts/update-image-versions.js | 4 +- scripts/update-wolves-playlist.js | 21 +- scripts/wolves-cue-at.mjs | 35 +- scripts/wolves-frame-audit.mjs | 107 ++- scripts/wolves-videos.mjs | 7 +- src/WolvesApp.vue | 4 +- src/WolvesTeaserApp.vue | 4 +- src/components/RssFeed.vue | 4 +- src/components/TopNavbar.vue | 10 +- src/components/dakota/DakotaVersionChips.vue | 6 +- src/components/sections/SectionPicker.vue | 26 +- src/components/server/ServerDemos.vue | 8 +- src/components/server/ServerFeatures.vue | 84 ++- src/components/wolves/WolvesBackCatalogue.vue | 4 +- .../wolves/WolvesCharacterGallery.vue | 4 +- src/components/wolves/WolvesComicReader.vue | 83 ++- src/components/wolves/WolvesIntroOverlay.vue | 122 +++- .../wolves/cinematic/CinematicCaptions.vue | 4 +- .../wolves/cinematic/CinematicStage.vue | 4 +- .../wolves/cinematic/CinematicTransition.vue | 4 +- .../wolves/cinematic/MediaWidget.vue | 8 +- .../wolves/cinematic/TheaterExperience.vue | 4 +- .../wolves/cinematic/transition-sfx.ts | 29 +- src/components/wolves/lore.ts | 20 +- .../wolves/lore/ChatlogLoreView.vue | 12 +- .../wolves/lore/DinosaurDossierView.vue | 16 +- .../wolves/lore/FieldReportLoreView.vue | 18 +- .../wolves/lore/GuardianBondLoreView.vue | 8 +- .../wolves/lore/GuardianDossierView.vue | 15 +- .../wolves/lore/LocationDossierView.vue | 18 +- src/components/wolves/lore/NewsLoreView.vue | 12 +- src/components/wolves/lore/SourceLoreView.vue | 12 +- src/components/wolves/lore/lore-pages.ts | 8 +- src/components/wolves/lore/readable-beats.ts | 14 +- src/composables/useDualBufferPlayer.ts | 50 +- src/composables/useYoutubeIframeApi.ts | 28 +- src/data/gallery-captions.ts | 7 +- src/data/wolves-comic-hero-shots.ts | 4 +- src/data/wolves-directors-cut-finale.ts | 8 +- src/data/wolves-directors-cut-intro.ts | 151 ++++- src/data/wolves-directors-cut-slides.ts | 36 +- src/data/wolves-directors-cut-timeline.ts | 12 +- src/data/wolves-gallery-cycle.ts | 9 +- src/data/wolves-intro-sequence.ts | 84 ++- src/data/wolves-lore-records.ts | 24 +- src/data/wolves-lore-timing.ts | 24 +- src/data/wolves-narrative-timeline.ts | 4 +- src/data/wolves-thesis-sequence.ts | 10 +- src/data/wolves-track-zero-beats.ts | 20 +- src/data/wolves-track-zero-manifest.ts | 60 +- src/data/wolves-track-zero-slides.ts | 8 +- src/data/wolves-trailer-plates.ts | 28 +- src/stores/cinematic.ts | 34 +- src/tests/backCatalogueOrder.test.ts | 25 +- src/tests/content.test.ts | 10 +- src/tests/dakotaVersionCard.test.ts | 16 +- src/tests/dakotaVersionChips.test.ts | 9 +- src/tests/locale-completeness.test.ts | 4 +- src/tests/rssFeed.test.ts | 4 +- src/tests/sectionContributors.test.ts | 27 +- src/tests/sectionPicker.test.ts | 14 +- src/tests/serverDemos.test.ts | 20 +- src/tests/wolvesApp.test.ts | 96 ++- src/tests/wolvesBackCatalogue.test.ts | 150 ++++- src/tests/wolvesCinematicConfig.test.ts | 13 +- src/tests/wolvesCinematicStage.test.ts | 41 +- src/tests/wolvesComicReader.test.ts | 188 ++++-- src/tests/wolvesDirectorsCutArtwork.test.ts | 5 +- .../wolvesDirectorsCutFinaleStage.test.ts | 31 +- src/tests/wolvesDirectorsCutIntro.test.ts | 11 +- src/tests/wolvesDirectorsCutSlides.test.ts | 34 +- src/tests/wolvesDualBufferPlayer.test.ts | 50 +- src/tests/wolvesFinaleReveal.test.ts | 4 +- src/tests/wolvesHelmLine.test.ts | 20 +- src/tests/wolvesHeroTypography.test.ts | 33 +- src/tests/wolvesIntroOverlay.test.ts | 618 ++++++++++++------ src/tests/wolvesIntroSequence.test.ts | 51 +- src/tests/wolvesLoreColumn.test.ts | 8 +- src/tests/wolvesLoreRecords.test.ts | 67 +- src/tests/wolvesLoreTiming.test.ts | 54 +- src/tests/wolvesMediaWidget.test.ts | 27 +- src/tests/wolvesNarrativeTimeline.test.ts | 23 +- src/tests/wolvesPlaylistScript.test.ts | 62 +- src/tests/wolvesTeaserApp.test.ts | 9 +- src/tests/wolvesTrackZeroBeats.test.ts | 23 +- src/tests/wolvesTrackZeroSlides.test.ts | 73 ++- src/tests/wolvesTrailerPlates.test.ts | 8 +- src/utils/feedParser.ts | 4 +- vite.config.ts | 7 +- 132 files changed, 4049 insertions(+), 1034 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index a3a0f3fd..4650b967 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -21,9 +21,19 @@ export default antfu({ yaml: false, markdown: true, rules: { - 'no-console': ['error', { - allow: ['info', 'warn', 'trace', 'error', 'group', 'groupEnd'], - }], + 'no-console': [ + 'error', + { + allow: [ + 'info', + 'warn', + 'trace', + 'error', + 'group', + 'groupEnd' + ], + } + ], 'style/comma-dangle': 'off', 'curly': ['error', 'all'], 'node/prefer-global/process': ['error', 'always'], diff --git a/record-wolves.cjs b/record-wolves.cjs index a3a36430..40501937 100644 --- a/record-wolves.cjs +++ b/record-wolves.cjs @@ -37,7 +37,9 @@ function parseArgs(argv) { continue } const [key, inlineValue] = raw.slice(2).split('=', 2) - const value = inlineValue === undefined ? argv[i + 1] : inlineValue + const value = inlineValue === undefined + ? argv[i + 1] + : inlineValue if (inlineValue === undefined) { i++ } @@ -402,7 +404,9 @@ async function main() { for (let i = 0; i < frameCount; i++) { const framePath = `frame-${String(i + 1).padStart(6, '0')}.jpg` const durSeconds - = i + 1 < frameCount ? (frameTimestamps[i + 1] - frameTimestamps[i]) / 1000 : 1 / effectiveFps + = i + 1 < frameCount + ? (frameTimestamps[i + 1] - frameTimestamps[i]) / 1000 + : 1 / effectiveFps concatLines.push(`file '${framePath}'`) concatLines.push(`duration ${Math.max(durSeconds, 0.001).toFixed(6)}`) } diff --git a/scripts/check-docs.mjs b/scripts/check-docs.mjs index 5c564826..93414142 100644 --- a/scripts/check-docs.mjs +++ b/scripts/check-docs.mjs @@ -10,7 +10,9 @@ function walk(directory) { return [] } const path = join(directory, entry.name) - return entry.isDirectory() ? walk(path) : [path] + return entry.isDirectory() + ? walk(path) + : [path] }) } @@ -19,14 +21,27 @@ function addError(message) { } const markdown = walk(root).filter(path => extname(path).toLowerCase() === '.md') -const required = ['AGENTS.md', 'docs/SKILL.md', 'docs/skills/INDEX.md', 'docs/README.md'] +const required = [ + 'AGENTS.md', + 'docs/SKILL.md', + 'docs/skills/INDEX.md', + 'docs/README.md' +] for (const path of required) { if (!existsSync(join(root, path))) { addError(`missing required file: ${path}`) } } -const banned = ['IMPROVEMENTS.md', 'CHANGELOG.md', 'CHANGES.md', 'SESSION.md', 'NOTES.md', 'PLAN.md', 'TODO.md'] +const banned = [ + 'IMPROVEMENTS.md', + 'CHANGELOG.md', + 'CHANGES.md', + 'SESSION.md', + 'NOTES.md', + 'PLAN.md', + 'TODO.md' +] for (const path of banned) { if (existsSync(join(root, path))) { addError(`banned agent changelog or session file: ${path} (write learnings to docs/skills/ instead)`) @@ -100,7 +115,9 @@ for (const path of markdown) { addError(`${relativePath}: missing Verification section`) } - const links = [...source.matchAll(/\[[^\]]+\]\([^)]+\)/g)].map(([match]) => { + const links = [ + ...source.matchAll(/\[[^\]]+\]\([^)]+\)/g) + ].map(([match]) => { const start = match.lastIndexOf('](') + 2 return match.slice(start, -1) }) diff --git a/scripts/check-git-hygiene.mjs b/scripts/check-git-hygiene.mjs index b048bd63..12af4575 100644 --- a/scripts/check-git-hygiene.mjs +++ b/scripts/check-git-hygiene.mjs @@ -51,7 +51,9 @@ function abort(message) { /** The remote half of `BASE_REF`, or null when the base ref is a local branch. */ function baseRemote(baseRef) { const [remote, ...rest] = baseRef.split('/') - return rest.length > 0 ? remote : null + return rest.length > 0 + ? remote + : null } export function classifyWorktree({ branch, dirty, ahead, prState, prNumber, prUrl, detached, isBase }) { @@ -93,7 +95,11 @@ function parseWorktrees(text) { const fields = new Map() for (const line of record.split('\n')) { const space = line.indexOf(' ') - fields.set(space === -1 ? line : line.slice(0, space), space === -1 ? true : line.slice(space + 1)) + fields.set(space === -1 + ? line + : line.slice(0, space), space === -1 + ? true + : line.slice(space + 1)) } return { path: fields.get('worktree'), @@ -159,14 +165,28 @@ function pullRequestsByBranch(slug, cwd) { } function selfTest() { - const base = { branch: 'feat/x', dirty: false, ahead: 1, prState: null, prNumber: null, prUrl: null, detached: false, isBase: false } + const base = { + branch: 'feat/x', + dirty: false, + ahead: 1, + prState: null, + prNumber: null, + prUrl: null, + detached: false, + isBase: false + } assert.equal(classifyWorktree({ ...base, prState: 'OPEN', prNumber: 1 }).ok, true) assert.equal(classifyWorktree({ ...base, dirty: true, ahead: 0 }).ok, true) assert.equal(classifyWorktree({ ...base, ahead: 0 }).ok, false) assert.equal(classifyWorktree(base).ok, false) assert.equal(classifyWorktree({ ...base, prState: 'MERGED', prNumber: 1 }).ok, false) assert.equal(classifyWorktree({ ...base, detached: true, ahead: 0 }).ok, false) - assert.equal(classifyWorktree({ ...base, branch: 'main', ahead: 0, isBase: true }).ok, true) + assert.equal(classifyWorktree({ + ...base, + branch: 'main', + ahead: 0, + isBase: true + }).ok, true) console.info('git-hygiene self-test: pass') } @@ -197,7 +217,12 @@ function main() { const failures = [] const active = [] - const prune = git(['worktree', 'prune', '--dry-run', '--verbose'], cwd) + const prune = git([ + 'worktree', + 'prune', + '--dry-run', + '--verbose' + ], cwd) if (prune) { failures.push(`stale worktree metadata:\n${prune}`) } diff --git a/scripts/generate-social-cards.js b/scripts/generate-social-cards.js index 954a9ddd..70b5f28b 100644 --- a/scripts/generate-social-cards.js +++ b/scripts/generate-social-cards.js @@ -16,30 +16,198 @@ const WORDMARK_PATH = path.join(PUBLIC_DIR, 'brands/bluefin-wordmark.svg') * 12 months (01 through 12), Day and Night pairs. */ export const BLUEFIN_MONTHLY_WALLPAPERS = [ - { file: 'bluefin-01-day.webp', title: 'Bluefin 01 - January (Day)', month: 'January', monthIndex: 1, time: 'Day', category: 'monthly' }, - { file: 'bluefin-01-night.webp', title: 'Bluefin 01 - January (Night)', month: 'January', monthIndex: 1, time: 'Night', category: 'monthly' }, - { file: 'bluefin-02-day.webp', title: 'Bluefin 02 - February (Day)', month: 'February', monthIndex: 2, time: 'Day', category: 'monthly' }, - { file: 'bluefin-02-night.webp', title: 'Bluefin 02 - February (Night)', month: 'February', monthIndex: 2, time: 'Night', category: 'monthly' }, - { file: 'bluefin-03-day.webp', title: 'Bluefin 03 - March (Day)', month: 'March', monthIndex: 3, time: 'Day', category: 'monthly' }, - { file: 'bluefin-03-night.webp', title: 'Bluefin 03 - March (Night)', month: 'March', monthIndex: 3, time: 'Night', category: 'monthly' }, - { file: 'bluefin-04-day.webp', title: 'Bluefin 04 - April (Day)', month: 'April', monthIndex: 4, time: 'Day', category: 'monthly' }, - { file: 'bluefin-04-night.webp', title: 'Bluefin 04 - April (Night)', month: 'April', monthIndex: 4, time: 'Night', category: 'monthly' }, - { file: 'bluefin-05-day.webp', title: 'Bluefin 05 - May (Day)', month: 'May', monthIndex: 5, time: 'Day', category: 'monthly' }, - { file: 'bluefin-05-night.webp', title: 'Bluefin 05 - May (Night)', month: 'May', monthIndex: 5, time: 'Night', category: 'monthly' }, - { file: 'bluefin-06-day.webp', title: 'Bluefin 06 - June (Day)', month: 'June', monthIndex: 6, time: 'Day', category: 'monthly' }, - { file: 'bluefin-06-night.webp', title: 'Bluefin 06 - June (Night)', month: 'June', monthIndex: 6, time: 'Night', category: 'monthly' }, - { file: 'bluefin-07-day.webp', title: 'Bluefin 07 - July (Day)', month: 'July', monthIndex: 7, time: 'Day', category: 'monthly' }, - { file: 'bluefin-07-night.webp', title: 'Bluefin 07 - July (Night)', month: 'July', monthIndex: 7, time: 'Night', category: 'monthly' }, - { file: 'bluefin-08-day.webp', title: 'Bluefin 08 - August (Day)', month: 'August', monthIndex: 8, time: 'Day', category: 'monthly' }, - { file: 'bluefin-08-night.webp', title: 'Bluefin 08 - August (Night)', month: 'August', monthIndex: 8, time: 'Night', category: 'monthly' }, - { file: 'bluefin-09-day.webp', title: 'Bluefin 09 - September (Day)', month: 'September', monthIndex: 9, time: 'Day', category: 'monthly' }, - { file: 'bluefin-09-night.webp', title: 'Bluefin 09 - September (Night)', month: 'September', monthIndex: 9, time: 'Night', category: 'monthly' }, - { file: 'bluefin-10-day.webp', title: 'Bluefin 10 - October (Day)', month: 'October', monthIndex: 10, time: 'Day', category: 'monthly' }, - { file: 'bluefin-10-night.webp', title: 'Bluefin 10 - October (Night)', month: 'October', monthIndex: 10, time: 'Night', category: 'monthly' }, - { file: 'bluefin-11-day.webp', title: 'Bluefin 11 - November (Day)', month: 'November', monthIndex: 11, time: 'Day', category: 'monthly' }, - { file: 'bluefin-11-night.webp', title: 'Bluefin 11 - November (Night)', month: 'November', monthIndex: 11, time: 'Night', category: 'monthly' }, - { file: 'bluefin-12-day.webp', title: 'Bluefin 12 - December (Day)', month: 'December', monthIndex: 12, time: 'Day', category: 'monthly' }, - { file: 'bluefin-12-night.webp', title: 'Bluefin 12 - December (Night)', month: 'December', monthIndex: 12, time: 'Night', category: 'monthly' }, + { + file: 'bluefin-01-day.webp', + title: 'Bluefin 01 - January (Day)', + month: 'January', + monthIndex: 1, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-01-night.webp', + title: 'Bluefin 01 - January (Night)', + month: 'January', + monthIndex: 1, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-02-day.webp', + title: 'Bluefin 02 - February (Day)', + month: 'February', + monthIndex: 2, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-02-night.webp', + title: 'Bluefin 02 - February (Night)', + month: 'February', + monthIndex: 2, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-03-day.webp', + title: 'Bluefin 03 - March (Day)', + month: 'March', + monthIndex: 3, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-03-night.webp', + title: 'Bluefin 03 - March (Night)', + month: 'March', + monthIndex: 3, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-04-day.webp', + title: 'Bluefin 04 - April (Day)', + month: 'April', + monthIndex: 4, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-04-night.webp', + title: 'Bluefin 04 - April (Night)', + month: 'April', + monthIndex: 4, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-05-day.webp', + title: 'Bluefin 05 - May (Day)', + month: 'May', + monthIndex: 5, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-05-night.webp', + title: 'Bluefin 05 - May (Night)', + month: 'May', + monthIndex: 5, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-06-day.webp', + title: 'Bluefin 06 - June (Day)', + month: 'June', + monthIndex: 6, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-06-night.webp', + title: 'Bluefin 06 - June (Night)', + month: 'June', + monthIndex: 6, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-07-day.webp', + title: 'Bluefin 07 - July (Day)', + month: 'July', + monthIndex: 7, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-07-night.webp', + title: 'Bluefin 07 - July (Night)', + month: 'July', + monthIndex: 7, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-08-day.webp', + title: 'Bluefin 08 - August (Day)', + month: 'August', + monthIndex: 8, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-08-night.webp', + title: 'Bluefin 08 - August (Night)', + month: 'August', + monthIndex: 8, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-09-day.webp', + title: 'Bluefin 09 - September (Day)', + month: 'September', + monthIndex: 9, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-09-night.webp', + title: 'Bluefin 09 - September (Night)', + month: 'September', + monthIndex: 9, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-10-day.webp', + title: 'Bluefin 10 - October (Day)', + month: 'October', + monthIndex: 10, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-10-night.webp', + title: 'Bluefin 10 - October (Night)', + month: 'October', + monthIndex: 10, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-11-day.webp', + title: 'Bluefin 11 - November (Day)', + month: 'November', + monthIndex: 11, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-11-night.webp', + title: 'Bluefin 11 - November (Night)', + month: 'November', + monthIndex: 11, + time: 'Night', + category: 'monthly' + }, + { + file: 'bluefin-12-day.webp', + title: 'Bluefin 12 - December (Day)', + month: 'December', + monthIndex: 12, + time: 'Day', + category: 'monthly' + }, + { + file: 'bluefin-12-night.webp', + title: 'Bluefin 12 - December (Night)', + month: 'December', + monthIndex: 12, + time: 'Night', + category: 'monthly' + }, ] /** @@ -67,7 +235,10 @@ export const BLUEFIN_EXTRA_WALLPAPERS = [ * Returns the verified wallpaper pool, ensuring no Aurora or Xe assets exist. */ export function getAllowedWallpapers() { - const all = [...BLUEFIN_MONTHLY_WALLPAPERS, ...BLUEFIN_EXTRA_WALLPAPERS] + const all = [ + ...BLUEFIN_MONTHLY_WALLPAPERS, + ...BLUEFIN_EXTRA_WALLPAPERS + ] const excludedPattern = /aurora|xe_/i return all.filter(item => !excludedPattern.test(item.file)) } @@ -124,7 +295,13 @@ export function selectRandomWallpaper(pool = getAllowedWallpapers(), randomFn = */ export function convertPngToWebp(pngPath, webpPath, quality = 90) { try { - execFileSync('cwebp', ['-q', String(quality), pngPath, '-o', webpPath], { stdio: 'pipe' }) + execFileSync('cwebp', [ + '-q', + String(quality), + pngPath, + '-o', + webpPath + ], { stdio: 'pipe' }) return true } catch { @@ -239,7 +416,9 @@ if (process.argv[1] && path.resolve(process.argv[1]) === path.resolve(fileURLToP const wallpaperArgIdx = args.indexOf('--wallpaper') const monthArgIdx = args.indexOf('--month') const modeArgIdx = args.indexOf('--mode') - const mode = modeArgIdx !== -1 ? args[modeArgIdx + 1] : 'monthly' + const mode = modeArgIdx !== -1 + ? args[modeArgIdx + 1] + : 'monthly' let selectedWallpaper = null @@ -285,7 +464,11 @@ if (process.argv[1] && path.resolve(process.argv[1]) === path.resolve(fileURLToP console.info(` ✓ ${outName}`) } // Also write active rotating card to public/meta.webp - await generateSocialCard({ wallpaper: selectedWallpaper, outputPath: path.join(PUBLIC_DIR, 'meta.webp'), browser }) + await generateSocialCard({ + wallpaper: selectedWallpaper, + outputPath: path.join(PUBLIC_DIR, 'meta.webp'), + browser + }) console.info(`Selected ${selectedWallpaper.file} for public/meta.webp (${selectedWallpaper.title})`) } finally { diff --git a/scripts/generate-wallpapers.js b/scripts/generate-wallpapers.js index 3cc1e35c..d2815b08 100644 --- a/scripts/generate-wallpapers.js +++ b/scripts/generate-wallpapers.js @@ -339,7 +339,9 @@ async function generate() { name: stem, ...dayNightNames(stem, file, nightFile), title: formatTitle(stem), - ...(wideAspectStems.has(stem) ? { fit: 'cover' } : {}) + ...(wideAspectStems.has(stem) + ? { fit: 'cover' } + : {}) }) processedStory.add(file) processedStory.add(nightFile) @@ -355,7 +357,9 @@ async function generate() { name: stem, ...dayNightNames(stem, dayFile, file), title: formatTitle(stem), - ...(wideAspectStems.has(stem) ? { fit: 'cover' } : {}) + ...(wideAspectStems.has(stem) + ? { fit: 'cover' } + : {}) }) processedStory.add(dayFile) processedStory.add(file) @@ -369,8 +373,12 @@ async function generate() { type: 'single', name: `wolves/wolves/${file}`, title: formatTitle(base), - ...(description ? { description } : {}), - ...(wideAspectStems.has(base) ? { fit: 'cover' } : {}) + ...(description + ? { description } + : {}), + ...(wideAspectStems.has(base) + ? { fit: 'cover' } + : {}) }) processedStory.add(file) } @@ -393,8 +401,12 @@ async function generate() { type: 'single', name: `wolves/people/${file}`, title: formatTitle(base), - ...(description ? { description } : {}), - ...(titleOnlyTheaterCaptions.has(base) ? { theaterTitleOnly: true } : {}) + ...(description + ? { description } + : {}), + ...(titleOnlyTheaterCaptions.has(base) + ? { theaterTitleOnly: true } + : {}) }) } @@ -448,7 +460,9 @@ async function generate() { } const inner = entries .map(([key, v]) => { - const safeKey = IDENTIFIER_RE.test(key) ? key : `'${key.replace(/'/g, '\\\'')}'` + const safeKey = IDENTIFIER_RE.test(key) + ? key + : `'${key.replace(/'/g, '\\\'')}'` return `${indent} ${safeKey}: ${serializeValue(v, `${indent} `)}` }) .join(',\n') diff --git a/scripts/guardian-cards/capture-scenes.mjs b/scripts/guardian-cards/capture-scenes.mjs index aae0a73b..b033704b 100644 --- a/scripts/guardian-cards/capture-scenes.mjs +++ b/scripts/guardian-cards/capture-scenes.mjs @@ -18,7 +18,9 @@ import { chromium } from 'playwright' const here = path.dirname(fileURLToPath(import.meta.url)) const { characters } = JSON.parse(fs.readFileSync(path.join(here, 'characters.json'), 'utf8')) const only = process.argv.slice(2) -const selected = only.length ? characters.filter(character => only.includes(character.slug)) : characters +const selected = only.length + ? characters.filter(character => only.includes(character.slug)) + : characters fs.mkdirSync(path.join(here, 'scenes'), { recursive: true }) @@ -30,7 +32,9 @@ const server = http.createServer((req, res) => { await new Promise(resolve => server.listen(4175, resolve)) const browser = await chromium.launch() -const page = await browser.newPage({ viewport: { width: 1280, height: 720 } }) +const page = await browser.newPage({ + viewport: { width: 1280, height: 720 } +}) let currentVideo = '' for (const character of selected) { @@ -50,7 +54,12 @@ for (const character of selected) { // Crop to the letterboxed footage region inside the 16:9 player. await page.screenshot({ path: path.join(here, 'scenes', `${character.slug}.png`), - clip: { x: 0, y: 96, width: 1280, height: 530 }, + clip: { + x: 0, + y: 96, + width: 1280, + height: 530 + }, }) console.info(`captured scenes/${character.slug}.png at ~${character.sceneTime}s of ${character.videoId}`) } diff --git a/scripts/guardian-cards/generate.mjs b/scripts/guardian-cards/generate.mjs index af48a45c..8a7c8bda 100644 --- a/scripts/guardian-cards/generate.mjs +++ b/scripts/guardian-cards/generate.mjs @@ -19,12 +19,17 @@ const repo = path.resolve(here, '..', '..') const outDir = path.join(repo, 'public', 'wolves', 'characters') const { characters } = JSON.parse(fs.readFileSync(path.join(here, 'characters.json'), 'utf8')) const only = process.argv.slice(2) -const selected = only.length ? characters.filter(character => only.includes(character.slug)) : characters +const selected = only.length + ? characters.filter(character => only.includes(character.slug)) + : characters fs.mkdirSync(outDir, { recursive: true }) const browser = await chromium.launch() -const page = await browser.newPage({ viewport: { width: 1200, height: 630 }, deviceScaleFactor: 1 }) +const page = await browser.newPage({ + viewport: { width: 1200, height: 630 }, + deviceScaleFactor: 1 +}) for (const character of selected) { const scene = path.join(here, 'scenes', `${character.slug}.png`) @@ -56,7 +61,9 @@ for (const character of selected) { } await page.goto(`file://${here}/card.html?${params}`) await page.waitForLoadState('networkidle') - await page.screenshot({ path: path.join(outDir, `${character.slug}.png`) }) + await page.screenshot({ + path: path.join(outDir, `${character.slug}.png`) + }) const target = `https://youtu.be/${character.videoId}?t=${character.linkTime}` const heading = `${character.class} — ${character.name}` diff --git a/scripts/lib/bluefin-version-projection.js b/scripts/lib/bluefin-version-projection.js index 0e64f7f6..27a0a8f1 100644 --- a/scripts/lib/bluefin-version-projection.js +++ b/scripts/lib/bluefin-version-projection.js @@ -93,7 +93,9 @@ export function projectBluefinStreams(auditResult, checkedAt) { function normalizeVals(vals) { const out = {} for (const [k, v] of Object.entries(vals)) { - out[k] = k === 'base' ? v : normalizeUserVersion(v) + out[k] = k === 'base' + ? v + : normalizeUserVersion(v) } return out } diff --git a/scripts/lib/image-sbom-registry.js b/scripts/lib/image-sbom-registry.js index 56f55a95..227b3c95 100644 --- a/scripts/lib/image-sbom-registry.js +++ b/scripts/lib/image-sbom-registry.js @@ -26,7 +26,10 @@ function freezePackage(record) { function freezeRecord(record) { const packages = Object.fromEntries( - Object.entries(record.packages).map(([field, pkg]) => [field, freezePackage(Object.freeze({ ...pkg }))]), + Object.entries(record.packages).map(([field, pkg]) => [ + field, + freezePackage(Object.freeze({ ...pkg })) + ]), ) return Object.freeze({ @@ -120,16 +123,31 @@ export const IMAGE_SBOM_REGISTRY = Object.freeze([ // mesa-dri-drivers from rpm-db-cataloger is used as the representative // of the installed Mesa source build regardless of which ELF version // is higher. - mesa: { name: 'mesa-dri-drivers', type: 'rpm', foundBy: 'rpm-db-cataloger', required: false }, + mesa: { + name: 'mesa-dri-drivers', + type: 'rpm', + foundBy: 'rpm-db-cataloger', + required: false + }, // Same OSTree-retained-object ambiguity as mesa above: the ELF // cataloger reports systemd from both the live rootfs and older // objects retained in the OSTree repository, at distinct versions. // The RPM database is the authority on what is installed. - systemd: { name: 'systemd', type: 'rpm', foundBy: 'rpm-db-cataloger', required: false }, + systemd: { + name: 'systemd', + type: 'rpm', + foundBy: 'rpm-db-cataloger', + required: false + }, // The RPM database is the shipped-package authority; the ELF binary // cataloger reports the same build without its epoch, which reads as an // ambiguity. The projection strips the epoch for display. - podman: { name: 'podman', type: 'rpm', foundBy: 'rpm-db-cataloger', required: false }, + podman: { + name: 'podman', + type: 'rpm', + foundBy: 'rpm-db-cataloger', + required: false + }, pipewire: { name: 'pipewire', required: false }, flatpak: { name: 'flatpak', required: false }, }, diff --git a/scripts/lib/image-version-audit.js b/scripts/lib/image-version-audit.js index 1ea25d62..7d8dad06 100644 --- a/scripts/lib/image-version-audit.js +++ b/scripts/lib/image-version-audit.js @@ -8,7 +8,12 @@ import { EvidenceError } from './verified-image-sbom.js' * Fields that appear in a generated output block but are never derived from an * image SBOM, so their disappearance is not evidence loss. */ -const NON_SBOM_FIELDS = new Set(['status', 'checkedAt', 'sources', 'isos']) +const NON_SBOM_FIELDS = new Set([ + 'status', + 'checkedAt', + 'sources', + 'isos' +]) /** * Partition extraction results into required and optional ambiguity. @@ -133,7 +138,9 @@ export async function verifyRegistry(records, dependencies) { } if (extraction.missingRequired.length > 0 || ambiguousRequired.length > 0) { - const errorCode = extraction.missingRequired.length > 0 ? 'missing-required' : 'ambiguous-required' + const errorCode = extraction.missingRequired.length > 0 + ? 'missing-required' + : 'ambiguous-required' const detail = extraction.missingRequired.length > 0 ? `missing required fields: ${extraction.missingRequired.join(', ')}` : `ambiguous required fields: ${ambiguousRequired.join(', ')}` @@ -147,7 +154,9 @@ export async function verifyRegistry(records, dependencies) { } if (extraction.missingOptional.length > 0 || ambiguousOptional.length > 0) { - const errorCode = ambiguousOptional.length > 0 ? 'ambiguous-optional' : 'missing-optional' + const errorCode = ambiguousOptional.length > 0 + ? 'ambiguous-optional' + : 'missing-optional' const detail = ambiguousOptional.length > 0 ? `ambiguous optional fields: ${ambiguousOptional.join(', ')}` : `missing optional fields: ${extraction.missingOptional.join(', ')}` @@ -275,7 +284,10 @@ export function assertExplainedFieldLoss(options) { return } - const ignored = new Set([...NON_SBOM_FIELDS, ...ignore]) + const ignored = new Set([ + ...NON_SBOM_FIELDS, + ...ignore + ]) const removed = Object.keys(previous).filter(key => !ignored.has(key) && !(key in next)) if (removed.length === 0) { return @@ -390,7 +402,10 @@ export function writeOutputsAtomically(outputs, destinationRoot, options = {}) { fsImpl.mkdirSync(tmpFileDir, { recursive: true }) } fsImpl.writeFileSync(tmpPath, serialize(content), 'utf8') - staged.push({ tmpPath, finalPath: path.join(destinationRoot, filename) }) + staged.push({ + tmpPath, + finalPath: path.join(destinationRoot, filename) + }) } // Ensure final directories exist for (const { finalPath } of staged) { diff --git a/scripts/lib/oci-sbom.js b/scripts/lib/oci-sbom.js index ea4af116..55911d9a 100644 --- a/scripts/lib/oci-sbom.js +++ b/scripts/lib/oci-sbom.js @@ -105,6 +105,8 @@ export function compareVersions(a, b) { * @returns {string|undefined} */ export function spdxPackageVersion(sbom, name) { - const { values } = extractMappedVersions(sbom, { _field: { name } }) + const { values } = extractMappedVersions(sbom, { + _field: { name } + }) return values._field } diff --git a/scripts/lib/sbom-issue-report.js b/scripts/lib/sbom-issue-report.js index 7776ff03..1c7ceff7 100644 --- a/scripts/lib/sbom-issue-report.js +++ b/scripts/lib/sbom-issue-report.js @@ -151,7 +151,11 @@ export function buildSbomIssuePlan(audit, openIssues, options = {}) { plan.update.push({ number: existing.number, title, body }) } else { - plan.create.push({ title, body, labels: ['bug', 'automation'] }) + plan.create.push({ + title, + body, + labels: ['bug', 'automation'] + }) } } diff --git a/scripts/lib/sbom-issue-sync.js b/scripts/lib/sbom-issue-sync.js index dfe93af2..c18dfb30 100644 --- a/scripts/lib/sbom-issue-sync.js +++ b/scripts/lib/sbom-issue-sync.js @@ -62,7 +62,9 @@ export async function syncSbomIssues(deps) { const audit = JSON.parse(fsImpl.readFileSync(auditPath, 'utf8')) const openIssues = await listOpenAutomationIssues(github, context) - const plan = buildSbomIssuePlan(audit, openIssues, { workflowUrl: workflowRunUrl(context) }) + const plan = buildSbomIssuePlan(audit, openIssues, { + workflowUrl: workflowRunUrl(context) + }) for (const item of plan.create) { await github.rest.issues.create({ diff --git a/scripts/lib/spdx-version-extractor.js b/scripts/lib/spdx-version-extractor.js index 9dbf4307..43bb27fe 100644 --- a/scripts/lib/spdx-version-extractor.js +++ b/scripts/lib/spdx-version-extractor.js @@ -99,7 +99,9 @@ export function extractMappedVersions(sbom, mappings) { } // De-duplicate (identical versions from different build elements are safe) - const distinct = [...new Set(accepted)] + const distinct = [ + ...new Set(accepted) + ] if (distinct.length === 0) { if (mapping.required) { @@ -117,5 +119,11 @@ export function extractMappedVersions(sbom, mappings) { } } - return { values, missingRequired, missingOptional, ambiguous, rejected } + return { + values, + missingRequired, + missingOptional, + ambiguous, + rejected + } } diff --git a/scripts/lib/verified-image-sbom.js b/scripts/lib/verified-image-sbom.js index 083b0a2a..ee111ad6 100644 --- a/scripts/lib/verified-image-sbom.js +++ b/scripts/lib/verified-image-sbom.js @@ -37,7 +37,9 @@ export class ToolingError extends Error { /** Every text surface a child-process failure can hide its cause in. */ function failureText(err) { return [err?.message, err?.stderr, err?.stdout] - .map(part => (typeof part === 'string' ? part : (part?.toString?.() ?? ''))) + .map(part => (typeof part === 'string' + ? part + : (part?.toString?.() ?? ''))) .join('\n') } @@ -69,7 +71,13 @@ export function classifyToolFailure(err, tool) { if (TRANSPORT_PATTERN.test(text)) { return new ToolingError('transport', tool, `${tool} could not reach the registry: ${text}`) } - if (typeof err?.code === 'string' && ['EACCES', 'EIO', 'ENOSPC', 'EMFILE', 'ENOENT'].includes(err.code)) { + if (typeof err?.code === 'string' && [ + 'EACCES', + 'EIO', + 'ENOSPC', + 'EMFILE', + 'ENOENT' + ].includes(err.code)) { return new ToolingError('tool-io', tool, `${tool} failed with a local I/O error (${err.code}): ${text}`) } return null @@ -93,7 +101,12 @@ function describesAbsence(err) { */ export function resolveImageDigest(image, run = execFileSync) { try { - const result = JSON.parse(run('oras', ['manifest', 'fetch', '--descriptor', image], { encoding: 'utf8' })) + const result = JSON.parse(run('oras', [ + 'manifest', + 'fetch', + '--descriptor', + image + ], { encoding: 'utf8' })) const repository = image.replace(/[:@].*$/, '') return `${repository}@${result.digest}` } @@ -118,7 +131,12 @@ export function resolveImageDigest(image, run = execFileSync) { export function discoverReferrers(imageAtDigest, run = execFileSync) { let raw try { - raw = run('oras', ['discover', '--format', 'json', imageAtDigest], { encoding: 'utf8' }) + raw = run('oras', [ + 'discover', + '--format', + 'json', + imageAtDigest + ], { encoding: 'utf8' }) } catch (err) { const tooling = classifyToolFailure(err, 'oras') @@ -226,7 +244,12 @@ export function verifySbomSignature(repository, digest, policy, run = execFileSy export function pullSpdxReferrer(repository, digest, run = execFileSync, fsImpl = fs) { const outputDir = fsImpl.mkdtempSync(path.join(os.tmpdir(), 'website-sbom-')) try { - run('oras', ['pull', `${repository}@${digest}`, '--output', outputDir], { encoding: 'utf8' }) + run('oras', [ + 'pull', + `${repository}@${digest}`, + '--output', + outputDir + ], { encoding: 'utf8' }) const files = fsImpl.readdirSync(outputDir) const jsonFile = files.find(name => name.endsWith('.json')) if (!jsonFile) { diff --git a/scripts/test-baseline.mjs b/scripts/test-baseline.mjs index c382e9a1..6e014830 100644 --- a/scripts/test-baseline.mjs +++ b/scripts/test-baseline.mjs @@ -33,8 +33,15 @@ const reportPath = join(mkdtempSync(join(tmpdir(), 'wolves-baseline-')), 'vitest try { execFileSync( 'npx', - ['vitest', 'run', '--reporter=json', `--outputFile=${reportPath}`], - { stdio: ['ignore', 'ignore', 'inherit'] }, + [ + 'vitest', + 'run', + '--reporter=json', + `--outputFile=${reportPath}` + ], + { + stdio: ['ignore', 'ignore', 'inherit'] + }, ) } catch { diff --git a/scripts/tests/bluefin-version-projection.test.ts b/scripts/tests/bluefin-version-projection.test.ts index 310131c0..ca27907e 100644 --- a/scripts/tests/bluefin-version-projection.test.ts +++ b/scripts/tests/bluefin-version-projection.test.ts @@ -72,7 +72,10 @@ const LTS_NVIDIA = { describe('projectBluefinStreams', () => { it('stable values come from bluefin-stable with normalized versions', () => { const result = projectBluefinStreams( - { checkedAt: '2026-08-26T00:00:00Z', images: [STABLE_BASE] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [STABLE_BASE] + }, ) expect(result.stable.status).toBe('verified') expect(result.stable.kernel).toBe('7.0.12-201') @@ -82,19 +85,28 @@ describe('projectBluefinStreams', () => { it('stable nvidia comes only from bluefin-stable-nvidia, epoch stripped', () => { const withNvidia = projectBluefinStreams( - { checkedAt: '2026-08-26T00:00:00Z', images: [STABLE_BASE, STABLE_NVIDIA] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [STABLE_BASE, STABLE_NVIDIA] + }, ) expect(withNvidia.stable.nvidia).toBe('610.57.04-1') const withoutNvidia = projectBluefinStreams( - { checkedAt: '2026-08-26T00:00:00Z', images: [STABLE_BASE] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [STABLE_BASE] + }, ) expect(withoutNvidia.stable.nvidia).toBeUndefined() }) it('missing optional nvidia/hwe images omit those fields', () => { const result = projectBluefinStreams( - { checkedAt: '2026-08-26T00:00:00Z', images: [STABLE_BASE] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [STABLE_BASE] + }, ) expect(result.stable.nvidia).toBeUndefined() expect(result.stable.hwe).toBeUndefined() @@ -103,7 +115,10 @@ describe('projectBluefinStreams', () => { it('currently pending LTS SBOM returns status unavailable with no versions', () => { // When LTS images are not in the audit (pendingSbom skips them) const result = projectBluefinStreams( - { checkedAt: '2026-08-26T00:00:00Z', images: [STABLE_BASE] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [STABLE_BASE] + }, ) expect(result.lts.status).toBe('unavailable') expect(result.lts.kernel).toBeUndefined() @@ -114,7 +129,10 @@ describe('projectBluefinStreams', () => { it('no literal "unknown" appears in serialized YAML', () => { // Full result with some missing images const result = projectBluefinStreams( - { checkedAt: '2026-08-26T00:00:00Z', images: [STABLE_BASE, STABLE_NVIDIA] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [STABLE_BASE, STABLE_NVIDIA] + }, ) const yaml = dumpYaml(result) expect(yaml).not.toContain('unknown') @@ -122,7 +140,15 @@ describe('projectBluefinStreams', () => { it('lTS fields come from their respective images when verified', () => { const result = projectBluefinStreams( - { checkedAt: '2026-08-26T00:00:00Z', images: [STABLE_BASE, LTS_BASE, LTS_HWE, LTS_NVIDIA] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [ + STABLE_BASE, + LTS_BASE, + LTS_HWE, + LTS_NVIDIA + ] + }, ) expect(result.lts.status).toBe('verified') expect(result.lts.kernel).toBe('6.12.0-233') @@ -140,9 +166,12 @@ describe('projectBluefinStreams', () => { it('unavailable stable when bluefin-stable fails verification', () => { const result = projectBluefinStreams( - { checkedAt: '2026-08-26T00:00:00Z', images: [ - { ...STABLE_BASE, status: 'unavailable', values: undefined }, - ] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [ + { ...STABLE_BASE, status: 'unavailable', values: undefined }, + ] + }, ) expect(result.stable.status).toBe('unavailable') expect(result.stable.kernel).toBeUndefined() @@ -174,7 +203,10 @@ describe('yAML serialization', () => { it('full serialization with partial optional data contains no literal unknown', () => { // Stable verified with NVIDIA, LTS unavailable (partial data) const result = projectBluefinStreams( - { checkedAt: '2026-08-26T00:00:00Z', images: [STABLE_BASE, STABLE_NVIDIA] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [STABLE_BASE, STABLE_NVIDIA] + }, ) const yaml = dumpYaml(result) expect(yaml).not.toContain('unknown') @@ -196,7 +228,10 @@ describe('projectBluefinStreams — degraded evidence', () => { } delete degradedStable.values.mesa - const result = projectBluefinStreams({ checkedAt: '2026-08-26T00:00:00Z', images: [degradedStable] }) + const result = projectBluefinStreams({ + checkedAt: '2026-08-26T00:00:00Z', + images: [degradedStable] + }) expect(result.stable.status).toBe('verified') expect(result.stable.kernel).toBe('7.0.12-201') @@ -261,7 +296,10 @@ describe('projectBluefinStreams — degraded evidence', () => { values: { ...STABLE_BASE.values, podman: '5:5.8.4-1.fc44' }, } - const result = projectBluefinStreams({ checkedAt: '2026-08-26T00:00:00Z', images: [withPodman] }) + const result = projectBluefinStreams({ + checkedAt: '2026-08-26T00:00:00Z', + images: [withPodman] + }) expect(result.stable.podman).toBe('5.8.4-1') }) diff --git a/scripts/tests/check-docs.test.ts b/scripts/tests/check-docs.test.ts index d65b8a55..ff874577 100644 --- a/scripts/tests/check-docs.test.ts +++ b/scripts/tests/check-docs.test.ts @@ -79,7 +79,9 @@ function makeRepo(): string { function run(root: string): RunResult { try { - const stdout = execFileSync(process.execPath, [join(root, 'scripts', 'check-docs.mjs')], { + const stdout = execFileSync(process.execPath, [ + join(root, 'scripts', 'check-docs.mjs') + ], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], }) @@ -137,7 +139,15 @@ describe('check-docs gate: required and banned paths', () => { expect(result.stderr).toContain('missing required file: docs/README.md') }) - it.each(['IMPROVEMENTS.md', 'CHANGELOG.md', 'CHANGES.md', 'SESSION.md', 'NOTES.md', 'PLAN.md', 'TODO.md'])( + it.each([ + 'IMPROVEMENTS.md', + 'CHANGELOG.md', + 'CHANGES.md', + 'SESSION.md', + 'NOTES.md', + 'PLAN.md', + 'TODO.md' + ])( 'rejects the banned agent changelog %s', (banned) => { const root = makeRepo() @@ -273,7 +283,12 @@ describe('check-docs gate: link checking', () => { expect(result.status).toBe(0) }) - it.each(['https://example.com/x.md', 'http://example.com/x.md', 'mailto:hi@example.com', '#anchor'])( + it.each([ + 'https://example.com/x.md', + 'http://example.com/x.md', + 'mailto:hi@example.com', + '#anchor' + ])( 'skips the non-local link %s', (link) => { const root = makeRepo() diff --git a/scripts/tests/check-git-hygiene.test.ts b/scripts/tests/check-git-hygiene.test.ts index 661e5cf3..1be7d77b 100644 --- a/scripts/tests/check-git-hygiene.test.ts +++ b/scripts/tests/check-git-hygiene.test.ts @@ -62,7 +62,9 @@ function stubGh(root: string, { stdout = '[]', status = 0, stderr = '' } = {}) { `cat <<'GH_STUB_EOF'`, stdout, 'GH_STUB_EOF', - stderr ? `printf '%s\\n' ${JSON.stringify(stderr)} >&2` : '', + stderr + ? `printf '%s\\n' ${JSON.stringify(stderr)} >&2` + : '', `exit ${status}`, '', ].join('\n')) @@ -79,7 +81,9 @@ function runChecker(repository: string, { bin, args = [] as string[] } = {} as { // `main` is both the base ref and the branch the checker treats as the // base branch, so the fixture needs no second remote-tracking ref. GIT_HYGIENE_BASE: 'main', - PATH: bin ? `${bin}:${process.env.PATH}` : process.env.PATH, + PATH: bin + ? `${bin}:${process.env.PATH}` + : process.env.PATH, }, }) return { ...result, output: `${result.stdout}${result.stderr}` } @@ -102,7 +106,9 @@ function pullRequest(overrides: Record = {}) { describe('check-git-hygiene --self-test', () => { it('passes without touching git or gh', () => { const { repository } = createRepository() - const result = runChecker(repository, { args: ['--self-test'] }) + const result = runChecker(repository, { + args: ['--self-test'] + }) expect(result.status).toBe(0) expect(result.output).toContain('git-hygiene self-test: pass') @@ -112,7 +118,9 @@ describe('check-git-hygiene --self-test', () => { describe('check-git-hygiene', () => { it('passes on a checkout holding only the base branch', () => { const { root, repository } = createRepository() - const result = runChecker(repository, { bin: stubGh(root) }) + const result = runChecker(repository, { + bin: stubGh(root) + }) expect(result.output).toContain('Git hygiene: pass') expect(result.status).toBe(0) @@ -121,7 +129,9 @@ describe('check-git-hygiene', () => { it('reports local edits on the base branch as active work, not a failure', () => { const { root, repository } = createRepository() writeFileSync(join(repository, 'dirty.txt'), 'uncommitted\n') - const result = runChecker(repository, { bin: stubGh(root) }) + const result = runChecker(repository, { + bin: stubGh(root) + }) expect(result.output).toContain('base branch has local edits') expect(result.status).toBe(0) @@ -132,7 +142,9 @@ describe('check-git-hygiene', () => { git(repository, 'checkout', '--quiet', '-b', 'feat/x') commit(repository, 'work') git(repository, 'checkout', '--quiet', 'main') - const result = runChecker(repository, { bin: stubGh(root) }) + const result = runChecker(repository, { + bin: stubGh(root) + }) expect(result.output).toContain('local branch [feat/x]') expect(result.output).toContain('is 1 commit(s) ahead of main but has no open PR') @@ -142,7 +154,9 @@ describe('check-git-hygiene', () => { it('fails an unmounted clean branch with no commits and no PR', () => { const { root, repository } = createRepository() git(repository, 'branch', 'feat/x') - const result = runChecker(repository, { bin: stubGh(root) }) + const result = runChecker(repository, { + bin: stubGh(root) + }) expect(result.output).toContain('has no commits beyond main and no open PR') expect(result.status).toBe(1) @@ -153,7 +167,11 @@ describe('check-git-hygiene', () => { git(repository, 'checkout', '--quiet', '-b', 'feat/x') commit(repository, 'work') git(repository, 'checkout', '--quiet', 'main') - const bin = stubGh(root, { stdout: JSON.stringify([pullRequest()]) }) + const bin = stubGh(root, { + stdout: JSON.stringify([ + pullRequest() + ]) + }) const result = runChecker(repository, { bin }) expect(result.output).toContain('active PR #7 (https://github.com/projectbluefin/website/pull/7)') @@ -165,7 +183,11 @@ describe('check-git-hygiene', () => { git(repository, 'checkout', '--quiet', '-b', 'feat/x') commit(repository, 'work') git(repository, 'checkout', '--quiet', 'main') - const bin = stubGh(root, { stdout: JSON.stringify([pullRequest({ state })]) }) + const bin = stubGh(root, { + stdout: JSON.stringify([ + pullRequest({ state }) + ]) + }) const result = runChecker(repository, { bin }) expect(result.output).toContain(`PR #7 is ${state.toLowerCase()}`) @@ -179,7 +201,11 @@ describe('check-git-hygiene', () => { commit(repository, 'work') git(repository, 'checkout', '--quiet', 'main') const bin = stubGh(root, { - stdout: JSON.stringify([pullRequest({ headRepositoryOwner: { login: 'a-fork-owner' } })]), + stdout: JSON.stringify([ + pullRequest({ + headRepositoryOwner: { login: 'a-fork-owner' } + }) + ]), }) const result = runChecker(repository, { bin }) @@ -213,7 +239,9 @@ describe('check-git-hygiene', () => { git(repository, 'worktree', 'add', '--quiet', '-b', 'feat/dirty', dirty) writeFileSync(join(dirty, 'wip.txt'), 'in progress\n') git(repository, 'worktree', 'add', '--quiet', '--detach', detached) - const result = runChecker(repository, { bin: stubGh(root) }) + const result = runChecker(repository, { + bin: stubGh(root) + }) expect(result.output).toContain('dirty work in progress on a fresh branch') expect(result.output).toContain('clean detached worktree with no open PR') @@ -225,7 +253,9 @@ describe('check-git-hygiene', () => { const abandoned = join(root, 'abandoned-worktree') git(repository, 'worktree', 'add', '--quiet', '-b', 'feat/abandoned', abandoned) rmSync(abandoned, { force: true, recursive: true }) - const result = runChecker(repository, { bin: stubGh(root) }) + const result = runChecker(repository, { + bin: stubGh(root) + }) expect(result.output).toContain(`${abandoned}: marked prunable by git`) // The prunable record still claims the branch, so the local-branch sweep @@ -264,7 +294,9 @@ describe('check-git-hygiene', () => { it('rejects an upstream remote that is not a GitHub repository', () => { const { root, repository } = createRepository('https://git.example.invalid/projectbluefin/website.git') - const result = runChecker(repository, { bin: stubGh(root) }) + const result = runChecker(repository, { + bin: stubGh(root) + }) expect(result.output).toContain('cannot derive GitHub repository from upstream URL') expect(result.status).not.toBe(0) @@ -275,7 +307,9 @@ describe('check-git-hygiene', () => { ['https://github.com/projectbluefin/website'], ])('derives the repository slug from upstream URL %s', (url) => { const { root, repository } = createRepository(url) - const result = runChecker(repository, { bin: stubGh(root) }) + const result = runChecker(repository, { + bin: stubGh(root) + }) expect(result.output).not.toContain('cannot derive GitHub repository') expect(result.status).toBe(0) @@ -302,7 +336,9 @@ describe('check-git-hygiene', () => { it('names the missing remote when the base ref remote is not configured', () => { const { root, repository } = createRepository() git(repository, 'remote', 'remove', 'upstream') - const result = runChecker(repository, { bin: stubGh(root) }) + const result = runChecker(repository, { + bin: stubGh(root) + }) expect(result.status).toBe(2) expect(result.output).toContain('no git remote named "upstream"') diff --git a/scripts/tests/dakota-version-projection.test.ts b/scripts/tests/dakota-version-projection.test.ts index d7b5411a..23605941 100644 --- a/scripts/tests/dakota-version-projection.test.ts +++ b/scripts/tests/dakota-version-projection.test.ts @@ -11,7 +11,15 @@ const BASE_VERIFIED = { imageDigest: IMAGE_DIGEST, sbomDigest: SBOM_DIGEST, status: 'verified', - values: { kernel: '7.0.7', gnome: '50.2', mesa: '26.1.0', systemd: '260.2', pipewire: '1.6.1', flatpak: '1.16.6', bootc: '1.15.2' }, + values: { + kernel: '7.0.7', + gnome: '50.2', + mesa: '26.1.0', + systemd: '260.2', + pipewire: '1.6.1', + flatpak: '1.16.6', + bootc: '1.15.2' + }, } const NVIDIA_VERIFIED = { @@ -41,7 +49,10 @@ const METADATA = { describe('projectDakotaVersions', () => { it('base fields come only from dakota', () => { const result = projectDakotaVersions( - { checkedAt: '2026-08-26T00:00:00Z', images: [BASE_VERIFIED] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [BASE_VERIFIED] + }, METADATA, ) expect(result.status).toBe('verified') @@ -51,13 +62,19 @@ describe('projectDakotaVersions', () => { it('nVIDIA comes only from dakota-nvidia', () => { const result = projectDakotaVersions( - { checkedAt: '2026-08-26T00:00:00Z', images: [BASE_VERIFIED, NVIDIA_VERIFIED] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [BASE_VERIFIED, NVIDIA_VERIFIED] + }, METADATA, ) expect(result.packages.nvidia).toBe('595.71.05') // nvidia does NOT appear from base const baseOnly = projectDakotaVersions( - { checkedAt: '2026-08-26T00:00:00Z', images: [BASE_VERIFIED] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [BASE_VERIFIED] + }, METADATA, ) expect(baseOnly.packages.nvidia).toBeUndefined() @@ -65,7 +82,10 @@ describe('projectDakotaVersions', () => { it('oGC appears only from verified dakota-gaming', () => { const result = projectDakotaVersions( - { checkedAt: '2026-08-26T00:00:00Z', images: [BASE_VERIFIED, GAMING_VERIFIED] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [BASE_VERIFIED, GAMING_VERIFIED] + }, METADATA, ) expect(result.packages['ogc-kernel']).toBe('7.1.8-ogc1') @@ -73,7 +93,10 @@ describe('projectDakotaVersions', () => { it('missing gaming SBOM omits OGC without affecting base Dakota', () => { const result = projectDakotaVersions( - { checkedAt: '2026-08-26T00:00:00Z', images: [BASE_VERIFIED, NVIDIA_VERIFIED] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [BASE_VERIFIED, NVIDIA_VERIFIED] + }, METADATA, ) expect(result.status).toBe('verified') @@ -85,7 +108,10 @@ describe('projectDakotaVersions', () => { it('required base failure returns status unavailable and packages {}', () => { const failedBase = { ...BASE_VERIFIED, status: 'unavailable', values: undefined } const result = projectDakotaVersions( - { checkedAt: '2026-08-26T00:00:00Z', images: [failedBase, NVIDIA_VERIFIED] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [failedBase, NVIDIA_VERIFIED] + }, METADATA, ) expect(result.status).toBe('unavailable') @@ -94,8 +120,16 @@ describe('projectDakotaVersions', () => { it('baseline metadata survives projection and no isos are emitted', () => { const result = projectDakotaVersions( - { checkedAt: '2026-08-26T00:00:00Z', images: [BASE_VERIFIED] }, - { ...METADATA, isos: [{ label: 'Download ISO', filename: 'dakota-live-alpha5.iso' }] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [BASE_VERIFIED] + }, + { + ...METADATA, + isos: [ + { label: 'Download ISO', filename: 'dakota-live-alpha5.iso' } + ] + }, ) expect(result).not.toHaveProperty('isos') expect(result.packages.baseline).toBe('x86-64-v3') @@ -104,7 +138,10 @@ describe('projectDakotaVersions', () => { it('stale freedesktop-sdk, Homebrew, and OGC values do not survive', () => { // These are NOT in any verified image values, so they must not appear const result = projectDakotaVersions( - { checkedAt: '2026-08-26T00:00:00Z', images: [BASE_VERIFIED, NVIDIA_VERIFIED] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [BASE_VERIFIED, NVIDIA_VERIFIED] + }, METADATA, ) expect(result.packages['freedesktop-sdk']).toBeUndefined() @@ -114,7 +151,10 @@ describe('projectDakotaVersions', () => { it('collects sources from all verified dakota images', () => { const result = projectDakotaVersions( - { checkedAt: '2026-08-26T00:00:00Z', images: [BASE_VERIFIED, NVIDIA_VERIFIED] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [BASE_VERIFIED, NVIDIA_VERIFIED] + }, METADATA, ) expect(result.sources).toHaveLength(2) @@ -124,7 +164,10 @@ describe('projectDakotaVersions', () => { it('uses provided checkedAt override', () => { const result = projectDakotaVersions( - { checkedAt: '2026-08-26T00:00:00Z', images: [BASE_VERIFIED] }, + { + checkedAt: '2026-08-26T00:00:00Z', + images: [BASE_VERIFIED] + }, METADATA, '2026-08-27T12:00:00Z', ) @@ -144,10 +187,18 @@ describe('projectDakotaVersions — degraded evidence', () => { status: 'degraded', errorCode: 'missing-optional', missingOptional: ['bootc'], - values: { kernel: '7.0.7', gnome: '50.2', mesa: '26.0.6', systemd: '260.2' }, + values: { + kernel: '7.0.7', + gnome: '50.2', + mesa: '26.0.6', + systemd: '260.2' + }, } - const result = projectDakotaVersions({ checkedAt: '2026-08-26T00:00:00Z', images: [degraded] }) + const result = projectDakotaVersions({ + checkedAt: '2026-08-26T00:00:00Z', + images: [degraded] + }) expect(result.status).toBe('verified') expect(result.packages.mesa).toBe('26.0.6') @@ -179,7 +230,10 @@ describe('projectDakotaVersions — degraded evidence', () => { values: { nvidia: '595.71.05' }, } - const result = projectDakotaVersions({ checkedAt: '2026-08-26T00:00:00Z', images: [base, unavailableNvidia] }) + const result = projectDakotaVersions({ + checkedAt: '2026-08-26T00:00:00Z', + images: [base, unavailableNvidia] + }) expect(result.packages).not.toHaveProperty('nvidia') expect(result.sources.map(s => s.id)).toEqual(['dakota']) diff --git a/scripts/tests/fixtures/github-script-runner.mjs b/scripts/tests/fixtures/github-script-runner.mjs index 8ab4e0fc..d60c7a70 100644 --- a/scripts/tests/fixtures/github-script-runner.mjs +++ b/scripts/tests/fixtures/github-script-runner.mjs @@ -28,7 +28,9 @@ const github = { listForRepo: async () => ({ data: openIssues }), create: async (params) => { created.push(params) - return { data: { number: 1 } } + return { + data: { number: 1 } + } }, update: async (params) => { updated.push(params) @@ -41,10 +43,16 @@ const github = { const context = { repo: { owner: 'projectbluefin', repo: 'website' }, runId: 987654321, - payload: { repository: { html_url: 'https://github.com/projectbluefin/website' } }, + payload: { + repository: { html_url: 'https://github.com/projectbluefin/website' } + }, } -const core = { info: () => {}, warning: () => {}, setFailed: () => {} } +const core = { + info: () => {}, + warning: () => {}, + setFailed: () => {} +} const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor const run = new AsyncFunction('github', 'context', 'core', 'require', process.env.GH_SCRIPT_BODY) diff --git a/scripts/tests/generate-social-card-render.test.ts b/scripts/tests/generate-social-card-render.test.ts index 1b86df1f..38424001 100644 --- a/scripts/tests/generate-social-card-render.test.ts +++ b/scripts/tests/generate-social-card-render.test.ts @@ -124,10 +124,18 @@ describe('generateSocialCard render path', () => { const wallpaper = BLUEFIN_MONTHLY_WALLPAPERS[0] const outputPath = path.join(workDir, 'nested/dir/card.webp') - const result = await generateSocialCard({ wallpaper, outputPath, deviceScaleFactor: 3, browser }) + const result = await generateSocialCard({ + wallpaper, + outputPath, + deviceScaleFactor: 3, + browser + }) expect(result).toBe(outputPath) - expect(browser.newPage).toHaveBeenCalledWith({ viewport: { width: 1200, height: 630 }, deviceScaleFactor: 3 }) + expect(browser.newPage).toHaveBeenCalledWith({ + viewport: { width: 1200, height: 630 }, + deviceScaleFactor: 3 + }) const [html, opts] = page.setContent.mock.calls[0] expect(opts).toEqual({ waitUntil: 'networkidle' }) diff --git a/scripts/tests/generate-wallpapers.test.ts b/scripts/tests/generate-wallpapers.test.ts index 72db8feb..c711809e 100644 --- a/scripts/tests/generate-wallpapers.test.ts +++ b/scripts/tests/generate-wallpapers.test.ts @@ -48,7 +48,9 @@ function scratchRoot(tree: Tree) { function run(tree: Tree) { const root = scratchRoot(tree) - const output = execFileSync(process.execPath, [join(root, 'scripts/generate-wallpapers.js')], { + const output = execFileSync(process.execPath, [ + join(root, 'scripts/generate-wallpapers.js') + ], { cwd: root, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], @@ -146,7 +148,9 @@ describe('generate-wallpapers.js', () => { expect(wallpapers).toEqual([ expect.objectContaining({ type: 'daynight', name: 'bluefin-duality', fit: 'cover' }), - expect.not.objectContaining({ fit: expect.anything() }), + expect.not.objectContaining({ + fit: expect.anything() + }), expect.objectContaining({ type: 'single', name: 'wolves/wolves/bluefin-huntress.webp', fit: 'cover' }), ]) expect(wallpapers[1].name).toBe('wolves/wolves/bluefin-dusk.webp') @@ -287,7 +291,9 @@ describe('generate-wallpapers.js', () => { }) it('groups whichever of the three exist, and leaves a lone one where it sorted', () => { - const pair = run({ wolves: images('a.webp', 'bluefin-huntress.webp', 'bluefin-k.webp', 'bluefin-lazy-days.webp') }) + const pair = run({ + wolves: images('a.webp', 'bluefin-huntress.webp', 'bluefin-k.webp', 'bluefin-lazy-days.webp') + }) expect(pair.wallpapers.map(w => w.name)).toEqual([ 'wolves/wolves/a.webp', 'wolves/wolves/bluefin-huntress.webp', @@ -295,7 +301,9 @@ describe('generate-wallpapers.js', () => { 'wolves/wolves/bluefin-k.webp', ]) - const lone = run({ wolves: images('a.webp', 'bluefin-huntress.webp', 'm.webp', 'z-bluefin-lazy-days.webp') }) + const lone = run({ + wolves: images('a.webp', 'bluefin-huntress.webp', 'm.webp', 'z-bluefin-lazy-days.webp') + }) expect(lone.wallpapers.map(w => w.name)).toEqual([ 'wolves/wolves/a.webp', 'wolves/wolves/bluefin-huntress.webp', @@ -305,7 +313,9 @@ describe('generate-wallpapers.js', () => { }) it('escapes quotes and backslashes in titles so the module still parses', () => { - const { wallpapers, source } = run({ showcase: images(`o'brien\\desk.webp`) }) + const { wallpapers, source } = run({ + showcase: images(`o'brien\\desk.webp`) + }) expect(wallpapers).toEqual([ { type: 'single', name: `wolves/showcase/o'brien\\desk.webp`, title: `O'brien\\desk` }, @@ -324,13 +334,17 @@ describe('generate-wallpapers.js', () => { }) it('exits 1 when the output file cannot be written', () => { - const root = scratchRoot({ showcase: images('a.webp') }) + const root = scratchRoot({ + showcase: images('a.webp') + }) rmSync(join(root, 'src'), { recursive: true }) let status: number | null = 0 let stderr = '' try { - execFileSync(process.execPath, [join(root, 'scripts/generate-wallpapers.js')], { cwd: root, stdio: 'pipe' }) + execFileSync(process.execPath, [ + join(root, 'scripts/generate-wallpapers.js') + ], { cwd: root, stdio: 'pipe' }) } catch (error) { const failure = error as { status: number | null, stderr: string } diff --git a/scripts/tests/oci-sbom-pull.test.ts b/scripts/tests/oci-sbom-pull.test.ts index 781ea610..1197d878 100644 --- a/scripts/tests/oci-sbom-pull.test.ts +++ b/scripts/tests/oci-sbom-pull.test.ts @@ -33,12 +33,16 @@ describe('discoverSbomDigest', () => { }) it('returns the digest of the SPDX referrer', () => { - mockedExec.mockReturnValue(discovery([{ artifactType: SBOM_ARTIFACT_TYPE, digest: DIGEST }]) as never) + mockedExec.mockReturnValue(discovery([ + { artifactType: SBOM_ARTIFACT_TYPE, digest: DIGEST } + ]) as never) expect(discoverSbomDigest('ghcr.io/projectbluefin/bluefin:stable')).toBe(DIGEST) }) it('queries oras discover with the SPDX artifact type and JSON format', () => { - mockedExec.mockReturnValue(discovery([{ artifactType: SBOM_ARTIFACT_TYPE, digest: DIGEST }]) as never) + mockedExec.mockReturnValue(discovery([ + { artifactType: SBOM_ARTIFACT_TYPE, digest: DIGEST } + ]) as never) discoverSbomDigest('ghcr.io/projectbluefin/bluefin:stable') const [bin, args] = mockedExec.mock.calls[0] as unknown as [string, string[]] @@ -75,7 +79,9 @@ describe('discoverSbomDigest', () => { }) it('throws when the SPDX referrer carries no digest', () => { - mockedExec.mockReturnValue(discovery([{ artifactType: SBOM_ARTIFACT_TYPE }]) as never) + mockedExec.mockReturnValue(discovery([ + { artifactType: SBOM_ARTIFACT_TYPE } + ]) as never) expect(() => discoverSbomDigest('img')).toThrow(/no attached SPDX SBOM/) }) }) @@ -93,7 +99,9 @@ describe('pullImageSbom', () => { const seen: string[] = [] mockedExec.mockImplementation(((_bin: string, args: string[]) => { if (args[0] === 'discover') { - return discovery([{ artifactType: SBOM_ARTIFACT_TYPE, digest: DIGEST }]) + return discovery([ + { artifactType: SBOM_ARTIFACT_TYPE, digest: DIGEST } + ]) } const dir = outputDirOf(args) seen.push(dir) @@ -106,7 +114,9 @@ describe('pullImageSbom', () => { } it('returns the parsed SPDX document from the pulled referrer', () => { - stubOras({ 'sbom.spdx.json': JSON.stringify({ spdxVersion: 'SPDX-2.3', packages: [] }) }) + stubOras({ + 'sbom.spdx.json': JSON.stringify({ spdxVersion: 'SPDX-2.3', packages: [] }) + }) expect(pullImageSbom('ghcr.io/projectbluefin/bluefin:stable')) .toEqual({ spdxVersion: 'SPDX-2.3', packages: [] }) }) @@ -154,7 +164,9 @@ describe('pullImageSbom', () => { const seen: string[] = [] mockedExec.mockImplementation(((_bin: string, args: string[]) => { if (args[0] === 'discover') { - return discovery([{ artifactType: SBOM_ARTIFACT_TYPE, digest: DIGEST }]) + return discovery([ + { artifactType: SBOM_ARTIFACT_TYPE, digest: DIGEST } + ]) } seen.push(outputDirOf(args)) throw new Error('oras pull failed') diff --git a/scripts/tests/sbom-issue-report.test.ts b/scripts/tests/sbom-issue-report.test.ts index fadb0075..7c91d663 100644 --- a/scripts/tests/sbom-issue-report.test.ts +++ b/scripts/tests/sbom-issue-report.test.ts @@ -124,7 +124,11 @@ describe('buildSbomIssuePlan', () => { it('updates an existing issue when the same failure recurs', () => { const audit = makeAudit([MISSING_SBOM_IMAGE]) const openIssues = [ - { number: 42, title: plan_title_for(MISSING_SBOM_IMAGE), state: 'open' }, + { + number: 42, + title: plan_title_for(MISSING_SBOM_IMAGE), + state: 'open' + }, ] const plan = buildSbomIssuePlan(audit, openIssues) @@ -138,7 +142,11 @@ describe('buildSbomIssuePlan', () => { it('closes an issue when the failure has recovered', () => { const audit = makeAudit([VERIFIED_IMAGE]) const openIssues = [ - { number: 42, title: plan_title_for(MISSING_SBOM_IMAGE), state: 'open' }, + { + number: 42, + title: plan_title_for(MISSING_SBOM_IMAGE), + state: 'open' + }, ] const plan = buildSbomIssuePlan(audit, openIssues) @@ -224,7 +232,11 @@ describe('buildSbomIssuePlan', () => { it('creates for new failures while closing recovered ones', () => { const audit = makeAudit([EVIDENCE_ERROR_IMAGE]) const openIssues = [ - { number: 42, title: plan_title_for(MISSING_SBOM_IMAGE), state: 'open' }, + { + number: 42, + title: plan_title_for(MISSING_SBOM_IMAGE), + state: 'open' + }, ] const plan = buildSbomIssuePlan(audit, openIssues) @@ -268,13 +280,16 @@ describe('buildSbomIssuePlan — exact error codes, degraded entries, and eviden }) it('separates two failure codes for the same product into two issues', () => { - const plan = buildSbomIssuePlan(makeAudit([MISSING_SBOM_IMAGE, { - ...MISSING_SBOM_IMAGE, - id: 'bluefin-lts', - errorCode: 'missing-sbom', - missingRequired: undefined, - error: 'no sbom', - }]), []) + const plan = buildSbomIssuePlan(makeAudit([ + MISSING_SBOM_IMAGE, + { + ...MISSING_SBOM_IMAGE, + id: 'bluefin-lts', + errorCode: 'missing-sbom', + missingRequired: undefined, + error: 'no sbom', + } + ]), []) expect(plan.create.map(i => i.title).sort()).toEqual([ '[SBOM verification] bluefin: missing-required', '[SBOM verification] bluefin: missing-sbom', @@ -290,14 +305,18 @@ describe('buildSbomIssuePlan — exact error codes, degraded entries, and eviden }) it('does not close a degraded image issue', () => { - const openIssues = [{ number: 7, title: '[SBOM verification] bluefin: ambiguous-optional', state: 'open' }] + const openIssues = [ + { number: 7, title: '[SBOM verification] bluefin: ambiguous-optional', state: 'open' } + ] const plan = buildSbomIssuePlan(makeAudit([DEGRADED_IMAGE]), openIssues) expect(plan.close).toHaveLength(0) expect(plan.update.map(u => u.number)).toEqual([7]) }) it('keeps a pending-mapping issue open rather than closing it', () => { - const openIssues = [{ number: 8, title: '[SBOM verification] dakota: pending-mapping', state: 'open' }] + const openIssues = [ + { number: 8, title: '[SBOM verification] dakota: pending-mapping', state: 'open' } + ] const plan = buildSbomIssuePlan(makeAudit([PENDING_IMAGE]), openIssues) expect(plan.close).toHaveLength(0) expect(plan.update.map(u => u.number)).toEqual([8]) @@ -342,7 +361,9 @@ describe('buildSbomIssuePlan — exact error codes, degraded entries, and eviden }) it('still alerts on a genuine missing-sbom for a mapped (non-pending) image', () => { - const plan = buildSbomIssuePlan(makeAudit([{ ...PENDING_MISSING_SBOM_BLUEFIN, pending: false }]), []) + const plan = buildSbomIssuePlan(makeAudit([ + { ...PENDING_MISSING_SBOM_BLUEFIN, pending: false } + ]), []) expect(plan.create).toHaveLength(1) expect(plan.create[0].title).toBe('[SBOM verification] bluefin: missing-sbom') }) diff --git a/scripts/tests/sbom-issue-sync.test.ts b/scripts/tests/sbom-issue-sync.test.ts index d426b9ba..2b80ec57 100644 --- a/scripts/tests/sbom-issue-sync.test.ts +++ b/scripts/tests/sbom-issue-sync.test.ts @@ -10,7 +10,9 @@ import { const CONTEXT = { repo: { owner: 'projectbluefin', repo: 'website' }, runId: 1234567890, - payload: { repository: { html_url: 'https://github.com/projectbluefin/website' } }, + payload: { + repository: { html_url: 'https://github.com/projectbluefin/website' } + }, } const AUDIT = { @@ -63,14 +65,18 @@ function makeGithub(openIssues: Array<{ number: number, title: string, state: st rest: { issues: { listForRepo, - create: vi.fn(async () => ({ data: { number: 999 } })), + create: vi.fn(async () => ({ + data: { number: 999 } + })), update: vi.fn(async () => ({ data: {} })), }, }, } } -const fsStub = { readFileSync: () => JSON.stringify(AUDIT) } +const fsStub = { + readFileSync: () => JSON.stringify(AUDIT) +} describe('workflowRunUrl', () => { it('builds the run URL from the repository payload', () => { @@ -78,7 +84,11 @@ describe('workflowRunUrl', () => { }) it('falls back to owner/repo when the payload has no repository', () => { - expect(workflowRunUrl({ repo: { owner: 'a', repo: 'b' }, runId: 7, payload: {} })) + expect(workflowRunUrl({ + repo: { owner: 'a', repo: 'b' }, + runId: 7, + payload: {} + })) .toBe('https://github.com/a/b/actions/runs/7') }) }) @@ -155,7 +165,12 @@ describe('syncSbomIssues', () => { const github = makeGithub([]) const readFileSync = vi.fn(() => JSON.stringify({ checkedAt: 'x', images: [] })) - await syncSbomIssues({ github, context: CONTEXT, auditPath: '/somewhere/sbom-audit.json', fs: { readFileSync } }) + await syncSbomIssues({ + github, + context: CONTEXT, + auditPath: '/somewhere/sbom-audit.json', + fs: { readFileSync } + }) expect(readFileSync).toHaveBeenCalledWith('/somewhere/sbom-audit.json', 'utf8') }) @@ -175,7 +190,9 @@ describe('syncWorkflowFailureIssue', () => { }) it('updates the existing failure issue instead of opening a duplicate', async () => { - const github = makeGithub([{ number: 77, title: FAILURE_ISSUE_TITLE, state: 'open' }]) + const github = makeGithub([ + { number: 77, title: FAILURE_ISSUE_TITLE, state: 'open' } + ]) const result = await syncWorkflowFailureIssue({ github, context: CONTEXT }) expect(result).toMatchObject({ action: 'updated', number: 77 }) @@ -186,7 +203,10 @@ describe('syncWorkflowFailureIssue', () => { it('finds the existing failure issue past the first page', async () => { const filler = Array.from({ length: 100 }, (_, i) => ({ number: i + 1, title: `noise ${i + 1}`, state: 'open' })) - const github = makeGithub([...filler, { number: 300, title: FAILURE_ISSUE_TITLE, state: 'open' }]) + const github = makeGithub([ + ...filler, + { number: 300, title: FAILURE_ISSUE_TITLE, state: 'open' } + ]) const result = await syncWorkflowFailureIssue({ github, context: CONTEXT }) diff --git a/scripts/tests/spdx-version-extractor.test.ts b/scripts/tests/spdx-version-extractor.test.ts index 0f63aa49..08146451 100644 --- a/scripts/tests/spdx-version-extractor.test.ts +++ b/scripts/tests/spdx-version-extractor.test.ts @@ -102,11 +102,25 @@ describe('extractMappedVersions', () => { it('skips duplicate evidence entries (same version, different elements)', () => { const sbom = { packages: [ - { name: 'foo', versionInfo: '1.2.3', externalRefs: [{ referenceType: 'bst-element', referenceLocator: 'a/foo.bst' }] }, - { name: 'foo', versionInfo: '1.2.3', externalRefs: [{ referenceType: 'bst-element', referenceLocator: 'b/foo.bst' }] }, + { + name: 'foo', + versionInfo: '1.2.3', + externalRefs: [ + { referenceType: 'bst-element', referenceLocator: 'a/foo.bst' } + ] + }, + { + name: 'foo', + versionInfo: '1.2.3', + externalRefs: [ + { referenceType: 'bst-element', referenceLocator: 'b/foo.bst' } + ] + }, ], } - const result = extractMappedVersions(sbom, { foo: { name: 'foo' } }) + const result = extractMappedVersions(sbom, { + foo: { name: 'foo' } + }) expect(result.values.foo).toBe('1.2.3') expect(result.ambiguous).toHaveLength(0) }) @@ -117,7 +131,9 @@ describe('extractMappedVersions', () => { { name: 'linux', versionInfo: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' }, ], } - const result = extractMappedVersions(sbom, { kernel: { name: 'linux', required: true } }) + const result = extractMappedVersions(sbom, { + kernel: { name: 'linux', required: true } + }) expect(result.missingRequired).toContain('kernel') expect(result.rejected.some(r => r.field === 'kernel')).toBe(true) }) @@ -128,7 +144,9 @@ describe('extractMappedVersions', () => { { name: 'kernel-core', versionInfo: '7.1.6-201.fc44', version: '7.1.6' }, ], } - const result = extractMappedVersions(sbom, { kernel: { name: 'kernel-core' } }) + const result = extractMappedVersions(sbom, { + kernel: { name: 'kernel-core' } + }) expect(result.values.kernel).toBe('7.1.6-201.fc44') }) @@ -138,7 +156,9 @@ describe('extractMappedVersions', () => { { name: 'kernel-core', version: '7.1.6-201.fc44' }, ], } - const result = extractMappedVersions(sbom, { kernel: { name: 'kernel-core' } }) + const result = extractMappedVersions(sbom, { + kernel: { name: 'kernel-core' } + }) expect(result.values.kernel).toBe('7.1.6-201.fc44') }) diff --git a/scripts/tests/test-baseline.test.ts b/scripts/tests/test-baseline.test.ts index 1b3bd4b6..a49136dc 100644 --- a/scripts/tests/test-baseline.test.ts +++ b/scripts/tests/test-baseline.test.ts @@ -79,7 +79,10 @@ function report(root: string, files: Array<{ name: string, assertions: Array<[st function run(root: string, options: { report?: string, args?: string[], vitestRc?: number } = {}): RunResult { const result = execFileSync( process.execPath, - [join(root, 'scripts', 'test-baseline.mjs'), ...(options.args ?? [])], + [ + join(root, 'scripts', 'test-baseline.mjs'), + ...(options.args ?? []) + ], { cwd: root, encoding: 'utf8', @@ -133,7 +136,14 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { const root = makeRepo() const { status, stderr } = runGate(root, { - report: report(root, [{ name: 'src/tests/a.test.ts', assertions: [['failed', 'a fails']] }]), + report: report(root, [ + { + name: 'src/tests/a.test.ts', + assertions: [ + ['failed', 'a fails'] + ] + } + ]), }) expect(status).toBe(2) @@ -146,8 +156,19 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { const { status, stdout } = runGate(root, { args: ['--update'], report: report(root, [ - { name: 'src/tests/z.test.ts', assertions: [['failed', 'z fails']] }, - { name: 'src/tests/a.test.ts', assertions: [['failed', 'a fails'], ['passed', 'a passes']] }, + { + name: 'src/tests/z.test.ts', + assertions: [ + ['failed', 'z fails'] + ] + }, + { + name: 'src/tests/a.test.ts', + assertions: [ + ['failed', 'a fails'], + ['passed', 'a passes'] + ] + }, ]), }) @@ -164,7 +185,14 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { const { status, stdout } = runGate(root, { args: ['--update'], vitestRc: 0, - report: report(root, [{ name: 'src/tests/a.test.ts', assertions: [['passed', 'a passes']] }]), + report: report(root, [ + { + name: 'src/tests/a.test.ts', + assertions: [ + ['passed', 'a passes'] + ] + } + ]), }) expect(status).toBe(0) @@ -178,7 +206,14 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { const { status } = runGate(root, { args: ['--update'], - report: report(root, [{ name: 'src/tests/a.test.ts', assertions: [['failed', 'a fails']] }]), + report: report(root, [ + { + name: 'src/tests/a.test.ts', + assertions: [ + ['failed', 'a fails'] + ] + } + ]), }) expect(status).toBe(0) @@ -190,7 +225,14 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { writeBaseline(root, 'src/tests/a.test.ts :: a fails\n') const { status, stdout } = runGate(root, { - report: report(root, [{ name: 'src/tests/a.test.ts', assertions: [['failed', 'a fails']] }]), + report: report(root, [ + { + name: 'src/tests/a.test.ts', + assertions: [ + ['failed', 'a fails'] + ] + } + ]), }) expect(status).toBe(0) @@ -203,8 +245,18 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { const { status, stderr } = runGate(root, { report: report(root, [ - { name: 'src/tests/a.test.ts', assertions: [['failed', 'a fails']] }, - { name: 'src/tests/b.test.ts', assertions: [['failed', 'b fails']] }, + { + name: 'src/tests/a.test.ts', + assertions: [ + ['failed', 'a fails'] + ] + }, + { + name: 'src/tests/b.test.ts', + assertions: [ + ['failed', 'b fails'] + ] + }, ]), }) @@ -220,7 +272,14 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { writeBaseline(root, 'src/tests/a.test.ts :: a fails\nsrc/tests/b.test.ts :: b fails\n') const { status, stdout } = runGate(root, { - report: report(root, [{ name: 'src/tests/a.test.ts', assertions: [['failed', 'a fails']] }]), + report: report(root, [ + { + name: 'src/tests/a.test.ts', + assertions: [ + ['failed', 'a fails'] + ] + } + ]), }) expect(status).toBe(0) @@ -233,7 +292,14 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { writeBaseline(root, 'src/tests/a.test.ts :: a fails\n') const { status, stdout, stderr } = runGate(root, { - report: report(root, [{ name: 'src/tests/b.test.ts', assertions: [['failed', 'b fails']] }]), + report: report(root, [ + { + name: 'src/tests/b.test.ts', + assertions: [ + ['failed', 'b fails'] + ] + } + ]), }) expect(status).toBe(1) @@ -247,10 +313,16 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { const { status, stdout } = runGate(root, { vitestRc: 0, - report: report(root, [{ - name: 'src/tests/a.test.ts', - assertions: [['passed', 'a passes'], ['skipped', 'a is skipped'], ['pending', 'a is pending']], - }]), + report: report(root, [ + { + name: 'src/tests/a.test.ts', + assertions: [ + ['passed', 'a passes'], + ['skipped', 'a is skipped'], + ['pending', 'a is pending'] + ], + } + ]), }) expect(status).toBe(0) @@ -264,7 +336,13 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { expect(runGate(root, { vitestRc: 0, report: '{}' }).status).toBe(0) expect(runGate(root, { vitestRc: 0, - report: JSON.stringify({ testResults: [{ name: join(root, 'src/tests/a.test.ts') }] }), + report: JSON.stringify({ + testResults: [ + { + name: join(root, 'src/tests/a.test.ts') + } + ] + }), }).status).toBe(0) }) @@ -273,7 +351,14 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { writeBaseline(root, '\n src/tests/a.test.ts :: a fails \n\n') const { status, stdout } = runGate(root, { - report: report(root, [{ name: 'src/tests/a.test.ts', assertions: [['failed', 'a fails']] }]), + report: report(root, [ + { + name: 'src/tests/a.test.ts', + assertions: [ + ['failed', 'a fails'] + ] + } + ]), }) expect(status).toBe(0) @@ -286,7 +371,14 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { const { status, stdout } = runGate(root, { vitestRc: 0, - report: report(root, [{ name: 'src/tests/a.test.ts', assertions: [['passed', 'a passes']] }]), + report: report(root, [ + { + name: 'src/tests/a.test.ts', + assertions: [ + ['passed', 'a passes'] + ] + } + ]), }) expect(status).toBe(0) @@ -299,8 +391,18 @@ describe('scripts/test-baseline.mjs (npm run test:gate)', () => { runGate(root, { args: ['--update'], report: report(root, [ - { name: 'src/tests/a.test.ts', assertions: [['failed', 'a fails']] }, - { name: 'src/tests/a.test.ts', assertions: [['failed', 'a fails']] }, + { + name: 'src/tests/a.test.ts', + assertions: [ + ['failed', 'a fails'] + ] + }, + { + name: 'src/tests/a.test.ts', + assertions: [ + ['failed', 'a fails'] + ] + }, ]), }) diff --git a/scripts/tests/update-back-catalogue.test.ts b/scripts/tests/update-back-catalogue.test.ts index 47625062..6db9c7c4 100644 --- a/scripts/tests/update-back-catalogue.test.ts +++ b/scripts/tests/update-back-catalogue.test.ts @@ -12,7 +12,12 @@ import { const album = { id: 'PLtest', title: 'Test Album', description: 'A test album' } function entry(overrides = {}) { - return { id: 'vid00000001', title: 'Artist - Song', duration: 200, ...overrides } + return { + id: 'vid00000001', + title: 'Artist - Song', + duration: 200, + ...overrides + } } describe('buildExperience', () => { @@ -27,12 +32,16 @@ describe('buildExperience', () => { describe('auditExperience', () => { it('accepts a well-formed experience', () => { - const entries = [entry()] + const entries = [ + entry() + ] expect(() => auditExperience(album, entries, buildExperience(album, entries))).not.toThrow() }) it('rejects an empty artist', () => { - const entries = [entry()] + const entries = [ + entry() + ] const experience = buildExperience(album, entries) experience.segments[0].artist = ' ' @@ -40,7 +49,9 @@ describe('auditExperience', () => { }) it('rejects an empty title', () => { - const entries = [entry()] + const entries = [ + entry() + ] const experience = buildExperience(album, entries) experience.segments[0].title = '' @@ -48,7 +59,9 @@ describe('auditExperience', () => { }) it('rejects an implausible duration', () => { - const entries = [entry()] + const entries = [ + entry() + ] const experience = buildExperience(album, entries) experience.segments[0].durationSeconds = 60 * 60 * 5 @@ -56,7 +69,9 @@ describe('auditExperience', () => { }) it('rejects a non-finite duration', () => { - const entries = [entry()] + const entries = [ + entry() + ] const experience = buildExperience(album, entries) experience.segments[0].durationSeconds = Number.POSITIVE_INFINITY @@ -64,7 +79,9 @@ describe('auditExperience', () => { }) it('still rejects a zero duration', () => { - const entries = [entry()] + const entries = [ + entry() + ] const experience = buildExperience(album, entries) experience.segments[0].durationSeconds = 0 @@ -83,7 +100,16 @@ describe('shouldIncludeAlbum', () => { }) it('rejects ids that could escape the experiences directory or carry URL syntax', () => { - for (const id of ['../../.github/x', 'a/b', 'a\\b', 'PL.test', 'PL test', 'PL?x=1', '', 42]) { + for (const id of [ + '../../.github/x', + 'a/b', + 'a\\b', + 'PL.test', + 'PL test', + 'PL?x=1', + '', + 42 + ]) { expect(shouldIncludeAlbum({ id, title: 'Album' }), String(id)).toBe(false) } }) @@ -96,7 +122,14 @@ describe('isPlaylistUrl', () => { }) it('rejects option-like, non-https and non-YouTube values', () => { - for (const value of ['--exec=id', '-a', 'http://www.youtube.com/playlist?list=PL', 'https://evil.example/playlist', 'not a url', undefined]) { + for (const value of [ + '--exec=id', + '-a', + 'http://www.youtube.com/playlist?list=PL', + 'https://evil.example/playlist', + 'not a url', + undefined + ]) { expect(isPlaylistUrl(value), String(value)).toBe(false) } }) @@ -112,13 +145,31 @@ describe('refreshMetadata', () => { it('recovers an album from git HEAD when the cached catalogue on disk is missing it', async () => { const onDiskCatalogue = { experiences: [ - { id: 'PL1', title: 'Album 1', subtitle: 'Old Sub', artwork: 'experiences/PL1.jpg', segments: [] }, + { + id: 'PL1', + title: 'Album 1', + subtitle: 'Old Sub', + artwork: 'experiences/PL1.jpg', + segments: [] + }, ], } const gitTrackedCatalogue = { experiences: [ - { id: 'PL1', title: 'Album 1', subtitle: 'Old Sub', artwork: 'experiences/PL1.jpg', segments: [] }, - { id: 'PL2', title: 'Album 2', subtitle: 'Sub 2', artwork: 'experiences/PL2.jpg', segments: [] }, + { + id: 'PL1', + title: 'Album 1', + subtitle: 'Old Sub', + artwork: 'experiences/PL1.jpg', + segments: [] + }, + { + id: 'PL2', + title: 'Album 2', + subtitle: 'Sub 2', + artwork: 'experiences/PL2.jpg', + segments: [] + }, ], } const upstreamMetadata = [ @@ -136,7 +187,9 @@ describe('refreshMetadata', () => { }), readFile: async () => JSON.stringify(onDiskCatalogue), writeFile: async (path: string, content: string | Buffer) => { - writtenFiles.set(path, typeof content === 'string' ? content : 'binary') + writtenFiles.set(path, typeof content === 'string' + ? content + : 'binary') }, gitShow: () => JSON.stringify(gitTrackedCatalogue), cataloguePath: '/fake/catalogue.json', @@ -154,12 +207,22 @@ describe('refreshMetadata', () => { it('prefers git HEAD entries over stale cached disk entries for existing albums in CI', async () => { const onDiskCatalogue = { experiences: [ - { id: 'PL1', title: 'Album 1 Stale', subtitle: 'Stale Sub', segments: ['old-seg'] }, + { + id: 'PL1', + title: 'Album 1 Stale', + subtitle: 'Stale Sub', + segments: ['old-seg'] + }, ], } const gitTrackedCatalogue = { experiences: [ - { id: 'PL1', title: 'Album 1 Committed', subtitle: 'Committed Sub', segments: ['fixed-seg-1', 'fixed-seg-2'] }, + { + id: 'PL1', + title: 'Album 1 Committed', + subtitle: 'Committed Sub', + segments: ['fixed-seg-1', 'fixed-seg-2'] + }, ], } const upstreamMetadata = [ @@ -175,7 +238,9 @@ describe('refreshMetadata', () => { }), readFile: async () => JSON.stringify(onDiskCatalogue), writeFile: async (path: string, content: string | Buffer) => { - writtenFiles.set(path, typeof content === 'string' ? content : 'binary') + writtenFiles.set(path, typeof content === 'string' + ? content + : 'binary') }, gitShow: () => JSON.stringify(gitTrackedCatalogue), cataloguePath: '/fake/catalogue.json', @@ -190,13 +255,28 @@ describe('refreshMetadata', () => { it('keeps uncommitted local edits outside CI while still recovering missing albums', async () => { const onDiskCatalogue = { experiences: [ - { id: 'PL1', title: 'Album 1', subtitle: 'Sub', segments: ['fresh-ingest-1', 'fresh-ingest-2'] }, + { + id: 'PL1', + title: 'Album 1', + subtitle: 'Sub', + segments: ['fresh-ingest-1', 'fresh-ingest-2'] + }, ], } const gitTrackedCatalogue = { experiences: [ - { id: 'PL1', title: 'Album 1', subtitle: 'Sub', segments: [] }, - { id: 'PL2', title: 'Album 2', subtitle: 'Sub 2', segments: ['committed-seg'] }, + { + id: 'PL1', + title: 'Album 1', + subtitle: 'Sub', + segments: [] + }, + { + id: 'PL2', + title: 'Album 2', + subtitle: 'Sub 2', + segments: ['committed-seg'] + }, ], } const upstreamMetadata = [ @@ -213,7 +293,9 @@ describe('refreshMetadata', () => { }), readFile: async () => JSON.stringify(onDiskCatalogue), writeFile: async (path: string, content: string | Buffer) => { - writtenFiles.set(path, typeof content === 'string' ? content : 'binary') + writtenFiles.set(path, typeof content === 'string' + ? content + : 'binary') }, gitShow: () => JSON.stringify(gitTrackedCatalogue), cataloguePath: '/fake/catalogue.json', @@ -244,7 +326,9 @@ describe('refreshMetadata', () => { }), readFile: async () => JSON.stringify(onDiskCatalogue), writeFile: async (path: string, content: string | Buffer) => { - writtenFiles.set(path, typeof content === 'string' ? content : 'binary') + writtenFiles.set(path, typeof content === 'string' + ? content + : 'binary') }, gitShow: () => JSON.stringify({ experiences: [] }), cataloguePath: '/fake/catalogue.json', diff --git a/scripts/tests/update-contributors.test.ts b/scripts/tests/update-contributors.test.ts index 44d75515..de61093a 100644 --- a/scripts/tests/update-contributors.test.ts +++ b/scripts/tests/update-contributors.test.ts @@ -18,23 +18,77 @@ describe('update-contributors script', () => { const urlStr = String(url) if (urlStr.includes('/orgs/projectbluefin/repos')) { return new Response(JSON.stringify([ - { full_name: 'projectbluefin/repo-a', fork: false, private: false, archived: false }, - { full_name: 'projectbluefin/repo-fork', fork: true, private: false, archived: false }, - { full_name: 'projectbluefin/repo-archived', fork: false, private: false, archived: true }, - ]), { status: 200, headers: { 'Content-Type': 'application/json' } }) + { + full_name: 'projectbluefin/repo-a', + fork: false, + private: false, + archived: false + }, + { + full_name: 'projectbluefin/repo-fork', + fork: true, + private: false, + archived: false + }, + { + full_name: 'projectbluefin/repo-archived', + fork: false, + private: false, + archived: true + }, + ]), { + status: 200, + headers: { 'Content-Type': 'application/json' } + }) } if (urlStr.includes('/repos/projectbluefin/repo-a/contributors')) { return new Response(JSON.stringify([ - { id: 2, login: 'bob', type: 'User', html_url: 'https://github.com/bob', avatar_url: 'https://avatars.githubusercontent.com/u/2' }, - { id: 99, login: 'actions-user', type: 'User', html_url: 'https://github.com/actions-user', avatar_url: 'https://avatars.githubusercontent.com/u/99' }, - { id: 98, login: 'renovate[bot]', type: 'Bot', html_url: 'https://github.com/renovate[bot]', avatar_url: 'https://avatars.githubusercontent.com/u/98' }, - ]), { status: 200, headers: { 'Content-Type': 'application/json' } }) + { + id: 2, + login: 'bob', + type: 'User', + html_url: 'https://github.com/bob', + avatar_url: 'https://avatars.githubusercontent.com/u/2' + }, + { + id: 99, + login: 'actions-user', + type: 'User', + html_url: 'https://github.com/actions-user', + avatar_url: 'https://avatars.githubusercontent.com/u/99' + }, + { + id: 98, + login: 'renovate[bot]', + type: 'Bot', + html_url: 'https://github.com/renovate[bot]', + avatar_url: 'https://avatars.githubusercontent.com/u/98' + }, + ]), { + status: 200, + headers: { 'Content-Type': 'application/json' } + }) } if (urlStr.includes('/repos/projectbluefin/repo-archived/contributors')) { return new Response(JSON.stringify([ - { id: 1, login: 'Alice', type: 'User', html_url: 'https://github.com/Alice', avatar_url: 'https://avatars.githubusercontent.com/u/1' }, - { id: 2, login: 'bob', type: 'User', html_url: 'https://github.com/bob', avatar_url: 'https://avatars.githubusercontent.com/u/2' }, - ]), { status: 200, headers: { 'Content-Type': 'application/json' } }) + { + id: 1, + login: 'Alice', + type: 'User', + html_url: 'https://github.com/Alice', + avatar_url: 'https://avatars.githubusercontent.com/u/1' + }, + { + id: 2, + login: 'bob', + type: 'User', + html_url: 'https://github.com/bob', + avatar_url: 'https://avatars.githubusercontent.com/u/2' + }, + ]), { + status: 200, + headers: { 'Content-Type': 'application/json' } + }) } return new Response('[]', { status: 200 }) }) @@ -45,8 +99,18 @@ describe('update-contributors script', () => { await updateContributors(targetFile) const content = JSON.parse(readFileSync(targetFile, 'utf8')) expect(content).toEqual([ - { id: 1, login: 'Alice', html_url: 'https://github.com/Alice', avatar_url: 'https://avatars.githubusercontent.com/u/1' }, - { id: 2, login: 'bob', html_url: 'https://github.com/bob', avatar_url: 'https://avatars.githubusercontent.com/u/2' }, + { + id: 1, + login: 'Alice', + html_url: 'https://github.com/Alice', + avatar_url: 'https://avatars.githubusercontent.com/u/1' + }, + { + id: 2, + login: 'bob', + html_url: 'https://github.com/bob', + avatar_url: 'https://avatars.githubusercontent.com/u/2' + }, ]) } finally { @@ -62,17 +126,39 @@ describe('update-contributors script', () => { const urlStr = String(url) if (urlStr.includes('/orgs/projectbluefin/repos')) { return new Response(JSON.stringify([ - { full_name: 'projectbluefin/empty-repo', fork: false, private: false, archived: false }, - { full_name: 'projectbluefin/has-contributor', fork: false, private: false, archived: false }, - ]), { status: 200, headers: { 'Content-Type': 'application/json' } }) + { + full_name: 'projectbluefin/empty-repo', + fork: false, + private: false, + archived: false + }, + { + full_name: 'projectbluefin/has-contributor', + fork: false, + private: false, + archived: false + }, + ]), { + status: 200, + headers: { 'Content-Type': 'application/json' } + }) } if (urlStr.includes('/repos/projectbluefin/empty-repo/contributors')) { return new Response(null, { status: 204 }) } if (urlStr.includes('/repos/projectbluefin/has-contributor/contributors')) { return new Response(JSON.stringify([ - { id: 10, login: 'dev', type: 'User', html_url: 'https://github.com/dev', avatar_url: 'https://avatars.githubusercontent.com/u/10' }, - ]), { status: 200, headers: { 'Content-Type': 'application/json' } }) + { + id: 10, + login: 'dev', + type: 'User', + html_url: 'https://github.com/dev', + avatar_url: 'https://avatars.githubusercontent.com/u/10' + }, + ]), { + status: 200, + headers: { 'Content-Type': 'application/json' } + }) } return new Response('[]', { status: 200 }) }) @@ -83,7 +169,12 @@ describe('update-contributors script', () => { await updateContributors(targetFile) const content = JSON.parse(readFileSync(targetFile, 'utf8')) expect(content).toEqual([ - { id: 10, login: 'dev', html_url: 'https://github.com/dev', avatar_url: 'https://avatars.githubusercontent.com/u/10' }, + { + id: 10, + login: 'dev', + html_url: 'https://github.com/dev', + avatar_url: 'https://avatars.githubusercontent.com/u/10' + }, ]) } finally { @@ -97,8 +188,16 @@ describe('update-contributors script', () => { const fetchMock = vi.fn(async () => { return new Response(JSON.stringify([ - { full_name: 'projectbluefin/only-fork', fork: true, private: false, archived: false }, - ]), { status: 200, headers: { 'Content-Type': 'application/json' } }) + { + full_name: 'projectbluefin/only-fork', + fork: true, + private: false, + archived: false + }, + ]), { + status: 200, + headers: { 'Content-Type': 'application/json' } + }) }) vi.stubGlobal('fetch', fetchMock) diff --git a/scripts/tests/update-dakota-versions.test.ts b/scripts/tests/update-dakota-versions.test.ts index 96db22bb..9d3ec585 100644 --- a/scripts/tests/update-dakota-versions.test.ts +++ b/scripts/tests/update-dakota-versions.test.ts @@ -53,10 +53,12 @@ describe('oci-sbom helpers', () => { }) it('ignores commit hashes and null versions', () => { - const hashOnly = { packages: [ - { name: 'gnome-shell', versionInfo: 'c9372e733d75cf3c5197a0dd29f8a4a422e2dddb9020cab3c179a6f3df03d4be' }, - { name: 'gnome-shell', versionInfo: null }, - ] } + const hashOnly = { + packages: [ + { name: 'gnome-shell', versionInfo: 'c9372e733d75cf3c5197a0dd29f8a4a422e2dddb9020cab3c179a6f3df03d4be' }, + { name: 'gnome-shell', versionInfo: null }, + ] + } expect(spdxPackageVersion(hashOnly, 'gnome-shell')).toBeUndefined() }) diff --git a/scripts/tests/update-flickr-photos.test.ts b/scripts/tests/update-flickr-photos.test.ts index ed948de5..6ed352f5 100644 --- a/scripts/tests/update-flickr-photos.test.ts +++ b/scripts/tests/update-flickr-photos.test.ts @@ -30,7 +30,12 @@ describe('update-flickr-photos helpers', () => { }) it('shuffles arrays without losing items', () => { - const input = [{ id: '1' }, { id: '2' }, { id: '3' }, { id: '4' }] + const input = [ + { id: '1' }, + { id: '2' }, + { id: '3' }, + { id: '4' } + ] const shuffled = shuffleArray(input) expect(shuffled).toHaveLength(input.length) expect(shuffled.every(item => input.includes(item))).toBe(true) @@ -44,7 +49,12 @@ describe('update-flickr-photos helpers', () => { }) it('normalizes Flickr photo objects', () => { - expect(normalizePhoto({ id: '123', server: '456', secret: 'abc', title: 'Photo' })).toEqual({ + expect(normalizePhoto({ + id: '123', + server: '456', + secret: 'abc', + title: 'Photo' + })).toEqual({ id: '123', server: '456', secret: 'abc', @@ -55,9 +65,24 @@ describe('update-flickr-photos helpers', () => { it('builds a fresh, deduplicated cache without retaining stale entries', () => { vi.spyOn(Math, 'random').mockReturnValue(0) const photos = selectFreshPhotos([ - { id: 'current-japan', server: '1', secret: 'a', title: 'Japan contributor summit' }, - { id: 'current-japan', server: '1', secret: 'a', title: 'Duplicate' }, - { id: 'current-europe', server: '2', secret: 'b', title: 'Europe maintainer summit' }, + { + id: 'current-japan', + server: '1', + secret: 'a', + title: 'Japan contributor summit' + }, + { + id: 'current-japan', + server: '1', + secret: 'a', + title: 'Duplicate' + }, + { + id: 'current-europe', + server: '2', + secret: 'b', + title: 'Europe maintainer summit' + }, ], 2) expect(photos.map(photo => photo.id).sort()).toEqual(['current-europe', 'current-japan']) @@ -68,7 +93,10 @@ describe('update-flickr-photos helpers', () => { vi.stubGlobal('fetch', fetchMock) fetchMock - .mockResolvedValueOnce(new Response('{}', { status: 429, headers: { 'retry-after': '1' } })) + .mockResolvedValueOnce(new Response('{}', { + status: 429, + headers: { 'retry-after': '1' } + })) .mockResolvedValueOnce(new Response('{"ok": true}', { status: 200 })) const res = await fetchWithRateLimit('https://example.com/test') @@ -112,7 +140,9 @@ describe('update-flickr-photos helpers', () => { writeFileSync(tmpPath, '[{"id":"cached-1"}]') try { const photos = await loadExistingPhotos(tmpPath) - expect(photos).toEqual([{ id: 'cached-1' }]) + expect(photos).toEqual([ + { id: 'cached-1' } + ]) } finally { try { @@ -166,11 +196,36 @@ describe('album HTML parsing', () => { const photos = extractPhotosFromAlbumHtml(html) expect(photos).toEqual([ - { id: '11111111111', server: '65535', secret: 'abc123def0', title: 'Maintainer Summit group photo' }, - { id: '22222222222', server: '65535', secret: 'bcd234efa1', title: 'Keynote speaker' }, - { id: '33333333333', server: '65535', secret: 'cde345fab2', title: 'Contributor signing the wall' }, - { id: '44444444444', server: '65535', secret: 'def456abc3', title: 'Hallway track crowd' }, - { id: '55555555555', server: '65535', secret: 'efg567bcd4', title: 'Sponsor booth signage' }, + { + id: '11111111111', + server: '65535', + secret: 'abc123def0', + title: 'Maintainer Summit group photo' + }, + { + id: '22222222222', + server: '65535', + secret: 'bcd234efa1', + title: 'Keynote speaker' + }, + { + id: '33333333333', + server: '65535', + secret: 'cde345fab2', + title: 'Contributor signing the wall' + }, + { + id: '44444444444', + server: '65535', + secret: 'def456abc3', + title: 'Hallway track crowd' + }, + { + id: '55555555555', + server: '65535', + secret: 'efg567bcd4', + title: 'Sponsor booth signage' + }, ]) }) @@ -215,7 +270,13 @@ describe('people-first filtering', () => { targetTotalPhotos: 10, albums: [], peopleFirst: { - allowPatterns: ['maintainer', 'contributor', 'people', 'group', 'crowd'], + allowPatterns: [ + 'maintainer', + 'contributor', + 'people', + 'group', + 'crowd' + ], blockPatterns: ['sponsor', 'banner', 'stage', 'booth'], }, } @@ -240,7 +301,10 @@ describe('people-first filtering', () => { }) it('returns false for empty allow patterns', () => { - const emptyConfig = { ...config, peopleFirst: { allowPatterns: [], blockPatterns: [] } } + const emptyConfig = { + ...config, + peopleFirst: { allowPatterns: [], blockPatterns: [] } + } expect(isPeopleFirstPhoto({ id: '8', title: 'Maintainer group photo' }, emptyConfig)).toBe(false) }) }) @@ -277,7 +341,10 @@ describe('title-family diversification', () => { }) it('returns the input unchanged when maxPerFamily is zero or negative', () => { - const photos = [{ id: '1', title: 'Photo' }, { id: '2', title: 'Photo' }] + const photos = [ + { id: '1', title: 'Photo' }, + { id: '2', title: 'Photo' } + ] expect(diversifyByTitleFamily(photos, 0)).toEqual(photos) expect(diversifyByTitleFamily(photos, -1)).toEqual(photos) }) @@ -360,8 +427,14 @@ describe('updateFlickrPhotos', () => { writeFileSync(configPath, JSON.stringify({ requestDelayMs: 0, maxPagesPerAlbum: 1, - albums: [{ id: '1', title: 'One' }, { id: '2', title: 'Two' }], - peopleFirst: { allowPatterns: ['summit'], blockPatterns: [] }, + albums: [ + { id: '1', title: 'One' }, + { id: '2', title: 'Two' } + ], + peopleFirst: { + allowPatterns: ['summit'], + blockPatterns: [] + }, })) if (existing) { writeFileSync(targetPath, `${JSON.stringify(existing)}\n`) @@ -369,7 +442,14 @@ describe('updateFlickrPhotos', () => { return { configPath, targetPath } } - const previous = [{ id: '9', server: '1', secret: 's', title: 'Old summit photo' }] + const previous = [ + { + id: '9', + server: '1', + secret: 's', + title: 'Old summit photo' + } + ] it('keeps the previous cache when every album fails', async () => { const { configPath, targetPath } = setup(previous) diff --git a/scripts/tests/update-image-versions-orchestrator.test.ts b/scripts/tests/update-image-versions-orchestrator.test.ts index 74fa1db1..a2c28a2b 100644 --- a/scripts/tests/update-image-versions-orchestrator.test.ts +++ b/scripts/tests/update-image-versions-orchestrator.test.ts @@ -63,7 +63,10 @@ function audit(overrides: Record> = {}) { return { checkedAt: CHECKED_AT, images: IMAGE_SBOM_REGISTRY.map((record) => { - const image = { ...verifiedImage(record), ...overrides[record.id] } + const image = { + ...verifiedImage(record), + ...overrides[record.id] + } if (image.status === 'unavailable') { delete image.values } @@ -144,7 +147,9 @@ describe('updateImageVersions — write mode', () => { }) it('carries the previous Dakota baseline forward but drops stale cached isos', async () => { - const isos = [{ label: 'Download ISO', filename: 'dakota-live.iso' }] + const isos = [ + { label: 'Download ISO', filename: 'dakota-live.iso' } + ] previousFiles[DAKOTA_PATH] = JSON.stringify({ status: 'verified', isos, @@ -171,7 +176,9 @@ describe('updateImageVersions — write mode', () => { it('stamps lastSuccessfulAt from the previous audit onto a newly failed image', async () => { previousFiles[AUDIT_PATH] = JSON.stringify({ checkedAt: '2026-10-04T00:00:00.000Z', - images: [{ id: 'dakota-gaming', status: 'verified' }], + images: [ + { id: 'dakota-gaming', status: 'verified' } + ], }) verifyRegistryMock.mockResolvedValue(audit({ 'dakota-gaming': { status: 'unavailable', errorCode: 'missing-sbom', error: 'no referrer' }, @@ -211,7 +218,9 @@ describe('updateImageVersions — write mode', () => { }) it('warns "unknown" when an unavailable image carries no error code', async () => { - verifyRegistryMock.mockResolvedValue(audit({ 'dakota-gaming': { status: 'unavailable' } })) + verifyRegistryMock.mockResolvedValue(audit({ + 'dakota-gaming': { status: 'unavailable' } + })) await updateImageVersions() @@ -230,7 +239,9 @@ describe('updateImageVersions — field-loss guard', () => { }) it('refuses to write when a published Dakota package vanishes without audit evidence', async () => { - previousFiles[DAKOTA_PATH] = JSON.stringify({ packages: { retired: '1.0' } }) + previousFiles[DAKOTA_PATH] = JSON.stringify({ + packages: { retired: '1.0' } + }) await expect(updateImageVersions()).rejects.toThrow( 'unexplained field loss in public/dakota-versions.json packages: retired', @@ -243,8 +254,15 @@ describe('updateImageVersions — field-loss guard', () => { it('accepts losing lts.hwe when the hwe image is unavailable (hwe aliases kernel)', async () => { previousFiles[STREAMS_PATH] = 'lts:\n status: verified\n hwe: "6.17.0"\n' verifyRegistryMock.mockResolvedValue(audit({ - 'bluefin-lts': { values: { kernel: '6.12.0-1.el10' } }, - 'bluefin-lts-hwe': { fields: ['kernel'], status: 'unavailable', errorCode: 'missing-sbom', error: 'gone' }, + 'bluefin-lts': { + values: { kernel: '6.12.0-1.el10' } + }, + 'bluefin-lts-hwe': { + fields: ['kernel'], + status: 'unavailable', + errorCode: 'missing-sbom', + error: 'gone' + }, })) await updateImageVersions() @@ -257,8 +275,13 @@ describe('updateImageVersions — field-loss guard', () => { it('refuses to drop lts.hwe when the hwe image verified without a kernel value', async () => { previousFiles[STREAMS_PATH] = 'lts:\n status: verified\n hwe: "6.17.0"\n' verifyRegistryMock.mockResolvedValue(audit({ - 'bluefin-lts': { values: { kernel: '6.12.0-1.el10' } }, - 'bluefin-lts-hwe': { fields: ['kernel'], values: {} }, + 'bluefin-lts': { + values: { kernel: '6.12.0-1.el10' } + }, + 'bluefin-lts-hwe': { + fields: ['kernel'], + values: {} + }, })) await expect(updateImageVersions()).rejects.toThrow('unexplained field loss in public/stream-versions.yml lts: hwe') @@ -266,8 +289,13 @@ describe('updateImageVersions — field-loss guard', () => { }) it('publishes an unavailable Dakota block when the base image fails', async () => { - const isos = [{ label: 'Download ISO', filename: 'dakota-live.iso' }] - previousFiles[DAKOTA_PATH] = JSON.stringify({ isos, packages: { kernel: '7.2.6' } }) + const isos = [ + { label: 'Download ISO', filename: 'dakota-live.iso' } + ] + previousFiles[DAKOTA_PATH] = JSON.stringify({ + isos, + packages: { kernel: '7.2.6' } + }) verifyRegistryMock.mockResolvedValue(audit({ dakota: { status: 'unavailable', errorCode: 'missing-sbom', error: 'gone' }, })) @@ -303,7 +331,10 @@ describe('updateImageVersions — --check-only', () => { it('exits 1 for the registry\'s own pending-mapping records, even though they are optional', async () => { const pending = Object.fromEntries(IMAGE_SBOM_REGISTRY .filter(record => record.pendingSbom === true) - .map(record => [record.id, { status: 'unavailable', errorCode: 'pending-mapping', error: 'pending' }])) + .map(record => [ + record.id, + { status: 'unavailable', errorCode: 'pending-mapping', error: 'pending' } + ])) expect(Object.keys(pending).length).toBeGreaterThan(0) verifyRegistryMock.mockResolvedValue(audit(pending)) @@ -351,7 +382,12 @@ describe('update-image-versions CLI', () => { // With oras absent the real collector raises ToolingError('tool-missing') // before touching the network, which exercises the CLI's exit-2 contract. - it.each([[[]], [['--check-only']]])('exits 2 and reports the block when oras is missing (args %j)', (args) => { + it.each([ + [[]], + [ + ['--check-only'] + ] + ])('exits 2 and reports the block when oras is missing (args %j)', (args) => { const before = [STREAMS_PATH, DAKOTA_PATH].map(file => fs.statSync(file).mtimeMs) const result = spawnSync(process.execPath, [scriptPath, ...args], { diff --git a/scripts/tests/update-image-versions.test.ts b/scripts/tests/update-image-versions.test.ts index 99c20bf8..1430eaa4 100644 --- a/scripts/tests/update-image-versions.test.ts +++ b/scripts/tests/update-image-versions.test.ts @@ -295,8 +295,18 @@ describe('productStatus', () => { const result = { checkedAt: '2026-08-26T00:00:00.000Z', images: [ - { id: 'dakota', product: 'dakota', required: true, status: 'verified' }, - { id: 'dakota-gaming', product: 'dakota', required: true, status: 'unavailable' }, + { + id: 'dakota', + product: 'dakota', + required: true, + status: 'verified' + }, + { + id: 'dakota-gaming', + product: 'dakota', + required: true, + status: 'unavailable' + }, ], } const status = productStatus(result) @@ -307,8 +317,18 @@ describe('productStatus', () => { const result = { checkedAt: '2026-08-26T00:00:00.000Z', images: [ - { id: 'dakota', product: 'dakota', required: true, status: 'verified' }, - { id: 'dakota-gaming', product: 'dakota', required: false, status: 'unavailable' }, + { + id: 'dakota', + product: 'dakota', + required: true, + status: 'verified' + }, + { + id: 'dakota-gaming', + product: 'dakota', + required: false, + status: 'unavailable' + }, ], } const status = productStatus(result) @@ -318,7 +338,9 @@ describe('productStatus', () => { it('throws an explicit error when an image entry has no product field', () => { const result = { checkedAt: '2026-08-26T00:00:00.000Z', - images: [{ id: 'orphan', status: 'verified' }], + images: [ + { id: 'orphan', status: 'verified' } + ], } expect(() => productStatus(result)).toThrow('audit image entry \'orphan\' is missing a product field') }) @@ -331,7 +353,9 @@ describe('productStatus', () => { image: 'ghcr.io/projectbluefin/bluefin:latest', certificateIdentityRegexp: '^https://.*$', certificateOidcIssuer: 'https://token.actions.githubusercontent.com', - packages: { kernel: { name: 'linux', required: true } }, + packages: { + kernel: { name: 'linux', required: true } + }, }) const collect = vi.fn().mockResolvedValue({ id: 'bluefin', @@ -339,12 +363,20 @@ describe('productStatus', () => { imageDigest: IMAGE_DIGEST, sbomDigest: SBOM_DIGEST, checkedAt: '2026-08-26T00:00:00.000Z', - sbom: { packages: [{ name: 'linux', versionInfo: '7.0.7' }, { name: 'gnome-shell', versionInfo: '50.2' }] }, + sbom: { + packages: [ + { name: 'linux', versionInfo: '7.0.7' }, + { name: 'gnome-shell', versionInfo: '50.2' } + ] + }, }) const auditResult = await verifyRegistry( [REQUIRED_RECORD, bluefinRecord], - { collectVerifiedImageSbom: collect, now: () => '2026-08-26T00:00:00.000Z' }, + { + collectVerifiedImageSbom: collect, + now: () => '2026-08-26T00:00:00.000Z' + }, ) // Must not mutate entries before calling productStatus @@ -539,7 +571,10 @@ describe('verifyRegistry — ambiguity is fail-closed', () => { it('carries the mapped field list onto every entry for the field-loss guard', async () => { const collect = collectorFor(AMBIGUOUS_RECORD, { - packages: [{ name: 'linux', versionInfo: '7.0.7' }, { name: 'mesa', versionInfo: '26.0.6' }], + packages: [ + { name: 'linux', versionInfo: '7.0.7' }, + { name: 'mesa', versionInfo: '26.0.6' } + ], }) const result = await verifyRegistry([AMBIGUOUS_RECORD], { collectVerifiedImageSbom: collect }) @@ -590,7 +625,9 @@ describe('verifyRegistry — pending mappings never verify', () => { it('stays unavailable with pending-mapping once an SPDX referrer appears', async () => { const collect = collectorFor(PENDING_RECORD, { - packages: [{ name: 'linux', versionInfo: '7.1.8-ogc1' }], + packages: [ + { name: 'linux', versionInfo: '7.1.8-ogc1' } + ], }) const result = await verifyRegistry([PENDING_RECORD], { collectVerifiedImageSbom: collect }) @@ -606,7 +643,11 @@ describe('verifyRegistry — pending mappings never verify', () => { it('treats an empty packages map as pending even without the pendingSbom flag', async () => { const record = Object.freeze({ ...PENDING_RECORD, pendingSbom: undefined, packages: {} }) - const collect = collectorFor(record, { packages: [{ name: 'linux', versionInfo: '7.1.8-ogc1' }] }) + const collect = collectorFor(record, { + packages: [ + { name: 'linux', versionInfo: '7.1.8-ogc1' } + ] + }) const result = await verifyRegistry([record], { collectVerifiedImageSbom: collect }) @@ -634,8 +675,18 @@ describe('productStatus — degraded entries', () => { const status = productStatus({ checkedAt: '2026-08-26T00:00:00.000Z', images: [ - { id: 'bluefin-stable', product: 'bluefin', required: true, status: 'degraded' }, - { id: 'bluefin-stable-nvidia', product: 'bluefin', required: false, status: 'verified' }, + { + id: 'bluefin-stable', + product: 'bluefin', + required: true, + status: 'degraded' + }, + { + id: 'bluefin-stable-nvidia', + product: 'bluefin', + required: false, + status: 'verified' + }, ], }) expect(status.bluefin.status).toBe('degraded') @@ -645,8 +696,18 @@ describe('productStatus — degraded entries', () => { const status = productStatus({ checkedAt: '2026-08-26T00:00:00.000Z', images: [ - { id: 'bluefin-stable', product: 'bluefin', required: true, status: 'degraded' }, - { id: 'bluefin-lts', product: 'bluefin', required: true, status: 'unavailable' }, + { + id: 'bluefin-stable', + product: 'bluefin', + required: true, + status: 'degraded' + }, + { + id: 'bluefin-lts', + product: 'bluefin', + required: true, + status: 'unavailable' + }, ], }) expect(status.bluefin.status).toBe('unavailable') @@ -670,7 +731,14 @@ describe('annotateLastSuccessful', () => { it('copies the previous run timestamp onto a newly failed image', () => { const current = { checkedAt: '2026-08-26T10:00:00.000Z', - images: [{ id: 'dakota', product: 'dakota', status: 'unavailable', errorCode: 'missing-sbom' }], + images: [ + { + id: 'dakota', + product: 'dakota', + status: 'unavailable', + errorCode: 'missing-sbom' + } + ], } const annotated = annotateLastSuccessful(current, previous) expect(annotated.images[0].lastSuccessfulAt).toBe('2026-08-25T10:00:00.000Z') @@ -679,7 +747,14 @@ describe('annotateLastSuccessful', () => { it('accepts a previously degraded image as a last successful verification', () => { const current = { checkedAt: '2026-08-26T10:00:00.000Z', - images: [{ id: 'bluefin-stable', product: 'bluefin', status: 'unavailable', errorCode: 'missing-sbom' }], + images: [ + { + id: 'bluefin-stable', + product: 'bluefin', + status: 'unavailable', + errorCode: 'missing-sbom' + } + ], } const annotated = annotateLastSuccessful(current, previous) expect(annotated.images[0].lastSuccessfulAt).toBe('2026-08-25T10:00:00.000Z') @@ -688,17 +763,26 @@ describe('annotateLastSuccessful', () => { it('preserves lastSuccessfulAt across consecutive failed runs', () => { const previousFailure = { checkedAt: '2026-08-26T10:00:00.000Z', - images: [{ - id: 'dakota', - product: 'dakota', - status: 'unavailable', - errorCode: 'missing-sbom', - lastSuccessfulAt: '2026-08-25T10:00:00.000Z', - }], + images: [ + { + id: 'dakota', + product: 'dakota', + status: 'unavailable', + errorCode: 'missing-sbom', + lastSuccessfulAt: '2026-08-25T10:00:00.000Z', + } + ], } const current = { checkedAt: '2026-08-27T10:00:00.000Z', - images: [{ id: 'dakota', product: 'dakota', status: 'unavailable', errorCode: 'missing-sbom' }], + images: [ + { + id: 'dakota', + product: 'dakota', + status: 'unavailable', + errorCode: 'missing-sbom' + } + ], } const annotated = annotateLastSuccessful(current, previousFailure) @@ -709,7 +793,14 @@ describe('annotateLastSuccessful', () => { it('records nothing when the previous run never verified that image', () => { const current = { checkedAt: '2026-08-26T10:00:00.000Z', - images: [{ id: 'bluefin-lts', product: 'bluefin', status: 'unavailable', errorCode: 'pending-mapping' }], + images: [ + { + id: 'bluefin-lts', + product: 'bluefin', + status: 'unavailable', + errorCode: 'pending-mapping' + } + ], } const annotated = annotateLastSuccessful(current, previous) expect(annotated.images[0]).not.toHaveProperty('lastSuccessfulAt') @@ -718,7 +809,14 @@ describe('annotateLastSuccessful', () => { it('annotates degraded entries too', () => { const current = { checkedAt: '2026-08-26T10:00:00.000Z', - images: [{ id: 'dakota', product: 'dakota', status: 'degraded', errorCode: 'ambiguous-optional' }], + images: [ + { + id: 'dakota', + product: 'dakota', + status: 'degraded', + errorCode: 'ambiguous-optional' + } + ], } const annotated = annotateLastSuccessful(current, previous) expect(annotated.images[0].lastSuccessfulAt).toBe('2026-08-25T10:00:00.000Z') @@ -727,7 +825,9 @@ describe('annotateLastSuccessful', () => { it('leaves verified entries untouched and does not mutate the input', () => { const current = { checkedAt: '2026-08-26T10:00:00.000Z', - images: [{ id: 'dakota', product: 'dakota', status: 'verified' }], + images: [ + { id: 'dakota', product: 'dakota', status: 'verified' } + ], } const annotated = annotateLastSuccessful(current, previous) expect(annotated.images[0]).not.toHaveProperty('lastSuccessfulAt') @@ -737,7 +837,9 @@ describe('annotateLastSuccessful', () => { it('is a no-op without a previous audit', () => { const current = { checkedAt: '2026-08-26T10:00:00.000Z', - images: [{ id: 'dakota', product: 'dakota', status: 'unavailable' }], + images: [ + { id: 'dakota', product: 'dakota', status: 'unavailable' } + ], } expect(annotateLastSuccessful(current, null).images[0]).not.toHaveProperty('lastSuccessfulAt') }) @@ -798,14 +900,16 @@ describe('assertExplainedFieldLoss', () => { it('accepts loss explained by an unavailable image that mapped the field', () => { const unavailableAudit = { checkedAt: '2026-08-26T10:00:00.000Z', - images: [{ - id: 'dakota-nvidia', - product: 'dakota', - required: false, - status: 'unavailable', - errorCode: 'image-not-found', - fields: ['nvidia'], - }], + images: [ + { + id: 'dakota-nvidia', + product: 'dakota', + required: false, + status: 'unavailable', + errorCode: 'image-not-found', + fields: ['nvidia'], + } + ], } expect(() => assertExplainedFieldLoss({ label: 'dakota-versions.json packages', @@ -830,7 +934,16 @@ describe('assertExplainedFieldLoss', () => { it('accepts an entire block going unavailable when the product has an unavailable image', () => { const unavailableAudit = { checkedAt: '2026-08-26T10:00:00.000Z', - images: [{ id: 'bluefin-lts', product: 'bluefin', required: true, status: 'unavailable', errorCode: 'pending-mapping', fields: [] }], + images: [ + { + id: 'bluefin-lts', + product: 'bluefin', + required: true, + status: 'unavailable', + errorCode: 'pending-mapping', + fields: [] + } + ], } expect(() => assertExplainedFieldLoss({ label: 'stream-versions.yml lts', @@ -880,7 +993,16 @@ describe('assertExplainedFieldLoss', () => { it('resolves the hwe alias to the kernel field of the HWE image', () => { const unavailableAudit = { checkedAt: '2026-08-26T10:00:00.000Z', - images: [{ id: 'bluefin-lts-hwe', product: 'bluefin', required: false, status: 'unavailable', errorCode: 'missing-sbom', fields: ['kernel'] }], + images: [ + { + id: 'bluefin-lts-hwe', + product: 'bluefin', + required: false, + status: 'unavailable', + errorCode: 'missing-sbom', + fields: ['kernel'] + } + ], } expect(() => assertExplainedFieldLoss({ label: 'stream-versions.yml lts', diff --git a/scripts/tests/verified-image-sbom.test.ts b/scripts/tests/verified-image-sbom.test.ts index 7d9943e7..406e61e3 100644 --- a/scripts/tests/verified-image-sbom.test.ts +++ b/scripts/tests/verified-image-sbom.test.ts @@ -59,7 +59,12 @@ describe('resolveImageDigest', () => { expect(result).toBe(`ghcr.io/projectbluefin/dakota@${DAKOTA_DIGEST}`) expect(run).toHaveBeenCalledWith( 'oras', - ['manifest', 'fetch', '--descriptor', 'ghcr.io/projectbluefin/dakota:latest'], + [ + 'manifest', + 'fetch', + '--descriptor', + 'ghcr.io/projectbluefin/dakota:latest' + ], expect.objectContaining({ encoding: 'utf8' }), ) }) @@ -80,7 +85,12 @@ describe('discoverReferrers', () => { const result = discoverReferrers(imageAtDigest, run) expect(run).toHaveBeenCalledWith( 'oras', - ['discover', '--format', 'json', imageAtDigest], + [ + 'discover', + '--format', + 'json', + imageAtDigest + ], expect.objectContaining({ encoding: 'utf8' }), ) expect(result).toEqual(dakotaDiscovery.referrers) @@ -257,7 +267,12 @@ describe('collectVerifiedImageSbom', () => { }) it('collects verified image SBOM for dakota with both provenance and SPDX', async () => { - const spdxDoc = { spdxVersion: 'SPDX-2.3', packages: [{ name: 'linux', versionInfo: '6.12.0' }] } + const spdxDoc = { + spdxVersion: 'SPDX-2.3', + packages: [ + { name: 'linux', versionInfo: '6.12.0' } + ] + } const mockFs = { mkdtempSync: vi.fn().mockReturnValue('/mock-tmp/sbom-abc'), readdirSync: vi.fn().mockReturnValue(['sbom.spdx.json']), @@ -541,7 +556,12 @@ describe('collectVerifiedImageSbom — publisher identity', () => { }) it('collects with sbomSignature: missing when the referrer carries no publisher signature in discovery', async () => { - const spdxDoc = { spdxVersion: 'SPDX-2.3', packages: [{ name: 'linux', versionInfo: '6.12.0' }] } + const spdxDoc = { + spdxVersion: 'SPDX-2.3', + packages: [ + { name: 'linux', versionInfo: '6.12.0' } + ] + } const mockFs = { mkdtempSync: vi.fn().mockReturnValue('/mock-tmp/sbom-unsigned'), readdirSync: vi.fn().mockReturnValue(['sbom.spdx.json']), diff --git a/scripts/tests/wolves-cue-at.test.ts b/scripts/tests/wolves-cue-at.test.ts index 31d71daa..c5ddbe96 100644 --- a/scripts/tests/wolves-cue-at.test.ts +++ b/scripts/tests/wolves-cue-at.test.ts @@ -51,7 +51,15 @@ function cueContaining(seconds: number): IntroOverlayTextCue { describe('wolves-videos registry', () => { it('resolves every alias, and no argument, to the canonical prologue key', () => { - for (const alias of [1, '1', 'first', 'gardener', 'winnower', 'prologue', undefined]) { + for (const alias of [ + 1, + '1', + 'first', + 'gardener', + 'winnower', + 'prologue', + undefined + ]) { const { key, video } = resolveVideo(alias as string | undefined) expect(key).toBe('prologue') expect(video).toBe(VIDEOS.prologue) @@ -149,12 +157,30 @@ describe('wolves-cue-at CLI', () => { }) it.each([ - ['m:ss', ['1:50']], - ['seconds', ['110']], - ['m and s', ['1m50s']], - ['ordinal before the timestamp', ['1', '1:50']], - ['ordinal after the timestamp', ['110', '1']], - ['alias', ['gardener', '1:50']], + [ + 'm:ss', + ['1:50'] + ], + [ + 'seconds', + ['110'] + ], + [ + 'm and s', + ['1m50s'] + ], + [ + 'ordinal before the timestamp', + ['1', '1:50'] + ], + [ + 'ordinal after the timestamp', + ['110', '1'] + ], + [ + 'alias', + ['gardener', '1:50'] + ], ])('answers the cue on screen at 110s given %s', (_label, args) => { const cue = cueContaining(110) const result = run(...args) diff --git a/scripts/tests/workflow-cache-parity.test.ts b/scripts/tests/workflow-cache-parity.test.ts index fdc580ab..8f721822 100644 --- a/scripts/tests/workflow-cache-parity.test.ts +++ b/scripts/tests/workflow-cache-parity.test.ts @@ -40,7 +40,9 @@ function collectLiveDataCacheSteps(): CacheStep[] { } steps.push({ file, - kind: uses.includes('/save@') ? 'save' : 'restore', + kind: uses.includes('/save@') + ? 'save' + : 'restore', paths: (step.with?.path ?? '').trim().split('\n').map(line => line.trim()).filter(Boolean), }) } diff --git a/scripts/tests/workflow-concurrency.test.ts b/scripts/tests/workflow-concurrency.test.ts index af7d3908..208fc092 100644 --- a/scripts/tests/workflow-concurrency.test.ts +++ b/scripts/tests/workflow-concurrency.test.ts @@ -10,7 +10,9 @@ const workflow = load(readFileSync(resolve(process.cwd(), '.github/workflows/ci. function policy(eventName: string, runId: number, pullRequestNumber?: number) { expect(workflow.concurrency.group).toBe(`\${{ github.workflow }}-\${{ github.event_name }}-\${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}`) expect(workflow.concurrency['cancel-in-progress']).toBe(`\${{ github.event_name == 'pull_request' }}`) - const identifier = eventName === 'pull_request' ? (pullRequestNumber || runId) : runId + const identifier = eventName === 'pull_request' + ? (pullRequestNumber || runId) + : runId return { group: `CI-${eventName}-${identifier}`, cancel: String(eventName === 'pull_request'), diff --git a/scripts/tests/workflow-sbom-policy.test.ts b/scripts/tests/workflow-sbom-policy.test.ts index 2a84d118..56bde6ef 100644 --- a/scripts/tests/workflow-sbom-policy.test.ts +++ b/scripts/tests/workflow-sbom-policy.test.ts @@ -170,7 +170,12 @@ function runScriptBody(body: string, openIssues: unknown[], env: Record { it('runs the failure-issue script end to end and deduplicates by exact title', () => { const { created, updated } = runScriptBody( scriptBodyFor('Create issue on failure'), - [{ number: 314, title: 'Failed to update live data from SBOM sources', state: 'open' }], + [ + { number: 314, title: 'Failed to update live data from SBOM sources', state: 'open' } + ], ) expect(created).toHaveLength(0) diff --git a/scripts/update-back-catalogue.js b/scripts/update-back-catalogue.js index 0cade2bd..2c8aa13a 100644 --- a/scripts/update-back-catalogue.js +++ b/scripts/update-back-catalogue.js @@ -47,7 +47,9 @@ const PLAYLIST_HOSTS = new Set(['www.youtube.com', 'youtube.com', 'music.youtube const MODULE_PATH = import.meta.url.startsWith('file:') ? fileURLToPath(import.meta.url) : null -const ROOT_DIR = MODULE_PATH ? resolve(dirname(MODULE_PATH), '..') : process.cwd() +const ROOT_DIR = MODULE_PATH + ? resolve(dirname(MODULE_PATH), '..') + : process.cwd() const EXPERIENCES_DIR = join(ROOT_DIR, 'public', 'experiences') /** @@ -83,7 +85,9 @@ export function cleanTitle(raw) { do { previous = title title = title.replace(pattern, (match, inner) => - TITLE_JUNK.test(inner) && !/\b(?:feat|from|live|cover|instrumental|intro|part)\b/i.test(inner) ? '' : match) + TITLE_JUNK.test(inner) && !/\b(?:feat|from|live|cover|instrumental|intro|part)\b/i.test(inner) + ? '' + : match) } while (title !== previous) } for (const separator of [' - ', ' | ']) { @@ -132,7 +136,9 @@ export function stripArtistPrefix(title, artist) { } let rest = title.slice(artist.length).replace(/^\s*[-/:—·]\s*/, '').trim() rest = rest.replace(/^["“]([^"”]+)["”]/, '$1').replace(/\s{2,}/g, ' ').trim() - return rest.length > 0 ? rest : title + return rest.length > 0 + ? rest + : title } function normalizeIdentity(value) { @@ -164,9 +170,15 @@ export function buildSegments(entries, chapter) { const override = TRACK_METADATA_OVERRIDES[entry.id] ?? {} const artist = override.artist ?? (reversed ? uploader - : cleanArtist(hasArtistPrefix ? artistPrefix.trim() : uploader)) + : cleanArtist(hasArtistPrefix + ? artistPrefix.trim() + : uploader)) const title = override.title ?? stripArtistPrefix( - reversed ? artistPrefix.trim() : (hasArtistPrefix ? titleParts.join(' - ').trim() : cleanedRawTitle), + reversed + ? artistPrefix.trim() + : (hasArtistPrefix + ? titleParts.join(' - ').trim() + : cleanedRawTitle), artist, ) const songKey = `${normalizeIdentity(artist)}::${normalizeIdentity(title)}` @@ -203,8 +215,12 @@ export function shouldIncludeAlbum(album) { if (!album || typeof album !== 'object') { return false } - const id = typeof album.id === 'string' ? album.id : '' - const title = typeof album.title === 'string' ? album.title : '' + const id = typeof album.id === 'string' + ? album.id + : '' + const title = typeof album.title === 'string' + ? album.title + : '' return PLAYLIST_ID_PATTERN.test(id) && !FEATURED_ALBUM_IDS.has(id) && !FEATURED_ALBUM_TITLES.has(title) } @@ -230,7 +246,12 @@ export function readPlaylistEntries(playlistUrl) { if (!isPlaylistUrl(playlistUrl)) { throw new TypeError(`Refusing to pass non-YouTube playlist URL to yt-dlp: ${String(playlistUrl)}`) } - const output = execFileSync('yt-dlp', ['--flat-playlist', '--dump-single-json', '--', playlistUrl], { + const output = execFileSync('yt-dlp', [ + '--flat-playlist', + '--dump-single-json', + '--', + playlistUrl + ], { encoding: 'utf8', maxBuffer: 64 * 1024 * 1024, }) @@ -238,8 +259,12 @@ export function readPlaylistEntries(playlistUrl) { } export function auditExperience(album, entries, experience) { - const playableEntries = (Array.isArray(entries) ? entries : []).filter(isPlayableEntry) - const generatedSegments = Array.isArray(experience?.segments) ? experience.segments : [] + const playableEntries = (Array.isArray(entries) + ? entries + : []).filter(isPlayableEntry) + const generatedSegments = Array.isArray(experience?.segments) + ? experience.segments + : [] if (playableEntries.length === 0) { throw new Error(`Back catalogue audit failed for ${album.title}: no playable entries found`) @@ -441,9 +466,13 @@ export async function refreshMetadata(options = {}) { } if (MODULE_PATH && process.argv[1] && MODULE_PATH === resolve(process.argv[1])) { - const run = process.argv.includes('--metadata-only') ? refreshMetadata : main + const run = process.argv.includes('--metadata-only') + ? refreshMetadata + : main run().catch((error) => { - console.error(error instanceof Error ? error.message : String(error)) + console.error(error instanceof Error + ? error.message + : String(error)) process.exitCode = 1 }) } diff --git a/scripts/update-contributors.js b/scripts/update-contributors.js index fdd81d4c..57d2d2df 100755 --- a/scripts/update-contributors.js +++ b/scripts/update-contributors.js @@ -4,8 +4,12 @@ import { rename, rm, writeFile } from 'node:fs/promises' import { dirname, join } from 'node:path' import { fileURLToPath, pathToFileURL } from 'node:url' -const MODULE_PATH = import.meta.url.startsWith('file:') ? fileURLToPath(import.meta.url) : null -const ROOT_DIR = MODULE_PATH ? dirname(dirname(MODULE_PATH)) : process.cwd() +const MODULE_PATH = import.meta.url.startsWith('file:') + ? fileURLToPath(import.meta.url) + : null +const ROOT_DIR = MODULE_PATH + ? dirname(dirname(MODULE_PATH)) + : process.cwd() const TARGET_PATH = join(ROOT_DIR, 'public', 'contributors.json') const LOGIN_PATTERN = /^[a-z\d][a-z\d-]{0,38}$/i const AUTOMATION_LOGINS = new Set([ @@ -27,7 +31,10 @@ async function fetchPages(path, allowEmpty = false) { if (process.env.GH_TOKEN) { headers.Authorization = `Bearer ${process.env.GH_TOKEN}` } - const response = await fetch(url, { headers, signal: AbortSignal.timeout(30000) }) + const response = await fetch(url, { + headers, + signal: AbortSignal.timeout(30000) + }) if (response.status === 204 && allowEmpty) { return records } @@ -118,7 +125,9 @@ export async function updateContributors(targetPath = TARGET_PATH) { if (people.size === 0) { throw new Error('No human contributors found; refusing to replace existing data') } - const contributors = [...people.values()].sort((a, b) => + const contributors = [ + ...people.values() + ].sort((a, b) => a.login.toLowerCase().localeCompare(b.login.toLowerCase(), 'en') || a.id - b.id, ) const temporaryPath = `${targetPath}.${process.pid}.tmp` diff --git a/scripts/update-flickr-photos.js b/scripts/update-flickr-photos.js index a96c164a..74b0f6b9 100644 --- a/scripts/update-flickr-photos.js +++ b/scripts/update-flickr-photos.js @@ -5,7 +5,9 @@ import { fileURLToPath } from 'node:url' const MODULE_PATH = import.meta.url.startsWith('file:') ? fileURLToPath(import.meta.url) : null -const ROOT_DIR = MODULE_PATH ? dirname(dirname(MODULE_PATH)) : process.cwd() +const ROOT_DIR = MODULE_PATH + ? dirname(dirname(MODULE_PATH)) + : process.cwd() const TARGET_PATH = join(ROOT_DIR, 'public', 'flickr-photos.json') const CONFIG_PATH = join(ROOT_DIR, 'scripts', 'flickr-curation.json') @@ -50,7 +52,9 @@ export async function fetchWithRateLimit(url, { retries = DEFAULT_CONFIG.maxRetr if (res.status === 429) { const retryAfter = res.headers.get('retry-after') - const waitSeconds = retryAfter ? Number(retryAfter) : Math.min(2 ** attempt * 2, 60) + const waitSeconds = retryAfter + ? Number(retryAfter) + : Math.min(2 ** attempt * 2, 60) if (attempt < retries) { console.warn(`Rate limited (429) for ${url}. Waiting ${waitSeconds}s before retry ${attempt + 1}/${retries}...`) await sleep(waitSeconds * 1000) @@ -157,7 +161,9 @@ export function selectFreshPhotos(candidates, targetTotalPhotos) { export function buildAlbumPageUrl(albumId, userId, page = 1) { const base = `https://www.flickr.com/photos/${userId}/albums/${albumId}` - return page > 1 ? `${base}/page${page}` : base + return page > 1 + ? `${base}/page${page}` + : base } export function extractPhotosFromAlbumHtml(html) { @@ -191,7 +197,9 @@ export function extractPhotosFromAlbumHtml(html) { const server = srcMatch[1] const id = srcMatch[2] const secret = srcMatch[3] - const title = titleMatch ? titleMatch[1].trim() : '' + const title = titleMatch + ? titleMatch[1].trim() + : '' if (!seen.has(id)) { seen.add(id) @@ -288,7 +296,9 @@ export async function scrapeAlbum(album, config, fetcher = fetchWithRateLimit) { const firstHtml = await firstRes.text() const totalPages = countAlbumPages(firstHtml) const targetPages = selectSpreadPages(totalPages, config.maxPagesPerAlbum) - const pageHtmlCache = new Map([[1, firstHtml]]) + const pageHtmlCache = new Map([ + [1, firstHtml] + ]) for (const page of targetPages) { let html = pageHtmlCache.get(page) diff --git a/scripts/update-image-versions.js b/scripts/update-image-versions.js index ef1af546..ed6f54f9 100644 --- a/scripts/update-image-versions.js +++ b/scripts/update-image-versions.js @@ -163,7 +163,9 @@ function isMainModule() { if (isMainModule()) { try { - await updateImageVersions({ checkOnly: process.argv.includes('--check-only') }) + await updateImageVersions({ + checkOnly: process.argv.includes('--check-only') + }) } catch (err) { if (err instanceof ToolingError) { diff --git a/scripts/update-wolves-playlist.js b/scripts/update-wolves-playlist.js index e1e01964..f3fc0063 100644 --- a/scripts/update-wolves-playlist.js +++ b/scripts/update-wolves-playlist.js @@ -10,7 +10,9 @@ const MUSIC_URL = `https://music.youtube.com/playlist?list=${PLAYLIST_ID}` const MODULE_PATH = import.meta.url.startsWith('file:') ? fileURLToPath(import.meta.url) : null -const ROOT_DIR = MODULE_PATH ? resolve(dirname(MODULE_PATH), '..') : process.cwd() +const ROOT_DIR = MODULE_PATH + ? resolve(dirname(MODULE_PATH), '..') + : process.cwd() const PUBLIC_DIR = join(ROOT_DIR, 'public') const TEMPO_CONFIGS = { @@ -105,8 +107,12 @@ export function normalizePlaylistEntries(entries) { return { id, - title: hasArtistPrefix ? titleParts.join(' - ').trim() : title, - artist: ARTIST_OVERRIDES[id] ?? (hasArtistPrefix ? artistPrefix.trim() : uploader), + title: hasArtistPrefix + ? titleParts.join(' - ').trim() + : title, + artist: ARTIST_OVERRIDES[id] ?? (hasArtistPrefix + ? artistPrefix.trim() + : uploader), youtubeVideoId: id, artwork: `wolves-artwork/${id}.jpg`, thumbnailUrl: thumbnail, @@ -127,7 +133,10 @@ function createManifest(tracks) { const { thumbnailUrl: _thumbnailUrl, ...manifestTrack } = track const tempo = TEMPO_CONFIGS[track.id] if (tempo) { - return { ...manifestTrack, ...tempo } + return { + ...manifestTrack, + ...tempo + } } return manifestTrack }), @@ -216,7 +225,9 @@ export async function main() { if (MODULE_PATH && process.argv[1] && MODULE_PATH === resolve(process.argv[1])) { main().catch((error) => { - console.error(error instanceof Error ? error.message : String(error)) + console.error(error instanceof Error + ? error.message + : String(error)) process.exitCode = 1 }) } diff --git a/scripts/wolves-cue-at.mjs b/scripts/wolves-cue-at.mjs index 8c24d9aa..0495a163 100644 --- a/scripts/wolves-cue-at.mjs +++ b/scripts/wolves-cue-at.mjs @@ -31,7 +31,9 @@ function parseTimestamp(value) { return Number(spelled[1]) * 60 + Number(spelled[2]) } const plain = Number(value) - return Number.isFinite(plain) ? plain : Number.NaN + return Number.isFinite(plain) + ? plain + : Number.NaN } function formatTimestamp(seconds) { @@ -42,9 +44,15 @@ function formatTimestamp(seconds) { } function describeCue(cue, at) { - const words = cue.text ? cue.text.trim().split(/\s+/).filter(Boolean).length : 0 - const lines = cue.text ? cue.text.split('\n').length : 0 - const holdEnd = cue.textHoldSeconds != null ? cue.start + cue.textHoldSeconds : cue.end + const words = cue.text + ? cue.text.trim().split(/\s+/).filter(Boolean).length + : 0 + const lines = cue.text + ? cue.text.split('\n').length + : 0 + const holdEnd = cue.textHoldSeconds != null + ? cue.start + cue.textHoldSeconds + : cue.end return { window: `${formatTimestamp(cue.start)} - ${formatTimestamp(cue.end)}`, text: cue.text || '(wordless shot)', @@ -56,8 +64,12 @@ function describeCue(cue, at) { emphasis: cue.emphasis ?? 'normal', position: cue.textPosition ?? 'default', image: cue.backgroundImage ?? (cue.backgroundCrossfade ? '(crossfade)' : '(none)'), - textUp: at == null || !cue.text ? null : at < holdEnd, - holdEnds: cue.textHoldSeconds != null ? formatTimestamp(holdEnd) : '(holds the shot)', + textUp: at == null || !cue.text + ? null + : at < holdEnd, + holdEnds: cue.textHoldSeconds != null + ? formatTimestamp(holdEnd) + : '(holds the shot)', } } @@ -80,7 +92,9 @@ async function main() { if (args.length === 0 || args.includes('--help')) { console.info('usage: node scripts/wolves-cue-at.mjs [video] ') console.info(`videos: ${knownVideoNames()} (default: prologue)`) - process.exit(args.length === 0 ? 1 : 0) + process.exit(args.length === 0 + ? 1 + : 0) } const positional = args.filter(arg => !arg.startsWith('-')) @@ -103,7 +117,12 @@ async function main() { process.exit(1) } - const server = await createServer({ root: ROOT, server: { middlewareMode: true }, appType: 'custom', logLevel: 'error' }) + const server = await createServer({ + root: ROOT, + server: { middlewareMode: true }, + appType: 'custom', + logLevel: 'error' + }) try { const segment = await video.load(specifier => server.ssrLoadModule(specifier)) const cues = segment.overlays diff --git a/scripts/wolves-frame-audit.mjs b/scripts/wolves-frame-audit.mjs index a360d7eb..14b5caa2 100644 --- a/scripts/wolves-frame-audit.mjs +++ b/scripts/wolves-frame-audit.mjs @@ -50,18 +50,27 @@ const SETTLE_ATTEMPTS = 3 function parseViewport(value) { const match = /^(\d+)x(\d+)$/.exec(value ?? '') - return match ? { width: Number(match[1]), height: Number(match[2]) } : null + return match + ? { + width: Number(match[1]), + height: Number(match[2]) + } + : null } function flagValue(args, name) { const index = args.indexOf(name) - return index === -1 ? null : args[index + 1] ?? null + return index === -1 + ? null + : args[index + 1] ?? null } /** The plate a cue puts on screen. A crossfade shot settles on its night plate. */ function plateFor(cue) { const image = cue.backgroundImage ?? cue.backgroundCrossfade?.[0]?.night ?? null - return image ? image.split('/').pop() : null + return image + ? image.split('/').pop() + : null } function normalise(text) { @@ -99,16 +108,42 @@ export function paintedBox({ elementBox, naturalWidth, naturalHeight, objectFit, const [x = '50%', y = '50%'] = position.split(/\s+/) const left = elementBox.left + objectPosition(x, elementBox.width - width) const top = elementBox.top + objectPosition(y, elementBox.height - height) - return { left, top, right: left + width, bottom: top + height, width, height } + return { + left, + top, + right: left + width, + bottom: top + height, + width, + height + } } function selfTest() { - const elementBox = { left: 0, top: 0, right: 1280, bottom: 720, width: 1280, height: 720 } - const contained = paintedBox({ elementBox, naturalWidth: 1024, naturalHeight: 768, objectFit: 'contain', objectPosition: '50% 50%' }) + const elementBox = { + left: 0, + top: 0, + right: 1280, + bottom: 720, + width: 1280, + height: 720 + } + const contained = paintedBox({ + elementBox, + naturalWidth: 1024, + naturalHeight: 768, + objectFit: 'contain', + objectPosition: '50% 50%' + }) if (contained.left !== 160 || contained.width !== 960 || contained.height !== 720) { throw new Error(`contain self-test failed: ${JSON.stringify(contained)}`) } - const covered = paintedBox({ elementBox, naturalWidth: 1024, naturalHeight: 768, objectFit: 'cover', objectPosition: '50% 50%' }) + const covered = paintedBox({ + elementBox, + naturalWidth: 1024, + naturalHeight: 768, + objectFit: 'cover', + objectPosition: '50% 50%' + }) if (covered.left !== 0 || covered.top !== -120 || covered.width !== 1280 || covered.height !== 960) { throw new Error(`cover self-test failed: ${JSON.stringify(covered)}`) } @@ -126,7 +161,9 @@ async function loadCues(videoKey) { const { video } = resolveVideo(videoKey) const loadModule = specifier => server.ssrLoadModule(specifier) const segment = await video.load(loadModule) - const geometry = video.loadGeometry ? await video.loadGeometry(loadModule) : [] + const geometry = video.loadGeometry + ? await video.loadGeometry(loadModule) + : [] return { segment, cues: segment.overlays, geometry } } finally { @@ -220,7 +257,9 @@ async function main() { if (!root) { return false } - const image = [...root.querySelectorAll('img.wolves-intro-overlay-background')] + const image = [ + ...root.querySelectorAll('img.wolves-intro-overlay-background') + ] .find(candidate => candidate.naturalWidth > 0 && Number(getComputedStyle(candidate).opacity) > 0.99) if (!image) { return false @@ -230,7 +269,9 @@ async function main() { } const caption = root.querySelector('.wolves-intro-overlay-text') const captionText = strip(caption?.innerText) - const captionOpacity = caption ? Number(getComputedStyle(caption).opacity) : 0 + const captionOpacity = caption + ? Number(getComputedStyle(caption).opacity) + : 0 if (text) { if (captionText !== text) { return false @@ -252,7 +293,14 @@ async function main() { // satisfied it — which is how a probe reports the shot it did not check. const box = (element) => { const rect = element.getBoundingClientRect() - return { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom, width: rect.width, height: rect.height } + return { + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom, + width: rect.width, + height: rect.height + } } return { image: { @@ -268,7 +316,10 @@ async function main() { // The opacity tolerance belongs only to a wordless shot, where any text is // the previous shot's line on its way out. caption: caption && captionText && (text || captionOpacity > 0.5) - ? { text: caption.innerText.replace(/\s+/g, ' ').trim(), box: box(caption) } + ? { + text: caption.innerText.replace(/\s+/g, ' ').trim(), + box: box(caption) + } : null, frame: { width: window.innerWidth, height: window.innerHeight }, } @@ -284,13 +335,20 @@ async function main() { // Report what was actually on screen, so a failure names the frame it found. const found = await page.evaluate(() => { const root = document.querySelector('.wolves-intro-overlay') - const image = [...root?.querySelectorAll('img.wolves-intro-overlay-background') ?? []] - .map(candidate => ({ element: candidate, opacity: Number(getComputedStyle(candidate).opacity) })) + const image = [ + ...root?.querySelectorAll('img.wolves-intro-overlay-background') ?? [] + ] + .map(candidate => ({ + element: candidate, + opacity: Number(getComputedStyle(candidate).opacity) + })) .sort((a, b) => b.opacity - a.opacity)[0] ?.element ?? null const caption = root?.querySelector('.wolves-intro-overlay-text') return { - plate: image ? decodeURIComponent(image.currentSrc).split('/').pop() : 'none', + plate: image + ? decodeURIComponent(image.currentSrc).split('/').pop() + : 'none', text: caption?.innerText.replace(/\s+/g, ' ').trim() || '(wordless)', } }) @@ -350,14 +408,25 @@ async function main() { await browser.close() } - const unique = list => [...new Set(list)] + const unique = list => [ + ...new Set(list) + ] console.info(`\nduration ${segment.duration}s, ${cues.length} shots checked`) - for (const [heading, list] of [['console errors', consoleErrors], ['page errors', pageErrors], ['bad requests', badRequests], ['problems', problems]]) { + for (const [heading, list] of [ + ['console errors', consoleErrors], + ['page errors', pageErrors], + ['bad requests', badRequests], + ['problems', problems] + ]) { console.info(`\n${heading}:`) - console.info(unique(list).length ? unique(list).map(entry => ` ${entry}`).join('\n') : ' (none)') + console.info(unique(list).length + ? unique(list).map(entry => ` ${entry}`).join('\n') + : ' (none)') } - process.exit(problems.length || consoleErrors.length || pageErrors.length || badRequests.length ? 1 : 0) + process.exit(problems.length || consoleErrors.length || pageErrors.length || badRequests.length + ? 1 + : 0) } main().catch((error) => { diff --git a/scripts/wolves-videos.mjs b/scripts/wolves-videos.mjs index e5378b99..c4822057 100644 --- a/scripts/wolves-videos.mjs +++ b/scripts/wolves-videos.mjs @@ -28,7 +28,12 @@ export const VIDEOS = { }, } -export const ALIASES = { 1: 'prologue', first: 'prologue', gardener: 'prologue', winnower: 'prologue' } +export const ALIASES = { + 1: 'prologue', + first: 'prologue', + gardener: 'prologue', + winnower: 'prologue' +} /** * Resolve a caller's name for a video to its registry entry. diff --git a/src/WolvesApp.vue b/src/WolvesApp.vue index 8dbeb7b1..357ad031 100644 --- a/src/WolvesApp.vue +++ b/src/WolvesApp.vue @@ -94,7 +94,9 @@ async function launchExperience(manifest: ExperienceManifest) { const isDirectorsCut = ref(false) const introVideos = computed(() => - isDirectorsCut.value ? buildDirectorsCutVideoSequence() : buildIntroVideoSequence() + isDirectorsCut.value + ? buildDirectorsCutVideoSequence() + : buildIntroVideoSequence() ) const INTRO_HANDOFF_FADE_MS = 400 const intro = ref | null>(null) diff --git a/src/WolvesTeaserApp.vue b/src/WolvesTeaserApp.vue index 65717565..a819ed22 100644 --- a/src/WolvesTeaserApp.vue +++ b/src/WolvesTeaserApp.vue @@ -52,7 +52,9 @@ function plate(id: string): TrailerPlate | undefined { /** A plate's authored fade, so nothing hard-cuts that should not. */ function opacityOf(id: string): number { const found = plate(id) - return found ? trailerPlateOpacity(found, visualTime.value) : 0 + return found + ? trailerPlateOpacity(found, visualTime.value) + : 0 } // The page heading steps aside before the cut's own main title arrives, so the diff --git a/src/components/RssFeed.vue b/src/components/RssFeed.vue index 00314c84..924d8bed 100644 --- a/src/components/RssFeed.vue +++ b/src/components/RssFeed.vue @@ -93,7 +93,9 @@ async function fetchFeed() { } } catch (err) { - error.value = err instanceof Error ? err.message : 'Failed to load feed' + error.value = err instanceof Error + ? err.message + : 'Failed to load feed' console.error('RSS Feed Error:', err) } finally { diff --git a/src/components/TopNavbar.vue b/src/components/TopNavbar.vue index 0a54f6b3..dea735b9 100644 --- a/src/components/TopNavbar.vue +++ b/src/components/TopNavbar.vue @@ -27,8 +27,14 @@ const rightNavLinks: NavLink[] = [ name: t('TopBar.Docs'), href: 'https://docs.projectbluefin.io/introduction' }, - { name: t('TopBar.Blog'), href: 'https://docs.projectbluefin.io/blog' }, - { name: t('TopBar.Reports'), href: 'https://docs.projectbluefin.io/reports' }, + { + name: t('TopBar.Blog'), + href: 'https://docs.projectbluefin.io/blog' + }, + { + name: t('TopBar.Reports'), + href: 'https://docs.projectbluefin.io/reports' + }, { name: t('TopBar.Discussions'), href: 'https://github.com/ublue-os/bluefin/discussions', diff --git a/src/components/dakota/DakotaVersionChips.vue b/src/components/dakota/DakotaVersionChips.vue index 91a89a85..2e6f0301 100644 --- a/src/components/dakota/DakotaVersionChips.vue +++ b/src/components/dakota/DakotaVersionChips.vue @@ -43,7 +43,11 @@ const chips = computed(() => { return Object.entries(versions.value.packages) .filter(([key]) => !props.keys || props.keys.includes(key)) .filter(([, v]) => v) - .map(([key, value]) => ({ label: LABELS[key] ?? key, value, isFeature: FEATURE_KEYS.has(key) })) + .map(([key, value]) => ({ + label: LABELS[key] ?? key, + value, + isFeature: FEATURE_KEYS.has(key) + })) }) diff --git a/src/components/sections/SectionPicker.vue b/src/components/sections/SectionPicker.vue index e46f47dd..821dd9f4 100644 --- a/src/components/sections/SectionPicker.vue +++ b/src/components/sections/SectionPicker.vue @@ -29,8 +29,23 @@ const PACKAGE_LABELS: Record = { // Kernel/init first, then graphics, then desktop. Every key here must be // resolvable from the image SBOM — see scripts/lib/image-sbom-registry.js. -const DAKOTA_KEYS = ['kernel', 'systemd', 'bootc', 'mesa', 'nvidia', 'gnome', 'pipewire'] -const CLASSIC_KEYS = ['base', 'kernel', 'systemd', 'mesa', 'gnome', 'pipewire'] +const DAKOTA_KEYS = [ + 'kernel', + 'systemd', + 'bootc', + 'mesa', + 'nvidia', + 'gnome', + 'pipewire' +] +const CLASSIC_KEYS = [ + 'base', + 'kernel', + 'systemd', + 'mesa', + 'gnome', + 'pipewire' +] async function loadVersions() { try { @@ -66,7 +81,12 @@ const classicRows = computed(() => { } return CLASSIC_KEYS .filter(key => stream[key]) - .map(key => ({ label: key === 'base' ? 'Base OS' : PACKAGE_LABELS[key] ?? key, value: stream[key] })) + .map(key => ({ + label: key === 'base' + ? 'Base OS' + : PACKAGE_LABELS[key] ?? key, + value: stream[key] + })) }) const classicDownloads = computed(() => [ diff --git a/src/components/server/ServerDemos.vue b/src/components/server/ServerDemos.vue index f91d2ef8..855bcb37 100644 --- a/src/components/server/ServerDemos.vue +++ b/src/components/server/ServerDemos.vue @@ -3,7 +3,13 @@ import { onMounted, onUnmounted, ref } from 'vue' import ServerFeatures from './ServerFeatures.vue' import ServerHighlights from './ServerHighlights.vue' -const phases: Phase[] = ['cluster', 'cpu', 'storage', 'highlights', 'features'] +const phases: Phase[] = [ + 'cluster', + 'cpu', + 'storage', + 'highlights', + 'features' +] const baseUrl = import.meta.env.BASE_URL diff --git a/src/components/server/ServerFeatures.vue b/src/components/server/ServerFeatures.vue index c5f79000..9eea4442 100644 --- a/src/components/server/ServerFeatures.vue +++ b/src/components/server/ServerFeatures.vue @@ -29,20 +29,82 @@ interface SysextCard { const cards: SysextCard[] = [ // CNCF Graduated - { name: 'Falco', href: 'https://falco.org', icon: IconShieldCheck, desc: 'Runtime security & threat detection', cncf: 'graduated' }, + { + name: 'Falco', + href: 'https://falco.org', + icon: IconShieldCheck, + desc: 'Runtime security & threat detection', + cncf: 'graduated' + }, // CNCF Incubating - { name: 'KubeVirt', href: 'https://kubevirt.io', icon: IconMonitorMultiple, desc: 'Virtual Machine Management', cncf: 'incubating' }, - { name: 'KubeStellar', href: 'https://kubestellar.io', icon: IconKubernetes, desc: 'Multi-cluster management and dashboard', cncf: 'incubating' }, + { + name: 'KubeVirt', + href: 'https://kubevirt.io', + icon: IconMonitorMultiple, + desc: 'Virtual Machine Management', + cncf: 'incubating' + }, + { + name: 'KubeStellar', + href: 'https://kubestellar.io', + icon: IconKubernetes, + desc: 'Multi-cluster management and dashboard', + cncf: 'incubating' + }, // CNCF Sandbox - { name: 'k3s', href: 'https://k3s.io', icon: IconKubernetes, desc: 'Lightweight Kubernetes cluster', cncf: 'sandbox' }, - { name: 'Inspektor Gadget', href: 'https://www.inspektor-gadget.io', icon: IconMagnifyScan, desc: 'eBPF-based debugging & tracing', cncf: 'sandbox' }, - { name: 'kured', href: 'https://kured.dev', icon: IconPowerCycle, desc: 'Safe automatic node reboots for Kubernetes', cncf: 'sandbox' }, - { name: 'Podman', href: 'https://podman.io', icon: IconDocker, desc: 'Daemonless container engine', cncf: 'sandbox' }, + { + name: 'k3s', + href: 'https://k3s.io', + icon: IconKubernetes, + desc: 'Lightweight Kubernetes cluster', + cncf: 'sandbox' + }, + { + name: 'Inspektor Gadget', + href: 'https://www.inspektor-gadget.io', + icon: IconMagnifyScan, + desc: 'eBPF-based debugging & tracing', + cncf: 'sandbox' + }, + { + name: 'kured', + href: 'https://kured.dev', + icon: IconPowerCycle, + desc: 'Safe automatic node reboots for Kubernetes', + cncf: 'sandbox' + }, + { + name: 'Podman', + href: 'https://podman.io', + icon: IconDocker, + desc: 'Daemonless container engine', + cncf: 'sandbox' + }, // Community - { name: 'Docker', href: 'https://docker.com', icon: IconDocker, desc: 'You probably have a bunch of these' }, - { name: 'Tailscale', href: 'https://tailscale.com', icon: IconVpn, desc: 'Zero-config WireGuard mesh VPN' }, - { name: 'Incus', href: 'https://linuxcontainers.org/incus/', icon: IconServerNetwork, desc: 'Container & VM manager' }, - { name: 'ZFS', href: 'https://openzfs.org', icon: IconDatabase, desc: 'Advanced filesystem & volume manager' }, + { + name: 'Docker', + href: 'https://docker.com', + icon: IconDocker, + desc: 'You probably have a bunch of these' + }, + { + name: 'Tailscale', + href: 'https://tailscale.com', + icon: IconVpn, + desc: 'Zero-config WireGuard mesh VPN' + }, + { + name: 'Incus', + href: 'https://linuxcontainers.org/incus/', + icon: IconServerNetwork, + desc: 'Container & VM manager' + }, + { + name: 'ZFS', + href: 'https://openzfs.org', + icon: IconDatabase, + desc: 'Advanced filesystem & volume manager' + }, ] const tierLabel: Record = { diff --git a/src/components/wolves/WolvesBackCatalogue.vue b/src/components/wolves/WolvesBackCatalogue.vue index 0e872791..14c44c0c 100644 --- a/src/components/wolves/WolvesBackCatalogue.vue +++ b/src/components/wolves/WolvesBackCatalogue.vue @@ -14,7 +14,9 @@ const emit = defineEmits<{ launch: [manifest: ExperienceManifest] }>() const experiences = ref([]) function resolveArtwork(artwork: string): string { - return /^https?:/.test(artwork) ? artwork : `${import.meta.env.BASE_URL}${artwork}` + return /^https?:/.test(artwork) + ? artwork + : `${import.meta.env.BASE_URL}${artwork}` } onMounted(async () => { diff --git a/src/components/wolves/WolvesCharacterGallery.vue b/src/components/wolves/WolvesCharacterGallery.vue index 968cf04d..3fd2f3f2 100644 --- a/src/components/wolves/WolvesCharacterGallery.vue +++ b/src/components/wolves/WolvesCharacterGallery.vue @@ -118,7 +118,9 @@ onMounted(async () => { return } const payload = await response.json() as { characters?: CharacterCard[] } - characters.value = Array.isArray(payload.characters) ? payload.characters : [] + characters.value = Array.isArray(payload.characters) + ? payload.characters + : [] } catch { // The gallery is additive; the lobby renders without it on failure. diff --git a/src/components/wolves/WolvesComicReader.vue b/src/components/wolves/WolvesComicReader.vue index 3870b641..3d9ca97a 100644 --- a/src/components/wolves/WolvesComicReader.vue +++ b/src/components/wolves/WolvesComicReader.vue @@ -140,7 +140,9 @@ let duskTimer: ReturnType | null = null const trackZeroFlickrPhotoIds = new Set( wallpapers.flatMap((wallpaper) => { const photoId = wallpaper.name?.startsWith('wolves/people/') && wallpaper.name.match(/\d{8,}/)?.[0] - return photoId ? [photoId] : [] + return photoId + ? [photoId] + : [] }), ) // CNCF feed photos whose Track 0 copy lives under a curated caption filename @@ -176,7 +178,9 @@ let crossfadeTimer: ReturnType | null = null const trackChangeSerial = ref(0) const activePhoto = computed(() => { - return activeBuffer.value === 'A' ? photoA.value : photoB.value + return activeBuffer.value === 'A' + ? photoA.value + : photoB.value }) /** @@ -429,7 +433,11 @@ const timelineSlides = computed(() => { // The slice must cover every hero index or a locked portrait is silently // dropped and every following locked window starts early. const peoplePool1 = andyAdvisorPhoto - ? [...shuffledPeople.slice(0, 7), andyAdvisorPhoto, ...shuffledPeople.slice(7, 15)] + ? [ + ...shuffledPeople.slice(0, 7), + andyAdvisorPhoto, + ...shuffledPeople.slice(7, 15) + ] : shuffledPeople.slice(0, 16) const jonoPhoto = peoplePool1.find(item => item.id === jonoBaconSlideId) const marinaPhoto = peoplePool1.find(item => item.id === marinaMooreSlideId) @@ -445,17 +453,28 @@ const timelineSlides = computed(() => { && bluefinGroupPhotos.every(entry => entry.photo !== undefined) const lockedHeroSlideIds = new Set([ jonoBaconSlideId, - ...(marinaPhoto ? [marinaMooreSlideId] : []), - ...(hasBluefinGroupLock ? bluefinGroupSlides.map(slide => slide.id) : []), - ...(lauraPhoto ? [lauraSlideId] : []), - ...(topheePhoto ? [topheeSlideId] : []), + ...(marinaPhoto + ? [marinaMooreSlideId] + : []), + ...(hasBluefinGroupLock + ? bluefinGroupSlides.map(slide => slide.id) + : []), + ...(lauraPhoto + ? [lauraSlideId] + : []), + ...(topheePhoto + ? [topheeSlideId] + : []), ]) const remainingPeoplePool1 = peoplePool1.filter(item => !lockedHeroSlideIds.has(item.id), ) if (!jonoPhoto) { - const sec3Items = [...normalPool2, ...peoplePool1] + const sec3Items = [ + ...normalPool2, + ...peoplePool1 + ] const sec3Cuts = trackZeroBeatCuts(currentTime, TRACK_ZERO_PRESENTATION_SECTIONS.contributorChorus.endTime, sec3Items.length, TRACK_ZERO_PRESENTATION_SECTIONS.contributorChorus.beatGroups) sec3Items.forEach((item, index) => { const endTime = sec3Cuts[index] @@ -839,7 +858,10 @@ const backCatalogueCuratedPhotos = computed(() => { // the `wolves/` subtree, so they are registered explicitly in // `artwork-wallpapers.ts` — which is also what keeps the import an // allowlist. Aurora artwork is excluded there and pinned by a test. - const familyArtwork = [...ublueArtworkWallpapers, ...bazziteArtworkWallpapers].map(wallpaper => ({ + const familyArtwork = [ + ...ublueArtworkWallpapers, + ...bazziteArtworkWallpapers + ].map(wallpaper => ({ id: wallpaper.name, isLocal: true, path: wallpaper.name, @@ -851,7 +873,12 @@ const backCatalogueCuratedPhotos = computed(() => { kind: wallpaper.kind, })) - return [...showcaseAndArt, ...heroShots, ...extraCharacters, ...familyArtwork] + return [ + ...showcaseAndArt, + ...heroShots, + ...extraCharacters, + ...familyArtwork + ] }) const activeTimelineSlide = computed(() => { @@ -916,7 +943,9 @@ const currentSlideTransitionDuration = computed(() => { return 1000 } // Long ambient holds get long dissolves; beat-length slides get near-cuts. - const crossfadeCap = slide.duration >= 8 ? 1600 : 800 + const crossfadeCap = slide.duration >= 8 + ? 1600 + : 800 return Math.min(crossfadeCap, slide.duration * 300) }) @@ -943,7 +972,9 @@ function daynightNightOpacity(slide: any, slideIndex: number): number { } const elapsed = (props.playlistCurrentTime ?? 0) - startTime const ratio = elapsed / duration - return Number.isFinite(ratio) ? Math.min(1.0, Math.max(0.0, ratio)) : 0 + return Number.isFinite(ratio) + ? Math.min(1.0, Math.max(0.0, ratio)) + : 0 } const daynightNightOpacityA = computed(() => daynightNightOpacity(photoA.value, slideAIndex.value)) @@ -1082,7 +1113,9 @@ function preloadUrl(url: string, priority: 'high' | 'low'): Promise { const urls = photo?.type === 'daynight' ? [`${baseUrl}img/wallpapers/${photo.dayName}`, `${baseUrl}img/wallpapers/${photo.nightName}`] - : [getFlickrPhotoUrl(photo)] + : [ + getFlickrPhotoUrl(photo) + ] return Promise.all(urls.map(url => preloadUrl(url, priority))).then((aspects) => { // Day/night halves share an aspect; take whichever half measured. const aspect = aspects.find(candidate => candidate !== null) @@ -1139,7 +1172,9 @@ watch([activeDisplayIndex, mixedPhotosToUse, trackChangeSerial], ([newVal]) => { if (!activePhotoObj) { return } - const displayedIndex = activeBuffer.value === 'A' ? slideAIndex.value : slideBIndex.value + const displayedIndex = activeBuffer.value === 'A' + ? slideAIndex.value + : slideBIndex.value if (activePhoto.value === activePhotoObj && displayedIndex === newVal) { // Already on stage (a boundary bump that resolved to the same slide object). return @@ -1289,11 +1324,15 @@ function getFlickrPhotoUrl(photo: any) { // unusually panoramic assets (see wideAspectStems in generate-wallpapers.js) // letterbox badly under contain, so they opt into cover instead. function photoObjectFit(photo: any) { - return photo?.fit === 'cover' ? 'cover' : 'contain' + return photo?.fit === 'cover' + ? 'cover' + : 'contain' } function photoObjectPosition(photo: any) { - return isWolvesExperience.value && photo?.id === ghostsInTheMistOpeningSlide.photoId ? 'center top' : 'center' + return isWolvesExperience.value && photo?.id === ghostsInTheMistOpeningSlide.photoId + ? 'center top' + : 'center' } /** @@ -1341,7 +1380,9 @@ function snapshotLaterTrackPhotos() { isLocal: false, path: `https://live.staticflickr.com/${photo.server}/${photo.id}_${photo.secret}_${isFeaturedOpening ? ghostsInTheMistOpeningSlide.imageSizeSuffix : 'b'}.jpg`, title: isFeaturedOpening ? ghostsInTheMistOpeningSlide.title : photo.title, - description: isFeaturedOpening ? ghostsInTheMistOpeningSlide.descriptionParts.join('\n\n') : undefined, + description: isFeaturedOpening + ? ghostsInTheMistOpeningSlide.descriptionParts.join('\n\n') + : undefined, type: 'single' as const, dayName: undefined, nightName: undefined, @@ -1446,7 +1487,9 @@ function shuffleWallpapers(array: any[]): any[] { const r = Math.random() // if people, score is in [0.45, 1.05] (tends toward end) // if showcase or story illustration, score is in [0.0, 0.6] (tends toward start) - const score = isPeople ? 0.45 + r * 0.6 : r * 0.6 + const score = isPeople + ? 0.45 + r * 0.6 + : r * 0.6 return { item, score } }) @@ -1479,7 +1522,9 @@ onMounted(async () => { const response = await fetch(`${import.meta.env.BASE_URL}flickr-photos.json`) if (response.ok) { const rawPhotos = await response.json() - flickrPhotos.value = Array.isArray(rawPhotos) ? rawPhotos : [] + flickrPhotos.value = Array.isArray(rawPhotos) + ? rawPhotos + : [] } } catch (err) { diff --git a/src/components/wolves/WolvesIntroOverlay.vue b/src/components/wolves/WolvesIntroOverlay.vue index 52346322..b89a9e53 100644 --- a/src/components/wolves/WolvesIntroOverlay.vue +++ b/src/components/wolves/WolvesIntroOverlay.vue @@ -73,7 +73,9 @@ const audioMountHost = ref(null) * segments' durations are known upfront; a video segment's entry stays 0 until its player * reports a real duration (or its `maxDuration` cutoff) in `onReady`. */ -const segmentDurations = ref(props.videos.map(video => (isTextSegment(video) ? video.duration : 0))) +const segmentDurations = ref(props.videos.map(video => (isTextSegment(video) + ? video.duration + : 0))) const currentSegment = computed(() => props.videos[sequenceState.value.index]) const canGoToPrevious = computed(() => sequenceState.value.index > 0) @@ -193,7 +195,9 @@ const activeMediaTitle = computed(() => activeBurnedInCaptions.value.find(cue => */ const activeCues = computed(() => activeOverlayCues(currentSegment.value?.overlays, currentTime.value)) const activeGuardianCues = computed(() => - activeComicTitleCardCue.value ? [] : activeCues.value.filter(cue => !cue.statusOnly), + activeComicTitleCardCue.value + ? [] + : activeCues.value.filter(cue => !cue.statusOnly), ) /** @@ -208,7 +212,11 @@ function parseGuardianCue(text: string): { guardianClass: string, name: string, return undefined } const [guardianClass, name, ...titleParts] = parts - return { guardianClass, name, title: titleParts.join(' — ') } + return { + guardianClass, + name, + title: titleParts.join(' — ') + } } /** @@ -218,18 +226,30 @@ function parseGuardianCue(text: string): { guardianClass: string, name: string, */ function titleSegments(title: string, blingTitle: string | undefined): { text: string, bling: boolean }[] { if (!blingTitle) { - return [{ text: title, bling: false }] + return [ + { text: title, bling: false } + ] } const index = title.indexOf(blingTitle) if (index === -1) { - return [{ text: title, bling: false }] + return [ + { text: title, bling: false } + ] } const before = title.slice(0, index) const after = title.slice(index + blingTitle.length) return [ - ...(before ? [{ text: before, bling: false }] : []), + ...(before + ? [ + { text: before, bling: false } + ] + : []), { text: blingTitle, bling: true }, - ...(after ? [{ text: after, bling: false }] : []), + ...(after + ? [ + { text: after, bling: false } + ] + : []), ] } @@ -500,8 +520,12 @@ const sceneCrossfadeDuration = computed(() => ( * verified in is not, and a value sampled once at mount is wrong for every resize * after it. */ -const viewportWidth = ref(typeof window === 'undefined' ? 1920 : window.innerWidth) -const viewportHeight = ref(typeof window === 'undefined' ? 1080 : window.innerHeight) +const viewportWidth = ref(typeof window === 'undefined' + ? 1920 + : window.innerWidth) +const viewportHeight = ref(typeof window === 'undefined' + ? 1080 + : window.innerHeight) function trackViewportSize(): void { viewportWidth.value = window.innerWidth @@ -563,15 +587,26 @@ const slimTitleSegments = computed(() => { const wordStart = line.indexOf(word) if (wordStart < 0) { - return [{ text: line, brand: false }] + return [ + { text: line, brand: false } + ] } const letterIndex = wordStart + word.indexOf('F') return [ - { text: line.slice(0, letterIndex), brand: false }, - { text: line.slice(letterIndex, letterIndex + 1), brand: true }, - { text: line.slice(letterIndex + 1), brand: false }, + { + text: line.slice(0, letterIndex), + brand: false + }, + { + text: line.slice(letterIndex, letterIndex + 1), + brand: true + }, + { + text: line.slice(letterIndex + 1), + brand: false + }, ].filter(part => part.text.length > 0) }) @@ -612,7 +647,12 @@ const activeCrossfadeStage = computed(() => { const elapsed = currentTime.value - cue.start const index = Math.min(stages.length - 1, Math.max(0, Math.floor(elapsed / stageDuration))) const stageStart = cue.start + index * stageDuration - return { crossfade: stages[index], index, start: stageStart, duration: stageDuration } + return { + crossfade: stages[index], + index, + start: stageStart, + duration: stageDuration + } }) /** @@ -657,7 +697,9 @@ function stripIntroPunctuation(text: string): string { } function formatIntroCueText(text: string, preservePunctuation?: boolean): string { - return preservePunctuation ? text : stripIntroPunctuation(text) + return preservePunctuation + ? text + : stripIntroPunctuation(text) } function activeVideoId(segment: Extract): string { @@ -674,14 +716,18 @@ function activeVideoCutoffDuration(segment: Extract, time: number): number { const cutoff = activeVideoCutoffDuration(segment) - return cutoff == null ? time : Math.min(time, cutoff) + return cutoff == null + ? time + : Math.min(time, cutoff) } const overlayTextParts = computed(() => { const cue = overlayCueForDisplay.value const text = formatIntroCueText(overlayText.value ?? '', cue?.preservePunctuation) const explicitHighlights = cue?.highlightSubstrings - ?? (cue?.highlightSubstring ? [cue.highlightSubstring] : undefined) + ?? (cue?.highlightSubstring + ? [cue.highlightSubstring] + : undefined) return buildOverlayTextParts( text, explicitHighlights?.map(highlight => formatIntroCueText(highlight, cue?.preservePunctuation)), @@ -969,7 +1015,11 @@ async function loadAudioTrack(youtubeVideoId: string | undefined, token: number, // video segments skip a rating card, using YouTube's own `start` param. playerVars: getChromeFreeYoutubePlayerVars({ autoplay: 1, - ...(startSeconds ? { start: Math.round(startSeconds) } : {}), + ...(startSeconds + ? { + start: Math.round(startSeconds) + } + : {}), }), events: { // The background embed's own end state is the scored card's completion backstop: a real @@ -1032,7 +1082,9 @@ function startTextSegment(segment: Extract) { // Watchdog only, never a cue source: how long the player's own clock has sat on the // identical reading. A playing player reports a new value every tick, so any repeat is // buffering, an ad, or the end of the track — `isTextSegmentComplete` decides which. - audioClockStalledMs = audioClock === lastAudioClockReading ? audioClockStalledMs + TEXT_CLOCK_TICK_MS : 0 + audioClockStalledMs = audioClock === lastAudioClockReading + ? audioClockStalledMs + TEXT_CLOCK_TICK_MS + : 0 lastAudioClockReading = audioClock currentTime.value = audioClock // Blocked autoplay, which is the one stall that is not an ad and never recovers on its @@ -1104,7 +1156,10 @@ function beginSegmentPlayback( if (!options.isDeepLink) { // Reload only for front-door entries: loadVideoById restarts playback from the // buffered beginning, which would discard a deep-linked Guardian opening time. - player?.loadVideoById?.({ videoId: activeVideoId(segment), startSeconds: openingTime }) + player?.loadVideoById?.({ + videoId: activeVideoId(segment), + startSeconds: openingTime + }) } player?.seekTo?.(openingTime, true) } @@ -1172,7 +1227,11 @@ function buildSegmentPlayer( autoplay: options.parked ? 0 : 1, // Keep YouTube's own captions off so the burned-in subtitles remain the only overlay. cc_load_policy: 0, - ...(options.startTime ? { start: Math.round(options.startTime) } : {}), + ...(options.startTime + ? { + start: Math.round(options.startTime) + } + : {}), }) let self: YoutubePlayer | null = null @@ -1249,7 +1308,10 @@ function buildSegmentPlayer( */ function parkPrewarmedPlayer(warmed: YoutubePlayer, segment: Extract, startTime: number) { warmed.mute?.() - warmed.cueVideoById?.({ videoId: activeVideoId(segment), startSeconds: startTime }) + warmed.cueVideoById?.({ + videoId: activeVideoId(segment), + startSeconds: startTime + }) warmed.seekTo?.(startTime, true) warmed.pauseVideo?.() // Adopt on readiness rather than on construction: readiness is what makes a warmed player @@ -1298,7 +1360,9 @@ async function prewarmNextSegment() { return } - const deepLinkTime = deepLinkStartConsumed ? null : (props.startAtNativeTime ?? null) + const deepLinkTime = deepLinkStartConsumed + ? null + : (props.startAtNativeTime ?? null) deepLinkStartConsumed = true prewarmedStartSeconds = Math.max(next.startOffset ?? 0, deepLinkTime ?? 0) prewarmedIsDeepLink = deepLinkTime != null @@ -1401,7 +1465,9 @@ async function loadVideoSegment(segment: Extract { mediaTitle: activeMediaTitle.value, showVoiceOverToggle: canToggleDestinyVoiceOver.value, voiceOverEnabled: canToggleDestinyVoiceOver.value ? destinyVoiceOverEnabled.value : false, - moods: isDirectorsCutPrologue.value ? PROLOGUE_MOODS.map(mood => ({ id: mood.id, label: mood.label })) : [], + moods: isDirectorsCutPrologue.value + ? PROLOGUE_MOODS.map(mood => ({ id: mood.id, label: mood.label })) + : [], activeMoodId: activeMoodId.value, showCaptionToggle: canToggleDestinyCaptions.value, captionsEnabled: canToggleDestinyCaptions.value ? destinyCaptionsEnabled.value : false, @@ -1628,7 +1696,9 @@ watchEffect(() => { getCurrentTime: () => currentTime.value, getDuration: () => activeSegmentDuration.value, getPlayerDuration: () => player?.getDuration?.() ?? 0, - getVideoId: () => (currentSegment.value && isVideoSegment(currentSegment.value) ? activeVideoId(currentSegment.value) : ''), + getVideoId: () => (currentSegment.value && isVideoSegment(currentSegment.value) + ? activeVideoId(currentSegment.value) + : ''), isPaused: () => isPaused.value, setVoiceOverEnabled, setCaptionsEnabled, diff --git a/src/components/wolves/cinematic/CinematicCaptions.vue b/src/components/wolves/cinematic/CinematicCaptions.vue index f8d7b446..58e32e53 100644 --- a/src/components/wolves/cinematic/CinematicCaptions.vue +++ b/src/components/wolves/cinematic/CinematicCaptions.vue @@ -9,7 +9,9 @@ const store = useCinematicStore() // source video's native timeline, so cues stay aligned with authored trims. const cues = computed(() => { const text = store.segment.captionsText - return text ? parseCaptionCues(text) : [] + return text + ? parseCaptionCues(text) + : [] }) const currentCue = computed(() => activeCaptionCue(cues.value, store.nativeTime)) diff --git a/src/components/wolves/cinematic/CinematicStage.vue b/src/components/wolves/cinematic/CinematicStage.vue index 91f94285..7e105f06 100644 --- a/src/components/wolves/cinematic/CinematicStage.vue +++ b/src/components/wolves/cinematic/CinematicStage.vue @@ -35,7 +35,9 @@ const layerFadeMs = computed(() => // segment the time-varying incoming signal is the large label and the track title // sits in the detail line; elsewhere it shows chapter + title. const plateLabel = computed(() => - isTrackZero.value ? getWolvesHudLabel(store.nativeTime) : store.segment.title, + isTrackZero.value + ? getWolvesHudLabel(store.nativeTime) + : store.segment.title, ) const plateDetail = computed(() => isTrackZero.value ? 'Seven Days to the Wolves' : store.segment.chapter, diff --git a/src/components/wolves/cinematic/CinematicTransition.vue b/src/components/wolves/cinematic/CinematicTransition.vue index bb5029cd..4614655c 100644 --- a/src/components/wolves/cinematic/CinematicTransition.vue +++ b/src/components/wolves/cinematic/CinematicTransition.vue @@ -42,7 +42,9 @@ const renderedLines = computed ({ kind: 'terminal' as const, text }))) const transitionStyle = computed(() => ({ '--wc-transition-enter-ms': prefersReducedMotion.value ? '0ms' : '400ms', - '--wc-transition-leave-ms': prefersReducedMotion.value ? '0ms' : `${TRANSITION_LEAVE_MS}ms`, + '--wc-transition-leave-ms': prefersReducedMotion.value + ? '0ms' + : `${TRANSITION_LEAVE_MS}ms`, })) function syncReducedMotion() { diff --git a/src/components/wolves/cinematic/MediaWidget.vue b/src/components/wolves/cinematic/MediaWidget.vue index 81ae0765..5c423254 100644 --- a/src/components/wolves/cinematic/MediaWidget.vue +++ b/src/components/wolves/cinematic/MediaWidget.vue @@ -55,14 +55,18 @@ const showCatalogueCredit = computed(() => ) const artworkSrc = computed(() => { const artwork = props.artwork ?? store.display.artwork - return artwork.startsWith('http') || artwork.startsWith('/') ? artwork : `${base}${artwork}` + return artwork.startsWith('http') || artwork.startsWith('/') + ? artwork + : `${base}${artwork}` }) function formatTime(totalSeconds: number): string { const seconds = Math.max(0, Math.floor(totalSeconds)) const minutes = Math.floor(seconds / 60) const rest = seconds % 60 - return `${minutes}:${rest < 10 ? '0' : ''}${rest}` + return `${minutes}:${rest < 10 + ? '0' + : ''}${rest}` } const segmentElapsed = computed(() => externalPlayback.value ? props.elapsed! : store.segmentElapsed) diff --git a/src/components/wolves/cinematic/TheaterExperience.vue b/src/components/wolves/cinematic/TheaterExperience.vue index 2d7dddd0..d2cce4ee 100644 --- a/src/components/wolves/cinematic/TheaterExperience.vue +++ b/src/components/wolves/cinematic/TheaterExperience.vue @@ -43,7 +43,9 @@ const slotElapsed = computed(() => Math.min( )) const isTrackZero = computed(() => store.segment.trackZeroExperience === true) const isWolvesPresentation = computed(() => store.isWolvesPresentation) -const thesis = computed(() => (isTrackZero.value ? getWolvesThesisState(time.value) : getWolvesThesisState(0))) +const thesis = computed(() => (isTrackZero.value + ? getWolvesThesisState(time.value) + : getWolvesThesisState(0))) // Static ordered video-loop sidecar for Track 0's desktop right column, below // the scheduled lore panel. This is a plain native