WIP: extract more crates
This commit is contained in:
parent
2dbd42163a
commit
943291daca
28 changed files with 173 additions and 17 deletions
11
Cargo.toml
11
Cargo.toml
|
@ -1,6 +1,13 @@
|
|||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["crates/cli", "crates/server", "crates/config", "crates/git"]
|
||||
members = [
|
||||
"crates/cli",
|
||||
"crates/server",
|
||||
"crates/config",
|
||||
"crates/git",
|
||||
"crates/gitforge",
|
||||
"crates/repo-actor",
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.5.1"
|
||||
|
@ -16,6 +23,8 @@ expect_used = "warn"
|
|||
git-next-server = { path = "crates/server" }
|
||||
git-next-config = { path = "crates/config" }
|
||||
git-next-git = { path = "crates/git" }
|
||||
git-next-gitforge = { path = "crates/gitforge" }
|
||||
git-next-repo-actor = { path = "crates/repo-actor" }
|
||||
|
||||
# CLI parsing
|
||||
clap = { version = "4.5", features = ["cargo", "derive"] }
|
||||
|
|
13
README.md
13
README.md
|
@ -190,9 +190,22 @@ The following diagram shows the dependency between the crates that make up `git-
|
|||
stateDiagram-v2
|
||||
cli --> server
|
||||
cli --> git
|
||||
|
||||
server --> config
|
||||
server --> git
|
||||
server --> gitforge
|
||||
server --> repo_actor
|
||||
|
||||
git --> config
|
||||
|
||||
gitforge --> config
|
||||
gitforge --> git
|
||||
|
||||
repo_actor --> config
|
||||
repo_actor --> git
|
||||
repo_actor --> gitforge
|
||||
|
||||
|
||||
```
|
||||
|
||||
## License
|
||||
|
|
|
@ -9,9 +9,9 @@ forgejo = []
|
|||
github = []
|
||||
|
||||
[dependencies]
|
||||
# # logging
|
||||
# logging
|
||||
# console-subscriber = { workspace = true }
|
||||
# tracing = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
# tracing-subscriber = { workspace = true }
|
||||
|
||||
# # base64 decoding
|
||||
|
@ -21,9 +21,9 @@ github = []
|
|||
# # gix = { workspace = true }
|
||||
# gix = { workspace = true }
|
||||
# async-trait = { workspace = true }
|
||||
#
|
||||
# # fs/network
|
||||
# kxio = { workspace = true }
|
||||
|
||||
# fs/network
|
||||
kxio = { workspace = true }
|
||||
|
||||
# TOML parsing
|
||||
serde = { workspace = true }
|
||||
|
@ -47,12 +47,12 @@ derive-with = { workspace = true }
|
|||
#
|
||||
# # file watcher
|
||||
# inotify = { workspace = true }
|
||||
#
|
||||
# # Actors
|
||||
# actix = { workspace = true }
|
||||
|
||||
# Actors
|
||||
actix = { workspace = true }
|
||||
# actix-rt = { workspace = true }
|
||||
# tokio = { workspace = true }
|
||||
#
|
||||
|
||||
[dev-dependencies]
|
||||
# # Testing
|
||||
assert2 = { workspace = true }
|
||||
|
|
64
crates/gitforge/Cargo.toml
Normal file
64
crates/gitforge/Cargo.toml
Normal file
|
@ -0,0 +1,64 @@
|
|||
[package]
|
||||
name = "git-next-gitforge"
|
||||
version = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["forgejo"]
|
||||
forgejo = []
|
||||
github = []
|
||||
|
||||
[dependencies]
|
||||
git-next-config = { workspace = true }
|
||||
git-next-git = { workspace = true }
|
||||
|
||||
# logging
|
||||
console-subscriber = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
tracing-subscriber = { workspace = true }
|
||||
|
||||
# base64 decoding
|
||||
base64 = { workspace = true }
|
||||
|
||||
# git
|
||||
async-trait = { workspace = true }
|
||||
|
||||
# fs/network
|
||||
kxio = { workspace = true }
|
||||
|
||||
# TOML parsing
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
toml = { workspace = true }
|
||||
|
||||
# Secrets and Password
|
||||
secrecy = { workspace = true }
|
||||
|
||||
# Conventional Commit check
|
||||
git-conventional = { workspace = true }
|
||||
|
||||
# Webhooks
|
||||
bytes = { workspace = true }
|
||||
ulid = { workspace = true }
|
||||
warp = { workspace = true }
|
||||
|
||||
# boilerplate
|
||||
derive_more = { workspace = true }
|
||||
|
||||
# file watcher
|
||||
inotify = { workspace = true }
|
||||
|
||||
# Actors
|
||||
actix = { workspace = true }
|
||||
actix-rt = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
# Testing
|
||||
assert2 = { workspace = true }
|
||||
|
||||
[lints.clippy]
|
||||
nursery = { level = "warn", priority = -1 }
|
||||
# pedantic = "warn"
|
||||
unwrap_used = "warn"
|
||||
expect_used = "warn"
|
|
@ -2,7 +2,9 @@ use git::OpenRepository;
|
|||
use git_next_config::{BranchName, GitDir, RepoConfig};
|
||||
use git_next_git::{self as git, GitRef};
|
||||
|
||||
use crate::{actors::repo::RepoActor, gitforge};
|
||||
use crate::{
|
||||
actors::repo::RepoActor, CommitStatus, ForgeBranchError, ForgeFileError, MessageToken,
|
||||
};
|
||||
|
||||
struct MockForge;
|
||||
#[derive(Clone, Debug)]
|
||||
|
@ -18,7 +20,7 @@ impl super::ForgeLike for MockForgeEnv {
|
|||
"mock".to_string()
|
||||
}
|
||||
|
||||
async fn branches_get_all(&self) -> Result<Vec<BranchName>, gitforge::ForgeBranchError> {
|
||||
async fn branches_get_all(&self) -> Result<Vec<BranchName>, ForgeBranchError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
@ -26,7 +28,7 @@ impl super::ForgeLike for MockForgeEnv {
|
|||
&self,
|
||||
_branch: &BranchName,
|
||||
_file_path: &str,
|
||||
) -> Result<String, gitforge::ForgeFileError> {
|
||||
) -> Result<String, ForgeFileError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
@ -35,7 +37,7 @@ impl super::ForgeLike for MockForgeEnv {
|
|||
_repository: OpenRepository,
|
||||
_repo_config: RepoConfig,
|
||||
_addr: actix::prelude::Addr<RepoActor>,
|
||||
_message_token: gitforge::MessageToken,
|
||||
_message_token: MessageToken,
|
||||
) {
|
||||
todo!()
|
||||
}
|
||||
|
@ -50,7 +52,7 @@ impl super::ForgeLike for MockForgeEnv {
|
|||
todo!()
|
||||
}
|
||||
|
||||
async fn commit_status(&self, _commit: &git::Commit) -> gitforge::CommitStatus {
|
||||
async fn commit_status(&self, _commit: &git::Commit) -> CommitStatus {
|
||||
todo!()
|
||||
}
|
||||
|
65
crates/repo-actor/Cargo.toml
Normal file
65
crates/repo-actor/Cargo.toml
Normal file
|
@ -0,0 +1,65 @@
|
|||
[package]
|
||||
name = "git-next-repo-actor"
|
||||
version = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["forgejo"]
|
||||
forgejo = []
|
||||
github = []
|
||||
|
||||
[dependencies]
|
||||
git-next-config = { workspace = true }
|
||||
git-next-git = { workspace = true }
|
||||
git-next-gitforge = { workspace = true }
|
||||
|
||||
# logging
|
||||
console-subscriber = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
tracing-subscriber = { workspace = true }
|
||||
|
||||
# base64 decoding
|
||||
base64 = { workspace = true }
|
||||
|
||||
# git
|
||||
async-trait = { workspace = true }
|
||||
|
||||
# fs/network
|
||||
kxio = { workspace = true }
|
||||
|
||||
# TOML parsing
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
toml = { workspace = true }
|
||||
|
||||
# Secrets and Password
|
||||
secrecy = { workspace = true }
|
||||
|
||||
# Conventional Commit check
|
||||
git-conventional = { workspace = true }
|
||||
|
||||
# Webhooks
|
||||
bytes = { workspace = true }
|
||||
ulid = { workspace = true }
|
||||
warp = { workspace = true }
|
||||
|
||||
# boilerplate
|
||||
derive_more = { workspace = true }
|
||||
|
||||
# file watcher
|
||||
inotify = { workspace = true }
|
||||
|
||||
# Actors
|
||||
actix = { workspace = true }
|
||||
actix-rt = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
# Testing
|
||||
assert2 = { workspace = true }
|
||||
|
||||
[lints.clippy]
|
||||
nursery = { level = "warn", priority = -1 }
|
||||
# pedantic = "warn"
|
||||
unwrap_used = "warn"
|
||||
expect_used = "warn"
|
|
@ -13,7 +13,9 @@ use git_next_git::{self as git, Generation, RepoDetails};
|
|||
use kxio::network::Network;
|
||||
use tracing::{debug, info, warn, Instrument};
|
||||
|
||||
use crate::{actors::repo::webhook::WebhookAuth, config::Webhook, gitforge};
|
||||
// use crate::{actors::repo::webhook::WebhookAuth, config::Webhook, gitforge};
|
||||
|
||||
use crate::webhook::WebhookAuth;
|
||||
|
||||
use self::webhook::WebhookId;
|
||||
|
|
@ -11,6 +11,8 @@ github = []
|
|||
[dependencies]
|
||||
git-next-config = { workspace = true }
|
||||
git-next-git = { workspace = true }
|
||||
git-next-gitforge = { workspace = true }
|
||||
git-next-repo-actor = { workspace = true }
|
||||
|
||||
# logging
|
||||
console-subscriber = { workspace = true }
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
pub mod file_watcher;
|
||||
pub mod repo;
|
||||
pub mod server;
|
||||
pub mod webhook;
|
||||
|
|
Loading…
Reference in a new issue