feat: project can be compiled now
i did it for testing in my other pc
This commit is contained in:
parent
176e6cb062
commit
5f78b6aa15
12 changed files with 18 additions and 23 deletions
|
|
@ -54,7 +54,8 @@ async fn initialize_tauri(builder: tauri::Builder<tauri::Wry>) -> LauncherResult
|
|||
.export_config(
|
||||
specta_typescript::Typescript::default()
|
||||
.bigint(specta_typescript::BigIntExportBehavior::BigInt)
|
||||
.formatter(ext::specta::formatter),
|
||||
.formatter(ext::specta::formatter)
|
||||
.header("// @ts-nocheck \n"),
|
||||
)
|
||||
.merge(api::commands::OneLauncherApiImpl.into_handler())
|
||||
.merge(onelauncher_core::api::tauri::TauriLauncherApiImpl.into_handler())
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { GameLoader, Model } from '@/bindings.gen';
|
||||
import type { ClusterModel, GameLoader } from '@/bindings.gen';
|
||||
import type { ImgHTMLAttributes, RefAttributes } from 'react';
|
||||
import FabricImage from '@/assets/logos/loaders/fabric.png';
|
||||
import ForgeImage from '@/assets/logos/loaders/forge.png';
|
||||
|
|
@ -6,7 +6,7 @@ import NeoForgeImage from '@/assets/logos/loaders/neoforge.png';
|
|||
import QuiltImage from '@/assets/logos/loaders/quilt.png';
|
||||
import VanillaImage from '@/assets/logos/minecraft.png';
|
||||
|
||||
export function getLoaderLogoSrc(loader: Model | GameLoader): string {
|
||||
export function getLoaderLogoSrc(loader: ClusterModel | GameLoader): string {
|
||||
const loaderName = (typeof loader === 'string' ? loader : loader.mc_loader).toLowerCase() as GameLoader;
|
||||
|
||||
const mapping: Record<GameLoader, string> = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { GameLoader, IngressPayload, Version, VersionType } from '@/bindings.gen';
|
||||
import type { GameLoader, Version, VersionType } from '@/bindings.gen';
|
||||
import type { JSX, RefAttributes } from 'react';
|
||||
import DefaultBanner from '@/assets/images/default_banner.png';
|
||||
import DefaultClusterBanner from '@/assets/images/default_instance_cover.jpg';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import type { ClassNameString } from '@onelauncher/common';
|
||||
import type { DialogProps } from 'react-aria-components';
|
||||
import {
|
||||
Dialog as AriaDialog,
|
||||
|
|
@ -7,7 +6,7 @@ import {
|
|||
ModalOverlay,
|
||||
} from 'react-aria-components';
|
||||
|
||||
interface ModalProps extends DialogProps, ClassNameString { }
|
||||
interface ModalProps extends DialogProps { }
|
||||
|
||||
function Modal({ className, ...props }: ModalProps) {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ function AccountPopup() {
|
|||
const defaultUser = useCommand('getDefaultUser', () => bindings.core.getDefaultUser(false));
|
||||
|
||||
const setDefaultUser = (user: MinecraftCredentials) => {
|
||||
bindings.commands.setDefaultUser(user.id);
|
||||
bindings.core.setDefaultUser(user.id);
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
import type { Model } from '@/bindings.gen';
|
||||
import type { ClusterModel } from '@/bindings.gen';
|
||||
import { bindings } from '@/main';
|
||||
import { useCommand } from '@onelauncher/common';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
function useRecentCluster() {
|
||||
const result = useCommand('getClusters', bindings.core.getClusters);
|
||||
const [cluster, setCluster] = useState<Model | undefined>();
|
||||
const [cluster, setCluster] = useState<ClusterModel | undefined>();
|
||||
|
||||
useEffect(() => {
|
||||
if (!result.data)
|
||||
return;
|
||||
|
||||
let mostRecentCluster: Model | undefined;
|
||||
let mostRecentCluster: ClusterModel | undefined;
|
||||
|
||||
for (const c of result.data) {
|
||||
if (!mostRecentCluster) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import type { UnlistenFn } from '@tauri-apps/api/event';
|
||||
import type { ReactNode } from 'react';
|
||||
import { bindings } from '@/main';
|
||||
import { randomString } from '@/utils/index';
|
||||
import { createContext, useContext, useEffect, useState } from 'react';
|
||||
import { createContext, useContext, useState } from 'react';
|
||||
|
||||
export interface NotificationData {
|
||||
title: string;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import type { HookReturn } from '@/hooks/useNotification';
|
||||
import type { QueryClient } from '@tanstack/react-query';
|
||||
import type { NavigateOptions, ToOptions } from '@tanstack/react-router';
|
||||
import NotificationToasts from '@/components/overlay/NotificationToasts';
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import { useCommand } from '@onelauncher/common';
|
|||
import { Button, Show, TextField } from '@onelauncher/common/components';
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
import { convertFileSrc } from '@tauri-apps/api/core';
|
||||
import { dataDir } from '@tauri-apps/api/path';
|
||||
import { open } from '@tauri-apps/plugin-dialog';
|
||||
import { Edit02Icon, FolderIcon, ImagePlusIcon, Share07Icon, Tool02Icon, Trash01Icon } from '@untitled-theme/icons-react';
|
||||
import { useState } from 'react';
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
import type { ProfileUpdate } from '@/bindings.gen';
|
||||
import ScrollableContainer from '@/components/ScrollableContainer';
|
||||
import usePopState from '@/hooks/usePopState';
|
||||
import { bindings } from '@/main';
|
||||
import { useCommand } from '@onelauncher/common';
|
||||
import { Button } from '@onelauncher/common/components';
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
import { GameSettings, ProcessSettings } from '../settings/minecraft';
|
||||
import Sidebar from '../settings/route';
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { useCommand } from '@onelauncher/common';
|
|||
import { Button, Show } from '@onelauncher/common/components';
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
import { useState } from 'react';
|
||||
import { useOnboardingContext } from './route';
|
||||
|
||||
export const Route = createFileRoute('/onboarding/login')({
|
||||
component: RouteComponent,
|
||||
|
|
|
|||
|
|
@ -41,14 +41,15 @@ pub async fn start_logger() {
|
|||
// This will log to a file in the logs directory, and will not show any logs in the console
|
||||
#[cfg(not(debug_assertions))]
|
||||
pub async fn start_logger() {
|
||||
use chrono::Local;
|
||||
use chrono::Local;
|
||||
use std::fs::OpenOptions;
|
||||
use tracing_subscriber::fmt::time::ChronoLocal;
|
||||
|
||||
use crate::io::Dirs;
|
||||
|
||||
use crate::store::Dirs;
|
||||
use crate::store::Core;
|
||||
|
||||
// Initialize and get logs directory path
|
||||
let logs_dir = Dirs::get().await?.launcher_logs_dir();
|
||||
let logs_dir = Dirs::get_launcher_logs_dir().await.unwrap_or_default();
|
||||
|
||||
let log_file_name = format!("launcher_{}.log", Local::now().format("%Y%m%d_%H%M%S"));
|
||||
let log_file_path = logs_dir.join(log_file_name);
|
||||
|
|
@ -65,7 +66,7 @@ pub async fn start_logger() {
|
|||
Ok(file) => file,
|
||||
Err(e) => {
|
||||
eprintln!("Could not start open log file: {e}");
|
||||
return None;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -86,7 +87,7 @@ pub async fn start_logger() {
|
|||
.with_ansi(false)
|
||||
.with_timer(ChronoLocal::rfc_3339());
|
||||
|
||||
if let Some(span) = Core::get().span_formatting.clone() {
|
||||
if let Some(span) = Core::get().logger_span_formatting.clone() {
|
||||
fmt_layer = fmt_layer.with_span_events(span);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue