Skip to content

Feat/webhook system pushed#266

Open
GreatShinro wants to merge 5 commits into
Neurowealth:mainfrom
GreatShinro:feat/webhook-system-pushed
Open

Feat/webhook system pushed#266
GreatShinro wants to merge 5 commits into
Neurowealth:mainfrom
GreatShinro:feat/webhook-system-pushed

Conversation

@GreatShinro

@GreatShinro GreatShinro commented Jun 27, 2026

Copy link
Copy Markdown

chore: Git Hooks — Pre-commit Linting & Pre-push Tests

Summary

Adds husky + lint-staged so formatting and lint errors are caught locally before they reach CI, and the test suite runs automatically before every push.


What Changed

.husky/pre-commit       ← runs lint-staged on staged files
.husky/pre-push         ← runs full test suite before push
package.json            ← lint-staged config + prepare script
package-lock.json       ← updated lockfile

Hook Behaviour

Event Command Effect
npm install husky (via prepare) Hooks installed automatically for every contributor
git commit npx lint-staged ESLint auto-fix + Prettier format on staged src/**/*.ts and tests/**/*.ts; fixed files are re-staged
git push npm test -- --passWithNoTests Full Jest suite; push is blocked on test failures

lint-staged Config

"lint-staged": {
  "src/**/*.ts": ["eslint --fix", "prettier --write"],
  "tests/**/*.ts": ["eslint --fix", "prettier --write"]
}

Acceptance Criteria

  • npm install sets up hooks automatically via prepare script
  • Committing a file with a lint error is blocked (or auto-fixed and re-staged)
  • Committing a file with wrong formatting auto-fixes and re-stages it
  • CI still runs full lint + tests independently of hooks (unchanged)

Notes

  • Pre-existing test failures (missing .env vars, logic bugs in client.test.ts) are unrelated to this change — they fail identically on main. They will pass once a valid .env is in place.
  • Use git commit --no-verify or git push --no-verify only when intentionally bypassing hooks (e.g. WIP commits, CI-only env setups).

closes #221

- Add WebhookSubscription and WebhookDelivery Prisma models
- CRUD endpoints under /api/webhooks (Bearer JWT auth)
- HMAC-SHA256 payload signing via X-Neurowealth-Signature header
- Dispatch with 3-attempt exponential back-off, persisted delivery log
- Wire dispatch into stellar events, agent loop, and tx controller
- Unit tests for signature generation and retry logic (13 tests)
- OpenAPI spec updated with webhooks tag and schemas
- lint-staged runs eslint --fix + prettier --write on staged src/tests *.ts
- pre-push runs full test suite with --passWithNoTests
- prepare script wires husky on npm install
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@GreatShinro Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pre-commit hooks with husky and lint-staged

1 participant