Skip to content

Commit 96d370c

Browse files
refactor: dissolve hm-plugin-cloud into hm/src/commands/cloud (#180)
1 parent 991a535 commit 96d370c

25 files changed

Lines changed: 35 additions & 99 deletions

File tree

‎Cargo.lock‎

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

‎Cargo.toml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ members = [
66
"crates/hm-core",
77
"crates/hm-plugin-protocol",
88
"crates/hm-pipeline-ir",
9-
"crates/hm-plugin-cloud",
109
"crates/hm-dsl-engine",
1110
"crates/hm-render",
1211
"crates/hm-vm",
@@ -17,7 +16,6 @@ default-members = [
1716
"crates/hm-core",
1817
"crates/hm-plugin-protocol",
1918
"crates/hm-pipeline-ir",
20-
"crates/hm-plugin-cloud",
2119
"crates/hm-dsl-engine",
2220
"crates/hm-render",
2321
"crates/hm-vm",
@@ -31,7 +29,6 @@ repository = "https://github.com/harmont-dev/harmont-cli"
3129
[workspace.dependencies]
3230
hm-core = { path = "crates/hm-core", version = "0.0.0-dev" }
3331
hm-plugin-protocol = { path = "crates/hm-plugin-protocol", version = "0.0.0-dev" }
34-
hm-plugin-cloud = { path = "crates/hm-plugin-cloud", version = "0.0.0-dev" }
3532
hm-pipeline-ir = { path = "crates/hm-pipeline-ir", version = "0.0.0-dev" }
3633
hm-dsl-engine = { path = "crates/hm-dsl-engine", version = "0.0.0-dev" }
3734
hm-render = { path = "crates/hm-render", version = "0.0.0-dev" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Cloud execution backend (submit + watch over the SDK).
2-
pub mod watch; // pub: hm-plugin-cloud's `build watch`/`job log` verbs reuse it
2+
pub mod watch; // pub: the CLI's `cloud build watch`/`cloud job log` verbs reuse it
33

44
mod backend;
55
pub use backend::CloudBackend;

‎crates/hm-plugin-cloud/Cargo.toml‎

Lines changed: 0 additions & 36 deletions
This file was deleted.

‎crates/hm-render/src/lib.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Build-event renderers shared by the `hm` CLI and `hm-plugin-cloud`.
1+
//! Build-event renderers shared across the `hm` CLI's local and cloud paths.
22
//!
33
//! This crate owns the output layer: the [`OutputRenderer`] trait, the
44
//! [`OutputMode`] selection enum, and the concrete renderers
@@ -15,7 +15,7 @@ use hm_plugin_protocol::BuildEvent;
1515
/// the `NO_COLOR` env convention, and whether stderr is a TTY.
1616
///
1717
/// Single source of truth for the color rule, shared by the `hm` run
18-
/// context and `hm-plugin-cloud`'s render preferences.
18+
/// context and the cloud commands' render preferences.
1919
#[must_use]
2020
pub fn color_enabled(no_color_flag: bool) -> bool {
2121
!no_color_flag && std::env::var_os("NO_COLOR").is_none() && std::io::stderr().is_terminal()

‎crates/hm/Cargo.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ hm-pipeline-ir = { workspace = true }
6262
hm-plugin-protocol = { workspace = true }
6363
hm-common = { workspace = true }
6464
hm-core = { workspace = true }
65-
hm-plugin-cloud = { workspace = true }
66-
harmont-cloud = { workspace = true }
65+
harmont-cloud = { workspace = true }
66+
harmont-cloud-raw = { workspace = true }
6767
hm-vm = { workspace = true, features = ["docker-backend"] }
6868
hm-dsl-engine = { workspace = true }
6969
hm-render = { workspace = true }

‎crates/hm/README.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ hm run --help # full flag reference
133133
## Cloud
134134

135135
`hm cloud <verb>` talks to the hosted Harmont API at `api.harmont.dev`.
136-
Every cloud verb is delivered by the embedded `hm-plugin-cloud` crate
137-
(no separate install step):
136+
Every cloud verb is built into the `hm` binary (no separate install step):
138137

139138
```sh
140139
hm cloud login # browser-loopback OAuth (or --paste to

‎crates/hm/src/cli/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub enum Command {
7070

7171
/// Interact with the Harmont cloud API.
7272
#[command(subcommand)]
73-
Cloud(hm_plugin_cloud::cli::CloudCommand),
73+
Cloud(crate::commands::cloud::cli::CloudCommand),
7474
}
7575

7676
#[derive(Debug, Clone, Subcommand)]
@@ -116,7 +116,7 @@ pub async fn dispatch(command: Command, ctx: RunContext<'_>) -> Result<i32> {
116116
Command::Plugin(cmd) => plugin::run(cmd).await.map(|()| 0),
117117
Command::Cloud(cmd) => {
118118
let env = std::env::vars().collect();
119-
hm_plugin_cloud::cli::dispatch_command(cmd, env, app).await
119+
crate::commands::cloud::cli::dispatch_command(cmd, env, app).await
120120
}
121121
}
122122
}

crates/hm-plugin-cloud/src/auth/login.rs renamed to crates/hm/src/commands/cloud/auth/login.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use anyhow::{Result, bail};
1717
use harmont_cloud::{HarmontClient, HarmontError};
1818
use hm_core::app_ctx::AppCtx;
1919

20-
use crate::settings;
20+
use crate::commands::cloud::settings;
2121

2222
pub(crate) async fn run(
2323
env: &BTreeMap<String, String>,
File renamed without changes.

0 commit comments

Comments
 (0)