refactor: merge forgejo crate into cli crate
This commit is contained in:
parent
f71e28512d
commit
52de3ef86e
15 changed files with 24 additions and 80 deletions
19
Cargo.lock
generated
19
Cargo.lock
generated
|
@ -1059,6 +1059,7 @@ version = "0.14.1"
|
|||
dependencies = [
|
||||
"anyhow",
|
||||
"assert2",
|
||||
"async-trait",
|
||||
"bon",
|
||||
"bytes",
|
||||
"chrono",
|
||||
|
@ -1069,7 +1070,6 @@ dependencies = [
|
|||
"directories",
|
||||
"git-conventional",
|
||||
"git-next-core",
|
||||
"git-next-forge-forgejo",
|
||||
"git-next-forge-github",
|
||||
"kameo",
|
||||
"kxio",
|
||||
|
@ -1085,6 +1085,7 @@ dependencies = [
|
|||
"rstest 0.24.0",
|
||||
"secrecy",
|
||||
"sendmail",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"standardwebhooks",
|
||||
"test-log",
|
||||
|
@ -1127,22 +1128,6 @@ dependencies = [
|
|||
"ulid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "git-next-forge-forgejo"
|
||||
version = "0.14.1"
|
||||
dependencies = [
|
||||
"assert2",
|
||||
"async-trait",
|
||||
"git-next-core",
|
||||
"kxio",
|
||||
"rand",
|
||||
"secrecy",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "git-next-forge-github"
|
||||
version = "0.14.1"
|
||||
|
|
|
@ -23,7 +23,6 @@ categories = ["development-tools"]
|
|||
|
||||
[workspace.dependencies]
|
||||
git-next-core = { path = "crates/core", version = "0.14" }
|
||||
git-next-forge-forgejo = { path = "crates/forge-forgejo", version = "0.14" }
|
||||
git-next-forge-github = { path = "crates/forge-github", version = "0.14" }
|
||||
|
||||
# TUI
|
||||
|
|
|
@ -14,7 +14,7 @@ categories = { workspace = true }
|
|||
[features]
|
||||
# default = ["forgejo", "github"]
|
||||
default = ["forgejo", "github", "tui"]
|
||||
forgejo = ["git-next-forge-forgejo"]
|
||||
forgejo = []
|
||||
github = ["git-next-forge-github"]
|
||||
tui = [
|
||||
"ratatui",
|
||||
|
@ -27,7 +27,6 @@ tui = [
|
|||
|
||||
[dependencies]
|
||||
git-next-core = { workspace = true }
|
||||
git-next-forge-forgejo = { workspace = true, optional = true }
|
||||
git-next-forge-github = { workspace = true, optional = true }
|
||||
|
||||
# TUI
|
||||
|
@ -55,6 +54,7 @@ git-conventional = { workspace = true }
|
|||
|
||||
# TOML parsing
|
||||
toml = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
|
||||
# Actors
|
||||
kameo = { workspace = true }
|
||||
|
@ -86,6 +86,9 @@ sendmail = { workspace = true }
|
|||
# desktop notifications
|
||||
notifica = { workspace = true }
|
||||
|
||||
# git
|
||||
async-trait = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
# Testing
|
||||
assert2 = { workspace = true }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
use git_next_core::git::{ForgeLike, RepoDetails};
|
||||
|
||||
#[cfg(feature = "forgejo")]
|
||||
use git_next_forge_forgejo::ForgeJo;
|
||||
use crate::forges::forgejo::ForgeJo;
|
||||
|
||||
#[cfg(feature = "github")]
|
||||
use git_next_forge_github::Github;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
//
|
||||
#![allow(clippy::expect_used)] // used with mock net
|
||||
|
||||
use crate::ForgeJo;
|
||||
use crate::forges::forgejo::ForgeJo;
|
||||
|
||||
use git_next_core::{
|
||||
git::{self, forge::commit::Status, ForgeLike as _},
|
||||
server::{ListenUrl, RepoListenUrl},
|
|
@ -2,7 +2,7 @@
|
|||
use git_next_core::{git, server::RepoListenUrl, WebhookId};
|
||||
use kxio::net::Net;
|
||||
|
||||
use crate::webhook::Hook;
|
||||
use crate::forges::forgejo::webhook::Hook;
|
||||
|
||||
pub async fn list(
|
||||
repo_details: &git::RepoDetails,
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
use crate as forgejo;
|
||||
use crate::forges::forgejo;
|
||||
|
||||
use git_next_core::{git, webhook};
|
||||
|
|
@ -1,14 +1,17 @@
|
|||
use git_next_core::git::forge::webhook::Error;
|
||||
//
|
||||
use git_next_core::{git, server::RepoListenUrl, RegisteredWebhook, WebhookAuth, WebhookId};
|
||||
use git_next_core::{
|
||||
git::{self, forge::webhook::Error},
|
||||
server::RepoListenUrl,
|
||||
RegisteredWebhook, WebhookAuth, WebhookId,
|
||||
};
|
||||
|
||||
use kxio::net::Net;
|
||||
use secrecy::ExposeSecret as _;
|
||||
use serde_json::json;
|
||||
use tracing::{info, instrument, warn};
|
||||
|
||||
use crate::webhook;
|
||||
use crate::webhook::Hook;
|
||||
use crate::forges::forgejo::webhook;
|
||||
use crate::forges::forgejo::webhook::Hook;
|
||||
|
||||
#[instrument(skip_all, fields(forge = %repo_details.forge.forge_alias(), repo = %repo_details.repo_alias))]
|
||||
pub async fn register(
|
3
crates/cli/src/forges/mod.rs
Normal file
3
crates/cli/src/forges/mod.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
//
|
||||
#[cfg(feature = "forgejo")]
|
||||
pub mod forgejo;
|
|
@ -11,6 +11,8 @@ mod repo;
|
|||
mod root;
|
||||
mod server;
|
||||
|
||||
mod forges;
|
||||
|
||||
#[cfg(feature = "tui")]
|
||||
mod tui;
|
||||
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
[package]
|
||||
name = "git-next-forge-forgejo"
|
||||
version = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
license = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
description = "Forgejo support for git-next, the trunk-based development manager"
|
||||
|
||||
[lints.clippy]
|
||||
nursery = { level = "warn", priority = -1 }
|
||||
pedantic = { level = "warn", priority = -1 }
|
||||
unwrap_used = "warn"
|
||||
expect_used = "warn"
|
||||
|
||||
[lints.rust]
|
||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
|
||||
|
||||
[dependencies]
|
||||
git-next-core = { workspace = true }
|
||||
|
||||
# logging
|
||||
tracing = { workspace = true }
|
||||
|
||||
# git
|
||||
async-trait = { workspace = true }
|
||||
|
||||
# fs/network
|
||||
kxio = { workspace = true }
|
||||
|
||||
# TOML parsing
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
# Secrets and Password
|
||||
secrecy = { workspace = true }
|
||||
|
||||
# # Actors
|
||||
tokio = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
# Testing
|
||||
assert2 = { workspace = true }
|
||||
rand = { workspace = true }
|
|
@ -1,9 +0,0 @@
|
|||
# git-next
|
||||
|
||||
## Trunk-based developement manager.
|
||||
|
||||
`git-next` is a combined server and command-line tool that enables trunk-based
|
||||
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.
|
Loading…
Add table
Reference in a new issue