Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions apps/oneclient/frontend/src/bindings.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export type ProcessPayloadKind = { type: "Starting"; command: string } | { type:

export type ProfileUpdate = { res: Resolution | null; force_fullscreen: boolean | null; mem_max: number | null; launch_args: string | null; launch_env: string | null; hook_pre: string | null; hook_wrapper: string | null; hook_post: string | null }

export type Provider = "Modrinth" | "CurseForge" | "SkyClient"
export type Provider = "Modrinth" | "CurseForge"

export type Resolution = { width: number; height: number }

Expand Down Expand Up @@ -303,8 +303,18 @@ export type VersionType =
*/
"old_beta"

const ARGS_MAP = { 'oneclient':'{"installUpdate":[],"getClustersGroupedByMajor":[],"checkForUpdate":[],"getBundlesFor":["cluster_id"],"getVersions":[]}', 'events':'{"process":["event"],"ingress":["event"],"message":["event"]}', 'core':'{"getLogByName":["id","name"],"getClusterById":["id"],"getLogs":["id"],"setDiscordRPCMessage":["message"],"getClusters":[],"getWorlds":["id"],"createSettingsProfile":["name"],"getUsers":[],"isClusterRunning":["cluster_id"],"fetchMinecraftProfile":["uuid"],"getPackage":["provider","slug"],"getScreenshots":["id"],"getRunningProcessesByClusterId":["cluster_id"],"getUsersFromAuthor":["provider","author"],"getLinkedPackages":["cluster_id"],"openMsaLogin":[],"getDefaultUser":["fallback"],"downloadExternalPackage":["package","cluster_id","force","skip_compatibility"],"writeSettings":["setting"],"getUser":["uuid"],"readSettings":[],"fetchLoggedInProfile":["access_token"],"getLoadersForVersion":["mc_version"],"open":["input"],"killProcess":["pid"],"installModpack":["modpack","cluster_id"],"setClusterStage":["id","stage"],"getRunningProcesses":[],"getProfileOrDefault":["name"],"updateClusterProfile":["name","profile"],"removeCluster":["id"],"getGameVersions":[],"getPackageBody":["provider","body"],"getMultiplePackages":["provider","slugs"],"getPackageVersions":["provider","slug","mc_version","loader","offset","limit"],"downloadPackage":["provider","package_id","version_id","cluster_id","skip_compatibility"],"changeSkin":["access_token","skin_url","skin_variant"],"changeCape":["access_token","cape_uuid"],"removeUser":["uuid"],"setDefaultUser":["uuid"],"launchCluster":["id","uuid","search_for_java"],"updateClusterById":["id","request"],"createCluster":["options"],"getGlobalProfile":[],"searchPackages":["provider","query"],"removePackage":["cluster_id","package_hash"],"uploadSkinBytes":["access_token","skin_data","image_format","skin_variant"],"removeCape":["access_token"],"convertUsernameUUID":["username_uuid"]}', 'folders':'{"fromCluster":["folder_name"],"openCluster":["folder_name"]}', 'debug':'{"getArch":[],"getBuildTimestamp":[],"getPlatform":[],"getType":[],"getLocale":[],"getOsVersion":[],"openDevTools":[],"getGitCommitHash":[],"isInDev":[],"getPackageVersion":[],"getFamily":[]}' }
export type Router = { 'debug': { openDevTools: () => Promise<void>,
const ARGS_MAP = { 'oneclient':'{"getVersions":[],"getClustersGroupedByMajor":[],"getBundlesFor":["cluster_id"],"installUpdate":[],"checkForUpdate":[]}', 'folders':'{"fromCluster":["folder_name"],"openCluster":["folder_name"]}', 'core':'{"searchPackages":["provider","query"],"getPackageBody":["provider","body"],"convertUsernameUUID":["username_uuid"],"getScreenshots":["id"],"getUsersFromAuthor":["provider","author"],"fetchMinecraftProfile":["uuid"],"setDefaultUser":["uuid"],"getGlobalProfile":[],"getMultiplePackages":["provider","slugs"],"updateClusterById":["id","request"],"getPackageVersions":["provider","slug","mc_version","loader","offset","limit"],"getRunningProcessesByClusterId":["cluster_id"],"getRunningProcesses":[],"changeSkin":["access_token","skin_url","skin_variant"],"installModpack":["modpack","cluster_id"],"getWorlds":["id"],"getPackage":["provider","slug"],"getLinkedPackages":["cluster_id"],"changeCape":["access_token","cape_uuid"],"getClusters":[],"createSettingsProfile":["name"],"downloadExternalPackage":["package","cluster_id","force","skip_compatibility"],"launchCluster":["id","uuid","search_for_java"],"setClusterStage":["id","stage"],"setDiscordRPCMessage":["message"],"open":["input"],"getClusterById":["id"],"getLogByName":["id","name"],"downloadPackage":["provider","package_id","version_id","cluster_id","skip_compatibility"],"fetchLoggedInProfile":["access_token"],"uploadSkinBytes":["access_token","skin_data","image_format","skin_variant"],"isClusterRunning":["cluster_id"],"removeCape":["access_token"],"createCluster":["options"],"updateClusterProfile":["name","profile"],"getGameVersions":[],"removePackage":["cluster_id","package_hash"],"removeCluster":["id"],"getLogs":["id"],"getUser":["uuid"],"getProfileOrDefault":["name"],"getUsers":[],"removeUser":["uuid"],"getDefaultUser":["fallback"],"openMsaLogin":[],"killProcess":["pid"],"readSettings":[],"getLoadersForVersion":["mc_version"],"writeSettings":["setting"]}', 'events':'{"ingress":["event"],"process":["event"],"message":["event"]}', 'debug':'{"getGitCommitHash":[],"getBuildTimestamp":[],"getPackageVersion":[],"getPlatform":[],"getType":[],"getLocale":[],"getArch":[],"getFamily":[],"isInDev":[],"openDevTools":[],"getOsVersion":[]}' }
export type Router = { 'events': { ingress: (event: IngressPayload) => Promise<void>,
message: (event: MessagePayload) => Promise<void>,
process: (event: ProcessPayload) => Promise<void> },
'oneclient': { getClustersGroupedByMajor: () => Promise<Partial<{ [key in number]: ClusterModel[] }>>,
getBundlesFor: (clusterId: number) => Promise<ModpackArchive[]>,
getVersions: () => Promise<OnlineClusterManifest>,
checkForUpdate: () => Promise<Update | null>,
installUpdate: () => Promise<null> },
'folders': { fromCluster: (folderName: string) => Promise<string>,
openCluster: (folderName: string) => Promise<null> },
'debug': { openDevTools: () => Promise<void>,
isInDev: () => Promise<boolean>,
getArch: () => Promise<string>,
getFamily: () => Promise<string>,
Expand All @@ -315,11 +325,6 @@ getOsVersion: () => Promise<string>,
getGitCommitHash: () => Promise<string>,
getBuildTimestamp: () => Promise<string>,
getPackageVersion: () => Promise<string> },
'events': { ingress: (event: IngressPayload) => Promise<void>,
message: (event: MessagePayload) => Promise<void>,
process: (event: ProcessPayload) => Promise<void> },
'folders': { fromCluster: (folderName: string) => Promise<string>,
openCluster: (folderName: string) => Promise<null> },
'core': { getClusters: () => Promise<ClusterModel[]>,
getClusterById: (id: number) => Promise<ClusterModel | null>,
removeCluster: (id: number) => Promise<null>,
Expand Down Expand Up @@ -368,12 +373,7 @@ changeCape: (accessToken: string, capeUuid: string) => Promise<MojangFullPlayerP
removeCape: (accessToken: string) => Promise<MojangFullPlayerProfile>,
convertUsernameUUID: (usernameUuid: string) => Promise<MowojangProfile>,
setDiscordRPCMessage: (message: string) => Promise<null>,
open: (input: string) => Promise<null> },
'oneclient': { getClustersGroupedByMajor: () => Promise<Partial<{ [key in number]: ClusterModel[] }>>,
getBundlesFor: (clusterId: number) => Promise<ModpackArchive[]>,
getVersions: () => Promise<OnlineClusterManifest>,
checkForUpdate: () => Promise<Update | null>,
installUpdate: () => Promise<null> } };
open: (input: string) => Promise<null> } };


export type { InferCommandOutput }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ export const Route = createFileRoute('/app/cluster/browser/')({
},
});

