File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
apps/svelte.dev/src/routes/devtools/updates.json Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ import { json } from '@sveltejs/kit' ;
2+
3+ export const prerender = true ;
4+
5+ export async function GET ( { fetch } ) {
6+ const gh : Array < { name : string } > = await fetch (
7+ 'https://api.github.com/repos/sveltejs/svelte-devtools/tags'
8+ ) . then ( ( r ) => r . json ( ) ) ;
9+
10+ // v2.2.0 is the first version that has the Firefox extension
11+ const tags = gh . reverse ( ) . slice ( gh . findIndex ( ( t ) => t . name === 'v2.2.0' ) ) ;
12+ const base = 'https://github.com/sveltejs/svelte-devtools/releases/download' ;
13+ return json ( {
14+ addons : {
15+ 16+ updates : tags . map ( ( { name : tag } ) => {
17+ return {
18+ version : tag ,
19+ update_link : `${ base } /${ tag } /svelte-devtools.xpi` ,
20+ applications : requirements [ tag ] && { gecko : requirements [ tag ] }
21+ } ;
22+ } )
23+ }
24+ }
25+ } ) ;
26+ }
27+
28+ const requirements : Record < string , any > = {
29+ 'v2.2.2' : { strict_min_version : '121.0' }
30+ } ;
You can’t perform that action at this time.
0 commit comments