Merge branch 'main' into feat/curseforge

This commit is contained in:
Pauline 2024-10-15 19:19:19 -04:00 • committed by GitHub
commit b5bc602d21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 1262 additions and 1218 deletions

View file

@ -1,27 +1,16 @@
## Description
<!-- Describe your changes in detail -->
<!-- Describe your changes in detail along with its rationale -->
## Related Issue(s)
<!-- List the issue(s) this PR solves -->
<!-- List the issue(s) this PR solves, if any -->
Fixes #
## How to test
<!-- Provide steps to test this PR -->
## Release Notes
<!--
Add entries for the CHANGELOG.md or "NONE" if there aren't any user facing changes.
Each line becomes a separate entry.
Format: [!<optional for breaking>] <description>
Example: !basic auth is no longer supported
-->
```release-note
```
## Documentation
<!--

View file

@ -25,6 +25,6 @@
"pathe": "^1.1.2"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1"
"@vercel/ncc": "^0.38.2"
}
}

View file

@ -21,6 +21,6 @@
"@actions/io": "^1.1.3"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1"
"@vercel/ncc": "^0.38.2"
}
}

260
Cargo.lock generated
View file

@ -340,7 +340,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -369,13 +369,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
[[package]]
name = "async-trait"
version = "0.1.82"
version = "0.1.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1"
checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -451,9 +451,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "autocfg"
version = "1.3.0"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "backtrace"
@ -811,9 +811,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.1.21"
version = "1.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0"
checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0"
dependencies = [
"jobserver",
"libc",
@ -1276,7 +1276,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
dependencies = [
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -1286,7 +1286,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f"
dependencies = [
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -1357,7 +1357,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -1381,7 +1381,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -1392,7 +1392,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
dependencies = [
"darling_core",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -1464,7 +1464,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -1477,7 +1477,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustc_version",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -1608,7 +1608,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -1631,7 +1631,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -1779,9 +1779,9 @@ dependencies = [
[[package]]
name = "embed-resource"
version = "2.4.3"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4edcacde9351c33139a41e3c97eb2334351a81a2791bebb0b243df837128f602"
checksum = "f4e24052d7be71f0efb50c201557f6fe7d237cfd5a64fd5bcd7fd8fe32dbbffa"
dependencies = [
"cc",
"memchr",
@ -1842,7 +1842,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -1956,9 +1956,9 @@ checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6"
[[package]]
name = "fdeflate"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645"
checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab"
dependencies = [
"simd-adler32",
]
@ -2009,9 +2009,9 @@ checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33"
[[package]]
name = "flate2"
version = "1.0.33"
version = "1.0.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253"
checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0"
dependencies = [
"crc32fast",
"miniz_oxide 0.8.0",
@ -2068,7 +2068,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -2180,7 +2180,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -2477,7 +2477,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -2577,7 +2577,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -2907,9 +2907,9 @@ dependencies = [
[[package]]
name = "hyper-util"
version = "0.1.8"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba"
checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b"
dependencies = [
"bytes",
"futures-channel",
@ -2920,7 +2920,6 @@ dependencies = [
"pin-project-lite",
"socket2",
"tokio",
"tower",
"tower-service",
"tracing",
]
@ -3121,9 +3120,9 @@ dependencies = [
[[package]]
name = "interpulse"
version = "1.1.3"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6f88df96566153d2d0f7761efe19c8f9bb1b867c47b5fa0d9a8e6e7ef273a0d"
checksum = "0231234632fd030df5027cd8d8c4c4f27a1177d6a18790f9e45a2a188491973a"
dependencies = [
"bytes",
"chrono",
@ -3360,9 +3359,9 @@ dependencies = [
[[package]]
name = "k256"
version = "0.13.3"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b"
checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b"
dependencies = [
"cfg-if",
"ecdsa",
@ -3462,9 +3461,9 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.158"
version = "0.2.159"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5"
[[package]]
name = "libflate"
@ -3506,6 +3505,16 @@ version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
[[package]]
name = "libmimalloc-sys"
version = "0.1.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "libredox"
version = "0.1.3"
@ -3514,7 +3523,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
dependencies = [
"bitflags 2.6.0",
"libc",
"redox_syscall 0.5.4",
"redox_syscall 0.5.6",
]
[[package]]
@ -3811,6 +3820,15 @@ dependencies = [
"sketches-ddsketch",
]
[[package]]
name = "mimalloc"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633"
dependencies = [
"libmimalloc-sys",
]
[[package]]
name = "mime"
version = "0.3.17"
@ -3846,7 +3864,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08"
dependencies = [
"adler",
"simd-adler32",
]
[[package]]
@ -3856,6 +3873,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1"
dependencies = [
"adler2",
"simd-adler32",
]
[[package]]
@ -4186,7 +4204,7 @@ dependencies = [
"proc-macro-crate 2.0.2",
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -4423,6 +4441,7 @@ dependencies = [
"chrono",
"cocoa",
"interpulse",
"mimalloc",
"objc",
"once_cell",
"onelauncher",
@ -4455,7 +4474,7 @@ name = "onelauncher_macros"
version = "1.0.0-alpha.1"
dependencies = [
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -4549,7 +4568,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -4745,7 +4764,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
dependencies = [
"cfg-if",
"libc",
"redox_syscall 0.5.4",
"redox_syscall 0.5.6",
"smallvec",
"windows-targets 0.52.6",
]
@ -4802,9 +4821,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "pest"
version = "2.7.12"
version = "2.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea"
checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9"
dependencies = [
"memchr",
"thiserror",
@ -4813,9 +4832,9 @@ dependencies = [
[[package]]
name = "pest_derive"
version = "2.7.12"
version = "2.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "664d22978e2815783adbdd2c588b455b1bd625299ce36b2a99881ac9627e6d8d"
checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0"
dependencies = [
"pest",
"pest_generator",
@ -4823,22 +4842,22 @@ dependencies = [
[[package]]
name = "pest_generator"
version = "2.7.12"
version = "2.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2d5487022d5d33f4c30d91c22afa240ce2a644e87fe08caad974d4eab6badbe"
checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e"
dependencies = [
"pest",
"pest_meta",
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
name = "pest_meta"
version = "2.7.12"
version = "2.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0091754bbd0ea592c4deb3a122ce8ecbb0753b738aa82bc055fcc2eccc8d8174"
checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f"
dependencies = [
"once_cell",
"pest",
@ -4959,7 +4978,7 @@ dependencies = [
"phf_shared 0.11.2",
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -5006,7 +5025,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -5044,9 +5063,9 @@ dependencies = [
[[package]]
name = "pkg-config"
version = "0.3.30"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
[[package]]
name = "plist"
@ -5063,15 +5082,15 @@ dependencies = [
[[package]]
name = "png"
version = "0.17.13"
version = "0.17.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1"
checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0"
dependencies = [
"bitflags 1.3.2",
"crc32fast",
"fdeflate",
"flate2",
"miniz_oxide 0.7.4",
"miniz_oxide 0.8.0",
]
[[package]]
@ -5114,9 +5133,9 @@ dependencies = [
[[package]]
name = "portable-atomic"
version = "1.7.0"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"
checksum = "d30538d42559de6b034bc76fd6dd4c38961b1ee5c6c56e3808c50128fdbc22ce"
[[package]]
name = "powerfmt"
@ -5696,9 +5715,9 @@ dependencies = [
[[package]]
name = "redox_syscall"
version = "0.5.4"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853"
checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b"
dependencies = [
"bitflags 2.6.0",
]
@ -6061,9 +6080,9 @@ dependencies = [
[[package]]
name = "rustls-pki-types"
version = "1.8.0"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0"
checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55"
[[package]]
name = "rustls-webpki"
@ -6199,7 +6218,7 @@ dependencies = [
"proc-macro2",
"quote",
"serde_derive_internals",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -6254,9 +6273,9 @@ dependencies = [
[[package]]
name = "security-framework-sys"
version = "2.11.1"
version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf"
checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6"
dependencies = [
"core-foundation-sys",
"libc",
@ -6329,7 +6348,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -6340,7 +6359,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -6385,14 +6404,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
name = "serde_spanned"
version = "0.6.7"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d"
checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1"
dependencies = [
"serde",
]
@ -6436,7 +6455,7 @@ dependencies = [
"darling",
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -6625,7 +6644,7 @@ dependencies = [
"objc2-foundation",
"objc2-quartz-core",
"raw-window-handle",
"redox_syscall 0.5.4",
"redox_syscall 0.5.6",
"wasm-bindgen",
"web-sys",
"windows-sys 0.59.0",
@ -6725,7 +6744,7 @@ dependencies = [
"Inflector",
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -7006,7 +7025,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -7039,9 +7058,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.77"
version = "2.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed"
checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590"
dependencies = [
"proc-macro2",
"quote",
@ -7157,9 +7176,9 @@ dependencies = [
[[package]]
name = "tao"
version = "0.30.0"
version = "0.30.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a93f2c6b8fdaeb7f417bda89b5bc767999745c3052969664ae1fa65892deb7e"
checksum = "06e48d7c56b3f7425d061886e8ce3b6acfab1993682ed70bef50fd133d721ee6"
dependencies = [
"bitflags 2.6.0",
"cocoa",
@ -7202,14 +7221,14 @@ checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
name = "tar"
version = "0.4.41"
version = "0.4.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909"
checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020"
dependencies = [
"filetime",
"libc",
@ -7318,7 +7337,7 @@ dependencies = [
"serde",
"serde_json",
"sha2 0.10.8",
"syn 2.0.77",
"syn 2.0.79",
"tauri-utils",
"thiserror",
"time",
@ -7336,7 +7355,7 @@ dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
"tauri-codegen",
"tauri-utils",
]
@ -7585,7 +7604,7 @@ dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -7674,22 +7693,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c"
[[package]]
name = "thiserror"
version = "1.0.63"
version = "1.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.63"
version = "1.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -7795,7 +7814,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -7912,27 +7931,6 @@ dependencies = [
"winnow",
]
[[package]]
name = "tower"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
dependencies = [
"futures-core",
"futures-util",
"pin-project",
"pin-project-lite",
"tokio",
"tower-layer",
"tower-service",
]
[[package]]
name = "tower-layer"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
[[package]]
name = "tower-service"
version = "0.3.3"
@ -7971,7 +7969,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -8220,15 +8218,15 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
[[package]]
name = "unicode-width"
version = "0.1.13"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
[[package]]
name = "unicode-xid"
version = "0.2.5"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "unicode_categories"
@ -8462,7 +8460,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
"wasm-bindgen-shared",
]
@ -8496,7 +8494,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -8594,9 +8592,9 @@ dependencies = [
[[package]]
name = "webpki-roots"
version = "0.26.5"
version = "0.26.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a"
checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958"
dependencies = [
"rustls-pki-types",
]
@ -8623,7 +8621,7 @@ checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -8649,7 +8647,7 @@ version = "1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d"
dependencies = [
"redox_syscall 0.5.4",
"redox_syscall 0.5.6",
"wasite",
"web-sys",
]
@ -8793,7 +8791,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -8804,7 +8802,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -8815,7 +8813,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -8826,7 +8824,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -9353,7 +9351,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]
@ -9374,7 +9372,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
"syn 2.0.79",
]
[[package]]

View file

@ -96,7 +96,7 @@ specta-typescript = { version = "=0.0.7" }
# rspc-specta2 is the specta v2 (rc) adapter for rspc.
rspc-tauri2 = { version = "=0.0.1" }
# core utilities for minecraft and mod management with pulseflow apis
interpulse = { version = "=1.1.3", features = [ "specta" ] }
interpulse = { version = "=1.2.0", features = [ "specta" ] }
# # ============= SECURITY ============= # #
thiserror = { version = "1.0" }
@ -123,7 +123,7 @@ base64 = { version = "0.22" }
p256 = { version = "0.13.2", features = [ "ecdsa" ] }
uuid = { version = "1.10", features = [ "serde", "v4" ] }
toml = { version = "0.8" }
nom = { version = "7" }
nom = { version = "7.1" }
# # ============= NETWORK ============= # #
reqwest = { version = "0.12", default-features = false, features = [
@ -160,6 +160,7 @@ bytes = { version = "1.7" }
# # ============= UTILITY ============= # #
async-channel = { version = "2.3" }
mimalloc = { version = "0.1" }
pin-project-lite = { version = "0.2" }
once_cell = { version = "1.19" }
quote = { version = "1.0" }
@ -207,6 +208,40 @@ features = [
]
default-features = false
[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
correctness = { level = "warn", priority = -1 }
perf = { level = "warn", priority = -1 }
style = { level = "warn", priority = -1 }
suspicious = { level = "warn", priority = -1 }
complexity = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
unnecessary_cast = "warn"
cast_lossless = "warn"
dbg_macro = "warn"
deprecated_cfg_attr = "warn"
separated_literal_suffix = "warn"
missing_errors_doc = "allow"
future_not_send = "allow"
module_name_repetitions = "allow"
struct_field_names = "allow"
cast_precision_loss = "allow"
missing_panics_doc = "allow"
significant_drop_tightening = "allow" # tmp
needless_return = "allow"
[workspace.lints.rust]
unused_qualifications = "warn"
rust_2018_idioms = { level = "warn", priority = -1 }
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unused_allocation = "warn"
unused_import_braces = "warn"
deprecated = "warn"
deprecated_in_future = "forbid"
unused_must_use = "deny"
[patch.crates-io]
# rspc = { git = "https://github.com/oscartbeaumont/rspc", rev = "9f26d6400affdb501837cb023678268ad72feb9b" }
# rspc-tauri2 = { git = "https://github.com/specta-rs/tauri2", rev = "6b9419566e2a826fb2a62538c7647f4524ab0fea" }

17
TODO.md
View file

@ -2,7 +2,7 @@
- [ ] **remove clusterpath, just switch to pathbuf or string in prisma, and refactor package api**
- [ ] **splash screen and reduce startup times**
- [ ] fix missing jars and libraries when launching clusters
- [x] fix missing jars and libraries when launching clusters
- [ ] migrate launcher backend storage to `prisma-client-rust` (see `prisma` branch).
- maybe use `sqlx` instead to avoid unnecessary bloat (but also i don't like sqlx lol)
- todo: also add caching to the prisma schema
@ -20,12 +20,10 @@
- [ ] implement forgewrapper instead of processing ourselves
- [ ] allow per-cluster sandboxing
- [x] implement gamemode
- [ ] better toml support
- [x] better toml support
- [ ] make all tauri events into tauri_specta events
- [ ] apple and windows signing
- [ ] calendar ian button easter egg
- [ ] investigate post init hooks
- [ ] investigate missing forge libraries
- [x] modal stacking
- [x] popup visibility toggled
- [x] smooth animations/animation accessibility
@ -33,8 +31,9 @@
- [ ] cluster reorganizing (drag n drop)
- [x] different cluster views
- [x] settings tsx
- [ ] packages api
- [ ] browser tsx
- [x] packages api
- [ ] curseforge api
- [x] browser tsx
- [ ] importing tsx
- [ ] mrpack tsx
- [x] launch the game
@ -42,7 +41,7 @@
- [x] authentication
- [x] manifest fetching
- [ ] tauri updater v1 -> v2
- [ ] fix old intel gpus <https://github.com/MultiMC/Launcher/issues/1276#issuecomment-774541617>
- [x] fix old intel gpus <https://github.com/MultiMC/Launcher/issues/1276#issuecomment-774541617>
- [ ] fix cmd+a on macos not selecting all text
- [ ] fix cmd+c on macos not pasting in oauth and entire launcher
- [ ] hotfix some webkitgtk problems if possible
@ -56,10 +55,10 @@
- [ ] reduce bundle size (<https://bundlephobia.com>):
- [ ] markdown-it (157kb) - lots of alternatives
- [ ] highlight.js (143kb) - shiki is a good alternative i think
- [ ] uFuzzy (24kb) - lots of alternatives, but its one of the best fuzzy searching libs
- [ ] overlayscrollbars (60kb) - not sure
- [ ] assets (63kb in icons and a lot more in .pngs) - we need to optimize our own assets, the ones from libs are negligable (default_instance_cover_ and header jpgs specifically)
- [ ] reduce app size (release binary) including in appimage (10mb right now, aiming for less than 14mb total release)
- [ ] drag and drop files into the launcher window (mods and modpack files)
- [ ] <https://github.com/gorilla-devs/GDLauncher-Carbon> and <https://github.com/gorilla-devs/libium>
- [ ] <https://github.com/gorilla-devs/furse> and <https://github.com/gorilla-devs/ferinth>
- [ ] add `minecraft.modpack.name` jvm arg based on installed modpack in `run_credentials`
- [ ] backwards compatibility from <https://github.com/PrismLauncher/PrismLauncher/blob/develop/libraries/launcher/org/prismlauncher/SystemProperties.java>

View file

@ -15,6 +15,9 @@ authors = { workspace = true }
name = "onelauncher_gui"
crate-type = [ "staticlib", "cdylib", "lib" ]
[lints]
workspace = true
[build-dependencies]
tauri-build = { workspace = true }
@ -43,6 +46,7 @@ chrono = { workspace = true }
uuid = { workspace = true }
tracing = { workspace = true }
tracing-error = { workspace = true }
mimalloc = { workspace = true }
[dependencies.tauri]
workspace = true

View file

@ -15,22 +15,19 @@ use uuid::Uuid;
#[specta::specta]
#[tauri::command]
pub async fn get_cluster(uuid: Uuid) -> Result<Cluster, String> {
match onelauncher::cluster::get_by_uuid(uuid).await? {
Some(cluster) => Ok(cluster),
None => Err("Cluster does not exist".into()),
}
(cluster::get_by_uuid(uuid).await?).map_or_else(|| Err("Cluster does not exist".into()), Ok)
}
#[specta::specta]
#[tauri::command]
pub async fn get_clusters() -> Result<Vec<Cluster>, String> {
Ok(onelauncher::cluster::list().await?)
Ok(cluster::list().await?)
}
#[specta::specta]
#[tauri::command]
pub async fn get_clusters_grouped() -> Result<HashMap<String, Vec<Cluster>>, String> {
Ok(onelauncher::cluster::list_grouped().await?)
Ok(cluster::list_grouped().await?)
}
#[derive(Serialize, Deserialize, Type)]
@ -76,16 +73,11 @@ pub async fn edit_game_settings(uuid: Uuid, new_cluster: Cluster) -> Result<(),
let cluster_path = ClusterPath::find_by_uuid(uuid).await?;
cluster::edit(&cluster_path, |old| {
// Game
old.force_fullscreen = new_cluster.force_fullscreen;
old.resolution = new_cluster.resolution;
old.memory = new_cluster.memory;
// Process
old.init_hooks = new_cluster.init_hooks.clone();
// Java
old.java = new_cluster.java.clone();
old.init_hooks.clone_from(&new_cluster.init_hooks);
old.java.clone_from(&new_cluster.java);
async move { Ok(()) }
})
@ -144,7 +136,7 @@ pub async fn run_cluster(uuid: Uuid) -> Result<DetailedProcess, String> {
#[specta::specta]
#[tauri::command]
pub async fn get_cluster_logs(uuid: Uuid) -> Result<Vec<String>, String> {
let cluster = onelauncher::cluster::get_by_uuid(uuid)
let cluster = cluster::get_by_uuid(uuid)
.await?
.ok_or("cluster not found")?;
let logs = logger::get_logs(&cluster.cluster_path(), None)
@ -158,7 +150,7 @@ pub async fn get_cluster_logs(uuid: Uuid) -> Result<Vec<String>, String> {
#[specta::specta]
#[tauri::command]
pub async fn get_cluster_log(uuid: Uuid, log_name: String) -> Result<String, String> {
let cluster = onelauncher::cluster::get_by_uuid(uuid)
let cluster = cluster::get_by_uuid(uuid)
.await?
.ok_or("cluster not found")?;
let log = logger::get_output_by_file(&cluster.cluster_path(), logger::LogType::Info, &log_name)
@ -169,7 +161,7 @@ pub async fn get_cluster_log(uuid: Uuid, log_name: String) -> Result<String, Str
#[specta::specta]
#[tauri::command]
pub async fn upload_log(uuid: Uuid, log_name: String) -> Result<String, String> {
let cluster = onelauncher::cluster::get_by_uuid(uuid)
let cluster = cluster::get_by_uuid(uuid)
.await?
.ok_or("cluster not found")?;
let log = logger::get_output_by_file(&cluster.cluster_path(), logger::LogType::Info, &log_name)
@ -182,7 +174,7 @@ pub async fn upload_log(uuid: Uuid, log_name: String) -> Result<String, String>
#[specta::specta]
#[tauri::command]
pub async fn get_screenshots(uuid: Uuid) -> Result<Vec<String>, String> {
let cluster = onelauncher::cluster::get_by_uuid(uuid)
let cluster = cluster::get_by_uuid(uuid)
.await?
.ok_or("cluster not found")?;
@ -195,7 +187,7 @@ pub async fn get_screenshots(uuid: Uuid) -> Result<Vec<String>, String> {
#[specta::specta]
#[tauri::command]
pub async fn get_worlds(uuid: Uuid) -> Result<Vec<String>, String> {
let cluster = onelauncher::cluster::get_by_uuid(uuid)
let cluster = cluster::get_by_uuid(uuid)
.await?
.ok_or("cluster not found")?;

View file

@ -8,6 +8,7 @@ pub mod commands;
pub mod events;
pub mod statics;
#[must_use]
pub fn init<R: tauri::Runtime>() -> TauriPlugin<R> {
tauri::plugin::Builder::new("onelauncher")
.setup(|app, _| {

View file

@ -1,4 +1,4 @@
use onelauncher::constants::*;
use onelauncher::constants::{NATIVE_ARCH, TARGET_OS, VERSION};
use serde::Serialize;
use specta::Type;
@ -12,8 +12,9 @@ pub struct ProgramInfo {
arch: String,
}
#[must_use]
pub fn get_program_info() -> ProgramInfo {
let webview_version = tauri::webview_version().unwrap_or("UNKNOWN".into());
let webview_version = tauri::webview_version().unwrap_or_else(|_| "UNKNOWN".into());
let tauri_version = tauri::VERSION;
let dev_build = tauri::is_dev();

View file

@ -75,9 +75,8 @@ pub async fn install_update(
app: tauri::AppHandle,
state: tauri::State<'_, State>,
) -> Result<(), String> {
let lock = match state.install_lock.try_lock() {
Ok(lock) => lock,
Err(_) => return Err("Update already installing".into()),
let Ok(lock) = state.install_lock.try_lock() else {
return Err("Update already installing".into());
};
app.emit("updater", UpdateEvent::Installing).ok();
@ -94,6 +93,7 @@ pub async fn install_update(
Ok(())
}
#[must_use]
pub fn plugin<R: Runtime>() -> TauriPlugin<R> {
tauri::plugin::Builder::new("onelauncher-updater")
.on_page_load(|window, _| {

View file

@ -53,7 +53,7 @@ pub async fn run_app<F: FnOnce(&tauri::AppHandle<tauri::Wry>) + Send + 'static>(
.export(
specta_typescript::Typescript::default()
.bigint(specta_typescript::BigIntExportBehavior::BigInt)
.formatter(crate::ext::specta::formatter),
.formatter(ext::specta::formatter),
"../../packages/client/src/bindings.ts",
)
.expect("failed to export debug bindings!");
@ -90,14 +90,15 @@ pub async fn run_app<F: FnOnce(&tauri::AppHandle<tauri::Wry>) + Send + 'static>(
tracing::error!("{err}");
};
app.run(|_, _| {})
app.run(|_, _| {});
}
fn setup(handle: &tauri::AppHandle) -> Result<(), Box<dyn std::error::Error>> {
let win = handle.get_webview_window("main").unwrap();
tokio::task::spawn(async move {
let state = match onelauncher::State::get().await {
let state = onelauncher::State::get();
let state = match state.await {
Ok(state) => state,
Err(err) => {
tracing::error!("{err}");

View file

@ -1,6 +1,9 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
#[tokio::main]
async fn main() {
onelauncher_gui::run().await;

View file

@ -24,7 +24,7 @@
"@onelauncher/client": "workspace:*",
"@solid-primitives/i18n": "^2.1.1",
"@solid-primitives/refs": "^1.0.8",
"@solidjs/router": "^0.14.5",
"@solidjs/router": "^0.14.7",
"@t3-oss/env-core": "^0.11.0",
"@tanstack/solid-query": "^5.56.2",
"@tauri-apps/api": "=2.0.0-rc.5",
@ -36,20 +36,20 @@
"overlayscrollbars": "^2.10.0",
"overlayscrollbars-solid": "^0.5.5",
"pathe": "^1.1.2",
"solid-js": "^1.8.22",
"solid-js": "^1.9.1",
"solid-transition-group": "^0.2.3",
"zod": "^3.23.8"
},
"devDependencies": {
"@sentry/vite-plugin": "^2.22.4",
"@solidjs/testing-library": "^0.8.9",
"@solidjs/testing-library": "^0.8.10",
"@tauri-apps/cli": "=2.0.0-rc.16",
"@testing-library/jest-dom": "^6.5.0",
"jsdom": "^25.0.0",
"jsdom": "^25.0.1",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.79.1",
"sass": "^1.79.4",
"unocss": "^0.62.4",
"vite": "^5.4.6",
"vite": "^5.4.8",
"vite-plugin-solid": "^2.10.2",
"vite-plugin-solid-svg": "^0.8.1",
"vite-tsconfig-paths": "^5.0.1"

View file

@ -10,6 +10,9 @@ readme = { workspace = true }
homepage = { workspace = true }
authors = { workspace = true }
[lints]
workspace = true
[dependencies]
onelauncher = { workspace = true, features = [ "cli" ] }
tokio = { workspace = true }

View file

@ -28,7 +28,7 @@ async fn search(provider: Providers) -> Result<()> {
)
.await?;
println!("{:#?}", results);
println!("{results:#?}");
Ok(())
}

View file

@ -16,7 +16,7 @@ async fn main() -> onelauncher::Result<()> {
// launch_and_authenticate().await?;
authenticate_mc().await?;
Ok(())
return Ok(());
}
/// pauline's epic gamer minecraft auth flow
@ -66,7 +66,7 @@ pub async fn modrinth() -> onelauncher::Result<()> {
let _state = State::get().await?;
let provider = Providers::Modrinth;
let result = provider.get("oneconfig").await?;
println!("{:#?}", result);
println!("{result:#?}");
// let managed_version = provider
// .get_version_for_game_version(&result.id, "1.8.9")
@ -119,7 +119,7 @@ pub async fn launch_and_authenticate() -> onelauncher::Result<()> {
println!("clearing clusters");
{
let c = cluster::list().await?;
for cluster in c.into_iter() {
for cluster in c {
cluster::remove(&cluster.cluster_path()).await?;
}
}
@ -149,8 +149,8 @@ pub async fn launch_and_authenticate() -> onelauncher::Result<()> {
let uuid = c_lock.read().await.uuid;
let pid = c_lock.read().await.current_child.read().await.id();
println!("mc_uuid: {}", uuid);
println!("mc_pid: {:?}", pid);
println!("mc_uuid: {uuid}");
println!("mc_pid: {pid:?}");
println!("proc_uuid: {:?}", processor::get_running().await?);
println!(

View file

@ -4,7 +4,7 @@
"version": "1.0.0-alpha.1",
"private": true,
"engineStrict": true,
"packageManager": "pnpm@9.10.0",
"packageManager": "pnpm@9.11.0",
"description": "Next-generation open source Minecraft launcher and tools for interacting with Polyfrost",
"license": "GPL-3.0-only",
"homepage": "https://polyfrost.org",
@ -46,7 +46,6 @@
"format:es": "pnpm lint:es --fix",
"lint:rs": "cargo +nightly fmt --check && cargo clippy -- -D warnings",
"format:rs": "cargo +nightly fmt && cargo clippy --fix",
"release:node": "bumpp -r",
"prisma:gen": "pnpm prisma generate --schema packages/core/prisma/schema.prisma",
"prisma:migrate": "pnpm prisma migrate dev --schema packages/core/prisma/schema.prisma"
},
@ -57,20 +56,19 @@
]
},
"devDependencies": {
"@flowr/eslint-config": "^4.3.4",
"@types/node": "^22.5.5",
"@flowr/eslint-config": "^4.4.0",
"@types/node": "^22.7.4",
"@unocss/eslint-plugin": "^0.62.4",
"@vitest/ui": "^2.1.1",
"bumpp": "^9.5.2",
"eslint": "^9.10.0",
"eslint": "^9.11.1",
"eslint-plugin-solid": "^0.14.3",
"jiti": "^1.21.6",
"prisma": "^5.19.1",
"jiti": "^2.0.0",
"prisma": "^5.20.0",
"rimraf": "^6.0.1",
"ts-node": "^10.9.2",
"tsx": "^4.19.1",
"typescript": "^5.6.2",
"vite": "^5.4.6",
"vite": "^5.4.8",
"vitest": "^2.1.1"
}
}

View file

@ -0,0 +1,20 @@
{
"name": "@onelauncher/actions",
"version": "1.0.0-alpha.1",
"private": true,
"description": "Next-generation open source Minecraft launcher",
"license": "GPL-3.0-only",
"repository": {
"type": "git",
"url": "git@github.com:polyfrost/onelauncher",
"directory": "packages/actions"
},
"bugs": "https://github.com/polyfrost/onelauncher/issues",
"sideEffects": false,
"scripts": {
},
"dependencies": {
},
"devDependencies": {
}
}

View file

@ -35,7 +35,7 @@
"highlight.js": "^11.10.0",
"markdown-it": "^14.1.0",
"plausible-tracker": "^0.3.9",
"solid-js": "^1.8.22",
"solid-js": "^1.9.1",
"xss": "^1.0.15"
},
"devDependencies": {

View file

@ -18,6 +18,9 @@ tauri = [ "dep:tauri", "dep:tauri-specta", "specta" ]
specta = [ "dep:specta" ]
cli = [ "dep:indicatif" ]
[lints]
workspace = true
[dependencies]
# features[default]
onelauncher_macros = { workspace = true }

View file

@ -45,11 +45,11 @@ pub enum PackFileHash {
impl From<String> for PackFileHash {
fn from(s: String) -> Self {
return match s.as_str() {
match s.as_str() {
"sha1" => Self::Sha1,
"sha512" => Self::Sha512,
_ => Self::Unknown(s),
};
}
}
}

View file

@ -64,26 +64,36 @@ impl fmt::Display for ImportType {
}
}
pub async fn import_instances(import: ImportType, path: PathBuf) -> crate::Result<Vec<String>> {
let instances_path = match import {
ImportType::GDLauncher | ImportType::ATLauncher => "instances".to_string(),
ImportType::Curseforge => "Instances".to_string(),
ImportType::MultiMC => multibased::get_instances_subpath(path.clone().join("multimc.cfg"))
.await
.unwrap_or_else(|| "instances".to_string()),
ImportType::PrismLauncher => {
multibased::get_instances_subpath(path.clone().join("prismlauncher.cfg"))
.await
.unwrap_or_else(|| "instances".to_string())
}
ImportType::Modrinth => "profiles".to_string(),
ImportType::TLauncher => "tinstances".to_string(),
ImportType::FTBLauncher => "ftbinstances".to_string(),
ImportType::Technic => "tecinstances".to_string(),
_ => return Err(anyhow::anyhow!("launcher type unknown, cant import").into()),
};
impl ImportType {
pub async fn get_instances_subpath(&self, path: &Path) -> crate::Result<PathBuf> {
Ok(path.join(
&(match self {
Self::GDLauncher | Self::ATLauncher => "instances".to_string(),
Self::Curseforge => "Instances".to_string(),
Self::MultiMC => {
multibased::get_instances_subpath(path.to_path_buf().join("multimc.cfg"))
.await
.unwrap_or_else(|| "instances".to_string())
}
Self::PrismLauncher => {
multibased::get_instances_subpath(path.to_path_buf().join("prismlauncher.cfg"))
.await
.unwrap_or_else(|| "instances".to_string())
}
Self::Modrinth => "profiles".to_string(),
Self::TLauncher => "tinstances".to_string(),
Self::FTBLauncher => "ftbinstances".to_string(),
Self::Technic => "tecinstances".to_string(),
Self::Unknown => {
return Err(anyhow::anyhow!("launcher type unknown, cant import").into())
}
}),
))
}
}
let instances_dir = path.join(&instances_path);
pub async fn import_instances(import: ImportType, path: PathBuf) -> crate::Result<Vec<String>> {
let instances_dir = import.get_instances_subpath(&path).await?;
let mut instances = Vec::new();
let mut dir = io::read_dir(&instances_dir)
.await
@ -170,7 +180,6 @@ pub async fn import_instance(
#[must_use]
pub fn default_launcher_path(r#type: ImportType) -> Option<PathBuf> {
let path = match r#type {
ImportType::MultiMC => None, // MultiMC data is in it's application directory
ImportType::PrismLauncher => Some(dirs::data_dir()?.join("PrismLauncher")),
ImportType::ATLauncher => Some(dirs::data_dir()?.join("ATLauncher")),
ImportType::GDLauncher => Some(dirs::data_dir()?.join("gdlauncher_next")),
@ -179,7 +188,7 @@ pub fn default_launcher_path(r#type: ImportType) -> Option<PathBuf> {
ImportType::FTBLauncher => Some(dirs::data_dir()?.join("FTB")),
ImportType::Technic => Some(dirs::data_dir()?.join("Technic")),
ImportType::TLauncher => Some(dirs::data_dir()?.join("TLauncher")),
ImportType::Unknown => None,
ImportType::Unknown | ImportType::MultiMC => None, // MultiMC data is in it's application directory
};
let path = path?;

View file

@ -34,14 +34,14 @@ pub async fn get_process_detailed_by_id(uuid: Uuid) -> crate::Result<DetailedPro
let child = processor
.get(uuid)
.ok_or(anyhow::anyhow!("process not found"))?;
.ok_or_else(|| anyhow::anyhow!("process not found"))?;
let child = child.read().await;
let pid = child
.current_child
.read()
.await
.id()
.ok_or(anyhow::anyhow!("process not found"))?;
.ok_or_else(|| anyhow::anyhow!("process not found"))?;
Ok(DetailedProcess {
uuid,
user: child.user,
@ -63,14 +63,14 @@ pub async fn get_processes_detailed_by_path(
for uuid in uuids {
let child = processor
.get(uuid)
.ok_or(anyhow::anyhow!("process not found"))?;
.ok_or_else(|| anyhow::anyhow!("process not found"))?;
let child = child.read().await;
let pid = child
.current_child
.read()
.await
.id()
.ok_or(anyhow::anyhow!("process not found"))?;
.ok_or_else(|| anyhow::anyhow!("process not found"))?;
processes.push(DetailedProcess {
uuid,
user: child.user,
@ -221,12 +221,12 @@ pub async fn get_pid_by_uuid(uuid: Uuid) -> crate::Result<u32> {
let processor = state.processor.read().await;
Ok(processor
.get(uuid)
.ok_or(anyhow::anyhow!("process not found"))?
.ok_or_else(|| anyhow::anyhow!("process not found"))?
.read()
.await
.current_child
.read()
.await
.id()
.ok_or(anyhow::anyhow!("process not found"))?)
.ok_or_else(|| anyhow::anyhow!("process not found"))?)
}

View file

@ -37,6 +37,7 @@ pub struct Ingress {
pub struct IngressId(Uuid);
impl Drop for IngressId {
#[clippy::has_significant_drop]
fn drop(&mut self) {
let ingress_uuid = self.0;
tokio::spawn(async move {
@ -52,11 +53,10 @@ impl Drop for IngressId {
#[cfg(feature = "tauri")]
{
let _ingress_feed_uuid = ingress.ingress_uuid;
use tauri::Emitter;
let event = ingress.ingress_type.clone();
let fraction = ingress.current / ingress.total;
use tauri::Emitter;
let _ = proxy_state.app.emit(
"ingress",
IngressPayload {
@ -119,7 +119,10 @@ impl ProxyState {
Ok(value.app.get_webview_window("main").unwrap())
}
#[allow(clippy::unused_async)]
#[allow(
clippy::unused_async,
reason = "clippy doesn't take into account the features"
)]
#[cfg(feature = "tauri")]
pub async fn get() -> crate::Result<Arc<Self>> {
Ok(PROXY_STATE.get().ok_or(ProxyError::NotInitialized)?.clone())

View file

@ -85,8 +85,9 @@ pub async fn edit_ingress(
title: &str,
) -> crate::Result<()> {
let proxy_state = crate::ProxyState::get().await?;
let ingress_feeds = proxy_state.ingress_feeds.write();
if let Some(ingress) = proxy_state.ingress_feeds.write().await.get_mut(&id.0) {
if let Some(ingress) = ingress_feeds.await.get_mut(&id.0) {
ingress.ingress_type = ingress_type;
ingress.total = total;
ingress.message = title.to_string();
@ -112,11 +113,9 @@ pub async fn send_ingress(
) -> crate::Result<()> {
let proxy_state = crate::ProxyState::get().await?;
let mut ingress = proxy_state.ingress_feeds.write().await;
let ingress = match ingress.get_mut(&key.0) {
Some(f) => f,
None => {
return Err(ProxyError::NoIngressFound(key.0).into());
}
let Some(ingress) = ingress.get_mut(&key.0) else {
return Err(ProxyError::NoIngressFound(key.0).into());
};
ingress.current += increment;
@ -125,20 +124,16 @@ pub async fn send_ingress(
if f64::abs(display - ingress.last_sent) > 0.005 {
#[cfg(feature = "cli")]
#[allow(clippy::cast_possible_truncation)]
{
ingress.cli.set_message(
message
.map(ToString::to_string)
.unwrap_or(ingress.message.clone()),
);
ingress
.cli
.set_message(message.map_or_else(|| ingress.message.clone(), ToString::to_string));
ingress
.cli
.set_position((display * CLI_TOTAL_INGRESS as f64).round() as u64);
}
#[cfg(feature = "tauri")]
use tauri::Emitter;
#[cfg(feature = "tauri")]
proxy_state
.app

View file

@ -59,6 +59,7 @@ pub async fn set(settings: Settings) -> crate::Result<()> {
}
/// sets the config and caches directory, this can have side effects.
#[allow(clippy::too_many_lines)]
pub async fn set_directory(new: PathBuf) -> crate::Result<()> {
tracing::trace!("changing config directory to {}", new.display());
@ -88,7 +89,7 @@ pub async fn set_directory(new: PathBuf) -> crate::Result<()> {
let old = state_write.directories.config_dir.read().await.clone();
tracing::trace!("resetting file watcher after changing config directory");
let fs_watcher = crate::utils::watcher::initialize_watcher().await?;
let fs_watcher = crate::utils::watcher::initialize_watcher()?;
state_write.watcher = RwLock::new(fs_watcher);
tracing::trace!("collecting all config files to be transfered");
@ -167,7 +168,7 @@ pub async fn set_directory(new: PathBuf) -> crate::Result<()> {
}
tracing::trace!("re-resetting file watching system");
let mut file_watcher = crate::utils::watcher::initialize_watcher().await?;
let mut file_watcher = crate::utils::watcher::initialize_watcher()?;
state_write.clusters =
RwLock::new(Clusters::initialize(&state_write.directories, &mut file_watcher).await?);
state_write.watcher = RwLock::new(file_watcher);

View file

@ -77,7 +77,7 @@ pub fn minecraft_arguments(
asset_index: &str,
game_directory: &Path,
assets_directory: &Path,
version_type: &VersionType,
version_type: VersionType,
resolution: Resolution,
java_arch: &str,
) -> crate::Result<Vec<String>> {
@ -196,7 +196,7 @@ fn parse_minecraft_argument(
asset_index: &str,
game_directory: &Path,
assets_directory: &Path,
version_type: &VersionType,
version_type: VersionType,
resolution: Resolution,
) -> crate::Result<String> {
Ok(argument
@ -204,7 +204,7 @@ fn parse_minecraft_argument(
.replace("${auth_access_token}", access_token)
.replace("${auth_session}", access_token)
.replace("${auth_player_name}", username)
.replace("${auth_xuid}", "10")
.replace("${auth_xuid}", "0") // TODO: add auth xuid
.replace("${auth_uuid}", &uuid.simple().to_string())
.replace("${uuid}", &uuid.simple().to_string())
.replace("${clientid}", crate::constants::MICROSOFT_CLIENT_ID)
@ -248,7 +248,7 @@ fn parse_java_argument(
"${library_directory}",
&onelauncher_utils::io::canonicalize(libraries_path)?.to_string_lossy(),
)
.replace("${classpath_seperator}", classpath_separator(java_arch))
.replace("${classpath_separator}", classpath_separator(java_arch))
.replace("${launcher_name}", crate::constants::NAME)
.replace("${launcher_version}", crate::constants::VERSION)
.replace("${version_name}", version)

View file

@ -325,9 +325,7 @@ pub async fn download_client(
let client = version
.downloads
.get(&ip::api::minecraft::DownloadType::Client)
.ok_or(anyhow::anyhow!(
"no client downloads exist for {version_id}"
))?;
.ok_or_else(|| anyhow::anyhow!("no client downloads exist for {version_id}"))?;
let path = st
.directories

View file

@ -76,16 +76,15 @@ pub async fn install_minecraft(
let version_manifest = metadata.minecraft.clone();
let versions = version_manifest
.ok_or(anyhow::anyhow!("couldn't get minecraft manifest"))?
.ok_or_else(|| anyhow::anyhow!("couldn't get minecraft manifest"))?
.versions;
let version_idx = versions
.iter()
.position(|g| g.id == cluster.meta.mc_version)
.ok_or(anyhow::anyhow!(
"invalid minecraft game version {}",
cluster.meta.mc_version
))?;
.ok_or_else(|| {
anyhow::anyhow!("invalid minecraft game version {}", cluster.meta.mc_version)
})?;
let version = &versions[version_idx];
let updated = version_idx <= versions.iter().position(|g| g.id == "22w16a").unwrap_or(0); // LWJGL patching
@ -271,16 +270,13 @@ pub async fn launch_minecraft(
let version_manifest = metadata.minecraft.clone();
let versions = version_manifest
.ok_or(anyhow::anyhow!("couldn't get minecraft manifest"))?
.ok_or_else(|| anyhow::anyhow!("couldn't get minecraft manifest"))?
.versions;
let version_index = versions
.iter()
.position(|it| it.id == cluster.meta.mc_version)
.ok_or(anyhow::anyhow!(
"invalid game version {}",
cluster.meta.mc_version
))?;
.ok_or_else(|| anyhow::anyhow!("invalid game version {}", cluster.meta.mc_version))?;
let version = &versions[version_index];
let updated = version_index <= versions.iter().position(|x| x.id == "22w16a").unwrap_or(0);
@ -361,7 +357,7 @@ pub async fn launch_minecraft(
&version_info.asset_index.id,
instance_path,
&state.directories.assets_dir().await,
&version.type_,
version.type_,
*resolution,
&java_version.arch,
)?
@ -382,19 +378,20 @@ pub async fn launch_minecraft(
// overrides `options.txt` with our settings: i can't believe it's not yaml
if !mc_options.is_empty() {
let options_path = instance_path.join("options.txt");
let mut options_string = String::new();
if options_path.exists() {
options_string = io::read_to_string(&options_path).await?;
}
let mut options_string = if options_path.exists() {
io::read_to_string(&options_path).await?
} else {
String::new()
};
for (key, value) in mc_options {
let re = regex::Regex::new(&format!(r"(?m)^{}:.*$", regex::escape(key)))?;
if !re.is_match(&options_string) {
options_string.push_str(&format!("\n{key}:{value}"));
} else {
if re.is_match(&options_string) {
let replaced_string = re
.replace_all(&options_string, &format!("{key}:{value}"))
.to_string();
options_string = replaced_string;
} else {
options_string.push_str(&format!("\n{key}:{value}"));
}
}

View file

@ -2,43 +2,6 @@
//!
//! A library used as a core for our launcher and Rust APIs.
#![warn(
clippy::all,
clippy::pedantic,
clippy::correctness,
clippy::perf,
clippy::style,
clippy::suspicious,
clippy::complexity,
clippy::nursery,
clippy::unwrap_used,
unused_qualifications,
rust_2018_idioms,
trivial_casts,
trivial_numeric_casts,
unused_allocation,
clippy::unnecessary_cast,
clippy::cast_lossless,
clippy::cast_possible_truncation,
clippy::cast_possible_wrap,
clippy::cast_sign_loss,
clippy::dbg_macro,
unused_import_braces,
clippy::deprecated_cfg_attr,
clippy::separated_literal_suffix,
deprecated
)]
#![forbid(deprecated_in_future)]
#![deny(unused_must_use)]
#![allow(
clippy::missing_errors_doc,
clippy::future_not_send,
clippy::module_name_repetitions,
clippy::struct_field_names,
clippy::cast_precision_loss,
clippy::significant_drop_tightening //tmp
)]
#[macro_use]
pub mod utils;

View file

@ -57,7 +57,6 @@ impl std::str::FromStr for ClusterStage {
"installed" => Self::Installed,
"downloading" => Self::Downloading,
"pack_downloading" => Self::PackDownloading,
"not_installed" => Self::NotInstalled,
_ => Self::NotInstalled,
})
}
@ -80,7 +79,7 @@ impl ClusterPath {
pub async fn find_by_uuid(uuid: Uuid) -> crate::Result<Self> {
Ok(crate::cluster::get_by_uuid(uuid)
.await?
.ok_or(anyhow::anyhow!("Cluster does not exist"))?
.ok_or_else(|| anyhow::anyhow!("Cluster does not exist"))?
.cluster_path())
}
@ -99,24 +98,27 @@ impl ClusterPath {
/// Validate the UTF of a cluster path.
pub fn validate(&self) -> crate::Result<&Self> {
self.0.to_str().ok_or(anyhow::anyhow!(
"invalid file path string {}!",
self.0.clone().to_string_lossy()
))?;
self.0.to_str().ok_or_else(|| {
anyhow::anyhow!(
"invalid file path string {}!",
self.0.clone().to_string_lossy()
)
})?;
Ok(self)
}
/// Validate the cluster and clone the current [`ClusterPath`].
pub async fn cluster_path(&self) -> crate::Result<Self> {
if let Some(c) = crate::cluster::get(self).await? {
Ok(c.cluster_path())
} else {
Err(anyhow::anyhow!(
"failed to get path of unmanaged or corrupted cluster {}",
self.to_string()
)
.into())
}
(crate::cluster::get(self).await?).map_or_else(
|| {
Err(anyhow::anyhow!(
"failed to get path of unmanaged or corrupted cluster {}",
self.to_string()
)
.into())
},
|c| Ok(c.cluster_path()),
)
}
/// Create a [`ClusterPath`] from a full [`PathBuf`].
@ -376,7 +378,6 @@ impl Loader {
#[must_use]
pub fn from_string(val: &str) -> Self {
match val {
"vanilla" => Self::Vanilla,
"forge" => Self::Forge,
"fabric" => Self::Fabric,
"quilt" => Self::Quilt,

View file

@ -24,15 +24,15 @@ impl DiscordRPC {
let mut discord_ipc = DiscordIpcClient::new(DISCORD_RPC_CLIENT_ID)
.map_err(|e| anyhow::anyhow!("failed to create discord client {}", e))?;
let connected = if !is_offline {
let connected = if is_offline {
Arc::new(AtomicBool::new(false))
} else {
let result = discord_ipc.connect();
if result.is_ok() {
Arc::new(AtomicBool::new(true))
} else {
Arc::new(AtomicBool::new(false))
}
} else {
Arc::new(AtomicBool::new(false))
};
let client = Arc::new(RwLock::new(discord_ipc));
@ -92,11 +92,9 @@ impl DiscordRPC {
/// Attempt to check if we are still in an offline environment.
pub async fn retry_online(&self) -> bool {
let state = match State::get().await {
Ok(s) => s,
Err(_) => return false,
let Ok(state) = State::get().await else {
return false;
};
let offline = state.offline.read().await;
if *offline {
return false;

View file

@ -193,11 +193,10 @@ impl Metadata {
.await?;
}
if let Some(meta) = metadata {
Ok(meta)
} else {
Err(anyhow::anyhow!("failed to fetch launcher metadata").into())
}
metadata.map_or_else(
|| Err(anyhow::anyhow!("failed to fetch launcher metadata").into()),
Ok,
)
}
/// Update and backup all available metadata.

View file

@ -38,15 +38,16 @@ impl MinecraftState {
.await
.ok();
if let Some(store) = store {
Ok(store)
} else {
Ok(Self {
users: HashMap::new(),
token: None,
default_user: None,
})
}
store.map_or_else(
|| {
Ok(Self {
users: HashMap::new(),
token: None,
default_user: None,
})
},
Ok,
)
}
/// Save the current Minecraft credentials.
@ -141,7 +142,9 @@ impl MinecraftState {
redirect_uri: redirect_uri.value.msa_oauth_redirect,
}),
Err(err) => {
if !valid_date {
if valid_date {
Err(err.into())
} else {
let (key, token, current_date, _) = self.refresh(Utc::now(), false).await?;
let verify = generate_oauth_challenge();
let mut hash = sha2::Sha256::new();
@ -157,8 +160,6 @@ impl MinecraftState {
session_id,
redirect_uri: redirect_uri.value.msa_oauth_redirect,
})
} else {
Err(err.into())
}
}
}
@ -877,12 +878,12 @@ async fn send_signed_request<T: serde::de::DeserializeOwned>(
step: MinecraftAuthStep,
current_date: DateTime<Utc>,
) -> Result<SignedRequestResponse<T>, MinecraftAuthError> {
use byteorder::WriteBytesExt;
let auth = authorization.map_or(Vec::new(), |v| v.as_bytes().to_vec());
let body = serde_json::to_vec(&raw_body)
.map_err(|source| MinecraftAuthError::SerializeError { step, source })?;
let time: u128 = { ((current_date.timestamp() as u128) + 11_644_473_600) * 10_000_000 };
use byteorder::WriteBytesExt;
let mut buffer = Vec::new();
buffer
.write_u32::<byteorder::BigEndian>(1)
@ -975,7 +976,7 @@ fn get_date_header(headers: &reqwest::header::HeaderMap) -> DateTime<Utc> {
.get(reqwest::header::DATE)
.and_then(|x| x.to_str().ok())
.and_then(|x| DateTime::parse_from_rfc2822(x).ok())
.map_or(Utc::now(), |x| x.with_timezone(&Utc))
.map_or_else(Utc::now, |x| x.with_timezone(&Utc))
}
#[tracing::instrument]

View file

@ -121,7 +121,7 @@ impl State {
let settings = Settings::initialize(&Directories::init_settings_file()?).await?;
let directories = Directories::initalize(&settings)?;
send_ingress(&ingress, 10.0, None).await?;
let mut watcher = crate::utils::watcher::initialize_watcher().await?;
let mut watcher = crate::utils::watcher::initialize_watcher()?;
let fetch_semaphore =
FetchSemaphore(RwLock::new(Semaphore::new(settings.max_async_fetches)));
let io_semaphore = IoSemaphore(RwLock::new(Semaphore::new(
@ -195,7 +195,8 @@ impl State {
/// Updates all data if we are connected to the internet.
pub fn update() {
tokio::task::spawn(async {
if let Ok(state) = Self::get().await {
let state = Self::get();
if let Ok(state) = state.await {
if !*state.offline.read().await {
let version_up = Clusters::update_versions();
let meta_up = Metadata::update();

View file

@ -34,7 +34,7 @@ pub enum PackageType {
impl PackageType {
/// attempt to get a [`PackageType`] from a loader string.
#[must_use]
pub fn from_loader(loaders: Vec<String>) -> Option<Self> {
pub fn from_loader(loaders: &[String]) -> Option<Self> {
if loaders
.iter()
.any(|x| ["fabric", "forge", "quilt"].contains(&&**x))
@ -55,7 +55,7 @@ impl PackageType {
}
#[must_use]
pub fn from_parent(path: PathBuf) -> Option<Self> {
pub fn from_parent(path: &Path) -> Option<Self> {
let path = path.parent()?.file_name()?;
match path.to_str()? {
"mods" => Some(Self::Mod),
@ -253,6 +253,7 @@ impl PackagesMeta {
#[derive(Debug)]
pub struct PackageManager {
pub cluster_path: ClusterPath,
modpacks: PackagesMeta,
mods: PackagesMeta,
datapacks: PackagesMeta,
resourcepacks: PackagesMeta,
@ -271,6 +272,7 @@ impl PackageManager {
pub fn new(cluster_path: ClusterPath) -> Self {
Self {
cluster_path,
modpacks: PackagesMeta::new(PackageType::ModPack),
mods: PackagesMeta::new(PackageType::Mod),
datapacks: PackagesMeta::new(PackageType::DataPack),
resourcepacks: PackagesMeta::new(PackageType::ResourcePack),
@ -292,13 +294,13 @@ impl PackageManager {
/// Get the `PackagesMeta` for a specific package type. Does not sync.
#[must_use]
pub fn get(&self, package_type: PackageType) -> &PackagesMeta {
pub const fn get(&self, package_type: PackageType) -> &PackagesMeta {
match package_type {
PackageType::Mod => &self.mods,
PackageType::DataPack => &self.datapacks,
PackageType::ResourcePack => &self.resourcepacks,
PackageType::ShaderPack => &self.shaderpacks,
_ => unreachable!(),
PackageType::ModPack => &self.modpacks,
}
}
@ -306,10 +308,10 @@ impl PackageManager {
fn get_mut(&mut self, package_type: PackageType) -> &mut PackagesMeta {
match package_type {
PackageType::Mod => &mut self.mods,
PackageType::ModPack => &mut self.modpacks,
PackageType::DataPack => &mut self.datapacks,
PackageType::ResourcePack => &mut self.resourcepacks,
PackageType::ShaderPack => &mut self.shaderpacks,
_ => unreachable!(),
}
}
@ -349,7 +351,7 @@ impl PackageManager {
let package_type = package
.meta
.get_package_type()
.unwrap_or(package_type.ok_or(anyhow::anyhow!("no package type"))?);
.unwrap_or(package_type.ok_or_else(|| anyhow::anyhow!("no package type"))?);
let packages = &mut self.get_mut(package_type).packages;
packages.insert(package_path, package);

View file

@ -237,16 +237,16 @@ impl ChildType {
return Ok(Some(0));
}
let process = system.process(sysinfo::Pid::from_u32(*pid));
if let Some(process) = process {
if process.status() == sysinfo::ProcessStatus::Run {
Ok(None)
} else {
Ok(Some(0))
}
} else {
Ok(Some(0))
}
system.process(sysinfo::Pid::from_u32(*pid)).map_or_else(
|| Ok(Some(0)),
|process| {
if process.status() == sysinfo::ProcessStatus::Run {
Ok(None)
} else {
Ok(Some(0))
}
},
)
}
}
}
@ -575,9 +575,9 @@ impl Processor {
started_at: Utc
.timestamp_opt(cache.start_time as i64, 0)
.single()
.ok_or(anyhow::anyhow!(
"couldn't convert processor cache timestamp to Utc"
))?, // TODO: Look into this
.ok_or_else(|| {
anyhow::anyhow!("couldn't convert processor cache timestamp to Utc")
})?, // TODO: Look into this
current_child,
manager,
last_updated,
@ -605,7 +605,8 @@ impl Processor {
// core main process loop, managed by tokio
loop {
if let Some(stat) = current_child.write().await.try_wait()? {
let value = current_child.write().await.try_wait();
if let Some(stat) = value? {
exit_status = stat;
break;
}
@ -655,7 +656,8 @@ impl Processor {
});
tokio::spawn(async {
let state = match State::get().await {
let state = State::get();
let state = match state.await {
Ok(state) => state,
Err(err) => {
tracing::warn!("failed to get state: {}", err);
@ -721,7 +723,8 @@ impl Processor {
.await?;
loop {
if let Some(stat) = current_child.write().await.try_wait()? {
let value = current_child.write().await.try_wait();
if let Some(stat) = value? {
exit_status = stat;
break;
}

View file

@ -13,7 +13,7 @@ use notify_debouncer_mini::{new_debouncer, DebounceEventResult, Debouncer};
/// Creates and initializes an FS watcher for the `clusters` directory, returning
/// the watcher as a [`Debouncer<RecommendedWatcher>`].
pub async fn initialize_watcher() -> crate::Result<Debouncer<RecommendedWatcher>> {
pub fn initialize_watcher() -> crate::Result<Debouncer<RecommendedWatcher>> {
let (mut sender, mut rscv) = channel(1);
let watcher = new_debouncer(
Duration::from_secs_f32(2.0),

View file

@ -10,6 +10,9 @@ readme = { workspace = true }
homepage = { workspace = true }
authors = { workspace = true }
[lints]
workspace = true
[target.'cfg(target_os = "linux")'.dependencies]
libc = { workspace = true }

View file

@ -0,0 +1,14 @@
{
"name": "@onelauncher/gamemode",
"version": "1.0.0-alpha.1",
"description": "Next-generation open source Minecraft launcher feral gamemode bindings",
"license": "GPL-3.0-only",
"repository": {
"type": "git",
"url": "git@github.com:polyfrost/onelauncher",
"directory": "packages/gamemode"
},
"bugs": "https://github.com/polyfrost/onelauncher/issues",
"sideEffects": false,
"scripts": {}
}

View file

@ -1,37 +1,4 @@
#![cfg(target_os = "linux")]
#![warn(
clippy::all,
clippy::pedantic,
clippy::correctness,
clippy::perf,
clippy::style,
clippy::suspicious,
clippy::complexity,
clippy::nursery,
clippy::unwrap_used,
unused_qualifications,
rust_2018_idioms,
trivial_casts,
trivial_numeric_casts,
unused_allocation,
clippy::unnecessary_cast,
clippy::cast_lossless,
clippy::cast_possible_truncation,
clippy::cast_possible_wrap,
clippy::cast_sign_loss,
clippy::dbg_macro,
unused_import_braces,
clippy::deprecated_cfg_attr,
clippy::separated_literal_suffix,
deprecated
)]
#![forbid(deprecated_in_future)]
#![deny(unused_must_use)]
#![allow(
clippy::missing_errors_doc,
clippy::future_not_send,
clippy::module_name_repetitions
)]
use libc::pid_t;
use std::ffi::c_int;

View file

@ -10,6 +10,9 @@ readme = { workspace = true }
homepage = { workspace = true }
authors = { workspace = true }
[lints]
workspace = true
[lib]
proc-macro = true

View file

@ -1,37 +1,3 @@
#![warn(
clippy::all,
clippy::pedantic,
clippy::correctness,
clippy::perf,
clippy::style,
clippy::suspicious,
clippy::complexity,
clippy::nursery,
clippy::unwrap_used,
unused_qualifications,
rust_2018_idioms,
trivial_casts,
trivial_numeric_casts,
unused_allocation,
clippy::unnecessary_cast,
clippy::cast_lossless,
clippy::cast_possible_truncation,
clippy::cast_possible_wrap,
clippy::cast_sign_loss,
clippy::dbg_macro,
unused_import_braces,
clippy::deprecated_cfg_attr,
clippy::separated_literal_suffix,
deprecated
)]
#![forbid(deprecated_in_future)]
#![deny(unused_must_use)]
#![allow(
clippy::missing_errors_doc,
clippy::future_not_send,
clippy::module_name_repetitions
)]
use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, ItemFn};

View file

@ -0,0 +1,14 @@
{
"name": "@onelauncher/prisma-cli",
"version": "1.0.0-alpha.1",
"description": "Next-generation open source Minecraft launcher primsa cli bindings",
"license": "GPL-3.0-only",
"repository": {
"type": "git",
"url": "git@github.com:polyfrost/onelauncher",
"directory": "packages/prisma-cli"
},
"bugs": "https://github.com/polyfrost/onelauncher/issues",
"sideEffects": false,
"scripts": {}
}

View file

@ -0,0 +1,14 @@
{
"name": "@onelauncher/prisma",
"version": "1.0.0-alpha.1",
"description": "Next-generation open source Minecraft launcher prisma bindings",
"license": "GPL-3.0-only",
"repository": {
"type": "git",
"url": "git@github.com:polyfrost/onelauncher",
"directory": "packages/prisma"
},
"bugs": "https://github.com/polyfrost/onelauncher/issues",
"sideEffects": false,
"scripts": {}
}

View file

@ -10,6 +10,9 @@ readme = { workspace = true }
homepage = { workspace = true }
authors = { workspace = true }
[lints]
workspace = true
[dependencies]
onelauncher_prisma = { workspace = true }
serde = { workspace = true }

View file

@ -0,0 +1,14 @@
{
"name": "@onelauncher/utils",
"version": "1.0.0-alpha.1",
"description": "Next-generation open source Minecraft launcher utils",
"license": "GPL-3.0-only",
"repository": {
"type": "git",
"url": "git@github.com:polyfrost/onelauncher",
"directory": "packages/utils"
},
"bugs": "https://github.com/polyfrost/onelauncher/issues",
"sideEffects": false,
"scripts": {}
}

View file

@ -5,40 +5,6 @@
//! - [`platform`]: Async utilities for managing OS-specific [`interpulse`] operations and rules.
//! - [`io`]: Async wrapper around [`tokio::fs`] and [`std::io::Error`] for our error system.
#![warn(
clippy::all,
clippy::pedantic,
clippy::correctness,
clippy::perf,
clippy::style,
clippy::suspicious,
clippy::complexity,
clippy::nursery,
clippy::unwrap_used,
unused_qualifications,
rust_2018_idioms,
trivial_casts,
trivial_numeric_casts,
unused_allocation,
clippy::unnecessary_cast,
clippy::cast_lossless,
clippy::cast_possible_truncation,
clippy::cast_possible_wrap,
clippy::cast_sign_loss,
clippy::dbg_macro,
unused_import_braces,
clippy::deprecated_cfg_attr,
clippy::separated_literal_suffix,
deprecated
)]
#![forbid(deprecated_in_future)]
#![deny(unused_must_use)]
#![allow(
clippy::missing_errors_doc,
clippy::future_not_send,
clippy::module_name_repetitions
)]
pub mod io;
pub mod logging;
pub mod platform;

View file

@ -185,6 +185,7 @@ fn message(input: &str) -> IResult<&str, &str> {
)(input)
}
#[allow(clippy::cast_sign_loss)]
fn plain_text(input: &str) -> IResult<&str, (Attributes<'_>, &str, &str)> {
map(take_until("<"), |text| {
(

1521
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

4
vitest.workspace.json Normal file
View file

@ -0,0 +1,4 @@
[
"packages/client/vitest.config.ts",
"apps/frontend/vitest.config.ts"
]

View file

@ -1,6 +0,0 @@
import { defineWorkspace } from 'vitest/config';
export default defineWorkspace([
'packages/client/vitest.config.ts',
'apps/frontend/vitest.config.ts',
]);