diff --git a/Cargo.toml b/Cargo.toml index dd0828f4..aa2d626a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ unwrap_used = "warn" expect_used = "warn" [workspace.dependencies] +git-next-core = { path = "crates/core", version = "0.10" } git-next-server = { path = "crates/server", version = "0.10" } git-next-server-actor = { path = "crates/server-actor", version = "0.10" } git-next-config = { path = "crates/config", version = "0.10" } diff --git a/crates/actor-macros/Cargo.toml b/crates/actor-macros/Cargo.toml index b5083ab1..4e0aa614 100644 --- a/crates/actor-macros/Cargo.toml +++ b/crates/actor-macros/Cargo.toml @@ -4,11 +4,9 @@ version = { workspace = true } edition = { workspace = true } license = { workspace = true } repository = { workspace = true } -description = "macros for actors for git-next, the trunk-based development manager" +description = "[deprecated crate] macros for actors for git-next, the trunk-based development manager" [dependencies] -# Actors -actix = { workspace = true } [lints.clippy] nursery = { level = "warn", priority = -1 } diff --git a/crates/actor-macros/README.md b/crates/actor-macros/README.md index ddc70e2a..f12c15d8 100644 --- a/crates/actor-macros/README.md +++ b/crates/actor-macros/README.md @@ -7,3 +7,5 @@ development workflows where each commit must pass CI before being included in the main branch. See [git-next](https://crates.io/crates/git-next) for more information. + +N.B. this crate has been merged into [git-next-core](https://crates.io/crates/git-next-core). diff --git a/crates/actor-macros/src/lib.rs b/crates/actor-macros/src/lib.rs index e935b02c..076971e2 100644 --- a/crates/actor-macros/src/lib.rs +++ b/crates/actor-macros/src/lib.rs @@ -1 +1 @@ -mod message; +// moved to crates/core/src/macros/ diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 8bbf0f30..7927c623 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -4,7 +4,7 @@ version = { workspace = true } edition = { workspace = true } license = { workspace = true } repository = { workspace = true } -description = "CLI support for git-next, the trunk-based development manager" +description = "git-next, the trunk-based development manager" authors = { workspace = true } rust-version = { workspace = true } documentation = { workspace = true } @@ -12,6 +12,7 @@ keywords = { workspace = true } categories = { workspace = true } [dependencies] +git-next-core = { workspace = true } git-next-server = { workspace = true } # CLI parsing diff --git a/crates/cli/README.md b/crates/cli/README.md index 714ffb1a..cdd5cccf 100644 --- a/crates/cli/README.md +++ b/crates/cli/README.md @@ -519,10 +519,11 @@ The following diagram shows the dependency between the crates that make up `git- ```mermaid stateDiagram-v2 + cli --> core + cli --> server file_watcher_actor --> config - file_watcher_actor --> actor_macros forge --> config forge --> git @@ -537,23 +538,24 @@ stateDiagram-v2 git --> config + repo_actor --> core repo_actor --> config repo_actor --> git repo_actor --> forge - repo_actor --> actor_macros server --> config server --> file_watcher_actor server --> server_actor + server_actor --> core server_actor --> config server_actor --> git server_actor --> forge server_actor --> repo_actor - server_actor --> actor_macros server_actor --> file_watcher_actor server_actor --> webhook_actor + webhook_actor --> core webhook_actor --> config webhook_actor --> repo_actor ``` diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml new file mode 100644 index 00000000..13289844 --- /dev/null +++ b/crates/core/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "git-next-core" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = "core for git-next, the trunk-based development manager" + +[dependencies] +# logging +console-subscriber = { workspace = true } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } + +# fs/network +kxio = { workspace = true } + +# Actors +actix = { workspace = true } +actix-rt = { workspace = true } + +[dev-dependencies] +# Testing +assert2 = { workspace = true } + +[lints.clippy] +nursery = { level = "warn", priority = -1 } +# pedantic = "warn" +unwrap_used = "warn" +expect_used = "warn" diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs new file mode 100644 index 00000000..992f6dd8 --- /dev/null +++ b/crates/core/src/lib.rs @@ -0,0 +1 @@ +mod macros; diff --git a/crates/actor-macros/src/message.rs b/crates/core/src/macros/message.rs similarity index 100% rename from crates/actor-macros/src/message.rs rename to crates/core/src/macros/message.rs diff --git a/crates/core/src/macros/mod.rs b/crates/core/src/macros/mod.rs new file mode 100644 index 00000000..e935b02c --- /dev/null +++ b/crates/core/src/macros/mod.rs @@ -0,0 +1 @@ +mod message; diff --git a/crates/file-watcher-actor/Cargo.toml b/crates/file-watcher-actor/Cargo.toml index aa353b82..8be02f6d 100644 --- a/crates/file-watcher-actor/Cargo.toml +++ b/crates/file-watcher-actor/Cargo.toml @@ -8,8 +8,6 @@ description = "Config file watcher for git-next, the trunk-based development man [dependencies] git-next-config = { workspace = true } -git-next-actor-macros = { workspace = true } -# git-next-repo-actor = { workspace = true } # logging tracing = { workspace = true } diff --git a/crates/repo-actor/Cargo.toml b/crates/repo-actor/Cargo.toml index 45fdba07..b342671d 100644 --- a/crates/repo-actor/Cargo.toml +++ b/crates/repo-actor/Cargo.toml @@ -12,10 +12,10 @@ forgejo = [] github = [] [dependencies] +git-next-core = { workspace = true } git-next-config = { workspace = true } git-next-git = { workspace = true } git-next-forge = { workspace = true } -git-next-actor-macros = { workspace = true } # logging tracing = { workspace = true } diff --git a/crates/repo-actor/src/messages.rs b/crates/repo-actor/src/messages.rs index 65e3a8ff..4fe760bf 100644 --- a/crates/repo-actor/src/messages.rs +++ b/crates/repo-actor/src/messages.rs @@ -3,8 +3,8 @@ use config::newtype; use derive_more::Display; use git::UserNotification; -use git_next_actor_macros::message; use git_next_config as config; +use git_next_core::message; use git_next_git as git; message!(LoadConfigFromRepo: "Request to load the `git-next.toml` from the git repo."); diff --git a/crates/repo-actor/src/tests/mod.rs b/crates/repo-actor/src/tests/mod.rs index b92f3e1c..6c66dd57 100644 --- a/crates/repo-actor/src/tests/mod.rs +++ b/crates/repo-actor/src/tests/mod.rs @@ -16,8 +16,8 @@ use git::{ repository::{factory::MockRepositoryFactory, open::MockOpenRepositoryLike, Direction}, Generation, MockForgeLike, RepoDetails, }; -use git_next_actor_macros::message; use git_next_config as config; +use git_next_core::message; use git_next_git as git; use mockall::predicate::eq; use std::{ diff --git a/crates/server-actor/Cargo.toml b/crates/server-actor/Cargo.toml index 4a247e56..91d24244 100644 --- a/crates/server-actor/Cargo.toml +++ b/crates/server-actor/Cargo.toml @@ -7,11 +7,11 @@ repository = { workspace = true } description = "Server actor for git-next, the trunk-based development manager" [dependencies] +git-next-core = { workspace = true } git-next-config = { workspace = true } git-next-git = { workspace = true } git-next-forge = { workspace = true } git-next-repo-actor = { workspace = true } -git-next-actor-macros = { workspace = true } git-next-file-watcher-actor = { workspace = true } git-next-webhook-actor = { workspace = true } diff --git a/crates/server-actor/src/lib.rs b/crates/server-actor/src/lib.rs index 2bca343d..a26e8382 100644 --- a/crates/server-actor/src/lib.rs +++ b/crates/server-actor/src/lib.rs @@ -24,7 +24,7 @@ use webhook::WebhookActor; pub use git_next_git::repository::{factory::real as repository_factory, RepositoryFactory}; -use crate::messages::ReceiveServerConfig; +use messages::ReceiveServerConfig; #[derive(Debug, derive_more::Display, derive_more::From)] pub enum Error { diff --git a/crates/server-actor/src/messages.rs b/crates/server-actor/src/messages.rs index adbf46e7..4e321c37 100644 --- a/crates/server-actor/src/messages.rs +++ b/crates/server-actor/src/messages.rs @@ -1,7 +1,7 @@ //- use derive_more::Constructor; -use git_next_actor_macros::message; use git_next_config::server::{ServerConfig, ServerStorage}; +use git_next_core::message; use std::net::SocketAddr; // receive server config diff --git a/crates/webhook-actor/Cargo.toml b/crates/webhook-actor/Cargo.toml index 353e7fc9..31c23b72 100644 --- a/crates/webhook-actor/Cargo.toml +++ b/crates/webhook-actor/Cargo.toml @@ -7,7 +7,7 @@ repository = { workspace = true } description = "webhook actor for git-next, the trunk-based development manager" [dependencies] -git-next-actor-macros = { workspace = true } +git-next-core = { workspace = true } git-next-config = { workspace = true } git-next-repo-actor = { workspace = true } diff --git a/crates/webhook-actor/src/messages.rs b/crates/webhook-actor/src/messages.rs index 97cf082f..886414ab 100644 --- a/crates/webhook-actor/src/messages.rs +++ b/crates/webhook-actor/src/messages.rs @@ -1,4 +1,4 @@ // -use git_next_actor_macros::message; +use git_next_core::message; message!(ShutdownWebhook: "Request to shutdown the Webhook actor");