// const PROVIDERS: Array<Provider> = ['Modrinth', 'CurseForge', 'SkyClient'];
// I don't think SkyClient will get implemented due to hypixel removing 1.8 support and SkyClient is only really for old 1.8 mods that aren't on a provider
// High chance we can just one day nuke the entire unfinished implementation
const PROVIDERS: Array<Provider> = ['Modrinth', 'CurseForge'];

function RouteComponent() {
Expand Down
43 changes: 20 additions & 23 deletions apps/oneclient/frontend/src/routes/app/cluster/browser/package.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
switch (pkg.provider) {
case 'Modrinth': return `https://modrinth.com/project/${pkg.slug}`;
case 'CurseForge': return `https://www.curseforge.com/minecraft/${pkg.package_type}s/${pkg.slug}`;
case 'SkyClient': return ``;
}
}

Expand Down Expand Up @@ -128,12 +127,10 @@
<p className="max-h-22 flex-1 overflow-hidden text-sm text-fg-secondary line-height-snug">{pkg.short_desc}</p>

<div className="flex flex-row gap-4 text-xs">
{pkg.provider !== 'SkyClient' && (
<div className="flex flex-row items-center gap-2">
<Download01Icon className="h-4 w-4" />
{abbreviateNumber(pkg.downloads)}
</div>
)}
<div className="flex flex-row items-center gap-2">
<Download01Icon className="h-4 w-4" />
{abbreviateNumber(pkg.downloads)}
</div>
</div>
</div>
</div>
Expand All @@ -151,23 +148,23 @@
{(Object.entries(pkg.links) as Array<[keyof typeof pkg.links, typeof pkg.links[keyof typeof pkg.links]]>).filter(a => a[1]).map(link =>
typeof link[1] == 'string'
? (
<ExternalLink
children={upperFirst(link[0])}
className="text-link hover:text-link-hover"
href={link[1]}
includeIcon
key={link[0]}
/>
)
<ExternalLink

Check failure on line 151 in apps/oneclient/frontend/src/routes/app/cluster/browser/package.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

Expected indentation of 9 tabs but found 8
children={upperFirst(link[0])}

Check failure on line 152 in apps/oneclient/frontend/src/routes/app/cluster/browser/package.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

Expected indentation of 10 tabs but found 9
className="text-link hover:text-link-hover"

Check failure on line 153 in apps/oneclient/frontend/src/routes/app/cluster/browser/package.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

Expected indentation of 10 tabs but found 9
href={link[1]}

Check failure on line 154 in apps/oneclient/frontend/src/routes/app/cluster/browser/package.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

Expected indentation of 10 tabs but found 9
includeIcon

Check failure on line 155 in apps/oneclient/frontend/src/routes/app/cluster/browser/package.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

Expected indentation of 10 tabs but found 9
key={link[0]}

Check failure on line 156 in apps/oneclient/frontend/src/routes/app/cluster/browser/package.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

Expected indentation of 10 tabs but found 9
/>

Check failure on line 157 in apps/oneclient/frontend/src/routes/app/cluster/browser/package.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

Expected indentation of 9 tabs but found 8
)
: (link[1] as Array<PackageDonationUrl>).map(donationLink => (
<ExternalLink
children={upperFirst(donationLink.id)}
className="text-link hover:text-link-hover"
href={donationLink.url}
includeIcon
key={donationLink.id}
/>
)))}
<ExternalLink
children={upperFirst(donationLink.id)}
className="text-link hover:text-link-hover"
href={donationLink.url}
includeIcon
key={donationLink.id}
/>
)))}
</div>
</div>

