mirror of
https://github.com/orhun/git-cliff.git
synced 2024-11-29 15:42:15 +03:00
refactor(lib)!: move changelog module to git-cliff-core
This will reduce the number of pulled dependencies if you want to use git-cliff as a library in your Rust project.
This commit is contained in:
parent
7767ace8f8
commit
2ab2c8fb5e
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -486,6 +486,7 @@ dependencies = [
|
||||
"glob",
|
||||
"indexmap",
|
||||
"lazy-regex",
|
||||
"log",
|
||||
"pretty_assertions",
|
||||
"regex",
|
||||
"rust-embed",
|
||||
|
@ -1,12 +1,10 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"git-cliff-core",
|
||||
"git-cliff",
|
||||
]
|
||||
members = ["git-cliff-core", "git-cliff"]
|
||||
|
||||
[workspace.dependencies]
|
||||
regex = "1.6.0"
|
||||
glob = "0.3.0"
|
||||
log = "0.4.17"
|
||||
|
||||
[profile.dev]
|
||||
opt-level = 0
|
||||
|
@ -13,6 +13,7 @@ rust-version = "1.60.0"
|
||||
[dependencies]
|
||||
glob.workspace = true
|
||||
regex.workspace = true
|
||||
log.workspace = true
|
||||
thiserror = "1.0.38"
|
||||
serde = { version = "1.0.152", features = ["derive"] }
|
||||
serde_json = "1.0.91"
|
||||
|
@ -1,11 +1,11 @@
|
||||
use git_cliff_core::commit::Commit;
|
||||
use git_cliff_core::config::Config;
|
||||
use git_cliff_core::error::Result;
|
||||
use git_cliff_core::release::{
|
||||
use crate::commit::Commit;
|
||||
use crate::config::Config;
|
||||
use crate::error::Result;
|
||||
use crate::release::{
|
||||
Release,
|
||||
Releases,
|
||||
};
|
||||
use git_cliff_core::template::Template;
|
||||
use crate::template::Template;
|
||||
use std::io::Write;
|
||||
|
||||
/// Changelog generator.
|
||||
@ -176,7 +176,7 @@ impl<'a> Changelog<'a> {
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use git_cliff_core::config::{
|
||||
use crate::config::{
|
||||
ChangelogConfig,
|
||||
CommitParser,
|
||||
CommitPreprocessor,
|
@ -1,6 +1,8 @@
|
||||
//! A highly customizable changelog generator
|
||||
#![warn(missing_docs, clippy::unwrap_used)]
|
||||
|
||||
/// Changelog generator.
|
||||
pub mod changelog;
|
||||
/// Command runner.
|
||||
pub mod command;
|
||||
/// Git commit.
|
||||
@ -18,5 +20,8 @@ pub mod repo;
|
||||
/// Template engine.
|
||||
pub mod template;
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
/// Default configuration file.
|
||||
pub const DEFAULT_CONFIG: &str = "cliff.toml";
|
||||
|
@ -28,8 +28,8 @@ default = ["update-informer"]
|
||||
[dependencies]
|
||||
glob.workspace = true
|
||||
regex.workspace = true
|
||||
log.workspace = true
|
||||
pretty_env_logger = "0.4.0"
|
||||
log = "0.4.17"
|
||||
dirs-next = "2.0.0"
|
||||
clap_complete = "4.1.1"
|
||||
clap_mangen = "0.2.7"
|
||||
|
@ -1,7 +1,5 @@
|
||||
/// Command-line argument parser.
|
||||
pub mod args;
|
||||
/// Changelog generator.
|
||||
pub mod changelog;
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
@ -11,8 +9,8 @@ use args::{
|
||||
Sort,
|
||||
Strip,
|
||||
};
|
||||
use changelog::Changelog;
|
||||
use clap::ValueEnum;
|
||||
use git_cliff_core::changelog::Changelog;
|
||||
use git_cliff_core::commit::Commit;
|
||||
use git_cliff_core::config::Config;
|
||||
use git_cliff_core::embed::EmbeddedConfig;
|
||||
|
Loading…
Reference in New Issue
Block a user