doc-drift/detector #9
@@ -77,6 +77,12 @@ cd client && npm run test:watch
|
||||
- Export pure functions (validators, formatters, etc.) for direct testing
|
||||
- Run `npm test` in both `server/` and `client/` before committing
|
||||
|
||||
**Doc drift check:**
|
||||
```bash
|
||||
node scripts/doc-drift.js
|
||||
```
|
||||
Scans `CLAUDE.md` and `PRD.md` for verifiable code references (file paths, API routes, component names) and cross-checks each against the filesystem and source tree. Prints a PASS/FAIL report with doc name and line number. Exits non-zero on any failure — suitable for CI gating.
|
||||
|
||||
## Application Structure
|
||||
|
||||
The default route `/` renders the paycheck-centric main view (`client/src/pages/PaycheckView.jsx`). It shows the current month's two paychecks side-by-side with bills, paid status, one-time expenses, and remaining balance. Month navigation (prev/next) fetches data via `GET /api/paychecks?year=&month=`.
|
||||
|
||||
@@ -79,7 +79,7 @@ function apiRouteExists(routePath) {
|
||||
const fragment = clean.replace(/^\/api/, '');
|
||||
try {
|
||||
const out = execSync(
|
||||
`grep -r --include="*.js" -l "${clean}\\|${fragment}" "${path.join(ROOT, 'server/src/routes')}"`,
|
||||
`grep -rE --include="*.js" -l "${clean}|${fragment}" "${path.join(ROOT, 'server/src/routes')}"`,
|
||||
{ stdio: ['pipe', 'pipe', 'pipe'] }
|
||||
).toString().trim();
|
||||
return out.length > 0;
|
||||
|
||||
Reference in New Issue
Block a user