Expand Down
Binary file not shown.
10 changes: 4 additions & 6 deletions apps/onelauncher/frontend/src/components/content/PackageItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,10 @@ export function PackageItem({ provider, ...item }: SearchResult & { provider: Pr
<p className="max-h-22 flex-1 overflow-hidden text-sm text-fg-secondary line-height-snug">{item.description}</p>

<div className="flex flex-row gap-4 text-xs">
<Show when={provider !== 'SkyClient'}>
<div className="flex flex-row items-center gap-2">
<Download01Icon className="h-4 w-4" />
{abbreviateNumber(item.downloads)}
</div>
</Show>
<div className="flex flex-row items-center gap-2">
<Download01Icon className="h-4 w-4" />
{abbreviateNumber(item.downloads)}
</div>
</div>
</div>
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import type { ImgHTMLAttributes, RefAttributes } from 'react';
import CurseForgeIcon from '@/assets/logos/curseforge.svg';
import VanillaImage from '@/assets/logos/minecraft.png';
import ModrinthIcon from '@/assets/logos/modrinth.svg';
import SkyClientImage from '@/assets/logos/skyclient.png';

export function getProviderLogoSrc(provider: string): string {
const providerName = provider.toLowerCase();

const mapping: Record<string, string> = {
modrinth: ModrinthIcon,
curseforge: CurseForgeIcon,
skyclient: SkyClientImage,
};

return mapping[providerName];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ function getPackageUrl(pkg: ManagedPackage): string {
switch (pkg.provider) {
case 'Modrinth': return `https://modrinth.com/project/${pkg.slug}`;
case 'CurseForge': return `https://www.curseforge.com/minecraft/${pkg.package_type}s/${pkg.slug}`;
case 'SkyClient': return ``;
}
}

Expand Down Expand Up @@ -147,12 +146,10 @@ function BrowserSidebar({ package: pkg }: { package: ManagedPackage }) {
<p className="max-h-22 flex-1 overflow-hidden text-sm text-fg-secondary line-height-snug">{pkg.short_desc}</p>

<div className="flex flex-row gap-4 text-xs">
<Show when={pkg.provider !== 'SkyClient'}>
<div className="flex flex-row items-center gap-2">
<Download01Icon className="h-4 w-4" />
{abbreviateNumber(pkg.downloads)}
</div>
</Show>
<div className="flex flex-row items-center gap-2">
<Download01Icon className="h-4 w-4" />
{abbreviateNumber(pkg.downloads)}
</div>
</div>
</div>
</div>
Expand All @@ -170,23 +167,23 @@ function BrowserSidebar({ package: pkg }: { package: ManagedPackage }) {
{(Object.entries(pkg.links) as Array<[keyof typeof pkg.links, typeof pkg.links[keyof typeof pkg.links]]>).filter(a => a[1]).map(link =>
typeof link[1] == 'string'
? (
<CustomA
children={upperFirst(link[0])}
className="text-link hover:text-link-hover"
href={link[1]}
includeIcon
key={link[0]}
/>
)
<CustomA
children={upperFirst(link[0])}
className="text-link hover:text-link-hover"
href={link[1]}
includeIcon
key={link[0]}
/>
)
: (link[1] as Array<PackageDonationUrl>).map(donationLink => (
<CustomA
children={upperFirst(donationLink.id)}
className="text-link hover:text-link-hover"
href={donationLink.url}
includeIcon
key={donationLink.id}
/>
)))}
<CustomA
children={upperFirst(donationLink.id)}
className="text-link hover:text-link-hover"
href={donationLink.url}
includeIcon
key={donationLink.id}
/>
)))}
</div>
</div>

