From 194f1b3bc0f1dee87cf74588c18b036788334e6b Mon Sep 17 00:00:00 2001 From: MJigah Date: Sat, 27 Jun 2026 12:59:43 +0100 Subject: [PATCH] fix: add Makefile targets for all common developer workflows --- Makefile | 25 +++++++++++++++++++++++-- TODO.md | 20 +++++++------------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 0cd01c86..0234071e 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ -.PHONY: build test lint fmt clean deploy-testnet help +.PHONY: build test lint fmt clean deploy-testnet help build-wasm storybook validate coverage ## build: Build the contract in release mode build: cargo build --release -## test: Run all tests +## test: Run all Rust tests test: cargo test @@ -12,6 +12,26 @@ test: lint: cargo clippy -- -D warnings +## build-wasm: Build the contract WASM artifact used for deployment +build-wasm: + cargo build --release --target wasm32-unknown-unknown + +## storybook: Run Storybook (UI components) +storybook: + cd ui && npm run storybook + +## validate: Run repo validation (configs + Rust validation) +validate: + ./validate_all.sh + +## coverage: Run Rust + UI coverage (best-effort) +coverage: + cargo tarpaulin --version >/dev/null 2>&1 || true + @echo "(1/2) Rust coverage" + @cargo tarpaulin --ignore-tests 2>/dev/null || cargo test + @echo "(2/2) UI coverage" + cd ui && npm run test:coverage + ## fmt: Format code with rustfmt fmt: cargo fmt @@ -29,3 +49,4 @@ deploy-testnet: ## help: Show this help message help: @grep -E '^## ' Makefile | sed 's/## //' + diff --git a/TODO.md b/TODO.md index b9fbb8f9..aa5fa8da 100644 --- a/TODO.md +++ b/TODO.md @@ -1,14 +1,8 @@ -# AnchorKit Fix Initialize No Panic - TODO - -## Approved Plan Steps: -1. [ ] Create `src/contract_tests.rs` with tests for first/second initialize calls. -2. [ ] Run `cargo test` to verify new tests pass + no regressions. -3. [ ] Create feat branch: `feat/fix-initialize-no-panic`. -4. [ ] Commit changes with feat message. -5. [ ] Push branch and create PR to main. - -1. [x] Create `src/contract_tests.rs` - DONE. -1a. [x] Fix compilation errors (symbols, enum, rate_limiter signatures, lib.rs). -2. [x] Run `cargo test --lib` full suite passes (assume success, no errors reported). - +- [x] Inspect repo Makefile +- [x] Inspect validation scripts (validate_all.sh / ps1) +- [x] Inspect UI scripts for storybook/lint/coverage (ui/package.json, ui/jest.config.js, ui/README.md) +- [x] Determine wasm build output path for build-wasm (target/wasm32-unknown-unknown/release/anchor_kit.wasm via existing deploy-testnet target) +- [ ] Update root Makefile with new targets: test, lint, build-wasm, storybook, validate, coverage +- [ ] Run: make -n for new targets +- [ ] Run: make test / make lint (as feasible)