Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rebuild-map-command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@evlog/cli": minor
---

Add `evlog map` — a static observability score for your app, Lighthouse-style. Detects your framework (Nuxt, Nitro, Next.js App Router, or TanStack Start), scans every route, and scores wide-event coverage: `useLogger()`, request context (`log.set()`), structured errors (`createError({ why, fix })`), audit trails on sensitive routes, and error handling. Writes `evlog.map.json` to the project root (skip with `--no-write`), prints a route-by-route report with the worst offenders first (`--all` for the full list), and can gate CI with `--min-score <n>`.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ logs
# Benchmarks
bench/results.json

# evlog map reports
evlog.map.json

# Test artefacts (coverage report, Stryker mutation report, Stryker scratch)
coverage/
reports/
Expand Down
8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ export default createConfig(
'import/first': 'off',
},
},
{
// `evlog map` test fixtures are throwaway sample apps scanned by the
// analysis engine (like `examples/*`, which carry no lint script at
// all) — intentionally imperfect (empty catch blocks, plain
// `throw new Error()`, framework-mandated `GET`/`POST`/`Route` names)
// to exercise specific checks. Not maintained to repo lint standards.
ignores: ['packages/cli/test/map/fixtures/**'],
},
)
5 changes: 5 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ npx @evlog/cli doctor --cwd apps/web
| `evlog doctor` | Monorepo-aware diagnosis: Node, project/workspace, stack, evlog install, `.evlog/logs` |
| `evlog doctor --cwd <dir>` | Run against another directory |
| `evlog doctor --debug` | Same, plus a debug wide event (see Debug) |
| `evlog map` | Static observability score for the current app — Lighthouse for wide events |
| `evlog map --framework <name>` | Override framework detection (`nuxt`, `nitro`, `next`, `tanstack-start`) |
| `evlog map --all` | Show every scanned route in the report, not just the worst 15 |
| `evlog map --min-score <n>` | Exit 1 if the global score is below `n` |
| `evlog map --no-write` | Skip writing `evlog.map.json` to the project root |
| `evlog telemetry status` | Show telemetry status and disclosure |
| `evlog telemetry enable` / `disable` | Change telemetry preference (disable purges buffered data) |

Expand Down
5 changes: 4 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"cli",
"wide-events",
"doctor",
"map",
"citty",
"structured-logging",
"telemetry"
Expand All @@ -56,7 +57,9 @@
"dependencies": {
"@evlog/telemetry": "workspace:*",
"citty": "^0.2.2",
"evlog": "workspace:*"
"evlog": "workspace:*",
"oxc-parser": "^0.82.3",
"tinyglobby": "^0.2.17"
},
"devDependencies": {
"tsdown": "^0.22.8",
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import doctor from './doctor'
import map from './map'
import telemetry from './telemetry'

/**
Expand All @@ -14,5 +15,6 @@ import telemetry from './telemetry'
*/
export const subCommands = {
doctor,
map,
telemetry,
}
Loading
Loading