Expand Down Expand Up @@ -288,16 +285,16 @@ function InstallButton() {
{browserContext.cluster
? version
? (
<span>
Download latest to
<br />
<span className="text-md font-semibold">{browserContext.cluster.name}</span>
</span>
)
<span>
Download latest to
<br />
<span className="text-md font-semibold">{browserContext.cluster.name}</span>
</span>
)
: versionsLoading ? 'Looking for a version...' : 'No matching version found'
: (clusters?.length ?? 0) > 0
? 'Select a Cluster'
: 'No clusters'}
? 'Select a Cluster'
: 'No clusters'}
</Show>
<Show when={download.isPending}>
<span>
Expand Down
2 changes: 1 addition & 1 deletion apps/onelauncher/frontend/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ProviderNames: Record<typeof LOADERS[number], string> = {
legacyfabric: 'Legacy Fabric',
} as const;

export const PROVIDERS = ['Modrinth', 'CurseForge', 'SkyClient'] as const;
export const PROVIDERS = ['Modrinth', 'CurseForge'] as const;
export const PACKAGE_TYPES = ['mod', 'resourcepack', 'datapack', 'shaderpack'] as const;

export function pluralize(n: number, word: string, locale: string = 'en'): string {
Expand Down
4 changes: 0 additions & 4 deletions packages/core/src/api/packages/provider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ pub(crate) mod tests;

mod curseforge;
mod modrinth;
// mod skyclient;

pub use curseforge::CurseForgeProviderImpl;
pub use modrinth::ModrinthProviderImpl;
// pub use skyclient::SkyClientProviderImpl;

#[async_trait::async_trait]
pub trait ProviderExt {
Expand Down Expand Up @@ -66,8 +64,6 @@ macro_rules! delegate {
match $self {
Provider::Modrinth => ModrinthProviderImpl.$method($($arg),*).await,
Provider::CurseForge => CurseForgeProviderImpl.$method($($arg),*).await,
// Provider::SkyClient => SkyClientProviderImpl.$method($($arg),*).await,
_ => todo!("skyclient not implement")
}
};
}
Expand Down
69 changes: 0 additions & 69 deletions packages/core/src/api/packages/provider/skyclient.rs

This file was deleted.

3 changes: 0 additions & 3 deletions packages/core/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ pub const METADATA_API_URL: &str = "https://meta.polyfrost.org";
pub const FEATURED_PACKAGES_URL: &str = "https://polyfrost.org/meta/onelauncher/featured.json";
/// <https://mclo.gs>/ API base url.
pub const MCLOGS_API_URL: &str = "https://api.mclo.gs/1";
/// <https://skyclient.co/> metadata base url.
pub const SKYCLIENT_BASE_URL: &str =
"https://raw.githubusercontent.com/SkyblockClient/SkyblockClient-REPO/refs/heads/main/v1";

// =========== Hacky Mojang-spec OS constants ===========
#[cfg(target_os = "windows")]
Expand Down
3 changes: 0 additions & 3 deletions packages/entity/src/domain/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ impl ToString for PackageType {
pub enum Provider {
Modrinth = 0,
CurseForge = 1,
SkyClient = 2,
}

impl Display for Provider {
Expand All @@ -85,7 +84,6 @@ impl Provider {
match self {
Self::Modrinth => "Modrinth",
Self::CurseForge => "CurseForge",
Self::SkyClient => "SkyClient",
}
}

Expand All @@ -95,7 +93,6 @@ impl Provider {
match self {
Self::Modrinth => "https://modrinth.com/",
Self::CurseForge => "https://curseforge.com/",
Self::SkyClient => "https://skyclient.co/",
}
}

Expand Down
Loading