chore(codegen): wire wagmi ABI codegen against smart-contracts submodule

- wagmi.config.ts: read ABIs from p2pix-smart-contracts/artifacts/contracts
  (P2Pix, Reputation, MockToken) and emit src/generated.ts with the
  @wagmi/cli actions plugin
- package.json: add scripts
  * contracts:compile — installs submodule deps + runs `hardhat compile`
  * wagmi:gen — runs @wagmi/cli to (re)generate src/generated.ts
  * prewagmi:gen — chains contracts:compile before wagmi:gen
  * prestart — runs wagmi:gen, so `bun start` always has fresh ABIs
- .gitignore: ignore src/generated.ts (regenerated on every prestart)

Note: GraphQL/subgraph codegen is intentionally out of scope here — it
will land in its own branch.
This commit is contained in:
2026-05-04 21:13:31 -03:00
committed by hueso
parent bdaffbd889
commit 7c17e940da
3 changed files with 36 additions and 9 deletions

View File

@@ -3,6 +3,7 @@
"version": "1.2.0",
"type": "module",
"scripts": {
"prestart": "bun run wagmi:gen",
"start": "vite --host=0.0.0.0 --port 3000",
"build": "bun run type-check && bun run build-only",
"preview": "vite preview",
@@ -11,7 +12,10 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write \"src/**/*.{ts,vue,json}\"",
"format:check": "prettier --check \"src/**/*.{ts,vue,json}\""
"format:check": "prettier --check \"src/**/*.{ts,vue,json}\"",
"contracts:compile": "cd p2pix-smart-contracts && bun install && bunx hardhat compile",
"prewagmi:gen": "bun run contracts:compile",
"wagmi:gen": "bun ./node_modules/@wagmi/cli/dist/esm/cli.js generate"
},
"dependencies": {
"@floating-ui/vue": "^1.1.11",