From 42d0ac7775eb7a9dc802fbe2b8bc25b7ad77a81d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Sun, 1 Dec 2024 23:14:17 +0300 Subject: [PATCH] refactor(tui): separate the changelog generate/write logic --- git-cliff-core/src/changelog.rs | 46 +++++++++++--------- git-cliff-core/src/template.rs | 2 +- git-cliff-tui/src/event.rs | 10 +++-- git-cliff-tui/src/main.rs | 72 +++++++++++++++---------------- git-cliff-tui/src/state.rs | 54 ++++++++++++++++++++--- git-cliff/src/lib.rs | 76 ++++++++++++++++++--------------- git-cliff/src/main.rs | 26 +++++++++-- 7 files changed, 183 insertions(+), 103 deletions(-) diff --git a/git-cliff-core/src/changelog.rs b/git-cliff-core/src/changelog.rs index 86a8e20300..328a3697da 100644 --- a/git-cliff-core/src/changelog.rs +++ b/git-cliff-core/src/changelog.rs @@ -28,31 +28,30 @@ use std::time::{ }; /// Changelog generator. -#[derive(Debug)] +#[derive(Clone, Debug)] pub struct Changelog<'a> { /// Releases that the changelog will contain. pub releases: Vec>, + /// Configuration. + pub config: Config, header_template: Option