forked from 1fpga/firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some quality of life and download cores in JS (1fpga#38)
In preparation for a full GUI.
- Loading branch information
Showing
28 changed files
with
1,827 additions
and
40 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "golem-fpga", | ||
"workspaces": [ | ||
"src/golem-frontend", | ||
"scripts/patreon" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type * as retronomicon from "@/retronomicon"; | ||
import * as net from "@/golem/net"; | ||
|
||
export type CoreList = | ||
retronomicon.paths["/cores"]["get"]["responses"]["200"]["content"]["application/json"]; | ||
|
||
export type ReleaseList = | ||
retronomicon.paths["/cores/{core_id}/releases"]["get"]["responses"]["200"]["content"]["application/json"]; | ||
|
||
export function cores(): CoreList { | ||
return net.fetchJson<CoreList>("https://retronomicon.land/api/v1/cores"); | ||
} | ||
|
||
export function releases(coreId: number): ReleaseList { | ||
return net.fetchJson<ReleaseList>( | ||
`https://retronomicon.land/api/v1/cores/${coreId}/releases`, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Network access type definitions. | ||
|
||
/** | ||
* This module provides functions for accessing the internet. It can download | ||
* JSON data or files from URLs. | ||
*/ | ||
declare module "@/golem/net" { | ||
/** | ||
* Download a JSON file from a URL. Returns the parsed JSON. | ||
* Will throw an error if the request fails or the response is not JSON. | ||
* | ||
* @param url The URL to download. | ||
*/ | ||
export function fetchJson<R extends object = any>(url: string): R; | ||
|
||
/** | ||
* Download a file from a URL. Returns the path to the downloaded file. | ||
* | ||
* @param url The URL to download. | ||
*/ | ||
export function downloadFile(url: string): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.