kicad-ipc-rs/docs/book
Milind Sharma d9644312ef
refactor: modularize client API and finalize v10 assessment follow-ups (#25)
* feat: bump vendored KiCad protos to v10.0.0

* test: add protocol contract tests for board layer name

* docs: overhaul README and guide site

- Rewrite README with punchy opening, realistic examples, and cleaner structure
- Update status to Beta and version numbers to 0.4.1
- Remove redundant sections (roadmap, future work, guide site link)
- Simplify API matrix by removing redundant Status column
- Add CONTRIBUTING.md header with welcoming message
- Expand mdBook examples with real-world patterns:
  - PCB analysis (unconnected nets, footprints)
  - Automation (text variables, test points)
  - CI/CD integration patterns
  - Net class validation
  - Selection manipulation
- Update mdBook intro with comparison table and clearer goals
- Update quickstart version numbers
- Suppress missing_docs warnings for internal modules (commands, envelope, transport)
- Format code with cargo fmt

* docs: complete library assessment report with verified findings

- Corrected baseline metrics (5448 LOC client.rs, 7903 non-generated total, 12766 overall)
- Added full non-generated source tree with LOC breakdown
- Expanded anti-pattern scan from 3 to 6 findings (AP-4 through AP-6)
- Added verified clean signals (zero production unwrap/expect/panic)
- Added transport architecture, feature flag, and model cross-dependency analysis
- Proposed concrete client.rs domain split into 8 modules
- Identified 5 new documentation issues (DR-2 through DR-6)
- Resolved DR-1 (version drift already fixed)
- Expanded risk register from 5 to 9 entries
- Updated prioritized action plan with corrected priorities

* fix: complete P0 action items from library assessment

- Fix clone_on_copy in client.rs map_text_shape (AP-1)
- Add clippy::enum_variant_names allow for generated proto code (AP-2)
- Fix bool_assert_comparison patterns in test assertions (AP-3)
- Fix broken README anchor in validation.md (DR-2)
- Remove docs/book/src/https: filesystem artifact (DR-3)

* refactor: split monolithic client.rs into domain modules

Split src/client.rs (5448 LOC) into src/client/ directory with 11 modules:
- mod.rs: core structs, builder, constants, send_command
- common.rs: ping, version, paths, documents, text vars, text geometry
- board.rs: nets, layers, origin, stackup, graphics, appearance, DRC
- selection.rs: get/add/remove/clear selection
- items.rs: CRUD, get by type/net/class, commit workflow
- document.rs: title block, save, revert, string serialization
- geometry.rs: bounding boxes, hit test, pad polygons, padstack, zones
- mappers.rs: all proto-to-model and model-to-proto conversions
- decode.rs: PCB item type decoding
- format.rs: selection detail formatting, debug utilities
- tests.rs: all unit tests

No public API changes. All existing tests pass.
Updated blocking parity test to scan split module files.

* refactor: add rpc! dispatch macro to reduce RPC boilerplate

Introduce rpc! macro in client/mod.rs that encapsulates the
pack → send_command → response_payload_as_any pattern repeated
across 57 RPC methods. Demonstrate usage in common.rs with 4
converted _raw methods.

* feat: complete P1/P2 action items from library assessment

- Add beginner examples: hello_kicad.rs and board_inspector.rs
- Add README prerequisites section with KiCad IPC API setup guide
- Add README examples section with run commands for all 3 examples
- Add protocol-contract tests: CMD/RES prefix validation, PCB types catalog
- Add module-level rustdoc to all client submodules
- All tests pass (default + blocking features)

* docs: update assessment report with completed action items

Mark resolved: AP-1/AP-2/AP-3 (clippy), DR-2 (anchor), DR-3 (artifact),
ST-1 (client.rs split), DR-5 (examples), DR-6 (prerequisites).
Mark mitigated: AP-4 (RPC boilerplate via rpc! macro).
Update baseline metrics to reflect 11-module client layout.
Update risk register, action plan status, and revision history.

* chore: finalize tier-1 API docs and modular client cleanup

Document the public client and blocking surfaces so strict rustdoc linting passes, while keeping tier-2/3 internals lightly scoped. Also clean stale modularization references and remove leftover split-refactor dead imports/helpers to reduce maintenance drift.
2026-03-29 20:54:49 +08:00
..
src refactor: modularize client API and finalize v10 assessment follow-ups (#25) 2026-03-29 20:54:49 +08:00
book.toml docs: add mdBook guide site and Pages deploy workflow (#15) 2026-02-28 13:15:33 +08:00