Repository navigation
Releases: StudioLE/example-rs
Releases · StudioLE/example-rs
Release list
v0.2.1
Immutable
release. Only release title and notes can be modified.
Maintenance
v0.2.0
Immutable
release. Only release title and notes can be modified.
Features
-
status: Validate `Id` with `FromStr` 175f02a by @StudioLE
- Accept only ASCII letters, digits,
-, and_so anIdis safe as a file name - Add
IdErrorwithEmptyandInvalidCharacter, soexample start ../etcis rejected at parse time - Remove
Id::newin favor ofId::from_str - Add
cli_args_parse_from_invalid_idandId::from_strtests
- Accept only ASCII letters, digits,
-
app: Add `--state-dir` with a platform default c6a2555 by @StudioLE
- Add global
--state-dirwith anEXAMPLE_STATE_DIRenv var and a dir completion hint - Add
Optionswith a hand-writtenFromServicesthat falls back to the platform state dir frometcetera - Add
CliArgs::fixture()for tests that override CLI arguments
- Add global
-
status: Store status in files bcc3b7b by @StudioLE
- Split status access into
StatusProviderandStatusWriter, both registered to oneStatusFileAdapter - Store one file per
IdinOptions::state_dir, treating a missing file asInactive - Create the state dir on startup with
Init - Set the status in
StartHandlerandStopHandlerafter checking it isn't already set - Add
StatusFake, an in-memory store for both traits, and register it inwith_test_services() - Add
StatusWriterSpyto record writes, replacingStatusProviderSpy - Test
StatusFileAdapteragainst a temp dir withtempfile
- Split status access into
-
status: Add `status` subcommand 7aa1bda by @StudioLE
- Add
StatusHandlerto print<id>: <status>for the requestedIdand return aStatusOutput - Add
WriteLine, injected so handlers can be tested withWriteLineSpy - Add
ConsoleWriterto write lines to stdout, returning an error on a broken pipe whereprintln!would panic - Add
subcommand_handler_runand thestatushelp snapshot
- Add
-
output: Add global `--format` for JSON, TOML, and YAML f24fa52 by @StudioLE
- Add global
--formatwith anEXAMPLE_FORMATenv var, choosing betweenhuman,json,toml, andyaml - Declare each format with
output(…)onCliArgsso the usage spec records the media type and framing - Add
OutputRendererto render anySerializevalue in the format fromCliArgs - Render
statusoutput throughOutputRenderer - Snapshot each format, picking it by registering a
CliArgsinstance
- Add global
-
commands: Print the new status from `start` and `stop` cb33bca by @StudioLE
- Render and write a
StatusOutputafterstartandstop, so--formatapplies to every subcommand - Return the
StatusOutputfromStartHandler::executeandStopHandler::execute - Assert the written line with
WriteLineSpyin the start and stop tests
- Render and write a
Maintenance
-
test: resolve clippy
unnecessary_wrapswarning in testcreate_loggerf1a5a5e by @StudioLE -
chore: Rename to
SubcommandHandlerfor consistency d43a9a4 by @StudioLE -
chore: Add feature issue templates 32e740b by @StudioLE
- Add
feature.ymlissue form for the web UI - Add
feature.mdmarkdown template forgh issue create -T - Structure: Problem, Goals, Hints, References
- Goals use RFC 2119 keywords; checkboxes for
MUST,SHOULD,MAY; plain bullets for exclusions - Prefill
feat:title and12-featlabel
- Add
-
refactor: Replace `clap` with `usage-rs` for CLI parsing 972aca9 by @StudioLE
- Swap the
Parser,Subcommand, andArgsderives forCli,Subcommands, andArgs - Replace the inert
value_enumon--log-levelwithusage-rsvalue_enum, so invalid values are rejected and the accepted values appear in help - Bump
studiole-loggingtov0.5.0with theusagefeature forLogLevel'sValueEnumderive - Add
unknown_flags = "error"to retainclap's rejection of unrecognized flags - Gain
-V/--versionand the__usage_spec__KDL spec for completions and manpages - Keep subcommand dispatch in
SubcommandHandlerrather than adopt#[usage(run)], which would bypass the service container - Cover CLI parsing and help pages with tests
- Note the last
clapversion inREADME.md
- Swap the
-
style(imports): Import `fmt` and `io` modules instead of aliasing items 699f58b by @StudioLE
- Replace
FmtResultwithfmt::Result - Drop the
IoReadandIoWritealiases forReadandWrite - Remove
.clippy.tomlto restore the defaultabsolute-paths-max-segmentsof2, allowing crate-rooted calls likeserde_json::from_str()
- Replace
-
refactor: Replace `mockall` with a hand-written `StatusProviderStub` fb986e7 by @StudioLE
- Add
StatusProviderStubandStatus::fixture(), with a hand-writtenFromServicesthat fillsstatusfrom the fixture - Rename
with_mock_services()towith_test_services(), which now takes no args and registers the stub - Override the stub per test with
with_instancewhere a handler needs a differentStatus - Rename
mock()tofixture()onId,StartRequest, andStopRequest - Remove
status_provider_mock_getand its snapshot, as it only tested the mock - Remove
mockallfromCargo.tomlandREADME.md
- Add
-
test: Add handler error-path and spy tests to showcase test doubles 1f96e72 by @StudioLE
- Change
StatusProviderStub.statusto aResultso tests can stub aStatusError - Add
StatusProviderSpyto record eachIdpassed toStatusProvider::get - Add
start_handler_execute_activeandstop_handler_execute_inactiveto cover the already active and inactive errors - Add
start_handler_execute_status_errorto cover wrapping aStatusErrorasStartError::GetStatus - Add
start_handler_execute_spyto assert the handler queries status with the requestId - Override stubs with
with_instance(StatusProviderStub { … })instead of anArc<dyn StatusProvider> - Limit the
dead_codeexpectation onStatusError::Readto non-test builds
- Change
-
test(cli_args): Snapshot the usage spec 7f7e0e0...