mirror of
https://github.com/open-goal/launcher.git
synced 2024-10-19 14:47:36 -04:00
build(deps-dev): bump the frontend-deps group with 8 updates (#289)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
This commit is contained in:
parent
69476e249c
commit
68794258b7
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<!-- TODO - perhaps eventually add a lightmode toggle -->
|
||||
<html lang="en" class="dark">
|
||||
<head>
|
||||
|
|
20
package.json
20
package.json
|
@ -22,36 +22,36 @@
|
|||
"@fullhuman/postcss-purgecss": "^5.0.0",
|
||||
"@iconify-json/ic": "^1.1.13",
|
||||
"@iconify-json/mdi": "^1.1.53",
|
||||
"@octokit/plugin-retry": "^3.0.9",
|
||||
"@octokit/plugin-retry": "^6.0.0",
|
||||
"@octokit/plugin-throttling": "^7.0.0",
|
||||
"@octokit/rest": "^20.0.1",
|
||||
"@popperjs/core": "^2.11.7",
|
||||
"@sveltejs/vite-plugin-svelte": "^2.4.2",
|
||||
"@sveltejs/vite-plugin-svelte": "^2.4.3",
|
||||
"@tauri-apps/cli": "^1.4.0",
|
||||
"@tauri-apps/tauricon": "github:tauri-apps/tauricon",
|
||||
"@testing-library/svelte": "^4.0.3",
|
||||
"@vitest/coverage-v8": "^0.33.0",
|
||||
"@tsconfig/svelte": "^5.0.0",
|
||||
"@vitest/coverage-v8": "^0.33.0",
|
||||
"ansi-to-span": "^0.0.1",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"classnames": "^2.3.2",
|
||||
"escape-html": "^1.0.3",
|
||||
"execa": "^7.1.1",
|
||||
"flowbite": "^1.6.5",
|
||||
"flowbite-svelte": "^0.39.2",
|
||||
"flowbite-svelte": "0.39.3",
|
||||
"jsdom": "^22.1.0",
|
||||
"postcss": "^8.4.26",
|
||||
"postcss": "^8.4.27",
|
||||
"postcss-load-config": "^4.0.1",
|
||||
"prettier": "^2.8.8",
|
||||
"prettier-plugin-svelte": "^2.10.1",
|
||||
"svelte": "^3.59.1",
|
||||
"prettier": "^3.0.0",
|
||||
"prettier-plugin-svelte": "^3.0.0",
|
||||
"svelte": "^4.1.1",
|
||||
"svelte-i18n": "^3.6.0",
|
||||
"svelte-preprocess": "^5.0.3",
|
||||
"tailwindcss": "^3.3.3",
|
||||
"typescript": "^5.1.3",
|
||||
"unplugin-icons": "^0.16.5",
|
||||
"vitest": "^0.33.0",
|
||||
"vite": "^4.4.4"
|
||||
"vite": "^4.4.7",
|
||||
"vitest": "^0.33.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^1.4.0",
|
||||
|
|
|
@ -21,7 +21,7 @@ const octokit = new Octokit({
|
|||
throttle: {
|
||||
onRateLimit: (retryAfter, options) => {
|
||||
octokit.log.warn(
|
||||
`Request quota exhausted for request ${options.method} ${options.url}`
|
||||
`Request quota exhausted for request ${options.method} ${options.url}`,
|
||||
);
|
||||
|
||||
// Retry twice after hitting a rate limit error, then give up
|
||||
|
@ -33,7 +33,7 @@ const octokit = new Octokit({
|
|||
onAbuseLimit: (retryAfter, options) => {
|
||||
// does not retry, only logs a warning
|
||||
octokit.log.warn(
|
||||
`Abuse detected for request ${options.method} ${options.url}`
|
||||
`Abuse detected for request ${options.method} ${options.url}`,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -17,7 +17,7 @@ const octokit = new Octokit({
|
|||
throttle: {
|
||||
onRateLimit: (retryAfter, options) => {
|
||||
octokit.log.warn(
|
||||
`Request quota exhausted for request ${options.method} ${options.url}`
|
||||
`Request quota exhausted for request ${options.method} ${options.url}`,
|
||||
);
|
||||
|
||||
// Retry twice after hitting a rate limit error, then give up
|
||||
|
@ -29,7 +29,7 @@ const octokit = new Octokit({
|
|||
onAbuseLimit: (retryAfter, options) => {
|
||||
// does not retry, only logs a warning
|
||||
octokit.log.warn(
|
||||
`Abuse detected for request ${options.method} ${options.url}`
|
||||
`Abuse detected for request ${options.method} ${options.url}`,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
@ -178,7 +178,7 @@ const releaseMeta = {
|
|||
launcherRelease.tag_name
|
||||
}/OpenGOAL-Launcher_${launcherRelease.tag_name.replace(
|
||||
"v",
|
||||
""
|
||||
"",
|
||||
)}_amd64.AppImage.tar.gz`,
|
||||
},
|
||||
"windows-x86_64": {
|
||||
|
@ -187,14 +187,14 @@ const releaseMeta = {
|
|||
launcherRelease.tag_name
|
||||
}/OpenGOAL-Launcher_${launcherRelease.tag_name.replace(
|
||||
"v",
|
||||
""
|
||||
"",
|
||||
)}_x64_en-US.msi.zip`,
|
||||
},
|
||||
},
|
||||
};
|
||||
fs.writeFileSync(
|
||||
"./.tauri/latest-release-v2.json",
|
||||
JSON.stringify(releaseMeta, null, 2) + "\n"
|
||||
JSON.stringify(releaseMeta, null, 2) + "\n",
|
||||
);
|
||||
|
||||
// Publish the release
|
||||
|
|
|
@ -21,7 +21,7 @@ const octokit = new Octokit({
|
|||
throttle: {
|
||||
onRateLimit: (retryAfter, options) => {
|
||||
octokit.log.warn(
|
||||
`Request quota exhausted for request ${options.method} ${options.url}`
|
||||
`Request quota exhausted for request ${options.method} ${options.url}`,
|
||||
);
|
||||
|
||||
// Retry twice after hitting a rate limit error, then give up
|
||||
|
@ -33,7 +33,7 @@ const octokit = new Octokit({
|
|||
onAbuseLimit: (retryAfter, options) => {
|
||||
// does not retry, only logs a warning
|
||||
octokit.log.warn(
|
||||
`Abuse detected for request ${options.method} ${options.url}`
|
||||
`Abuse detected for request ${options.method} ${options.url}`,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
@ -74,7 +74,7 @@ for (const asset of assets.data) {
|
|||
}
|
||||
if (!matchFound) {
|
||||
console.log(
|
||||
`Asset name does not match any of the expected regexes: ${assetName}`
|
||||
`Asset name does not match any of the expected regexes: ${assetName}`,
|
||||
);
|
||||
missingAsset = true;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,10 @@ body {
|
|||
}
|
||||
|
||||
.text-outline {
|
||||
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
|
||||
text-shadow:
|
||||
-1px -1px 0 #000,
|
||||
1px -1px 0 #000,
|
||||
-1px 1px 0 #000,
|
||||
1px 1px 0 #000;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,14 +168,14 @@ export async function initLocales(async: boolean) {
|
|||
for (const locale of AVAILABLE_LOCALES) {
|
||||
register(
|
||||
locale.id,
|
||||
() => import(`../../assets/translations/${locale.id}.json`)
|
||||
() => import(`../../assets/translations/${locale.id}.json`),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
for (const locale of AVAILABLE_LOCALES) {
|
||||
addMessages(
|
||||
locale.id,
|
||||
await import(`../../assets/translations/${locale.id}.json`)
|
||||
await import(`../../assets/translations/${locale.id}.json`),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,10 +10,10 @@ function failed(msg: string): InstallationOutput {
|
|||
}
|
||||
|
||||
export async function updateDataDirectory(
|
||||
gameName: string
|
||||
gameName: string,
|
||||
): Promise<InstallationOutput> {
|
||||
return await invoke_rpc("update_data_directory", { gameName }, () =>
|
||||
failed("Failed to update data directory")
|
||||
failed("Failed to update data directory"),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -23,48 +23,48 @@ export async function getEndOfLogs(): Promise<string> {
|
|||
|
||||
export async function extractAndValidateISO(
|
||||
pathToIso: string,
|
||||
gameName: string
|
||||
gameName: string,
|
||||
): Promise<InstallationOutput> {
|
||||
return await invoke_rpc(
|
||||
"extract_and_validate_iso",
|
||||
{ pathToIso, gameName },
|
||||
() => failed("Failed to extract and validate ISO")
|
||||
() => failed("Failed to extract and validate ISO"),
|
||||
);
|
||||
}
|
||||
|
||||
export async function runDecompiler(
|
||||
pathToIso: string,
|
||||
gameName: string,
|
||||
truncateLogs: boolean = false
|
||||
truncateLogs: boolean = false,
|
||||
): Promise<InstallationOutput> {
|
||||
return await invoke_rpc(
|
||||
"run_decompiler",
|
||||
{ pathToIso, gameName, truncateLogs },
|
||||
() => failed("Failed to run decompiler")
|
||||
() => failed("Failed to run decompiler"),
|
||||
);
|
||||
}
|
||||
|
||||
export async function runCompiler(
|
||||
pathToIso: string,
|
||||
gameName: string,
|
||||
truncateLogs: boolean = false
|
||||
truncateLogs: boolean = false,
|
||||
): Promise<InstallationOutput> {
|
||||
return await invoke_rpc(
|
||||
"run_compiler",
|
||||
{ pathToIso, gameName, truncateLogs },
|
||||
() => failed("Failed to run compiler")
|
||||
() => failed("Failed to run compiler"),
|
||||
);
|
||||
}
|
||||
|
||||
export async function launchGame(
|
||||
gameName: string,
|
||||
inDebug: boolean
|
||||
inDebug: boolean,
|
||||
): Promise<void> {
|
||||
return await invoke_rpc(
|
||||
"launch_game",
|
||||
{ gameName, inDebug },
|
||||
() => {},
|
||||
"Unable to launch game"
|
||||
"Unable to launch game",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,6 @@ export async function openREPL(gameName: string): Promise<void> {
|
|||
"open_repl",
|
||||
{ gameName },
|
||||
() => {},
|
||||
"Unable to open REPL"
|
||||
"Unable to open REPL",
|
||||
);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ export async function resetLauncherSettingsToDefaults(): Promise<boolean> {
|
|||
"reset_to_defaults",
|
||||
{},
|
||||
() => false,
|
||||
"Unable to reset settings"
|
||||
"Unable to reset settings",
|
||||
);
|
||||
return success != false;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ export async function getInstallationDirectory(): Promise<string | null> {
|
|||
}
|
||||
|
||||
export async function setInstallationDirectory(
|
||||
newDir: string
|
||||
newDir: string,
|
||||
): Promise<string | null> {
|
||||
// TODO - not insanely crazy about this pattern (message in the response instead of the error)
|
||||
// consider changing it
|
||||
|
@ -36,7 +36,7 @@ export async function setInstallationDirectory(
|
|||
"set_install_directory",
|
||||
{ newDir },
|
||||
() => "Unexpected error occurred",
|
||||
"Invalid installation directory"
|
||||
"Invalid installation directory",
|
||||
);
|
||||
|
||||
if (errMsg !== null) {
|
||||
|
@ -50,18 +50,18 @@ export async function setInstallationDirectory(
|
|||
}
|
||||
|
||||
export async function isAVXRequirementMet(
|
||||
force: boolean
|
||||
force: boolean,
|
||||
): Promise<boolean | undefined> {
|
||||
return await invoke_rpc("is_avx_requirement_met", { force }, () => undefined);
|
||||
}
|
||||
|
||||
export async function isOpenGLRequirementMet(
|
||||
force: boolean
|
||||
force: boolean,
|
||||
): Promise<boolean | undefined> {
|
||||
const result = await invoke_rpc(
|
||||
"is_opengl_requirement_met",
|
||||
{ force },
|
||||
() => undefined
|
||||
() => undefined,
|
||||
);
|
||||
|
||||
if (typeof result !== "boolean") {
|
||||
|
@ -84,20 +84,20 @@ export async function getInstalledVersion(gameName: string): Promise<String> {
|
|||
}
|
||||
|
||||
export async function getInstalledVersionFolder(
|
||||
gameName: string
|
||||
gameName: string,
|
||||
): Promise<String> {
|
||||
return invoke_rpc("get_installed_version_folder", { gameName }, () => null);
|
||||
}
|
||||
|
||||
export async function saveActiveVersionChange(
|
||||
versionFolder: VersionFolders,
|
||||
newActiveVersion: String
|
||||
newActiveVersion: String,
|
||||
): Promise<boolean> {
|
||||
return invoke_rpc(
|
||||
"save_active_version_change",
|
||||
{ versionFolder, newActiveVersion },
|
||||
() => false,
|
||||
"Couldn't save active version change"
|
||||
"Couldn't save active version change",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -115,20 +115,20 @@ export async function setLocale(localeId: string): Promise<void> {
|
|||
svelteLocale.set(localeId);
|
||||
// Update CSS variable if needed
|
||||
let localeInfo = AVAILABLE_LOCALES.find(
|
||||
(locale) => locale.id === localeId
|
||||
(locale) => locale.id === localeId,
|
||||
);
|
||||
if (localeInfo !== undefined && localeInfo.fontFamily !== undefined) {
|
||||
document.documentElement.style.setProperty(
|
||||
"--launcher-font-family",
|
||||
localeInfo.fontFamily
|
||||
localeInfo.fontFamily,
|
||||
);
|
||||
} else {
|
||||
document.documentElement.style.setProperty(
|
||||
"--launcher-font-family",
|
||||
"Noto Sans"
|
||||
"Noto Sans",
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -141,18 +141,18 @@ export async function getBypassRequirements(): Promise<boolean> {
|
|||
}
|
||||
|
||||
export async function getEnabledTexturePacks(
|
||||
gameName: string
|
||||
gameName: string,
|
||||
): Promise<string[]> {
|
||||
return await invoke_rpc(
|
||||
"get_enabled_texture_packs",
|
||||
{ gameName: gameName },
|
||||
() => []
|
||||
() => [],
|
||||
);
|
||||
}
|
||||
|
||||
export async function cleanupEnabledTexturePacks(
|
||||
gameName: string,
|
||||
cleanupList: string[]
|
||||
cleanupList: string[],
|
||||
): Promise<void> {
|
||||
return await invoke_rpc(
|
||||
"cleanup_enabled_texture_packs",
|
||||
|
@ -160,7 +160,7 @@ export async function cleanupEnabledTexturePacks(
|
|||
gameName: gameName,
|
||||
cleanupList: cleanupList,
|
||||
},
|
||||
() => {}
|
||||
() => {},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ function failed(msg: string): FeatureJobOutput {
|
|||
|
||||
export async function setEnabledTexturePacks(
|
||||
gameName: string,
|
||||
packs: string[]
|
||||
packs: string[],
|
||||
): Promise<FeatureJobOutput> {
|
||||
return await invoke_rpc(
|
||||
"set_enabled_texture_packs",
|
||||
|
@ -188,6 +188,6 @@ export async function setEnabledTexturePacks(
|
|||
undefined,
|
||||
() => {
|
||||
return { success: true, msg: null };
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -12,20 +12,20 @@ function failed(msg: string): FeatureJobOutput {
|
|||
}
|
||||
|
||||
export async function listExtractedTexturePackInfo(
|
||||
gameName: string
|
||||
gameName: string,
|
||||
): Promise<any> {
|
||||
return await invoke_rpc(
|
||||
"list_extracted_texture_pack_info",
|
||||
{
|
||||
gameName: gameName,
|
||||
},
|
||||
() => []
|
||||
() => [],
|
||||
);
|
||||
}
|
||||
|
||||
export async function extractNewTexturePack(
|
||||
gameName: string,
|
||||
pathToZip: string
|
||||
pathToZip: string,
|
||||
): Promise<boolean | undefined> {
|
||||
return await invoke_rpc(
|
||||
"extract_new_texture_pack",
|
||||
|
@ -33,12 +33,12 @@ export async function extractNewTexturePack(
|
|||
gameName: gameName,
|
||||
zipPath: pathToZip,
|
||||
},
|
||||
() => undefined
|
||||
() => undefined,
|
||||
);
|
||||
}
|
||||
|
||||
export async function updateTexturePackData(
|
||||
gameName: string
|
||||
gameName: string,
|
||||
): Promise<FeatureJobOutput> {
|
||||
return await invoke_rpc(
|
||||
"update_texture_pack_data",
|
||||
|
@ -49,13 +49,13 @@ export async function updateTexturePackData(
|
|||
undefined,
|
||||
() => {
|
||||
return { success: true, msg: null };
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export async function deleteTexturePacks(
|
||||
gameName: string,
|
||||
packs: string[]
|
||||
packs: string[],
|
||||
): Promise<FeatureJobOutput> {
|
||||
return await invoke_rpc(
|
||||
"delete_texture_packs",
|
||||
|
@ -67,6 +67,6 @@ export async function deleteTexturePacks(
|
|||
undefined,
|
||||
() => {
|
||||
return { success: true, msg: null };
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ export async function uninstallGame(gameName: string): Promise<boolean> {
|
|||
"uninstall_game",
|
||||
{ gameName },
|
||||
() => false,
|
||||
"Unable to uninstall game"
|
||||
"Unable to uninstall game",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,6 @@ export async function resetGameSettings(gameName: string): Promise<void> {
|
|||
"reset_game_settings",
|
||||
{ gameName },
|
||||
() => {},
|
||||
"Unable to reset game settings"
|
||||
"Unable to reset game settings",
|
||||
);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ async function genericLog(level: string, log: String): Promise<void> {
|
|||
} catch (e) {
|
||||
console.log(
|
||||
"[opengoal_launcher]: Unexpected error encountered when trying to log",
|
||||
e
|
||||
e,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ export async function errorLog(log: String): Promise<void> {
|
|||
export async function exceptionLog(log: String, error: any): Promise<void> {
|
||||
if (error instanceof Error) {
|
||||
errorLog(
|
||||
`${log} | Exception: ${error.name}:${error.message}, Stack: ${error.stack}, Cause: ${error.cause}`
|
||||
`${log} | Exception: ${error.name}:${error.message}, Stack: ${error.stack}, Cause: ${error.cause}`,
|
||||
);
|
||||
} else {
|
||||
errorLog(`${log} | ${error}`);
|
||||
|
|
|
@ -16,7 +16,7 @@ export async function invoke_rpc<T>(
|
|||
args: InvokeArgs,
|
||||
handleError: (error: unknown) => T,
|
||||
toastOnError?: string,
|
||||
onSuccess?: (result: T) => T
|
||||
onSuccess?: (result: T) => T,
|
||||
): Promise<T> {
|
||||
try {
|
||||
// this assumes the call is made in a way that does not trick the type inference
|
||||
|
|
|
@ -5,12 +5,12 @@ export async function generateSupportPackage(): Promise<void> {
|
|||
const userPath = await saveFilePrompt(
|
||||
"ZIP",
|
||||
["zip"],
|
||||
"opengoal-support-package.zip"
|
||||
"opengoal-support-package.zip",
|
||||
);
|
||||
return await invoke_rpc(
|
||||
"generate_support_package",
|
||||
{ userPath },
|
||||
() => {},
|
||||
"Unable to create support package"
|
||||
"Unable to create support package",
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,38 +3,38 @@ import { invoke_rpc } from "./rpc";
|
|||
export type VersionFolders = null | "official" | "unofficial" | "devel";
|
||||
|
||||
export async function listDownloadedVersions(
|
||||
versionFolder: VersionFolders
|
||||
versionFolder: VersionFolders,
|
||||
): Promise<string[]> {
|
||||
return await invoke_rpc(
|
||||
"list_downloaded_versions",
|
||||
{ versionFolder },
|
||||
() => []
|
||||
() => [],
|
||||
);
|
||||
}
|
||||
|
||||
export async function downloadOfficialVersion(
|
||||
version: String,
|
||||
url: String
|
||||
url: String,
|
||||
): Promise<boolean> {
|
||||
return await invoke_rpc(
|
||||
"download_version",
|
||||
{ version, url, versionFolder: "official" },
|
||||
() => false,
|
||||
"Unable to download official version",
|
||||
() => true
|
||||
() => true,
|
||||
);
|
||||
}
|
||||
|
||||
export async function removeVersion(
|
||||
version: String,
|
||||
versionFolder: String
|
||||
versionFolder: String,
|
||||
): Promise<boolean> {
|
||||
return await invoke_rpc(
|
||||
"remove_version",
|
||||
{ version, versionFolder },
|
||||
() => false,
|
||||
"Unable to remove version",
|
||||
() => true
|
||||
() => true,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ export async function openVersionFolder(versionFolder: VersionFolders) {
|
|||
"go_to_version_folder",
|
||||
{ versionFolder },
|
||||
() => {},
|
||||
"Unable to open version folder"
|
||||
"Unable to open version folder",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,6 @@ export async function ensureActiveVersionStillExists(): Promise<boolean> {
|
|||
"ensure_active_version_still_exists",
|
||||
{},
|
||||
() => false,
|
||||
"Error checking that active version exists"
|
||||
"Error checking that active version exists",
|
||||
);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ export async function openDir(directory: string): Promise<void> {
|
|||
"open_dir_in_os",
|
||||
{ directory },
|
||||
() => {},
|
||||
"Unable to open directory"
|
||||
"Unable to open directory",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { open, save } from "@tauri-apps/api/dialog";
|
|||
export async function filePrompt(
|
||||
extensions: string[],
|
||||
name: string,
|
||||
title: string
|
||||
title: string,
|
||||
): Promise<string | null> {
|
||||
const path = await open({
|
||||
title: title,
|
||||
|
@ -22,7 +22,7 @@ export async function filePrompt(
|
|||
export async function saveFilePrompt(
|
||||
fileType: string,
|
||||
fileExtensions: string[],
|
||||
fileName: string
|
||||
fileName: string,
|
||||
): Promise<string | null> {
|
||||
return await save({
|
||||
filters: [{ name: fileType, extensions: fileExtensions }],
|
||||
|
@ -32,7 +32,7 @@ export async function saveFilePrompt(
|
|||
|
||||
export async function saveFolderPrompt(
|
||||
fileType: string,
|
||||
fileExtensions: string[]
|
||||
fileExtensions: string[],
|
||||
): Promise<string | null> {
|
||||
return await save({
|
||||
filters: [{ name: fileType, extensions: fileExtensions }],
|
||||
|
@ -43,7 +43,7 @@ export async function isoPrompt(): Promise<string | undefined> {
|
|||
const path = await filePrompt(
|
||||
["ISO", "iso"],
|
||||
"Jak ISO File",
|
||||
"Select your legitimately obtained ISO File"
|
||||
"Select your legitimately obtained ISO File",
|
||||
);
|
||||
if (path === null) {
|
||||
return undefined;
|
||||
|
|
|
@ -137,12 +137,12 @@ describe("listOfficialReleases", () => {
|
|||
"opengoal-windows-v0.0.1.zip",
|
||||
"opengoal-linux-v0.0.1.tar.gz",
|
||||
]),
|
||||
])
|
||||
]),
|
||||
);
|
||||
const releases = await listOfficialReleases();
|
||||
expect(releases.length).toBe(1);
|
||||
expect(
|
||||
releases[0].downloadUrl.endsWith("opengoal-macos-intel-v0.0.1.tar.gz")
|
||||
releases[0].downloadUrl.endsWith("opengoal-macos-intel-v0.0.1.tar.gz"),
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
|
@ -156,7 +156,7 @@ describe("listOfficialReleases", () => {
|
|||
"opengoal-windows-v0.0.1.zip",
|
||||
"opengoal-linux-v0.0.1.tar.gz",
|
||||
]),
|
||||
])
|
||||
]),
|
||||
);
|
||||
const releases = await listOfficialReleases();
|
||||
expect(releases.length).toBe(1);
|
||||
|
@ -173,12 +173,12 @@ describe("listOfficialReleases", () => {
|
|||
"opengoal-windows-v0.0.1.zip",
|
||||
"opengoal-linux-v0.0.1.tar.gz",
|
||||
]),
|
||||
])
|
||||
]),
|
||||
);
|
||||
const releases = await listOfficialReleases();
|
||||
expect(releases.length).toBe(1);
|
||||
expect(
|
||||
releases[0].downloadUrl.endsWith("opengoal-windows-v0.0.1.zip")
|
||||
releases[0].downloadUrl.endsWith("opengoal-windows-v0.0.1.zip"),
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
|
@ -192,12 +192,12 @@ describe("listOfficialReleases", () => {
|
|||
"opengoal-windows-v0.0.1.zip",
|
||||
"opengoal-linux-v0.0.1.tar.gz",
|
||||
]),
|
||||
])
|
||||
]),
|
||||
);
|
||||
const releases = await listOfficialReleases();
|
||||
expect(releases.length).toBe(1);
|
||||
expect(
|
||||
releases[0].downloadUrl.endsWith("opengoal-linux-v0.0.1.tar.gz")
|
||||
releases[0].downloadUrl.endsWith("opengoal-linux-v0.0.1.tar.gz"),
|
||||
).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
@ -218,12 +218,12 @@ describe("getLatestOfficialRelease", () => {
|
|||
"opengoal-windows-v0.0.1.zip",
|
||||
"opengoal-linux-v0.0.1.tar.gz",
|
||||
]),
|
||||
])
|
||||
]),
|
||||
);
|
||||
const releases = await listOfficialReleases();
|
||||
expect(releases.length).toBe(1);
|
||||
expect(
|
||||
releases[0].downloadUrl.endsWith("opengoal-macos-intel-v0.0.1.tar.gz")
|
||||
releases[0].downloadUrl.endsWith("opengoal-macos-intel-v0.0.1.tar.gz"),
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
|
@ -237,7 +237,7 @@ describe("getLatestOfficialRelease", () => {
|
|||
"opengoal-windows-v0.0.1.zip",
|
||||
"opengoal-linux-v0.0.1.tar.gz",
|
||||
]),
|
||||
])
|
||||
]),
|
||||
);
|
||||
const releases = await listOfficialReleases();
|
||||
expect(releases.length).toBe(1);
|
||||
|
@ -254,12 +254,12 @@ describe("getLatestOfficialRelease", () => {
|
|||
"opengoal-windows-v0.0.1.zip",
|
||||
"opengoal-linux-v0.0.1.tar.gz",
|
||||
]),
|
||||
])
|
||||
]),
|
||||
);
|
||||
const releases = await listOfficialReleases();
|
||||
expect(releases.length).toBe(1);
|
||||
expect(
|
||||
releases[0].downloadUrl.endsWith("opengoal-windows-v0.0.1.zip")
|
||||
releases[0].downloadUrl.endsWith("opengoal-windows-v0.0.1.zip"),
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
|
@ -273,12 +273,12 @@ describe("getLatestOfficialRelease", () => {
|
|||
"opengoal-windows-v0.0.1.zip",
|
||||
"opengoal-linux-v0.0.1.tar.gz",
|
||||
]),
|
||||
])
|
||||
]),
|
||||
);
|
||||
const releases = await listOfficialReleases();
|
||||
expect(releases.length).toBe(1);
|
||||
expect(
|
||||
releases[0].downloadUrl.endsWith("opengoal-linux-v0.0.1.tar.gz")
|
||||
releases[0].downloadUrl.endsWith("opengoal-linux-v0.0.1.tar.gz"),
|
||||
).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ export interface ReleaseInfo {
|
|||
function isIntelMacOsRelease(
|
||||
platform: string,
|
||||
architecture: string,
|
||||
assetName: string
|
||||
assetName: string,
|
||||
): boolean {
|
||||
return (
|
||||
platform === "darwin" &&
|
||||
|
@ -26,7 +26,7 @@ function isIntelMacOsRelease(
|
|||
function isWindowsRelease(
|
||||
platform: string,
|
||||
architecture: string,
|
||||
assetName: string
|
||||
assetName: string,
|
||||
): boolean {
|
||||
return (
|
||||
platform === "win32" &&
|
||||
|
@ -38,7 +38,7 @@ function isWindowsRelease(
|
|||
function isLinuxRelease(
|
||||
platform: string,
|
||||
architecture: string,
|
||||
assetName: string
|
||||
assetName: string,
|
||||
): boolean {
|
||||
return (
|
||||
platform === "linux" &&
|
||||
|
@ -48,7 +48,7 @@ function isLinuxRelease(
|
|||
}
|
||||
|
||||
async function getDownloadLinkForCurrentPlatform(
|
||||
release: any
|
||||
release: any,
|
||||
): Promise<string | undefined> {
|
||||
const platformName = await platform();
|
||||
const archName = await arch();
|
||||
|
@ -69,7 +69,7 @@ export async function listOfficialReleases(): Promise<ReleaseInfo[]> {
|
|||
// TODO - handle rate limiting
|
||||
// TODO - long term - handle pagination (more than 100 releases)
|
||||
const resp = await fetch(
|
||||
"https://api.github.com/repos/open-goal/jak-project/releases?per_page=100"
|
||||
"https://api.github.com/repos/open-goal/jak-project/releases?per_page=100",
|
||||
);
|
||||
// TODO - handle error
|
||||
const githubReleases = await resp.json();
|
||||
|
@ -92,7 +92,7 @@ export async function listOfficialReleases(): Promise<ReleaseInfo[]> {
|
|||
export async function getLatestOfficialRelease(): Promise<ReleaseInfo> {
|
||||
// TODO - handle rate limiting
|
||||
const resp = await fetch(
|
||||
"https://api.github.com/repos/open-goal/jak-project/releases/latest"
|
||||
"https://api.github.com/repos/open-goal/jak-project/releases/latest",
|
||||
);
|
||||
// TODO - handle error
|
||||
const githubRelease = await resp.json();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en" class="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
|
|
|
@ -54,7 +54,7 @@ describe("Splash.svelte", () => {
|
|||
});
|
||||
render(Splash, {});
|
||||
const localeSelect = (await screen.findByTestId(
|
||||
"locale-select"
|
||||
"locale-select",
|
||||
)) as HTMLSelectElement;
|
||||
expect(localeSelect).toBeTruthy();
|
||||
fireEvent.change(localeSelect, { target: { value: "en-US" } });
|
||||
|
@ -80,14 +80,14 @@ describe("Splash.svelte", () => {
|
|||
});
|
||||
render(Splash, {});
|
||||
const deleteOldDataDirButton = await screen.findByTestId(
|
||||
"delete-old-data-dir-button"
|
||||
"delete-old-data-dir-button",
|
||||
);
|
||||
expect(deleteOldDataDirButton).toBeTruthy();
|
||||
// delete the dir, it'll go away
|
||||
fireEvent.click(deleteOldDataDirButton);
|
||||
expect(oldDataDirDeleted).toBeTruthy();
|
||||
const pickInstallFolderButton = await screen.findByTestId(
|
||||
"pick-install-folder-button"
|
||||
"pick-install-folder-button",
|
||||
);
|
||||
expect(pickInstallFolderButton).toBeTruthy();
|
||||
});
|
||||
|
@ -109,13 +109,13 @@ describe("Splash.svelte", () => {
|
|||
vi.mocked(folderPrompt).mockResolvedValue(undefined);
|
||||
render(Splash, {});
|
||||
let pickInstallFolderButton = await screen.findByTestId(
|
||||
"pick-install-folder-button"
|
||||
"pick-install-folder-button",
|
||||
);
|
||||
expect(pickInstallFolderButton).toBeTruthy();
|
||||
fireEvent.click(pickInstallFolderButton);
|
||||
// It's still there since the user didn't pick a folder
|
||||
pickInstallFolderButton = await screen.findByTestId(
|
||||
"pick-install-folder-button"
|
||||
"pick-install-folder-button",
|
||||
);
|
||||
expect(pickInstallFolderButton).toBeTruthy();
|
||||
});
|
||||
|
@ -145,7 +145,7 @@ describe("Splash.svelte", () => {
|
|||
vi.mocked(folderPrompt).mockResolvedValue("/wow/good/job/nice/folder");
|
||||
render(Splash, {});
|
||||
let pickInstallFolderButton = await screen.findByTestId(
|
||||
"pick-install-folder-button"
|
||||
"pick-install-folder-button",
|
||||
);
|
||||
expect(pickInstallFolderButton).toBeTruthy();
|
||||
fireEvent.click(pickInstallFolderButton);
|
||||
|
@ -156,7 +156,7 @@ describe("Splash.svelte", () => {
|
|||
() => {
|
||||
expect(mainWindowOpened).toBeTruthy();
|
||||
},
|
||||
{ timeout: 5000 }
|
||||
{ timeout: 5000 },
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -183,7 +183,7 @@ describe("Splash.svelte", () => {
|
|||
vi.mocked(folderPrompt).mockResolvedValue("/wow/good/job/nice/folder");
|
||||
render(Splash, {});
|
||||
let pickInstallFolderButton = await screen.findByTestId(
|
||||
"pick-install-folder-button"
|
||||
"pick-install-folder-button",
|
||||
);
|
||||
expect(pickInstallFolderButton).toBeTruthy();
|
||||
fireEvent.click(pickInstallFolderButton);
|
||||
|
@ -191,7 +191,7 @@ describe("Splash.svelte", () => {
|
|||
screen.findByText("wow that was a terrible directory");
|
||||
});
|
||||
pickInstallFolderButton = await screen.findByTestId(
|
||||
"pick-install-folder-button"
|
||||
"pick-install-folder-button",
|
||||
);
|
||||
expect(pickInstallFolderButton).toBeTruthy();
|
||||
});
|
||||
|
|
|
@ -28,7 +28,7 @@ export default defineConfig({
|
|||
input: {
|
||||
main: fileURLToPath(new URL("./index.html", import.meta.url)),
|
||||
splash: fileURLToPath(
|
||||
new URL("./src/splash/index.html", import.meta.url)
|
||||
new URL("./src/splash/index.html", import.meta.url),
|
||||
),
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue