From 7cd3cdb8b79c4ca11cdbd4194a72fb6b3cd8829d Mon Sep 17 00:00:00 2001 From: wiru Date: Thu, 20 Jun 2024 14:57:36 -0300 Subject: [PATCH 1/2] chore(release): prepare for v0.2.0 --- Cargo.lock | 10 +++++----- Cargo.toml | 2 +- hac-cli/Cargo.toml | 2 +- hac-client/Cargo.toml | 2 +- hac-client/src/app.rs | 1 - .../src/pages/collection_viewer/request_editor.rs | 14 +++++++++----- .../request_editor/auth_editor.rs | 6 +++--- .../request_editor/body_editor.rs | 4 ++-- .../request_editor/headers_editor.rs | 2 ++ .../collection_viewer/sidebar/directory_form.rs | 2 -- hac-colors/Cargo.toml | 2 +- hac-config/Cargo.toml | 2 +- hac-core/Cargo.toml | 2 +- 13 files changed, 27 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index deae996..3e8368a 100755 --- a/Cargo.lock +++ b/Cargo.lock @@ -587,14 +587,14 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "hac-cli" -version = "0.1.0" +version = "0.2.0" dependencies = [ "clap", ] [[package]] name = "hac-client" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "crossterm", @@ -622,7 +622,7 @@ dependencies = [ [[package]] name = "hac-colors" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "crossterm", @@ -634,7 +634,7 @@ dependencies = [ [[package]] name = "hac-config" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "dirs", @@ -645,7 +645,7 @@ dependencies = [ [[package]] name = "hac-core" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "hac-config", diff --git a/Cargo.toml b/Cargo.toml index 9a40a00..f030cc2 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ resolver = "2" name = "hac" [workspace.package] -version = "0.1.0" +version = "0.2.0" [workspace.dependencies] hac-config = { path = "hac-config" } diff --git a/hac-cli/Cargo.toml b/hac-cli/Cargo.toml index f93c340..da888d2 100755 --- a/hac-cli/Cargo.toml +++ b/hac-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hac-cli" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "your handy API client, on your terminal!" repository = "https://github.com/wllfaria/hac" diff --git a/hac-client/Cargo.toml b/hac-client/Cargo.toml index 64c3504..5002a0f 100755 --- a/hac-client/Cargo.toml +++ b/hac-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hac-client" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "your handy API client, on your terminal!" repository = "https://github.com/wllfaria/hac" diff --git a/hac-client/src/app.rs b/hac-client/src/app.rs index 28749e9..71bcdfc 100755 --- a/hac-client/src/app.rs +++ b/hac-client/src/app.rs @@ -23,7 +23,6 @@ impl<'app> App<'app> { config: &'app hac_config::Config, dry_run: bool, ) -> anyhow::Result { - let terminal = Terminal::new(CrosstermBackend::new(std::io::stdout()))?; Ok(Self { screen_manager: ScreenManager::new( diff --git a/hac-client/src/pages/collection_viewer/request_editor.rs b/hac-client/src/pages/collection_viewer/request_editor.rs index 078a672..87a08d5 100755 --- a/hac-client/src/pages/collection_viewer/request_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor.rs @@ -162,7 +162,7 @@ impl<'re> RequestEditor<'re> { ReqEditorTabs::Body => self.body_editor.draw(frame, size)?, ReqEditorTabs::Headers => self.headers_editor.draw(frame, size)?, ReqEditorTabs::Query => UnderConstruction::new(self.colors).draw(frame, size)?, - ReqEditorTabs::Auth => self.auth_editor.draw(frame, size)?, + ReqEditorTabs::Auth => UnderConstruction::new(self.colors).draw(frame, size)?, } Ok(()) @@ -285,13 +285,17 @@ impl Eventful for RequestEditor<'_> { }, ReqEditorTabs::Headers => match self.headers_editor.handle_key_event(key_event)? { Some(HeadersEditorEvent::Quit) => return Ok(Some(RequestEditorEvent::Quit)), + Some(HeadersEditorEvent::RemoveSelection) => { + return Ok(Some(RequestEditorEvent::RemoveSelection)) + } None => {} }, ReqEditorTabs::Query => {} - ReqEditorTabs::Auth => match self.auth_editor.handle_key_event(key_event)? { - Some(_) => todo!(), - None => {} - }, + ReqEditorTabs::Auth => { + if (self.auth_editor.handle_key_event(key_event)?).is_some() { + todo!() + } + } } Ok(None) diff --git a/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs b/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs index 72fa323..297b58b 100755 --- a/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor/auth_editor.rs @@ -5,12 +5,12 @@ use crate::pages::{Eventful, Renderable}; #[derive(Debug)] pub struct AuthEditor<'ae> { - colors: &'ae hac_colors::colors::Colors, + _colors: &'ae hac_colors::colors::Colors, } impl<'ae> AuthEditor<'ae> { pub fn new(colors: &'ae hac_colors::colors::Colors) -> Self { - AuthEditor { colors } + AuthEditor { _colors: colors } } } @@ -25,7 +25,7 @@ impl Renderable for AuthEditor<'_> { impl Eventful for AuthEditor<'_> { type Result = (); - fn handle_key_event(&mut self, key_event: KeyEvent) -> anyhow::Result> { + fn handle_key_event(&mut self, _key_event: KeyEvent) -> anyhow::Result> { Ok(None) } } diff --git a/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs b/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs index 641939a..9f4d301 100755 --- a/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor/body_editor.rs @@ -43,7 +43,7 @@ pub struct BodyEditor<'be> { /// Only KeyAction::Complex are stored here as any other kind of key action can be acted upon /// instantly keymap_buffer: Option, - collection_store: Rc>, + _collection_store: Rc>, } impl<'be> BodyEditor<'be> { @@ -60,7 +60,7 @@ impl<'be> BodyEditor<'be> { Self { body, tree, - collection_store, + _collection_store: collection_store, styled_display, cursor: Cursor::default(), editor_mode: EditorMode::Normal, diff --git a/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs b/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs index 9ca7b9b..199e10f 100755 --- a/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs +++ b/hac-client/src/pages/collection_viewer/request_editor/headers_editor.rs @@ -23,6 +23,7 @@ use super::headers_editor_edit_form::{HeadersEditorForm, HeadersEditorFormEvent} #[derive(Debug)] pub enum HeadersEditorEvent { Quit, + RemoveSelection, } #[derive(Debug)] @@ -438,6 +439,7 @@ impl Eventful for HeadersEditor<'_> { .borrow_mut() .push_overlay(CollectionViewerOverlay::HeadersForm(self.selected_row)); } + KeyCode::Esc => return Ok(Some(HeadersEditorEvent::RemoveSelection)), KeyCode::Char('n') => { let idx = headers.len(); headers.push(HeaderMap { diff --git a/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs b/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs index cc9001e..6766369 100644 --- a/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs +++ b/hac-client/src/pages/collection_viewer/sidebar/directory_form.rs @@ -1,5 +1,3 @@ -use hac_core::collection::types::*; - use crate::ascii::LOGO_ASCII; use crate::pages::collection_viewer::collection_store::CollectionStore; use crate::pages::input::Input; diff --git a/hac-colors/Cargo.toml b/hac-colors/Cargo.toml index c5dbe59..47ed969 100755 --- a/hac-colors/Cargo.toml +++ b/hac-colors/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hac-colors" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "your handy API client, on your terminal!" repository = "https://github.com/wllfaria/hac" diff --git a/hac-config/Cargo.toml b/hac-config/Cargo.toml index 951ff99..d117611 100755 --- a/hac-config/Cargo.toml +++ b/hac-config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hac-config" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "your handy API client, on your terminal!" repository = "https://github.com/wllfaria/hac" diff --git a/hac-core/Cargo.toml b/hac-core/Cargo.toml index 6b5c7c3..03a393b 100755 --- a/hac-core/Cargo.toml +++ b/hac-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hac-core" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "your handy API client, on your terminal!" repository = "https://github.com/wllfaria/hac" From 83c74560613b16f2ad92a78dba22d995bbdd9438 Mon Sep 17 00:00:00 2001 From: wiru Date: Thu, 20 Jun 2024 15:18:45 -0300 Subject: [PATCH 2/2] chore(release): release hac v0.1.2 --- CHANGELOG.md | 61 +++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54b43bf..c5c4284 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,38 @@ # Changelog +## [0.1.2] - 2024-06-20 + +### Bug Fixes + +- Fixing resizing crashing when drawing hint +- Using chars().count() instead of len() +- Fixing broken tests + +### Features + +- Rendering request headers onscreen +- Selecting and moving around headers +- Deleting headers and help overlays +- Header forms editing and creation +- Sending headers through request +- Redesign of create request form +- Editing headers on the sidebar +- Creating directories on the sidebar +- Initial implementation of parent selector +- Deleting requests and headers +- Removing parent from a request +- Editing directories on the sidebar + +### Refactor + +- Separating body editor to request editor to implement headers +- Hints are now controlled by its own component + +### Wip + +- Headers pane rendering +- Header edit form without key handling + ## [0.1.1] - 2024-06-03 ### Bug Fixes @@ -10,6 +43,7 @@ - Packaging hac as nix flake - Adding how to try with nix to readme +- Release hac v0.1.1 ### Refactor @@ -29,49 +63,22 @@ ### Bug Fixes -- Weird coloring of status bar -- Fixing delete backwards - Fixing broken tests for tree traversal - Fixing screen manager tests failing - Only showing cursor when editing the uri ### Features -- Synchronization of requests to file system -- Properly syncing and allowing further edits -- Adding better comments througout the app -- Adding initial CLI interfacing -- Proper extension for collections -- Handling other http methods -- Allow for changing urls -- Correct handling of new collections -- Showing cursor on uri pane -- Displaying status time and size of requests -- Hiding body tab when request method has no body -- Displaying error messages on request -- Chunking error text to multiline - Synchronization problems are now gone - Empty state for responses - Enabling dry run and better readme ### Miscellaneous Tasks -- Updated readme, licensing and getting project ready for use -- Adding contributing guidelines -- Pull request and issue templates -- Initial todos, have to do a lot more - Renaming project to hac - Setting up publishing to crates.io - Setting packages metadata - Renaming tui to client for publishing - Release hac v0.1.0 -### Refactor - -- Changing schemas to collection naming - -### Testing - -- Testing ascii error art -