This repository was archived by the owner on Mar 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 1
1
import { Pathy } from '@bscotch/pathy' ;
2
- import { assert } from '@bscotch/utility/browser' ;
3
2
import { z } from 'zod' ;
4
3
import { defaultNotesCachePath } from './constants.js' ;
5
4
import { downloadRssFeed , findPairedRuntime } from './feeds.lib.js' ;
@@ -23,14 +22,15 @@ export async function computeReleasesSummaryWithNotes(
23
22
releases ||= await computeReleasesSummary ( ) ;
24
23
const notes = await listReleaseNotes ( releases , cache ) ;
25
24
const withNotes : GameMakerReleaseWithNotes [ ] = [ ] ;
25
+ const emptyChanges = {
26
+ changes : {
27
+ since : null ,
28
+ groups : [ ] ,
29
+ } ,
30
+ } ;
26
31
for ( const release of releases ) {
27
- const ideNotes = notes [ release . ide . notesUrl ] ;
28
- assert ( ideNotes , `No notes found for IDE release ${ release . ide . version } ` ) ;
29
- const runtimeNotes = notes [ release . runtime . notesUrl ] ;
30
- assert (
31
- runtimeNotes ,
32
- `No notes found for IDE release ${ release . runtime . version } ` ,
33
- ) ;
32
+ const ideNotes = notes [ release . ide . notesUrl ] || emptyChanges ;
33
+ const runtimeNotes = notes [ release . runtime . notesUrl ] || emptyChanges ;
34
34
const ide = { ...release . ide , notes : ideNotes . changes } ;
35
35
const runtime = { ...release . runtime , notes : runtimeNotes . changes } ;
36
36
withNotes . push ( {
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ export async function listReleaseNotes(
25
25
const cacheData = await cachePath . read ( { fallback : { } } ) ;
26
26
for ( const release of releases ) {
27
27
for ( const type of [ 'ide' , 'runtime' ] as const ) {
28
- const url = release [ type ] . notesUrl ;
28
+ let url = release [ type ] . notesUrl ;
29
+ // URL can be malformed
30
+ url = url . replace ( / ^ ( .+ \. c l o u d f r o n t \. n e t ) ( r e l e a s e .* ) $ / , '$1/$2' ) ;
29
31
if ( cacheData [ url ] ) {
30
32
if ( ! cacheData [ url ] . type ) {
31
33
cacheData [ url ] . type = type ;
@@ -92,7 +94,7 @@ function cleanNotes(cachedNotes: RawReleaseNotesCache) {
92
94
const notesByUrl = cleanedNotes . reduce ( ( acc , note ) => {
93
95
acc [ note . url ] = note ;
94
96
return acc ;
95
- } , { } as Record < string , typeof cleanedNotes [ 0 ] > ) ;
97
+ } , { } as Record < string , ( typeof cleanedNotes ) [ 0 ] > ) ;
96
98
return notesByUrl ;
97
99
}
98
100
Original file line number Diff line number Diff line change 1
1
import { pathy } from '@bscotch/pathy' ;
2
- import { listReleasesWithNotes } from '../packages/releases/dist/index.js' ;
2
+ import { computeReleasesSummaryWithNotes } from '../packages/releases/dist/index.js' ;
3
3
import fs from 'fs' ;
4
4
5
5
const notesCache = pathy ( 'packages/releases/release-notes-cache.json' ) ;
6
6
const summaryPath = pathy ( 'packages/releases/releases-summary.json' ) ;
7
- const releases = await listReleasesWithNotes ( undefined , notesCache ) ;
7
+ const releases = await computeReleasesSummaryWithNotes ( undefined , notesCache ) ;
8
8
await summaryPath . write ( releases ) ;
9
9
// Write to the file that GitHub Workflow uses to store env vars
10
10
fs . appendFileSync (
You can’t perform that action at this time.
0 commit comments