- r3bl_ansi_color
- r3bl_core
- r3bl_macro
- r3bl_test_fixtures
- r3bl_tui
- v0.6.0 2024-10-21
- v0.5.9 2024-09-12
- v0.5.8 2024-09-07
- v0.5.7 2024-08-13
- v0.5.6 2024-06-29
- v0.5.5 2024-05-20
- v0.5.4 2024-05-20
- v0.5.3 2024-04-15
- v0.5.2 2024-01-14
- v0.5.1 2024-01-09
- v0.5.0 2023-12-31
- v0.4.0 2023-12-22
- v0.3.10 2023-10-29
- v0.3.9 2023-10-29
- v0.3.7 2023-10-21
- v0.3.6 2023-10-17
- v0.3.5 2023-10-14
- v0.3.3 2023-04-20
- v0.3.2 2023-03-06
- v0.3.1 2023-03-06
- r3bl_tuify
- r3bl_terminal_async
- r3bl-cmdr
- r3bl_analytics_schema
This is part of a total reorganization of the r3bl-open-core
repo. This is a breaking
change for almost every crate in the repo. This
PR contains all the changes.
- Updated:
- This release just uses the latest deps from
r3bl-open-core
repo, since so many crates have been reorganized and renamed. The functionality has not changed at all, just the imports.
- This release just uses the latest deps from
- Updated:
- Minor fix to documentation in
lib.rs
andREADME.md
to use GIF instead of MP4 files for theedi
andgiti
videos. The MP4 files were not showing on docs.rs, crates.io, or github.com.
- Minor fix to documentation in
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
. - Update
UPDATE_IF_NOT_THIS_VERSION
to0.0.15
. This is kept in sync w/ the deployed backendr3bl-base
.
- Upgrade all deps to their latest versions in
The most significant change in this release is the use of the latest release of the
Markdown parser from r3bl_tui
, which improves the editing experience of writing each
individual line of Markdown text. Common edge cases that were not handled before are now
handled correctly. And these are cases that come up quite frequently when editing Markdown
in a text editor.
-
Fixed:
- Use the latest release of the
r3bl_tui
crate version0.5.6
which fixes a lot of common bugs with the Markdown parser. This are critical bug fixes that are needed for theedi
binary target, to make it a stable and usable Markdown editor for daily use.
- Use the latest release of the
-
Changed:
- Use the latest release of the
r3bl_tui
crate version0.5.5
. - Clean up
main_event_loop
and get rid of needless'static
inAS
trait bound. - Fix cargo clippy doc warnings.
- Update
UPDATE_IF_NOT_THIS_VERSION
to0.0.14
. This is kept in sync w/ the deployed backendr3bl-base
.
- Use the latest release of the
-
Updated:
- Dependencies for
syntect
,strum
,strum-macros
,reedline
,serial_test
bumped to their latest versions.
- Dependencies for
- Changed:
Cargo.toml
now points to the correct documentation link on docs.rs.README.md
now has the correct URL for the hero image (that will load on crates.io and not just github.com).lib.rs
has the same URL for the hero image asREADME.md
.- Update
UPDATE_IF_NOT_THIS_VERSION
to0.0.13
. This is kept in sync w/ the deployed backendr3bl-base
.
- Changed:
- Use the latest deps of all the
r3bl_*
crates to fix breaking build whencargo install r3bl-cmdr
is run. Not sure how long this has been broken. Moving forwards, this will be checked using a VM on every release. Updaterelease-guide.md
instructions with this info.r3bl_ansi_color = { path = "../ansi_color", version = "0.6.9" }
r3bl_rs_utils_core = { path = "../core", version = "0.9.13" }
r3bl_rs_utils_macro = { path = "../macro", version = "0.9.9" }
r3bl_tui = { path = "../tui", version = "0.5.3" }
r3bl_tuify = { path = "../tuify", version = "0.1.26" }
- Update the
UPDATE_IF_NOT_THIS_VERSION
to0.0.12
. This is kept in sync w/ the deployed backendr3bl-base
.
- Use the latest deps of all the
- Added:
edi
,giti
: Add checks to see if binary needs to be upgraded.- Search for
UPDATE_IF_NOT_THIS_VERSION
inr3bl-open-core
repo (incmdr
folder), and inr3bl-base
repo.UPDATE_IF_NOT_THIS_VERSION
is set to0.0.11
for this release. - If upgrade is needed, then display a message to the user asking them to run
cargo install r3bl-cmdr
again.
- Search for
giti
add feature:giti branch checkout
giti
add feature:giti branch new
- Add
reedline
version0.28.0
dependency inCargo.toml
.
-
Fixed:
- Refactor & clean up the analytics client code.
-
Updated:
- Use the latest
r3bl_rs_utils_core
version0.9.11
.
- Use the latest
-
Added:
- Anonymized analytics reporting to prioritize feature development for
edi
andgiti
.
- Anonymized analytics reporting to prioritize feature development for
-
Changed:
- Replace the
run
command withexamples
in therun
nushell script. To run an example you usenu run examples
. and provide instructions on therun
script at the top level folder of this monorepo. Updatelib.rs
andREADME.md
to reflect this change. The behavior of therun
nushell script is more uniform across all crates in this repo.
- Replace the
-
Changed:
- Rename
run.nu
torun
and updateREADME.md
andlib.rs
to reflect this change. This is a more ergonomic command to use, when using it directly eg:./run build
(macOS, Linux), ornu run build
(Windows).
- Rename
-
Added:
- Add binary target
giti
. This is an interactive git client that is tuified. It is a productivity tool for git workflows, and is meant as a replacement for directly usinggit
. This also serves as a real world example of using ther3bl_tuify
crate.- View all the
giti branch
subcommands (e.g.delete
,checkout
,new
, etc.) and select one subcommand using theselect_from_list()
whengiti branch
runs. - Delete one or more branches using
select_from_list()
whengiti branch delete
command runs.
- View all the
- Add binary target
edi
. This is a powerful TUI Markdown editor. You can use it to create new MD files, or edit any type of text file. It supports syntax highlighting for most file formats (though.toml
and.todo
are missing). - Add binary target
rc
akar3bl-cmdr
.
- Add binary target
This is part of a total reorganization of the r3bl-open-core
repo. This is a breaking
change for almost every crate in the repo. This
PR contains all the changes.
-
Updated:
- This release just uses the latest deps from
r3bl-open-core
repo, since so many crates have been reorganized and renamed. The functionality has not changed at all, just the imports.
- This release just uses the latest deps from
-
Removed:
- Move some of
term.rs
into:r3bl_core
- The functions to get the terminal window size and width.r3bl_ansi_color
- The functions to detect whether the current process is running in an interactive TTY or not.
- Move some of
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
- Updated:
- Make
clip_string_to_width_with_ellipsis
pub so that other crates can use it (eg:r3bl_terminal_async
). - Change the names of enums to be more readable.
IsTTYResult::IsTTY
->TTYResult::IsInteractive
.IsTTYResult::IsNotTTY
->TTYResult::IsNotInteractive
.
- Using latest deps for
r3bl_rs_utils_core
version0.9.13
, andr3bl_rs_utils_macro
version0.9.9
.
- Make
- Updated:
- Dependency updated
reedline
version0.28.0
,r3bl_rs_utils_core
version0.9.12
.
- Dependency updated
- Added:
- Add
tuify/src/constants.rs
with color constants.
- Add
-
Changed:
- Rename
run.nu
torun
. This simplifies commands to run it, eg:nu run build
, or./run build
. - Replace the
run
command withexamples
in therun
nushell script. To run an example you usenu run examples
. and provide instructions on therun
script at the top level folder of this monorepo. Updatelib.rs
andREADME.md
to reflect this change. The behavior of therun
nushell script is more uniform across all crates in this repo.
- Rename
-
Added:
- Add a new top level function
select_from_list_with_multi_line_header()
inpublic_api.rs
to allow for multi-line headers in the list selection menu. This allows ANSI formatted strings to be used in each header line.
- Add a new top level function
-
Fixed:
- In
select_from_list()
, themax_width_col_count
is now respected to limit the max width of the terminal window that is used.
- In
- Updated:
- Update dependency on
r3bl_rs_utils_core
to0.9.10
.
- Update dependency on
-
Updated:
- Update dependency on
reedline
crate to0.27.1
. - Update dependency on
r3bl_rs_utils_core
to0.9.9
.
- Update dependency on
-
Removed:
- Remove dependency on
r3bl_tui
crate.
- Remove dependency on
-
Changed:
- Change the default theme so that it is better looking and more readable on Mac, Linux, and Windows. Add many different themes to choose from.
-
Added:
Ctrl + c
now behaves just like theEscape
key. In the past, pressingCtrl + c
would do nothing the user could not exit the app by pressing this shortcut.- More code quality and ability to test the main event loop, by creating a new
TestVecKeyPressReader
struct, and abstracting theread()
(fromstdin
) into aKeyPressReader
trait. This is similar to what is done forTestStringWriter
(tostdout
).
- Updated:
- Upgrade all deps to their latest versions.
- Updated:
- Bug fix: #170
- Updated:
- Use the latest
r3bl_rs_utils_core
crate due to https://rustsec.org/advisories/RUSTSEC-2021-0139.html, andansi_term
not being maintained anymore.
- Use the latest
- Updated:
- Use the latest
r3bl_rs_utils_core
crate due to https://rustsec.org/advisories/RUSTSEC-2021-0139.html, andansi_term
not being maintained anymore.
- Use the latest
- Updated:
- Dependency on
simplelog
is replaced w/r3bl_simple_logger
(which is in ther3bl_rs_utils
repo workspace assimple_logger
).
- Dependency on
This is a major release that not only includes new functionality, but is a radical reorganization of the crates. The reason for paying down this technical debt now is to ensure that the codebase is easier to maintain and understand, and easier to add new features to in the future. The separation of concerns is now much clearer, and they reflect how the functionality is used in the real world.
Another huge change is the method signature of main_event_loop()
. This is a breaking
change, and it uses dependency injection, to provide an input device, output device,
state, and app to the function! This allows for new types of applications to be built,
which can carry state around between "applets".
This is part of a total reorganization of the r3bl-open-core
repo. This is a breaking
change for almost every crate in the repo. This
PR contains all the changes.
-
Added:
- Provide a totally new interface for the
main_event_loop()
that allows for more flexibility in how the event loop is run, using dependency injection. This is a breaking change, but it is needed to make the codebase more maintainable and possible to test end to end. This new change introduces the concept of providing some dependencies to the function itself in order to use it: state, input device, output device, and app. The function now returns these dependencies as well, so that they can be used to create a running pipeline of small "applets" where all of these dependencies are passed around, allowing a new generation of experiences to be built, that are not monolithic, but are composable and testable. - End to end test for the
main_event_loop_impl()
which tests everything in the TUI engine! 🎉 This feature has taken about 2 years and 7 months to implement (2024-10-07
)! This repo was created in2022-02-23
, which you can get usingcurl https://api.github.com/repos/r3bl-org/r3bl-open-core | jq .created_at
.
- Provide a totally new interface for the
-
Changed:
- Refactor lots of styling related code in preparation for the move to
core
. This will make it easier to maintain and test the codebase, and clean up the dependencies. - The latest version of
unicode-width
cratev2.0.0
changes the widths of many of the emoji. This requires lots of tests to be changed in order to work w/ the new constant width values.
- Refactor lots of styling related code in preparation for the move to
-
Removed:
- Move the
color_wheel
module intor3bl_core
crate. This is to ensure that it is possible to import just color wheel and lolcat related functionality without having to import the entirer3bl_tui
crate. And de-tangles the dependency tree, making it easier to maintain. The reason they ended up inr3bl_tui
in the first place is because it was easier to develop them there, but since then, lots of other consumers of this functionality have emerged, including crates that are created by "3rd party developers" (people not R3BL and not part ofr3bl-open-core
repo).
- Move the
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
-
Removed:
- Remove
get-size
crate fromCargo.toml
. This was causing some issues withRUSTSEC-2024-0370
.
- Remove
-
Added:
- Add
size-of
crate. - This new crate is used to calculate the size of structs in bytes.
- Change the implementations of many structs in the following modules:
editor_buffer
,dialog_buffer
,editor_component
,editor_engine
,color_wheel
,lolcat
, and following files:offscreen_buffer.rs
,main_event_loop.rs
.
- Add
-
Updated:
- Use the latest deps for all crates in
Cargo.toml
andCargo.lock
.
- Use the latest deps for all crates in
The biggest change in this release is rewriting the example runner using the latest
r3bl_terminal_async
crate, and dropping the use of reedline
crate (which is no longer
used to run the examples).
r3bl_terminal_async
is fully async and allows seamless creation of REPLs and shells. It
also supports pause and resume for spinners, along with many other features.
-
Updated:
- Change the main examples launcher (which you can run using
nu run examples
) so that it correctly handles raw mode transitions, and also correctly uses ther3bl_terminal_async
crate to ask the user for input (using "async readline"). - Drop dependency on
reedline
. User3bl_terminal_async
instead to get async readline capabilities. Update examples to use this new crate, and make example launcher easier to maintain.
- Change the main examples launcher (which you can run using
-
Fixed:
The biggest change in this release is the rewrite of the Markdown parser. This was done because the previous parser was not able to handle many corner cases in parsing complex fragments from a single line of text, which is common in Markdown. The new parser is exhaustively tested and is able to handle many more corner cases.
-
Fixed:
- Rewrite most of the Markdown parser and add exhaustive tests and lots of corner cases
which were not covered before. A lot of these issues were found by using the
edi
binary target for a few weeks as a Markdown editor. Here's the PR with these fixes.
- Rewrite most of the Markdown parser and add exhaustive tests and lots of corner cases
which were not covered before. A lot of these issues were found by using the
-
Updated:
- Fix docs (for docs.rs and README.md for github and crates.io).
- Fix clippy warnings.
- Make minor refactors and cleanups.
- Updated:
- Fix typos in
README.md
.
- Fix typos in
- Updated:
README.md
- Fix image loading problems on crates.io. The
README.md
is shown in crates.io, andlib.rs
is shown in docs.rs. - Clean up the content in the
README.md
file, and make it current, and updatelib.rs
to match.
- Fix image loading problems on crates.io. The
- Updated:
- Dependency changes inherited from
r3bl_rs_utils_core
version0.9.13
, andr3bl_rs_utils_macro
version0.9.9
. - Lots of clippy fixes.
- Dependency changes inherited from
- Updated:
- Dependency updated
reedline
version0.28.0
,r3bl_rs_utils_core
version0.9.12
.
- Dependency updated
- Added:
- Simple function
ColorWheel::lolcat_into_string()
that receives a string and colorizes it using some defaults. It is similar to theColorWheel::colorize_into_string()
which it uses under the hood, but it is simpler to use.
- Simple function
-
Changed:
- Rename
run.nu
torun
in thetui
folder. This simplifies commands to run it, eg:nu run build
, or./run build
. - Rename
run.nu
torun
in the top level folder as well. - Replace the
run
command withexamples
in therun
nushell script. To run an example you usenu run examples
. and provide instructions on therun
script at the top level folder of this monorepo. Updatelib.rs
andREADME.md
to reflect this change. The behavior of therun
nushell script is more uniform across all crates in this repo. - In
app.rs
, changeApp
trait functionapp_handle_signal()
to receive 2 new arguments:component_registry_map
, andhas_focus
. This makes it similar toapp_handle_input_event()
.
- Rename
-
Fixed:
- Editor component now cleans up state correctly after new content loads. This includes the undo/redo stack, and the render ops cache (for the content).
- Fix
tui/examples/demo/ex_pitch
example to correctly move back and forward between slides.
-
Added:
- Escape key now clears the selection.
- Ctrl+A now selects all text.
- Tests for
EditorComponent
for undo / redo history, text selection, and clipboard service. - Add tests to editor component for clipboard service.
-
Changed:
- Drop the use of Redux for state management entirely. Replace this with mutable state. And a new architecture for App and Component, that is more like Elm, rather than React and Redux.
- Async middleware functions no longer use Redux for propagating state transitions to
the app; instead, they now achieve this through async
tokio::mpsc
channels. Here's a design doc for this change. Here's the issue and PR for this change. Here are some videos that go over this massive change: - In the editor component, disable the syntect highlighter for the editor by default and just use the custom MD parser. For files that are not Markdown, we will probably need to enable syntect in the future since it is not covered by the custom MD parser & highlighter combo.
-
Fixed:
- Fix the custom MD parser so that it correctly parses plain text.
-
Added:
- Add undo, redo support for the editor component.
- Add binary target for
edi
which is going to be a Markdown editor similar tonano
ormicro
. It is meant to showcase what ther3bl_tui
crate can do. It is also meant to be a useful productivity tool. - Add function
colorize_into_string()
to make it easy to apply color wheel to a string and then convert it into an ANSI styled string that can be used to print to the terminal emulator. Also added conversion functionconvert_tui_color_into_r3bl_ansi_color()
to convert fromTuiColor
tor3bl_ansi_term::Color
. - In editor component, add support for caching rendered output of content. When the content changes, or the viewport size or window size change, the cache is invalidated. This is useful for performance reasons. It also leverages the undo/redo system for cache invalidation (which makes it fast to invalidate the render ops cache w/out having to do a content comparison to detect changes).
- Add lots of editor component tests for selection, content cache.
-
Updated:
- Update dependency on
reedline
crate to0.27.1
. - Update dependency on
r3bl_rs_utils_core
to0.9.10
. - Update dependency on
r3bl_rs_utils_macro
to0.9.8
.
- Update dependency on
- Changed:
- Replaced
arboard
crate withcopypasta-ext
.arboard
was not working well on macOS and Windows.- The
copypasta-ext
crate should fix the problem w/ dropping the clipboard contents when an app using the editor component exits.
- Added deps are upgraded to their latest versions.
- Changed
cargo.deny
so that it now acceptsISC
license.
- Replaced
- Added:
- Support for select, copy, cut, paste, and delete have been added to the editor component.
- Changed:
- Dropped support for
clipboard
crate. Usedarboard
instead which is actively maintained and supported by 1Password. New Github Actions have been added to ensure thatcargo-deny
is used in order to check for crates going unmaintained (along w/ license audit checks). There are known issues w/ this crate on Wayland & Arch. https://github.com/r3bl-org/r3bl-open-core/commit/3ba4ff821373361bedcd0b7185a4b6ba15b745c8
- Dropped support for
-
Changed:
- Dropped support for
palette
crate. Usecolorgrad
instead. More info here: #162
- Dropped support for
-
Updated:
- Upgraded all deps to their latest versions.
-
Changed:
- Switched to using
r3bl_ansi_color
to detect terminal color capabilities and color output and conversions. - Apply
#[serial]
on tests that mutate global variables to make those tests un-flaky. This was already being done inr3bl_ansi_color
, just bringing this over to ther3bl_tui
crate with this release.
- Switched to using
-
Removed:
- Dependency on
ansi_term
which is no longer maintained https://rustsec.org/advisories/RUSTSEC-2021-0139.html. - Needless dependencies on crates that are not used.
- Dependency on
- Added:
- Support for selecting text using keyboard.
- Support for copying text to clipboard using keyboard.
- Fixed:
- Main event loop was actually doing the wrong thing and blocking on the thread. Even though it
accepted an input event asynchronously using
AsyncEventStream
(EventStream
is provided bycrossterm
and built using tokio async streams), it was blocking this task (running in parallel on a thread) as it was waiting for the input event to be processed by the app. The fix allows the main thread to simply spawn a new task (in parallel, on a thread) to process the input event. Anmpsc
channel is used in order for the async work done to signal to the main thread that it should break out of its infinite loop.
- Main event loop was actually doing the wrong thing and blocking on the thread. Even though it
accepted an input event asynchronously using
- Added:
- Add
ColorSupport
as a way to detect terminal emulator capabilities at runtime. This uses theconcolor_query
crate to detect terminal emulator capabilities at runtime. - At the
RenderOps
level, updateto_crossterm_color()
so that it usesColorSupport
to determine the best color to use based on terminal emulator capabilities at runtime. It can automatically convert from truecolor to ANSI 256 to grayscale. Note that if a color is specified as truecolor, then it will automatically be downgraded. If it is specified as ANSI or grayscale then it will not be downgraded. - Add
ColorWheel
as a way to consolidate all gradient related coloring. Gradients can be specified in truecolor, ANSI 256, or grayscale. TheColorWheel
will automatically use the correct colors based on the terminal emulator capabilities at runtime usingColorSupport
. - Add new Markdown parser written using
nom
crate calledparse_markdown()
.- This parser not only parses regular Markdown but it also supports R3BL extensions for notes (metadata: tags, title, authors, date).
- And it also supports smart lists (ordered and unordered). Smart lists also have support for todos (in the form of checked and unchecked items).
- Add a new syntax highlighting engine for the new Markdown parser, in the
EditorComponent
calledtry_parse_and_highlight()
.- It formats headings using different gradients for each heading levels 1-6. It also has elegant fallbacks for ANSI256 and grayscale.
- It formats metadata (tags, title, authors, date) using different fg and bg colors.
- Smart lists are formatted using different fg and bg colors. Ordered and unordered lists are formatted differently. Checked and unchecked items are formatted differently.
- For code blocks, the
syntect
crate is used to do syntax highlighting based on the correct language of the code block. Since the R3BL themer3bl.tmTheme
specifies colors in truecolor, they will automatically be downgraded to ANSI256 or grayscale based on terminal emulator capabilities at runtime thanks toto_crossterm_color()
.
- To make console log debugging nicer, some new traits have been added
ConsoleLogInColor
,PrettyPrintDebug
. These traits work together. If a struct implementsPrettyPrintDebug
then it gets the implementation ofConsoleLogInColor
for free (which gives it the ability to print using fg and bg colors to the console).
- Add
- Fixed:
- Bug when trying to render an app that's taller than the offscreen buffer / terminal height
-
Added:
- First changelog entry.
- Remove dependency on ansi-parser crate: issue.
- Make lolcat code better: issue.
- Add
ColorSupport
as a way to detect terminal emulator capabilities at runtime. - Add
ColorWheel
as a way to consolidate all gradient related coloring. UseColorSupport
as a way to fallback from truecolor, to ANSI 256, to grayscale gracefully based on terminal emulator capabilities at runtime.
- Add
- Provide for ANSI 256 color fallback for MacOS terminal app: issue
-
Removed:
- Removed lolcat example from demo.
-
Changed:
- The first demo example (
ex_app_no_layout
) now has support for animation. It automatically increments the state every second and the gradient color wheel is updated accordingly.
- The first demo example (
This is a major release that does not include any new functionality, but is a radical
reorganization & rename of the crate, it used to be
r3bl_rs_utils_core
.
The r3bl-open-core
repo was started in 2022-02-23
, about 2 years, 7 months ago, (which
you can get using curl https://api.github.com/repos/r3bl-org/r3bl-open-core | jq .created_at
). We have learned many lessons since then after writing about 125K lines of
Rust code.
And it is time to pay down the accrued technical debt, to ensure that the codebase is easier to maintain and understand, and easier to add new features to in the future. The separation of concerns is now much clearer, and they reflect how the functionality is used in the real world.
-
Removed:
- Remove the dependency on
r3bl_simple_logger
and archive it. You can read the details in its CHANGELOG entry. Tokio tracing is now used under the covers. - Remove all the functions like
log_debug
,log_info
, etc. and favor directly using tokio tracing macros for logging, eg:tracing::debug!
,tracing::info!
, etc.
- Remove the dependency on
-
Changed:
- Rename the
debug!
macro, which is confusing, since it clashes with logging, toconsole_log!
. This macro is used in many places in the codebase for quick formatted output to console (viaeprintln!
). The code to format the output is in theconsole_log_impl.rs
file. - Reorganize the
src
folder to make sure that there aren't any top level files, and that everything is in a module. This is to make it easier to add new modules in the future. - The latest version of
unicode-width
cratev2.0.0
changes the widths of many of the emoji. This requires lots of tests to be changed in order to work w/ the new constant width values.
- Rename the
-
Added:
- Simplify the actual logging API into a single function, and allow use of tokio
tracing, macros for for logging, eg:
tracing::debug!
,tracing::info!
, etc. Seelogging_api.rs
for more details. - Move the
color_wheel
module intor3bl_core
crate. This is to ensure that it is possible to import just color wheel and lolcat related functionality without having to import the entirer3bl_tui
crate. And de-tangles the dependency tree, making it easier to maintain. The reason they ended up inr3bl_tui
in the first place is because it was easier to develop them there, but since then, lots of other consumers of this functionality have emerged, including crates that are created by "3rd party developers" (people not R3BL and not part ofr3bl-open-core
repo). - Move the
kv.rs
module intostorage
from thenazmulidris/rust-scratch/tcp-api-server
repo. This provides an in-memory / in-process key value store that is built on top ofsled
. This eliminates the need to use files to save / load data. - Move the
miette_setup_global_report_handler.rs
from thenazmulidris/rust-scratch/tcp-api-server
repo. This allows customization of the miette global report handler at the process level. Useful for apps that need to override the default report handler formatting. - Add
OutputDevice
that abstracts away the output device (eg:stdout
,stderr
,SharedWriter
, etc.). This is useful for end to end testing, and adapting to a variety of different input and output devices (in the future). Support for this is provided inr3bl_test_fixtures
. - Add
InputDevice
that abstracts away the input device (eg:stdin
). This is useful for end to end testing. This is useful for end to end testing, and adapting to a variety of different input and output devices (in the future). Support for this is provided inr3bl_test_fixtures
.- Moved:
- Move some code from
r3bl_tuify
'sterm.rs
intor3bl_core
. This module provides a simple API to detect the size of a terminal window and its width.
- Simplify the actual logging API into a single function, and allow use of tokio
tracing, macros for for logging, eg:
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
- Added:
- Initial support structs for use by
r3bl-base
andr3bl-cmdr
.
- Initial support structs for use by
This is a major release that does not include any new functionality, but is a radical
reorganization & rename of the crate, it used to be
r3bl_rs_utils_macro
.
The r3bl-open-core
repo was started in 2022-02-23
, about 1 year, 7 months, and 11 days
ago, (which you can get using curl https://api.github.com/repos/r3bl-org/r3bl-open-core | jq .created_at
). We have learned many lessons since then after writing about 125K lines
of Rust code.
And it is time to pay down the accrued technical debt, to ensure that the codebase is easier to maintain and understand, and easier to add new features to in the future. The separation of concerns is now much clearer, and they reflect how the functionality is used in the real world.
This PR contains all the changes.
Changed:
- The name of this repo used to be
r3bl_rs_utils_macro
. - The modules and functions in this crate which are used (by other crates in this monorepo)
are left unchanged. Only the unused modules and functions are moved to the
r3bl-open-core-archive
repo.
Deleted:
- Move all the unused modules and functions to the
r3bl-open-core-archive
repo.
This is part of a total reorganization of the r3bl-open-core
repo. This is a breaking
change for almost every crate in the repo. This
PR contains all the changes.
-
Changed:
- Some type aliases were defined here redundantly, since they were also defined in
r3bl_core
crate. Remove these duplicate types and add a dependency tor3bl_core
crate.
- Some type aliases were defined here redundantly, since they were also defined in
-
Added:
- Add ability for
StdoutMock
to be turned into anOutputDevice
struct for mocks that are needed in tests. This is done via theOutputDeviceExt
trait that is implemented forOutputDevice
, which adds this method:OutputDevice::new_mock()
. - Add ability for
mod@async_input_stream
to be turned into anInputDevice
struct for mocks that are needed in tests. This is done via theInputDeviceExt
trait that is implemented forInputDevice
, which adds this method:InputDevice::new_mock(vec![])
.
- Add ability for
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
This release adds a new function to create an async stream that yields results (from a vec) at a specified interval. This is useful for testing async functions that need to simulate a stream of events with a delay.
-
Added:
- Add
gen_input_stream_with_delay()
to create an async stream that yields results (from a vec) at a specified interval. This is useful for testing async functions that need to simulate a stream of events with a delay. - Add more tests.
- Add
-
Misc:
- The async_cancel_safe example repo now uses this crate. Here's a tutorial about it.
This is the first release of this crate. It is a top level crate in the r3bl-open-core
that is meant to hold all the test fixtures for all the other crates in this monorepo. It
primarily tests input events coming from user input via keyboard and mouse (eg: crossterm
events). And it tests output that is sent to stdout
which it mocks. Here are all the
links for this release: crates.io,
docs.rs,
GitHub.
- Added:
- Add a new top level crate in the
r3bl-open-core
monorepo calledr3bl_test_fixtures
. This is to make it easier to maintain and test the fixtures and allow all the other crates in this monorepo to use them. These fixtures are migrated fromr3bl_terminal_async
crate, where they were gestated, before being graduated for use by the entire monorepo.
- Add a new top level crate in the
This is a major version upgrade and potentially a breaking change if you use the tracing modules in this crate. This PR contains all the changes.
-
Added:
- Add tests to ensure that the tracing module works as expected. This includes using the
assert_cmd
trait to test the output of a test binary that is run as a subprocess. Ensure that stdout and stderr are captured and can be tested for correctness. Also ensure thatSharedWriter
works as expected. Also ensure that file log output works as expected.
- Add tests to ensure that the tracing module works as expected. This includes using the
-
Changed:
- Refactor the tracing and Jaeger related code into 2 separate modules. This is laying
the groundwork for these modules to be moved into
r3bl_core
crate. Radically simplify the tracing configuration design and init mechanisms, so they are easy to understand, use, and maintain. - Introduce the use of
InputDevice
andOutputDevice
to make it consistent withr3bl_tui
crate on how DI is used to provide input and output devices. The input device provides a way to get user input events from stdin (or from a test fixture). The output device provides a way to output to stdout (or to a test fixture). Replace the use of type aliases with the actual structs fromr3bl_core
crate.
- Refactor the tracing and Jaeger related code into 2 separate modules. This is laying
the groundwork for these modules to be moved into
-
Deleted:
- Move the Jaeger tracing module to the
tcp-api-server
crate in therust-scratch
repo. This wasn't really used anywhere else. Also remove all the OpenTelemetry related dependencies from this crate. - Move the tracing module into the
r3bl_core
crate, in the mono repo.
- Move the Jaeger tracing module to the
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
The biggest change in this release is complete support for pause and resume. Now when the output is paused, input is also paused, with the exception of allowing Ctrl+C and Ctrl+D through.
The second big change is how spinners now work. Once a spinner is started, Ctrl+C and Ctrl+D are directed to the spinner, to cancel it. Spinners can also be checked for completion or cancellation by long running tasks, to ensure that they exit as a response to user cancellation.
The third (and final) change is that TerminalAsync::try_new()
now accepts prompts that
can have ANSI escape sequences in them. By using r3bl_rs_utils_core::StringLength
to
calculate the display width of strings containing ANSI escape sequences (by memoizing the
results of the calculations), the cost of repeatedly calculating this display width is
almost eliminated.
Here's the PR with all the code related to this release.
-
Added:
- Add support to extend pause and resume functionality to the entire crate. Now, when the output is paused, for eg, when the spinner is running, then the input to the readline is also stopped, until output is resumed. This wasn't the case in the past, and it was possible to type and update the prompt while the output was paused.
- Add user cancellation support for spinners. Once a spinner is started,
Ctrl+C and Ctrl+D are directed to the spinner, to cancel it.
Spinners can also be checked for completion or cancellation by long running tasks, to
ensure that they exit as a response to user cancellation. Update the
examples/terminal_async.rs
to show how to best use this new feature. - Add better examples for how to use
TerminalAsync::try_new()
in Rust docs. - Add a new example
async_shell.rs
to demonstrate how to useTerminalAsync
to create an interactive shell (withbash
under the covers) that can orchestrate a shell asynchronously usingtokio::process
.
-
Changed:
- Clean up the shutdown mechanism for
TerminalAsync
andReadline
so that it is automatic, and doesn't require the use ofclose()
anymore. By simply dropping theReadline
instance, it will automatically clean up after itself (and correctly handle raw mode entry and exit).
- Clean up the shutdown mechanism for
This minor release just updates the r3bl_test_fixtures
crate to version 0.0.2
which
adds a new function to create an async stream that yields results (from a vec) at a
specified interval.
- Changed:
- Bump dependency on
r3bl_test_fixtures
to version0.0.2
.
- Bump dependency on
This release migrates the test fixtures out of this crate and into a new top level crate
in the r3bl-open-core
monorepo called r3bl_test_fixtures
. This is to make it
easier to maintain and test the fixtures and allow all the other crates in this monorepo
to use them. Here are all the links for this release:
crates.io,
docs.rs,
GitHub.
-
Changed:
- Remove the test fixtures out of this crate and into a new top level crate in the
r3bl-open-core
monorepo calledr3bl_test_fixtures
. This is to make it easier to maintain and test the fixtures and allow all the other crates in this monorepo to use them.
- Remove the test fixtures out of this crate and into a new top level crate in the
-
Added:
- Add
r3bl_test_fixtures
version0.0.1
as adev-dependency
to this crate.
- Add
This release adds a new module for checking port availability on a host, and adds a new function to clean up the prompt when the CLI exits. It also adds a new module to allow for OpenTelemetry (OTel) tracing to be added to the tracing setup. This uses the latest version of Jaeger and OpenTelemetry.
-
Added:
- New module to check for port availability on a host called
port_availability
. This is useful for checking if a port is available before starting a server (which is a common use case for interactive CLI programs). - Add
TerminalAsync::print_exit_message()
- This cleans the prompt so it doesn't linger in the display output. This is intended to be used as the final display message when the CLI exits. - For greater flexibility
tracing_setup.rs
try_create_layers(..)
now returns aVec<Layer>
. This allows for more flexibility in the future to add more layers to the tracing setup, such as adding an OTel (OpenTelemetry) layer, or a Jaeger layer, etc. - Add
jaeger_setup
module, to allow OTel layer to be added to the tracing setup. It uses the latest version of Jaeger and OpenTelemetry. The docs intokio.rs
website (at the time of this writing) are out of date and use version0.16.0
ofopentelemetry-jaeger
crate who's exporter component has already been deprecated and will be removed soon. Details are in PR 326. More info in this blog post.
- New module to check for port availability on a host called
-
Changed:
try_create_layers(..)
also adds a level filter layer to the layers it returns. This is to ensure that the log level is set correctly for the log output, even if other layers (like the OTel / Jaeger) layer are sandwiched later. This is a minor change that should not affect the public API. Details are in PR 326.
- Changed:
- Rewrite the
tracing_setup.rs
file so that it is easier to understand and maintain. The creation of multiple layers in tracing is now streamlined with no code redundancy. Ther3bl_terminal_async::tracing_writer_config::Writer
is renamed tor3bl_terminal_async::WriterArg
. This is minor change that should only affectclap
configuration in CLI programs that use this. Use the best practices from the tokio tracing docs here as inspiration for this change.
- Rewrite the
-
Changed:
- Simplify
SpinnerRenderer
so that it is no longer a trait. Replace with plain functions receive a mutable ref to aSpinnerStyle
. This trait just added more noise, making it more difficult to grok what this code does. SharedWriter
now silently ignores errors onwrite()
for all cloned instances. Only the very first instance will return an error. This is to prevent needless error messages being displayed when using tokio tracing. This default behavior can easily be overridden by setting thesilent_error
field tofalse
in theSharedWriter
struct. Added tests for this as well.
- Simplify
-
Added:
ReadlineEvent::Resized
is a new variant that reports when the terminal has been resized. This is a feature request from here.SharedWriter
now has a constructornew(...)
so that it is easier to create a new instance of it.
- Changed:
- Refactor `TracingConfig`` with better expression of display preference:
- Require a
SharedWriter
forTracingConfig
(no longer optional). - Fix log filename bug (now file extensions are used when supplied).
- Redo
TracingConfig
with better expression of display preference (stdin
,stdout
,SharedWriter
).
- Require a
- Update example
examples/terminal_async.rs
to use thetracing_setup::init
and provide a realTracingConfig
struct, which outputs logs to display (SharedWriter
) and file.
- Refactor `TracingConfig`` with better expression of display preference:
- Changed:
- Remove use of
TokioMutex
. There are some dangers to being "cancel safe" when using async Rust. This is outlined in the following: docs, and video. It is better to avoid using aTokioMutex
to check for cancellation and instead to use broadcast channel for shutdown signals, just like the code already does. The changes made in this release are related to removing the use ofTokioMutex
all together in favor of theStdMutex
since there is really no need to use it at all. And thus avoid any potential of "cancel safe" errors cropping up!
- Remove use of
- Updated:
- Minor refactoring to remove the use of
JoinHandle::abort()
and replace it with a tokio broadcast channel to signal tasks to stop. This is a more graceful, flexible, and powerful way to stop tasks that are running in parallel. This change is applied tospinner.rs
andreadline.rs
. The public API remains exactly the same.
- Minor refactoring to remove the use of
This is the first release of this crate.
- Added:
- A new crate in this repo that allows for async terminal input and output. This is useful for building TUIs that are async and can handle input and output in parallel. To build apps that are not full TUI, this is a great option to create interactive CLIs and REPLs that are fully async and multithreaded (with input and output) with a really powerful (multi) line editor and prompt.
This is part of a total reorganization of the r3bl-open-core
repo. This is a breaking
change for almost every crate in the repo. This
PR contains all the changes.
- Added:
- Move code from
r3bl_core
'sterm.rs
to detect whetherstdin
,stdout
,stderr
is interactive. This has a dependency on the standard library, and notcrossterm
anymore. The API exposed here is ergonomic, and returns anenum
rather thanbool
, which make it easier to use and understand.
- Move code from
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
- Updated:
- Upgrade all deps to their latest versions.
-
Added:
- Support for
Grayscale
color output. This is in preparation of making the color support work across all platforms (MacOS, Linux, Windows). And use this in ther3bl_tui
crate. Update tests to reflect this.
- Support for
-
Removed:
- Dependency on
once-cell
removed by replacingArc<Mutex<_>>
withunsafe
andAtomicI8
.
- Dependency on
-
Added:
- Tests.
-
Replaced:
justfile
is now replaced withnu
scriptrun.nu
.
This crate is now renamed to r3bl_macro
to make it consistent with the naming for all
crates in this repo. Please look at the r3bl_macro
for more details.
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
- Updated:
- Use the latest
r3bl_rs_utils_core
version0.9.13
.
- Use the latest
- Updated:
- Use latest
r3bl_rs_utils_core
version0.9.10
. Remove unused dependencies, and update to the latest ones.
- Use latest
- Updated:
- Upgrade all deps to their latest versions.
- Updated:
- Update
r3bl_rs_utils_core
crate due to https://rustsec.org/advisories/RUSTSEC-2021-0139.html, andansi_term
not being maintained anymore.
- Update
- Updated:
- Dependency on
simplelog
is replaced w/r3bl_simple_logger
(which is in ther3bl_rs_utils
repo workspace assimple_logger
).
- Dependency on
This crate is now renamed to r3bl_core
to make it consistent with the naming for all
crates in this repo. Please look at the r3bl_core
for more details.
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
-
Removed:
- Remove
get-size
crate fromCargo.toml
. This was causing some issues withRUSTSEC-2024-0370
.
- Remove
-
Added:
- Add
size-of
crate. - This new crate is used to calculate the size of structs in bytes
(eg:
Vec<UnicodeString>
which is on the heap). - Change the implementations of many structs in the following modules:
tui_core
. - Add
common_math.rs
tocommon
module, to make it easy to format numbers with commas. This is useful for displaying size in bytes or kilobytes, etc. in log output messages.
- Add
-
Updated:
- Use the latest deps for all crates in
Cargo.toml
andCargo.lock
.
- Use the latest deps for all crates in
The main additions to this release are the StringLength
enum, the timed!()
macro, and
the ok!()
macro.
- Added:
- New enum
StringLength
that can be used to calculate the length of strings that have ANSI escape sequences in them. It also usesUnicodeWidth
to calculate the "display" width of the (stripped) string. It also memoizes the result so that it is fast to calculate the length of the same string multiple times. This is used in ther3bl_terminal_async
crate. It also has a method to calculate the SHA256 hash of a givenString
, and return it as au8
. - New declarative macro
timed!()
that measures the time the given expression takes to run usingtime::Instant::now()
. If you usetimed!($expr)
then it will return a tuple of($expr, duration)
. - New declarative macro
ok!()
that is just syntactic sugar forOk(())
. If you useok!($expr)
then it will returnOk($expr)
. - Here's the PR with all the code related to this release.
- New enum
- Changed:
- Removed
syntect
dep. - Rename
Style
toTuiStyle
. - Lots of cargo clippy fixes.
- Removed
- Added:
- Add
generate_friendly_random_id()
to generate human readable and friendly IDs.
- Add
- Added:
- Add more variants to the
CommonErrorType
enum:ConfigFolderCountNotBeCreated
,ConfigFolderPathCouldNotBeGenerated
.
- Add more variants to the
- Updated:
- Upgrade all the deps to their latest versions:
serde
version1.0.190
. Propagate this to all the other crates in ther3bl-open-core
repo, and bump their version numbers: e.g.tuify
,macro
,tui
,cmdr
.
- Upgrade all the deps to their latest versions:
- Updated:
- Upgrade all deps to their latest versions.
- Updated:
- Upgrade all deps to their latest versions.
- Updated:
- Dependency on
simple_logger
updated due to this security advisory https://rustsec.org/advisories/RUSTSEC-2021-0139.html.simple_logger
itself had to dropansi_term
.
- Dependency on
-
Removed:
- Dependency on
ansi_term
is dropped due to this security advisory https://rustsec.org/advisories/RUSTSEC-2021-0139.html. Flagged when running CI/CD job on Ockam repo.
- Dependency on
-
Updated:
- Documentation for
r3bl_simple_logger
crate. And how to think about it vs. using log facilities from ther3bl_rs_utils_core
crate. Update docs there too.
- Documentation for
- Updated:
- Dependency on
simplelog
is replaced w/r3bl_simple_logger
(which is in ther3bl_rs_utils
repo workspace assimple_logger
). TuiColor
has a few new variants. They can beRgbValue
,AnsiValue
, orANSIBasicColor
. It is safe to use justRgbValue
since the library will degrade gracefully to ANSI 256 or grayscale based on terminal emulator capabilities at runtime (provided byto_crossterm_color()
andColorSupport
). If a color is specified asAnsiValue
orANSIBasicColor
then it will not be downgraded.
- Dependency on
- Added:
- First changelog entry.
- Move lolcat into
tui_core
crate.
- Removed:
- ANSI escape sequences are no longer used internally in any intermediate format used by the TUI engine. It is reserved exclusively for output to stdout using (for now) crossterm. This opens the door for future support for GUI app (not just terminal emulators).
This crate has been moved into the r3bl-open-core-archive repo for archival purposes. It is no longer maintained. This crate was only added to this mono repo since it had become unmaintained. We now use tokio tracing, so this is no longer required.
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
- Updated:
- Upgrade all deps to their latest versions.
- Updated:
- Upgrade all deps to their latest versions.
-
Replaced:
- Dependency on
ansi_term
is dropped due to this security advisory https://rustsec.org/advisories/RUSTSEC-2021-0139.html. Replaced withr3bl_ansi_color
.
- Dependency on
-
Added:
- Documentation for
r3bl_simple_logger
crate. And how to think about it vs. using log facilities from ther3bl_rs_utils_core
crate. Update docs there too.
- Documentation for
- Added:
This crate has been moved into the r3bl-open-core-archive repo for archival purposes. It is no longer maintained. The redux pattern was removed from the TUI engine in 2024, in favor of "Elm style" or "signals" based architecture.
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
-
Removed:
- Remove
get-size
crate fromCargo.toml
. This was causing some issues withRUSTSEC-2024-0370
.
- Remove
-
Updated:
- Use the latest deps for all crates in
Cargo.toml
andCargo.lock
.
- Use the latest deps for all crates in
- Updated:
- Upgrade all deps to their latest versions.
- Updated:
- Dependency on
r3bl_rs_utils_core
&r3bl_rs_utils_macro
crates due to https://rustsec.org/advisories/RUSTSEC-2021-0139.html, andansi_term
not being maintained anymore.
- Dependency on
-
Updated:
- Dependency on
simplelog
is replaced w/r3bl_simple_logger
(which is in ther3bl_rs_utils
repo workspace assimple_logger
).
- Dependency on
-
Removed:
- Dependency on
ansi_term
which is no longer maintained https://rustsec.org/advisories/RUSTSEC-2021-0139.html. - Needless dependencies on crates that are not used.
- Dependency on
This crate has been moved into the r3bl-open-core-archive repo for archival purposes. It is no longer maintained.
- Updated:
- Upgrade all deps to their latest versions in
Cargo.toml
andCargo.lock
. - Improve docs in
lib.rs
andREADME.md
.
- Upgrade all deps to their latest versions in
-
Updated:
- Add single dependency on
r3bl_rs_utils_core
version0.9.10
.
- Add single dependency on
-
Removed:
- Remove all the unnecessary dependencies from
Cargo.toml
. - Remove all unnecessary
dev-dependencies
fromCargo.toml
.
- Remove all the unnecessary dependencies from
-
Moved:
- All the source code from the top level folder of the
r3bl-open-core
repo into theutils
sub folder. The crater3bl_rs_utils
used to reside at the top level folder of this repo. It has been moved into theutils
sub folder. At the top level, only a workspace remains to link all the contained crates together for efficient builds.
- All the source code from the top level folder of the
- Updated:
- Upgrade all deps to their latest versions (including
r3bl_tui
w/ latest copy, paste, cut, delete support).
- Upgrade all deps to their latest versions (including
- Updated:
- Upgraded
r3bl_tui
to latest version.
- Upgraded
- Forgot to update the r3bl_tui dependency in Cargo.toml.
- Updated:
- Upgrade all deps to their latest versions.
- Updated:
- Upgrade all deps to their latest versions.
- Changes:
- Use latest dependencies on the
r3bl_rs_utils
repo. Lots of needless dependencies have been dropped. - Drop
ansi_term
dependency due to security advisory https://rustsec.org/advisories/RUSTSEC-2021-0139.html.
- Use latest dependencies on the