Krolyxon
Commit 6efefdd

Branches

Tags

Refs →

bench516efefdd

Merge pull request #5 from krolyxon/tui-crate

Move the TUI into crates/bench51-tui
Author
K
Date
2026-11-01 10:29 +0530
Committer
GitHub · 2026-11-01 10:29 +0530
Parents
8756c54 43502f8
Commit
6efefddb77a371612c1851a8dc81fdbd92165e61

+42 −35

11 files changed

  1. M .github/workflows/release.yml +1 −1
  2. M CHANGELOG.md +3 −0
  3. M Cargo.lock +10 −10
  4. M Cargo.toml +2 −16
  5. M README.md +7 −7
  6. A crates/bench51-tui/Cargo.toml +18 −0
  7. R src/main.rs → crates/bench51-tui/src/main.rs +1 −1
  8. R src/ui/app.rs → crates/bench51-tui/src/ui/app.rs +0 −0
  9. R src/ui/draw.rs → crates/bench51-tui/src/ui/draw.rs +0 −0
  10. R src/ui/mod.rs → crates/bench51-tui/src/ui/mod.rs +0 −0
  11. R src/ui/syntax.rs → crates/bench51-tui/src/ui/syntax.rs +0 −0
M .github/workflows/release.yml View
@@ -65,7 +65,7 @@ jobs:
6565 key: ${{ matrix.target }}
6666
6767 - name: Build
68− run: cargo build --release --locked --target ${{ matrix.target }} -p bench51 -p bench51-gui
68+ run: cargo build --release --locked --target ${{ matrix.target }} -p bench51-tui -p bench51-gui
6969
7070 - name: Package
7171 shell: bash
M CHANGELOG.md View
@@ -19,6 +19,9 @@ All notable changes to bench51. The format follows
1919 ### Changed
2020
2121 - Theme moved from the View menu to Settings.
22+- The terminal app moved from `src/` to `crates/bench51-tui` (package
23+ `bench51-tui`, binary still `bench51`); the repository root is now a
24+ plain workspace. From source: `cargo install --path crates/bench51-tui`.
2225
2326 ### Fixed
2427
M Cargo.lock View
@@ -483,16 +483,6 @@ version = "0.22.1"
483483 source = "registry+https://github.com/rust-lang/crates.io-index"
484484 checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
485485
486−[[package]]
487−name = "bench51"
488−version = "0.2.0"
489−dependencies = [
490− "bench51-core",
491− "clap",
492− "ratatui",
493− "ratatui-textarea",
494−]
495−
496486 [[package]]
497487 name = "bench51-core"
498488 version = "0.2.0"
@@ -509,6 +499,16 @@ dependencies = [
509499 "serde",
510500 ]
511501
502+[[package]]
503+name = "bench51-tui"
504+version = "0.2.0"
505+dependencies = [
506+ "bench51-core",
507+ "clap",
508+ "ratatui",
509+ "ratatui-textarea",
510+]
511+
512512 [[package]]
513513 name = "bit-set"
514514 version = "0.5.3"
M Cargo.toml View
@@ -1,5 +1,6 @@
11 [workspace]
2−members = ["crates/*"]
2+resolver = "3"
3+members = ["crates/bench51-core", "crates/bench51-tui", "crates/bench51-gui"]
34
45 [workspace.package]
56 version = "0.2.0"
@@ -12,21 +13,6 @@ unsafe_code = "forbid"
1213 bench51-core = { path = "crates/bench51-core" }
1314 clap = { version = "4.5.54", features = ["derive"] }
1415
15−[package]
16−name = "bench51"
17−version.workspace = true
18−edition.workspace = true
19−description = "A TUI Intel 8051 assembler, simulator and debugger"
20−
21−[dependencies]
22−bench51-core.workspace = true
23−clap.workspace = true
24−ratatui = "0.30"
25−ratatui-textarea = "0.9"
26−
27−[lints]
28−workspace = true
29−
3016 # egui and wgpu are unusably slow without optimisation; keep our own crates
3117 # quick to rebuild.
3218 [profile.dev.package."*"]
M README.md View
@@ -120,7 +120,7 @@ Prebuilt binaries cover Linux (x86_64, aarch64), Windows (x86_64) and macOS
120120
121121 ```bash
122122 cargo install --locked --git https://github.com/krolyxon/bench51 bench51-gui # the desktop app
123−cargo install --locked --git https://github.com/krolyxon/bench51 bench51 # the terminal app
123+cargo install --locked --git https://github.com/krolyxon/bench51 bench51-tui # the terminal app (bench51)
124124 ```
125125
126126 ## Usage
@@ -288,7 +288,7 @@ Letter shortcuts work too, for terminals that swallow function keys:
288288
289289 ```bash
290290 cargo run --release -p bench51-gui # the desktop app
291−cargo run --release -p bench51 # the terminal app
291+cargo run --release -p bench51-tui # the terminal app
292292 cargo test --workspace # assembler, CPU, peripheral, session and example-program tests
293293 cargo clippy --workspace --all-targets
294294 ```
@@ -305,12 +305,12 @@ every target. It publishes the archives and `SHA256SUMS` with that
305305 changelog section as the release notes, then installs the result with the
306306 one-liners on Linux, macOS and Windows.
307307
308−Code layout:
308+Code layout, one crate per part under `crates/`:
309309
310−- `crates/bench51-gui/` is the `bench51-gui` desktop app (egui).
311−- `src/` is the `bench51` terminal app (ratatui), including headless
312− assembly.
313−- `crates/bench51-core/`, shared by both: `isa.rs` (opcode table), `asm/`
310+- `bench51-gui/` builds the `bench51-gui` desktop app (egui).
311+- `bench51-tui/` builds the `bench51` terminal app (ratatui), including
312+ headless assembly.
313+- `bench51-core/`, shared by both: `isa.rs` (opcode table), `asm/`
314314 (assembler, listing, Intel HEX), `sim/` (CPU, peripherals, disassembler),
315315 `session.rs` (build, run, step and breakpoints), `syntax.rs`
316316 (highlighting tokens), `files.rs` (HEX loading)
A crates/bench51-tui/Cargo.toml View
@@ -0,0 +1,18 @@
1+[package]
2+name = "bench51-tui"
3+version.workspace = true
4+edition.workspace = true
5+description = "A TUI Intel 8051 assembler, simulator and debugger"
6+
7+[[bin]]
8+name = "bench51"
9+path = "src/main.rs"
10+
11+[dependencies]
12+bench51-core.workspace = true
13+clap.workspace = true
14+ratatui = "0.30"
15+ratatui-textarea = "0.9"
16+
17+[lints]
18+workspace = true
R src/main.rs → crates/bench51-tui/src/main.rs View
@@ -8,7 +8,7 @@ use clap::Parser;
88
99 /// Intel 8051 assembler, simulator and TUI debugger.
1010 #[derive(Parser, Debug)]
11−#[command(version, about)]
11+#[command(name = "bench51", version, about)]
1212 struct Args {
1313 /// Assembly source (.asm) or Intel HEX (.hex) file to open.
1414 file: Option<PathBuf>,
R src/ui/app.rs → crates/bench51-tui/src/ui/app.rs View

[No content changes]

R src/ui/draw.rs → crates/bench51-tui/src/ui/draw.rs View

[No content changes]

R src/ui/mod.rs → crates/bench51-tui/src/ui/mod.rs View

[No content changes]

R src/ui/syntax.rs → crates/bench51-tui/src/ui/syntax.rs View

[No content changes]