Description:
Rust contract developers currently must manually re-run cargo test after every code change, which interrupts flow and slows the red-green-refactor cycle. Adding cargo-watch support with a documented invocation (cargo watch -x test) provides instant feedback on file changes, keeping developers in their editor rather than their terminal. A convenience npm/Make target should wrap this so the command is easy to discover.
Acceptance Criteria:
Relevant Files:
Cargo.toml — add cargo-watch dev dependency or document install requirement
.cargo/config.toml — new or existing file for incremental build config
package.json — add "watch:contracts" script
Makefile — add watch-contracts target
Description:
Rust contract developers currently must manually re-run
cargo testafter every code change, which interrupts flow and slows the red-green-refactor cycle. Addingcargo-watchsupport with a documented invocation (cargo watch -x test) provides instant feedback on file changes, keeping developers in their editor rather than their terminal. A convenience npm/Make target should wrap this so the command is easy to discover.Acceptance Criteria:
cargo-watchadded as a dev-dependency in the Rust workspaceCargo.tomlor documented as a required global install with an exact version pinwatch:contractsscript added to the rootpackage.jsonthat runscargo watch -x testfrom the contracts crate directorymake watch-contractstarget added to theMakefile(depends on issue Add Makefile with targets: dev, test, build, contract-deploy, db-migrate, db-reset, clean #352) that invokes the same command-w src/to scope watching to source files only, ignoringtarget/churn.cargo/config.toml(or existing config) sets reasonableCARGO_INCREMENTAL=1and parallel job limits for fast recompilationREADMEorCONTRIBUTING.mdcovers the hot-reload workflow and any platform-specific notes (e.g., inotify limits on Linux)cargo watch— only the standardcargo test— ensuring no watch process blocks CI pipelinesRelevant Files:
Cargo.toml— addcargo-watchdev dependency or document install requirement.cargo/config.toml— new or existing file for incremental build configpackage.json— add"watch:contracts"scriptMakefile— addwatch-contractstarget