chore(wailsv3): migrate frontend to v3 bindings and runtime

Regenerated bindings with wails3 generate bindings (1 service, 29 methods, 25 models) into frontend/bindings/AniTrack as TypeScript; output verified byte-deterministic across regens, so it is committed like wailsjs was.

- 10 Svelte files: wailsjs/go/main/App imports -> import {App} from bindings/AniTrack with App.* call prefixes. No logic or markup changes.
- WebsiteLink.svelte: BrowserOpenURL -> Browser.OpenURL from @wailsio/runtime.
- AvatarMenu.svelte: runtime.Quit -> Application.Quit from @wailsio/runtime.
- package.json: add @wailsio/runtime pinned to 3.0.0-beta.20 (exact, matching the Go framework); lockfile updated, all deps still max in-range, majors deferred.
- Production vite build passes with the new bindings.
This commit is contained in:
John O'Keefe
2026-09-13 17:10:17 -04:00
parent 850c1c6aee
commit 0642163844
18 changed files with 475 additions and 79 deletions
+9 -18
View File
@@ -28,16 +28,7 @@
import type { StatusOption, StatusOptions } from "../helperTypes/StatusTypes";
import type { AniListUpdateVariables } from "../anilist/types/AniListTypes";
import { convertDateToAniList } from "../helperFunctions/convertDateToAniList";
import {
AniListDeleteEntry,
AniListUpdateEntry,
DeleteMyAnimeListEntry,
MyAnimeListUpdate,
SimklSyncEpisodes,
SimklSyncRating,
SimklSyncRemove,
SimklSyncStatus,
} from "../../wailsjs/go/main/App";
import {App} from "../../bindings/AniTrack";
import { AddAnimeServiceToTable } from "../helperModules/AddAnimeServiceToTable.svelte";
import { CheckIfAniListLoggedInAndLoadWatchList } from "../helperModules/CheckIfAniListLoggedInAndLoadWatchList.svelte";
import Datepicker from "./Datepicker.svelte";
@@ -207,7 +198,7 @@
startedAt: convertDateToAniList(startedAtDate),
completedAt: convertDateToAniList(completedAtDate),
};
await AniListUpdateEntry(body).then((value: AniListGetSingleAnime) => {
await App.AniListUpdateEntry(body).then((value: AniListGetSingleAnime) => {
if (!value.data?.MediaList || value.data.MediaList.mediaId === 0) {
setApiError(
"anilist",
@@ -261,7 +252,7 @@
comments: submitData.notes,
};
await MyAnimeListUpdate(currentMalAnime, body).then(
await App.MyAnimeListUpdate(currentMalAnime, body).then(
(malAnimeReturn: MalListStatus) => {
malAnime.update((value) => {
value.my_list_status.status = malAnimeReturn.status;
@@ -317,7 +308,7 @@
try {
if (simklLoggedIn && currentSimklAnime.show.ids.simkl !== 0) {
if (currentSimklAnime.watched_episodes_count !== submitData.episodes) {
await SimklSyncEpisodes(currentSimklAnime, submitData.episodes).then(
await App.SimklSyncEpisodes(currentSimklAnime, submitData.episodes).then(
(value: SimklAnime) => {
AddAnimeServiceToTable({
id: `s-${value.show.ids.simkl}`,
@@ -340,7 +331,7 @@
}
if (currentSimklAnime.user_rating !== submitData.rating) {
await SimklSyncRating(currentSimklAnime, submitData.rating).then(
await App.SimklSyncRating(currentSimklAnime, submitData.rating).then(
(value) => {
AddAnimeServiceToTable({
id: `s-${value.show.ids.simkl}`,
@@ -363,7 +354,7 @@
}
if (currentSimklAnime.status !== submitData.status.simkl) {
await SimklSyncStatus(
await App.SimklSyncStatus(
currentSimklAnime,
submitData.status.simkl,
).then((value) => {
@@ -409,7 +400,7 @@
isAniListLoggedIn &&
currentAniListAnime.data.MediaList.mediaId !== 0
) {
await AniListDeleteEntry(currentAniListAnime.data.MediaList.id);
await App.AniListDeleteEntry(currentAniListAnime.data.MediaList.id);
AddAnimeServiceToTable({
id: `a-${currentAniListAnime.data.MediaList.mediaId}`,
title,
@@ -436,7 +427,7 @@
try {
if (malLoggedIn && currentMalAnime.id !== 0) {
await DeleteMyAnimeListEntry(currentMalAnime.id);
await App.DeleteMyAnimeListEntry(currentMalAnime.id);
AddAnimeServiceToTable({
id: `m-${currentMalAnime.id}`,
title: currentMalAnime.title,
@@ -463,7 +454,7 @@
try {
if (simklLoggedIn && currentSimklAnime.show.ids.simkl !== 0) {
await SimklSyncRemove(currentSimklAnime);
await App.SimklSyncRemove(currentSimklAnime);
AddAnimeServiceToTable({
id: `s-${currentSimklAnime.show.ids.simkl}`,
title: currentSimklAnime.show.title,
@@ -16,10 +16,10 @@
logoutOfSimkl,
serviceLoggingIn,
} from "../helperModules/GlobalVariablesAndHelperFunctions.svelte";
import * as runtime from "../../wailsjs/runtime";
import {Application} from "@wailsio/runtime";
import type { MyAnimeListUser } from "../mal/types/MALTypes";
import type { SimklUser } from "../simkl/types/simklTypes";
import { ShowVersion } from "../../wailsjs/go/main/App";
import {App} from "../../bindings/AniTrack";
let currentAniListUser: AniListUser;
let currentMALUser: MyAnimeListUser;
@@ -189,14 +189,14 @@
<button
on:click={() => {
dropdownUser();
ShowVersion();
App.ShowVersion();
}}
class="block px-4 py-2 w-full text-sm hover:bg-gray-600 text-gray-200 over:text-white"
>
Version
</button>
<button
on:click={() => runtime.Quit()}
on:click={() => Application.Quit()}
class="block px-4 py-2 w-full text-sm hover:bg-gray-600 text-gray-200 over:text-white"
>
Exit Application
@@ -8,7 +8,7 @@
} from "../helperModules/GlobalVariablesAndHelperFunctions.svelte";
import type { AniListCurrentUserWatchList } from "../anilist/types/AniListCurrentUserWatchListType";
import { GetAniListUserWatchingList } from "../../wailsjs/go/main/App";
import {App} from "../../bindings/AniTrack";
let aniListWatchListLoaded: AniListCurrentUserWatchList;
let page: number;
@@ -23,7 +23,7 @@
const perPageOptions = [10, 20, 50];
function ChangeWatchListPage(newPage: number) {
GetAniListUserWatchingList(newPage, perPage, sort).then((result) => {
App.GetAniListUserWatchingList(newPage, perPage, sort).then((result) => {
watchListPage.set(newPage);
aniListWatchlist.set(result);
aniListLoggedIn.set(true);
@@ -43,7 +43,7 @@
function changeCountPerPage(
e: Event & { currentTarget: HTMLSelectElement },
): void {
GetAniListUserWatchingList(1, Number(e.currentTarget.value), sort).then(
App.GetAniListUserWatchingList(1, Number(e.currentTarget.value), sort).then(
(result) => {
animePerPage.set(Number(e.currentTarget.value));
watchListPage.set(1);
+2 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import {AniListSearch} from "../../wailsjs/go/main/App";
import {App} from "../../bindings/AniTrack";
import type {AniSearchList} from "../anilist/types/AniListTypes";
import {push} from "svelte-spa-router";
@@ -81,7 +81,7 @@
reject(new Error("AniList is taking too long to respond. Please try again."))
}, SEARCH_TIMEOUT_MS)
})
const result = await Promise.race([AniListSearch(term), timeout])
const result = await Promise.race([App.AniListSearch(term), timeout])
if (searchRequestId !== myRequest) {
return
}
+2 -2
View File
@@ -6,7 +6,7 @@
aniListWatchlist,
} from "../helperModules/GlobalVariablesAndHelperFunctions.svelte";
import { MediaListSort } from "../anilist/types/AniListTypes";
import { GetAniListUserWatchingList } from "../../wailsjs/go/main/App";
import {App} from "../../bindings/AniTrack";
const sortTypes = [
{ value: MediaListSort.MediaId, name: "Media Id Asc" },
@@ -55,7 +55,7 @@
console.log(sort);
async function changeWatchListSort() {
const result = await GetAniListUserWatchingList(
const result = await App.GetAniListUserWatchingList(
$watchListPage,
$animePerPage,
$aniListSort,
@@ -1,5 +1,5 @@
<script lang="ts">
import { BrowserOpenURL } from "../../wailsjs/runtime";
import {Browser} from "@wailsio/runtime";
export let id: string;
export let url = "";
@@ -25,7 +25,7 @@
<button
type="button"
class="underline underline-offset-2 px-4 py-1"
on:click={() => BrowserOpenURL(url)}>{newId}</button
on:click={() => Browser.OpenURL(url)}>{newId}</button
>
{:else}
{id}