diff --git a/packages/releases/src/feeds.ts b/packages/releases/src/feeds.ts index 92d7873..83942e5 100644 --- a/packages/releases/src/feeds.ts +++ b/packages/releases/src/feeds.ts @@ -1,5 +1,4 @@ import { Pathy } from '@bscotch/pathy'; -import { assert } from '@bscotch/utility/browser'; import { z } from 'zod'; import { defaultNotesCachePath } from './constants.js'; import { downloadRssFeed, findPairedRuntime } from './feeds.lib.js'; @@ -23,14 +22,15 @@ export async function computeReleasesSummaryWithNotes( releases ||= await computeReleasesSummary(); const notes = await listReleaseNotes(releases, cache); const withNotes: GameMakerReleaseWithNotes[] = []; + const emptyChanges = { + changes: { + since: null, + groups: [], + }, + }; for (const release of releases) { - const ideNotes = notes[release.ide.notesUrl]; - assert(ideNotes, `No notes found for IDE release ${release.ide.version}`); - const runtimeNotes = notes[release.runtime.notesUrl]; - assert( - runtimeNotes, - `No notes found for IDE release ${release.runtime.version}`, - ); + const ideNotes = notes[release.ide.notesUrl] || emptyChanges; + const runtimeNotes = notes[release.runtime.notesUrl] || emptyChanges; const ide = { ...release.ide, notes: ideNotes.changes }; const runtime = { ...release.runtime, notes: runtimeNotes.changes }; withNotes.push({ diff --git a/packages/releases/src/notes.ts b/packages/releases/src/notes.ts index 839ba6b..704405b 100644 --- a/packages/releases/src/notes.ts +++ b/packages/releases/src/notes.ts @@ -25,7 +25,9 @@ export async function listReleaseNotes( const cacheData = await cachePath.read({ fallback: {} }); for (const release of releases) { for (const type of ['ide', 'runtime'] as const) { - const url = release[type].notesUrl; + let url = release[type].notesUrl; + // URL can be malformed + url = url.replace(/^(.+\.cloudfront\.net)(release.*)$/, '$1/$2'); if (cacheData[url]) { if (!cacheData[url].type) { cacheData[url].type = type; @@ -92,7 +94,7 @@ function cleanNotes(cachedNotes: RawReleaseNotesCache) { const notesByUrl = cleanedNotes.reduce((acc, note) => { acc[note.url] = note; return acc; - }, {} as Record); + }, {} as Record); return notesByUrl; } diff --git a/scripts/update-releases-summary.mjs b/scripts/update-releases-summary.mjs index 8342ee8..ba03bd8 100644 --- a/scripts/update-releases-summary.mjs +++ b/scripts/update-releases-summary.mjs @@ -1,10 +1,10 @@ import { pathy } from '@bscotch/pathy'; -import { listReleasesWithNotes } from '../packages/releases/dist/index.js'; +import { computeReleasesSummaryWithNotes } from '../packages/releases/dist/index.js'; import fs from 'fs'; const notesCache = pathy('packages/releases/release-notes-cache.json'); const summaryPath = pathy('packages/releases/releases-summary.json'); -const releases = await listReleasesWithNotes(undefined, notesCache); +const releases = await computeReleasesSummaryWithNotes(undefined, notesCache); await summaryPath.write(releases); // Write to the file that GitHub Workflow uses to store env vars fs.appendFileSync(