♻️ refactor: i promise this is the last big refactor

This commit is contained in:
Pauline 2024-07-26 04:03:22 +02:00
parent 9a4422fe8b
commit 40e5e1f6ba
No known key found for this signature in database
GPG key ID: 722BB181973296AE
210 changed files with 192 additions and 232 deletions

16
.gitignore vendored
View file

@ -24,7 +24,7 @@ vender/
# Created by git when using merge tools for conflicts
*.BACKUP.*
# *.BASE.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*_BACKUP_*.txt
@ -117,6 +117,9 @@ fabric.properties
.idea/*
!.idea/codeStyles
!.idea/runConfigurations
### Linux ###
*~
@ -241,7 +244,7 @@ web_modules/
.yarn-integrity
# dotenv environment variable files
# .env
.env
.env.development.local
.env.test.local
.env.production.local
@ -258,7 +261,6 @@ out
# Nuxt.js build / generate output
.nuxt
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
@ -266,7 +268,6 @@ out
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
@ -322,7 +323,7 @@ Cargo.lock
*.pdb
### rust-analyzer ###
# Can be generated by other build systems other than cargo (ex: bazelbuild/rust_rules)
# Can be generated by other build systems other than cargo (ex: bazelbuild/rust_rules)
rust-project.json
@ -333,7 +334,6 @@ rust-project.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
!.vscode/tailwind.json
# Local History for Visual Studio Code
.history/
@ -359,7 +359,7 @@ ehthumbs_vista.db
# Folder config file
[Dd]esktop.ini
# Recyc# le Bin used on file shares
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
@ -389,4 +389,4 @@ $RECYCLE.BIN/
# and uncomment the following lines
# .pnp.*
# End of https://www.toptal.com/developers/gitignore/api/node,rust,yarn,linux,macos,windows,rust-analyzer,visualstudiocode,git
# End of https://www.toptal.com/developers/gitignore/api/git,node,rust,yarn,linux,macos,windows,rust-analyzer,visualstudiocode,intellij+all

1
.nvmrc
View file

@ -1 +0,0 @@
20

View file

@ -1,8 +1,9 @@
[workspace]
resolver = "2"
members = [
"crates/*",
"apps/desktop/src-tauri",
"apps/testing",
"apps/desktop",
"packages/core"
]
[workspace.package]
@ -19,6 +20,8 @@ authors = [
version = "1.0.0"
[workspace.dependencies]
onelauncher = { path = "./packages/core" }
# tauri uses latest crates.io beta channel (temporarily can use v2 and main branches if necessary)
tauri = { version = "=2.0.0-beta.24", features = [
"rustls-tls",

View file

@ -1,4 +1,3 @@
/dist-isolation
/coverage
/src/bindings.ts
/dist
# Generated by Tauri
.cargo/
/gen

View file

@ -1,6 +0,0 @@
#!/usr/bin/env bash
export ICONS_VOLUME="$(realpath ./.icons)"
export DIST_VOLUME="$(realpath dist)"
export ISOLATION_VOLUME="$(realpath isolation-dist)"
export WORKSPACE_VOLUME="$(realpath ../..)"

View file

@ -1,2 +0,0 @@
src-tauri/Cross.toml
src-tauri/.gitignore

View file

@ -1,7 +1,7 @@
[package]
name = "onelauncher_gui"
description = "Next-generation open source Minecraft launcher"
version = { workspace = true }
version = "1.0.0" # todo: make it so tauri works with the ws
license = { workspace = true }
edition = { workspace = true }
repository = { workspace = true }
@ -25,7 +25,7 @@ tauri-build = { workspace = true, features = [
] }
[dependencies]
onelauncher = { path = "../../../crates/core", features = [ "tauri" ] }
onelauncher = { workspace = true, features = [ "tauri" ] }
tauri = { workspace = true, features = [
"isolation",

View file

@ -1,8 +1,8 @@
{
"name": "@onelauncher/gui",
"name": "@onelauncher/desktop",
"type": "module",
"version": "1.0.0",
"description": "Next-generation open source Minecraft desktop launcher",
"description": "Next-generation open source Minecraft launcher",
"license": "GPL-3.0-only",
"repository": {
"type": "git",
@ -10,45 +10,16 @@
"directory": "apps/desktop"
},
"scripts": {
"tauri": "pnpm tauri",
"dev": "pnpm vite dev",
"build": "pnpm vite build"
"build": "pnpm tauri build",
"dev": "pnpm tauri dev",
"tauri": "pnpm tauri"
},
"dependencies": {
"@fontsource/poppins": "^5.0.14",
"@iconify-json/logos": "^1.1.43",
"@leeoniya/ufuzzy": "^1.0.14",
"@onelauncher/client": "workspace:*",
"@onelauncher/core": "workspace:*",
"@onelauncher/distribution": "workspace:*",
"@rspc/client": "^0.2.3",
"@rspc/solid-query": "^0.2.3",
"@rspc/tauri": "^0.2.0",
"@solid-primitives/refs": "^1.0.8",
"@solidjs/router": "^0.14.1",
"@tanstack/solid-query": "^5.51.9",
"@tauri-apps/api": "^2.0.0-beta.13",
"@tauri-apps/plugin-clipboard-manager": "github:tauri-apps/tauri-plugin-clipboard-manager#v2",
"@tauri-apps/plugin-shell": "github:tauri-apps/tauri-plugin-shell#v2",
"@thisbeyond/solid-dnd": "^0.7.5",
"@thisbeyond/solid-select": "^0.15.0",
"@unocss/reset": "^0.61.5",
"@untitled-theme/icons-solid": "^0.10.5",
"overlayscrollbars": "^2.9.2",
"overlayscrollbars-solid": "^0.5.5",
"solid-js": "^1.8.19",
"solid-transition-group": "^0.2.3",
"uuid": "^10.0.0"
"@onelauncher/frontend": "workspace:*"
},
"devDependencies": {
"@solidjs/testing-library": "^0.8.9",
"@tauri-apps/cli": "^2.0.0-beta.20",
"@testing-library/jest-dom": "^6.4.8",
"@types/uuid": "^10.0.0",
"jsdom": "^24.1.1",
"sass": "^1.77.8",
"unocss": "^0.61.5",
"vite-plugin-solid": "^2.10.2",
"vite-plugin-solid-svg": "^0.8.1",
"vite-tsconfig-paths": "^4.3.2"
"@tauri-apps/cli": "^2.0.0-beta.20"
}
}

View file

@ -1,3 +0,0 @@
# Generated by Tauri
.cargo/
/gen

View file

@ -1,12 +0,0 @@
[build.env]
# must set ICONS_VOLUME, DIST_VOLUME, ISOLATION_VOLUME and WORKSPACE_VOLUME environment variables
# this can be done running `$ . .setup-cross.sh` in the onelauncher_gui folder
volumes = [
"ICONS_VOLUME",
"DIST_VOLUME",
"ISOLATION_VOLUME",
"WORKSPACE_VOLUME"
]
[target.aarch64-unknown-linux-gnu]
image = "aarch64-unknown-linux-gnu:latest"

View file

@ -58,7 +58,7 @@ pub async fn run_app<F: FnOnce(&mut tauri::App) + Send + 'static>(setup: F) {
let builder = collect_commands!();
#[cfg(debug_assertions)]
let builder = builder.path("../src/bindings.ts");
let builder = builder.path("../../frontend/src/bindings.ts");
builder.build().unwrap()
});

View file

@ -1,7 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/core/tauri-config-schema/schema.json",
"productName": "OneLauncher",
"version": "../package.json",
"identifier": "OneLauncher",
"app": {
"withGlobalTauri": true,
@ -18,7 +17,7 @@
"pattern": {
"use": "isolation",
"options": {
"dir": "../src-isolation/"
"dir": "../frontend/src-isolation/"
}
},
"assetProtocol": {
@ -56,9 +55,9 @@
]
},
"build": {
"beforeDevCommand": "pnpm dev",
"beforeBuildCommand": "pnpm build",
"frontendDist": "../dist",
"beforeDevCommand": "pnpm dev --filter @onelauncher/frontend",
"beforeBuildCommand": "pnpm build --filter @onelauncher/frontend",
"frontendDist": "../frontend/dist",
"devUrl": "http://localhost:8001"
},
"bundle": {
@ -66,11 +65,11 @@
"targets": "all",
"category": "Game",
"icon": [
"../.icons/32x32.png",
"../.icons/128x128.png",
"../.icons/128x128@2x.png",
"../.icons/icon.icns",
"../.icons/icon.ico"
"../../packages/distribution/icons/32x32.png",
"../../packages/distribution/icons/128x128.png",
"../../packages/distribution/icons/128x128@2x.png",
"../../packages/distribution/icons/icon.icns",
"../../packages/distribution/icons/icon.ico"
],
"copyright": "Polyfrost",
"longDescription": "",
@ -80,7 +79,7 @@
"linux": {
"deb": {
"depends": [],
"desktopTemplate": "../../distribution/linux/org.polyfrost.launcher.desktop.template"
"desktopTemplate": "../../packages/distribution/linux/org.polyfrost.launcher.desktop.template"
}
},
"shortDescription": "Next-generation open source Minecraft launcher",

3
apps/frontend/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
/dist-isolation
/coverage
/src/bindings.ts

5
apps/frontend/dist/.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
# This is done so that Tauri never complains that '../dist does not exist'

View file

@ -0,0 +1,52 @@
{
"name": "@onelauncher/frontend",
"type": "module",
"version": "1.0.0",
"description": "Next-generation open source Minecraft launcher frontend",
"license": "GPL-3.0-only",
"repository": {
"type": "git",
"url": "git@github.com:polyfrost/onelauncher",
"directory": "apps/frontend"
},
"scripts": {
"dev": "pnpm vite dev",
"build": "pnpm vite build"
},
"dependencies": {
"@fontsource/poppins": "^5.0.14",
"@iconify-json/logos": "^1.1.43",
"@leeoniya/ufuzzy": "^1.0.14",
"@onelauncher/client": "workspace:*",
"@rspc/client": "^0.2.3",
"@rspc/solid-query": "^0.2.3",
"@rspc/tauri": "^0.2.0",
"@solid-primitives/refs": "^1.0.8",
"@solidjs/router": "^0.14.1",
"@tanstack/solid-query": "^5.51.9",
"@tauri-apps/api": "^2.0.0-beta.13",
"@tauri-apps/plugin-clipboard-manager": "github:tauri-apps/tauri-plugin-clipboard-manager#v2",
"@tauri-apps/plugin-shell": "github:tauri-apps/tauri-plugin-shell#v2",
"@thisbeyond/solid-dnd": "^0.7.5",
"@thisbeyond/solid-select": "^0.15.0",
"@unocss/reset": "^0.61.5",
"@untitled-theme/icons-solid": "^0.10.5",
"overlayscrollbars": "^2.9.2",
"overlayscrollbars-solid": "^0.5.5",
"solid-js": "^1.8.19",
"solid-transition-group": "^0.2.3",
"uuid": "^10.0.0"
},
"devDependencies": {
"@solidjs/testing-library": "^0.8.9",
"@tauri-apps/cli": "^2.0.0-beta.20",
"@testing-library/jest-dom": "^6.4.8",
"@types/uuid": "^10.0.0",
"jsdom": "^24.1.1",
"sass": "^1.77.8",
"unocss": "^0.61.5",
"vite-plugin-solid": "^2.10.2",
"vite-plugin-solid-svg": "^0.8.1",
"vite-tsconfig-paths": "^4.3.2"
}
}

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 321 KiB

After

Width:  |  Height:  |  Size: 321 KiB

View file

Before

Width:  |  Height:  |  Size: 340 KiB

After

Width:  |  Height:  |  Size: 340 KiB

View file

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 769 B

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Some files were not shown because too many files have changed in this diff Show more