BlueGit

timfa posprint

Files

posprint / .cursor / rules / development.mdc

development.mdc

development.mdc 1.7 KiB Download Raw
1---
2description: posprint development conventions
3globs: **/*
4alwaysApply: true
5---
6
7# posprint development rules
8
9## Language and dependencies
10
11- Single language: **Rust** with **egui** (eframe) for the UI.
12- Prefer std library and in-house code. Add a crate only when reimplementing would be unreasonable (e.g. `serialport`, `serde`, `image`, UI framework).
13- ESC/POS encoding lives in `src/escpos.rs` — do not add the `escpos` crates.io package.
14- Printing: **USB-serial only** in v0.1.x. No Bluetooth or USB printer-class until explicitly requested.
15
16## Testing
17
18- **Every module must have unit tests** in `#[cfg(test)] mod tests` (or `tests/` for integration).
19- New behaviour requires new tests in the same commit.
20- Run `cargo test` before merging; all tests must pass.
21- Use `MockTransport` for printer I/O in tests; never require hardware in CI.
22
23## Branches and commits
24
25- Default branch: `master`.
26- Use `feature/` or `fix/` branches for changes.
27- Commit frequently with focused messages; avoid one large commit at the end.
28- Merge to `master` only after `cargo test` is green.
29
30## Documentation
31
32- See `.cursor/rules/documentation.mdc` for full doc-sync rules.
33- Keep `docs/HELP.md` in sync with supported DSL and UI features.
34- The in-app Help tab must mirror `docs/HELP.md` (via `include_str!` in `src/lib.rs`).
35- Update `docs/ARCHITECTURE.md`, `docs/PRINTING.md`, etc. when implementation diverges from design.
36
37## Releases
38
39- GitLab CI (`.gitlab-ci.yml`) runs tests on push.
40- Tagged releases produce Windows `.exe`, Debian `.deb` (apt), and Arch `.pkg.tar.zst` (pacman).
41- Debian packages use `cargo-deb` and `[package.metadata.deb]` in `Cargo.toml`.
42- Arch packages use `packaging/arch/PKGBUILD` and `makepkg`.