Skip to content
This repository was archived by the owner on Mar 14, 2026. It is now read-only.

Commit 6eaaca8

Browse files
committed
fix(crate): tests and issues
1 parent e1c55f9 commit 6eaaca8

8 files changed

Lines changed: 46 additions & 47 deletions

File tree

Cargo.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "core"
2+
name = "corelib"
33
version.workspace = true
44
edition.workspace = true
55
publish = false

crates/minecraft-essentails/Cargo.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,21 @@ pkg-fmt = "zip"
3030

3131

3232
[dependencies]
33-
core = { path = "../core", default-features = false}
33+
corelib = { path = "../core", default-features = false}
3434
clap = { version = "4.5.27", features = ["derive"], optional = true }
3535
tokio = { version = "1.43.0", features = ["macros"] }
3636
serde = "1.0.217"
3737

3838
[dev-dependencies]
3939
dotenv = "0.15.0"
40+
tokio = { version = "1.43.0", features = ["macros", "tokio-macros"] }
4041

4142
[features]
4243
default = ["auth", "cli", "launch", "modrinth", "curseforge"]
43-
auth = ["core/auth"]
44-
launch = ["core/launch"]
45-
refresh = ["core/refresh"]
44+
auth = ["corelib/auth"]
45+
launch = ["corelib/launch"]
46+
refresh = ["corelib/refresh"]
4647
# Mod Platforms
47-
modrinth = ["core/modrinth"]
48-
curseforge = ["core/curseforge"]
48+
modrinth = ["corelib/modrinth"]
49+
curseforge = ["corelib/curseforge"]
4950
cli = ["dep:clap", "auth"]

crates/minecraft-essentails/src/cwd.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::path::PathBuf;
22

33
use clap::{Args, Parser, Subcommand};
4-
use minecraft_essentials::{AuthType, AuthenticationBuilder, LaunchBuilder};
54

65
#[derive(Parser)]
76
#[command(version, long_about = None)]

crates/minecraft-essentails/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,36 @@
77
///
88
/// This module contains all the error types and related functionality
99
/// for error handling within the library.
10-
pub use core::errors;
11-
pub(crate) use core::trait_alias;
10+
pub use corelib::errors;
11+
pub(crate) use corelib::trait_alias;
1212

1313
/// Structs module for the Minecraft-Essentials library.
1414
///
1515
/// This module contains all the structs and related functionality
1616
/// for structs within the library.
17-
pub use core::structs;
17+
pub use corelib::structs;
1818
#[cfg(test)]
1919
mod tests;
2020

2121
#[cfg(feature = "launch")]
2222
/// Launch module for the Minecraft-Essentials library.
23-
use core::launch;
23+
use corelib::launch;
2424

2525
#[cfg(feature = "auth")]
26-
use core::auth;
26+
use corelib::auth;
2727

2828
#[cfg(feature = "modrinth")]
29-
use core::modrinth;
29+
use corelib::modrinth;
3030

3131
use std::path::PathBuf;
3232

33-
use core::{
33+
use corelib::{
3434
HTTP::{self, Client},
3535
auth::microsoft::CodeResponse,
3636
};
3737

3838
#[cfg(feature = "auth")]
39-
pub use core::auth::AuthInfo as CustomAuthData;
39+
pub use corelib::auth::AuthInfo as CustomAuthData;
4040

4141
#[cfg(feature = "auth")]
4242
use auth::{

crates/minecraft-essentails/src/tests.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use super::*;
22
use dotenv::dotenv;
33
use std::env;
4-
use todio::pin;
54

65
#[cfg(feature = "auth")]
76
#[tokio::test]
@@ -16,8 +15,6 @@ async fn test_oauth_url() {
1615
let oauth = Oauth::new(&client_id, Some(port));
1716
let url = oauth.url().await;
1817

19-
pin!(url);
20-
2118
assert_eq!(url, expected_url);
2219
}
2320

@@ -47,8 +44,8 @@ async fn test_authentication_info() {
4744
let mut builder = AuthenticationBuilder::builder();
4845
builder
4946
.of_type(AuthType::Oauth)
50-
.client_id(&client_id)
51-
.client_secret(&client_secret)
47+
.client_id(Some(&client_id))
48+
.client_secret(Some(&client_secret))
5249
.port(port);
5350

5451
let assert_url = format!(
@@ -59,7 +56,9 @@ async fn test_authentication_info() {
5956

6057
assert_eq!(assert_url, url);
6158

62-
builder.of_type(AuthType::DeviceCode).client_id(&client_id);
59+
builder
60+
.of_type(AuthType::DeviceCode)
61+
.client_id(Some(&client_id));
6362

6463
let device_code = builder.get_info().await.device_code.unwrap();
6564
let url = device_code.verification_uri.clone();

crates/node/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ crate-type = ["cdylib"]
1010
[dependencies]
1111
napi = { version = "2.16.13", default-features = false, features = ["napi4", "tokio", "async"] }
1212
napi-derive = "2.16.13"
13-
core = { path = "../core" }
13+
corelib = { path = "../core" }
1414

1515
[build-dependencies]
1616
napi-build = "2.1.4"

crates/node/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
use napi::{Error, Result, bindgen_prelude::*};
44
use napi_derive::napi;
55

6-
use core::EXPERIMENTAL_MESSAGE;
7-
use core::HTTP::Client;
8-
use core::auth::AuthInfo as CoreAuthInfo;
9-
use core::launch::JavaJRE;
6+
use corelib::EXPERIMENTAL_MESSAGE;
7+
use corelib::HTTP::Client;
8+
use corelib::auth::AuthInfo as CoreAuthInfo;
9+
use corelib::launch::JavaJRE;
1010

11-
use core::auth::{
11+
use corelib::auth::{
1212
bearer_token,
1313
microsoft::{SCOPE, authenticate_device, device_authentication_code, ouath, ouath_token},
1414
xbox::{XblOutput, XtsOutput, xbl, xsts},

0 commit comments

Comments
 (0)