feat: start of cross platform page system (#4731)

* feat: abstract api-client DI into ui package

* feat: cross platform page system

* feat: tanstack as cross platform useAsyncData

* feat: archon servers routes + labrinth billing routes

* fix: dont use partial

* feat: migrate server list page to tanstack + api-client + re-enabled broken features!

* feat: migrate servers manage page to api-client before page system

* feat: migrate manage page to page system

* fix: type issues

* fix: upgrade wrapper bugs

* refactor: move state types into api-client

* feat: disable financial stuff on app frontend

* feat: finalize cross platform page system for now

* fix: lint

* fix: build issues

* feat: remove papaparse

* fix: lint

* fix: interface error

---------

Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
Calum H.
2025-11-14 17:15:09 +00:00
committed by GitHub
parent 26feaf753a
commit 7ccc32675b
79 changed files with 2631 additions and 1259 deletions

View File

@@ -23,8 +23,10 @@ export abstract class AbstractModrinthClient {
*/
private _moduleNamespaces: Map<string, Record<string, AbstractModule>> = new Map()
// TODO: When adding kyros/archon add readonly fields for those too.
public readonly labrinth!: InferredClientModules['labrinth']
public readonly archon!: InferredClientModules['archon']
public readonly kyros!: InferredClientModules['kyros']
public readonly iso3166!: InferredClientModules['iso3166']
constructor(config: ClientConfig) {
this.config = {
@@ -171,7 +173,7 @@ export abstract class AbstractModrinthClient {
/**
* Build the full URL for a request
*/
protected buildUrl(path: string, baseUrl: string, version: number | 'internal'): string {
protected buildUrl(path: string, baseUrl: string, version: number | 'internal' | string): string {
// Remove trailing slash from base URL
const base = baseUrl.replace(/\/$/, '')
@@ -181,6 +183,9 @@ export abstract class AbstractModrinthClient {
versionPath = '/_internal'
} else if (typeof version === 'number') {
versionPath = `/v${version}`
} else if (typeof version === 'string') {
// Custom version string (e.g., 'v0', 'modrinth/v0')
versionPath = `/${version}`
}
const cleanPath = path.startsWith('/') ? path : `/${path}`