Skip to content

Commit

Permalink
deps(proto): Update to proto v0.24. (#1220)
Browse files Browse the repository at this point in the history
* First pass.

* Update tests.

* Fix tests.

* Update changelog.

* Pin bun.
  • Loading branch information
milesj authored Dec 7, 2023
1 parent 1c7ce97 commit 67e6ebd
Show file tree
Hide file tree
Showing 16 changed files with 179 additions and 182 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
# Required for "global bins" tests
- uses: moonrepo/setup-toolchain@v0
if: ${{ runner.os == 'Linux' }}
- run: proto install bun 1.0.0
- run: proto install bun 1.0.0 --pin
if: ${{ runner.os == 'Linux' }}
- uses: mozilla-actions/[email protected]
- name: Run tests
Expand Down
56 changes: 31 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ cached = "0.46.1"
chrono = { version = "0.4.31", features = ["serde"] }
cd_env = "0.1.2"
ci_env = "0.2.1"
clap = { version = "4.4.8", features = ["derive", "env", "wrap_help"] }
clap = { version = "4.4.11", features = ["derive", "env", "wrap_help"] }
clap_complete = "4.4.4"
console = "0.15.7"
miette = "5.10.0"
once_cell = "1.18.0"
once_map = "0.4.11"
once_cell = "1.19.0"
once_map = "0.4.13"
pathdiff = "0.2.1"
petgraph = { version = "0.6.4", default-features = false, features = [
"serde-1",
] }
proto_core = "0.23.7"
proto_core = "0.24.2"
relative-path = { version = "1.9.0", features = ["serde"] }
regex = "1.10.2"
reqwest = { version = "0.11.22", default-features = false, features = [
Expand All @@ -54,11 +54,9 @@ schematic = { version = "0.12.10", default-features = false, features = [
"url",
"yaml",
"type_semver",
"type_version_spec",
"type_warpgate",
] }
semver = "1.0.20"
serde = { version = "1.0.192", features = ["derive", "rc"] }
serde = { version = "1.0.193", features = ["derive", "rc"] }
serde_json = "1.0.108"
serde_yaml = "0.9.27"
starbase = "0.2.10"
Expand All @@ -75,7 +73,7 @@ starbase_utils = { version = "0.3.11", default-features = false, features = [
"toml",
"yaml",
] }
system_env = "0.1.6"
system_env = "0.1.8"
tera = { version = "1.19.1", features = ["preserve_order"] }
thiserror = "1.0.50"
tokio = { version = "1.34.0", default-features = false, features = [
Expand All @@ -89,5 +87,5 @@ tokio = { version = "1.34.0", default-features = false, features = [
] }
tokio-util = "0.7.10"
tracing = "0.1.40"
url = "2.4.1"
uuid = { version = "1.6.0", features = ["v4"] }
url = "2.5.0"
uuid = { version = "1.6.1", features = ["v4"] }
7 changes: 2 additions & 5 deletions crates/core/tool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ pub use manager::*;
pub use tool::*;

use proto_core::{
inject_default_manifest_config, Id, PluginLocator, ProtoEnvironment, Tool as ProtoTool,
UserConfig, Wasm,
inject_default_manifest_config, Id, PluginLocator, ProtoEnvironment, Tool as ProtoTool, Wasm,
};
use std::env;
use std::path::Path;
Expand Down Expand Up @@ -49,9 +48,7 @@ pub async fn load_tool_plugin(
Wasm::file(proto.get_plugin_loader().load_plugin(id, locator).await?),
)?;

let user_config = UserConfig::load()?;

inject_default_manifest_config(id, proto, &user_config, &mut manifest)?;
inject_default_manifest_config(id, proto, &mut manifest)?;

ProtoTool::load_from_manifest(id, proto, manifest)
}
4 changes: 2 additions & 2 deletions nextgen/app-components/src/resources.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use moon_config::{InheritedTasksManager, ToolchainConfig, WorkspaceConfig};
use proto_core::ToolsConfig;
use proto_core::ProtoConfig;
use semver::Version;
use starbase::Resource;
use std::path::PathBuf;
Expand Down Expand Up @@ -29,7 +29,7 @@ pub struct Tasks {
#[derive(Debug, Resource)]
pub struct Toolchain {
pub config: ToolchainConfig,
pub proto: ToolsConfig,
pub proto_config: ProtoConfig,
pub proto_home: PathBuf,
}

Expand Down
14 changes: 7 additions & 7 deletions nextgen/app/src/systems/startup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::app_error::AppError;
use moon_app_components::{AppInfo, Tasks, Toolchain, WorkingDir, Workspace, WorkspaceRoot};
use moon_common::consts;
use moon_config::{InheritedTasksManager, ToolchainConfig, WorkspaceConfig};
use proto_core::{get_proto_home, ToolsConfig, TOOLS_CONFIG_NAME};
use proto_core::{get_proto_home, ProtoConfig, PROTO_CONFIG_NAME};
use semver::Version;
use starbase::system;
use starbase_styles::color;
Expand Down Expand Up @@ -121,7 +121,7 @@ pub fn load_toolchain_config(workspace_root: StateRef<WorkspaceRoot>, resources:
consts::CONFIG_TOOLCHAIN_FILENAME
);
let config_path = workspace_root.join(&config_name);
let proto_path = workspace_root.join(TOOLS_CONFIG_NAME);
let proto_path = workspace_root.join(PROTO_CONFIG_NAME);

debug!(
file = ?config_path,
Expand All @@ -132,24 +132,24 @@ pub fn load_toolchain_config(workspace_root: StateRef<WorkspaceRoot>, resources:
if proto_path.exists() {
debug!(
"Found a {} file in the root, loading into the toolchain",
color::file(TOOLS_CONFIG_NAME)
color::file(PROTO_CONFIG_NAME)
);
}

let mut proto_tools = ToolsConfig::load_from(workspace_root)?;
proto_tools.inherit_builtin_plugins();
// TODO
let proto_config = ProtoConfig::default();

let config = if config_path.exists() {
debug!("Config file does not exist, using defaults");

ToolchainConfig::default()
} else {
ToolchainConfig::load(workspace_root, &config_path, &proto_tools)?
ToolchainConfig::load(workspace_root, &config_path, &proto_config)?
};

resources.set(Toolchain {
config,
proto: proto_tools,
proto_config,
proto_home: get_proto_home()?,
});
}
Expand Down
2 changes: 1 addition & 1 deletion nextgen/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub use language_platform::*;
pub use portable_path::*;
pub use project::*;
pub use project_config::*;
pub use proto_core::{ToolsConfig, UnresolvedVersionSpec, Version, VersionReq, VersionSpec};
pub use proto_core::{ProtoConfig, UnresolvedVersionSpec, Version, VersionReq, VersionSpec};
pub use schematic::{Config, ConfigEnum, ConfigError, PartialConfig};
pub use shapes::*;
pub use template::*;
Expand Down
Loading

0 comments on commit 67e6ebd

Please sign in to comment.