refactor: merge actor-macros into core

Starting to flatten the crates.
This commit is contained in:
Paul Campbell 2024-07-24 09:04:21 +01:00
parent 758ca5c2dc
commit 48c968db2d
19 changed files with 52 additions and 18 deletions

View file

@ -23,6 +23,7 @@ unwrap_used = "warn"
expect_used = "warn" expect_used = "warn"
[workspace.dependencies] [workspace.dependencies]
git-next-core = { path = "crates/core", version = "0.10" }
git-next-server = { path = "crates/server", 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-server-actor = { path = "crates/server-actor", version = "0.10" }
git-next-config = { path = "crates/config", version = "0.10" } git-next-config = { path = "crates/config", version = "0.10" }

View file

@ -4,11 +4,9 @@ version = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
license = { workspace = true } license = { workspace = true }
repository = { 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] [dependencies]
# Actors
actix = { workspace = true }
[lints.clippy] [lints.clippy]
nursery = { level = "warn", priority = -1 } nursery = { level = "warn", priority = -1 }

View file

@ -7,3 +7,5 @@ development workflows where each commit must pass CI before being included in
the main branch. the main branch.
See [git-next](https://crates.io/crates/git-next) for more information. 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).

View file

@ -1 +1 @@
mod message; // moved to crates/core/src/macros/

View file

@ -4,7 +4,7 @@ version = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
license = { workspace = true } license = { workspace = true }
repository = { 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 } authors = { workspace = true }
rust-version = { workspace = true } rust-version = { workspace = true }
documentation = { workspace = true } documentation = { workspace = true }
@ -12,6 +12,7 @@ keywords = { workspace = true }
categories = { workspace = true } categories = { workspace = true }
[dependencies] [dependencies]
git-next-core = { workspace = true }
git-next-server = { workspace = true } git-next-server = { workspace = true }
# CLI parsing # CLI parsing

View file

@ -519,10 +519,11 @@ The following diagram shows the dependency between the crates that make up `git-
```mermaid ```mermaid
stateDiagram-v2 stateDiagram-v2
cli --> core
cli --> server cli --> server
file_watcher_actor --> config file_watcher_actor --> config
file_watcher_actor --> actor_macros
forge --> config forge --> config
forge --> git forge --> git
@ -537,23 +538,24 @@ stateDiagram-v2
git --> config git --> config
repo_actor --> core
repo_actor --> config repo_actor --> config
repo_actor --> git repo_actor --> git
repo_actor --> forge repo_actor --> forge
repo_actor --> actor_macros
server --> config server --> config
server --> file_watcher_actor server --> file_watcher_actor
server --> server_actor server --> server_actor
server_actor --> core
server_actor --> config server_actor --> config
server_actor --> git server_actor --> git
server_actor --> forge server_actor --> forge
server_actor --> repo_actor server_actor --> repo_actor
server_actor --> actor_macros
server_actor --> file_watcher_actor server_actor --> file_watcher_actor
server_actor --> webhook_actor server_actor --> webhook_actor
webhook_actor --> core
webhook_actor --> config webhook_actor --> config
webhook_actor --> repo_actor webhook_actor --> repo_actor
``` ```

30
crates/core/Cargo.toml Normal file
View file

@ -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"

1
crates/core/src/lib.rs Normal file
View file

@ -0,0 +1 @@
mod macros;

View file

@ -0,0 +1 @@
mod message;

View file

@ -8,8 +8,6 @@ description = "Config file watcher for git-next, the trunk-based development man
[dependencies] [dependencies]
git-next-config = { workspace = true } git-next-config = { workspace = true }
git-next-actor-macros = { workspace = true }
# git-next-repo-actor = { workspace = true }
# logging # logging
tracing = { workspace = true } tracing = { workspace = true }

View file

@ -12,10 +12,10 @@ forgejo = []
github = [] github = []
[dependencies] [dependencies]
git-next-core = { workspace = true }
git-next-config = { workspace = true } git-next-config = { workspace = true }
git-next-git = { workspace = true } git-next-git = { workspace = true }
git-next-forge = { workspace = true } git-next-forge = { workspace = true }
git-next-actor-macros = { workspace = true }
# logging # logging
tracing = { workspace = true } tracing = { workspace = true }

View file

@ -3,8 +3,8 @@ use config::newtype;
use derive_more::Display; use derive_more::Display;
use git::UserNotification; use git::UserNotification;
use git_next_actor_macros::message;
use git_next_config as config; use git_next_config as config;
use git_next_core::message;
use git_next_git as git; use git_next_git as git;
message!(LoadConfigFromRepo: "Request to load the `git-next.toml` from the git repo."); message!(LoadConfigFromRepo: "Request to load the `git-next.toml` from the git repo.");

View file

@ -16,8 +16,8 @@ use git::{
repository::{factory::MockRepositoryFactory, open::MockOpenRepositoryLike, Direction}, repository::{factory::MockRepositoryFactory, open::MockOpenRepositoryLike, Direction},
Generation, MockForgeLike, RepoDetails, Generation, MockForgeLike, RepoDetails,
}; };
use git_next_actor_macros::message;
use git_next_config as config; use git_next_config as config;
use git_next_core::message;
use git_next_git as git; use git_next_git as git;
use mockall::predicate::eq; use mockall::predicate::eq;
use std::{ use std::{

View file

@ -7,11 +7,11 @@ repository = { workspace = true }
description = "Server actor for git-next, the trunk-based development manager" description = "Server actor for git-next, the trunk-based development manager"
[dependencies] [dependencies]
git-next-core = { workspace = true }
git-next-config = { workspace = true } git-next-config = { workspace = true }
git-next-git = { workspace = true } git-next-git = { workspace = true }
git-next-forge = { workspace = true } git-next-forge = { workspace = true }
git-next-repo-actor = { workspace = true } git-next-repo-actor = { workspace = true }
git-next-actor-macros = { workspace = true }
git-next-file-watcher-actor = { workspace = true } git-next-file-watcher-actor = { workspace = true }
git-next-webhook-actor = { workspace = true } git-next-webhook-actor = { workspace = true }

View file

@ -24,7 +24,7 @@ use webhook::WebhookActor;
pub use git_next_git::repository::{factory::real as repository_factory, RepositoryFactory}; 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)] #[derive(Debug, derive_more::Display, derive_more::From)]
pub enum Error { pub enum Error {

View file

@ -1,7 +1,7 @@
//- //-
use derive_more::Constructor; use derive_more::Constructor;
use git_next_actor_macros::message;
use git_next_config::server::{ServerConfig, ServerStorage}; use git_next_config::server::{ServerConfig, ServerStorage};
use git_next_core::message;
use std::net::SocketAddr; use std::net::SocketAddr;
// receive server config // receive server config

View file

@ -7,7 +7,7 @@ repository = { workspace = true }
description = "webhook actor for git-next, the trunk-based development manager" description = "webhook actor for git-next, the trunk-based development manager"
[dependencies] [dependencies]
git-next-actor-macros = { workspace = true } git-next-core = { workspace = true }
git-next-config = { workspace = true } git-next-config = { workspace = true }
git-next-repo-actor = { workspace = true } git-next-repo-actor = { workspace = true }

View file

@ -1,4 +1,4 @@
// //
use git_next_actor_macros::message; use git_next_core::message;
message!(ShutdownWebhook: "Request to shutdown the Webhook actor"); message!(ShutdownWebhook: "Request to shutdown the Webhook actor");