@trueclara/parser
v0.1.1
Published
Build-time structural graph parser for Next.js applications.
Maintainers
Readme
@trueclara/parser
Build-time structural graph parser for Next.js applications — part of TrueClara.
The parser walks your Next.js source tree (App Router and Pages Router) and emits a deterministic route graph: routes, API routes, server actions, middleware, and the edges between them. TrueClara uses this graph to attribute observed traffic regressions to specific routes and deploys. It runs locally or in CI and produces auditable JSON.
CLI
npx @trueclara/parser <path-to-nextjs-repo>
npx @trueclara/parser <path> -o graph.json # write to a file
npx @trueclara/parser <path> --pretty # pretty-print JSON
npx @trueclara/parser <path> --verbose # print parser warnings to stderrExit codes: 0 clean, 2 completed with warnings, 1 error.
Programmatic
import { parseNextProject } from "@trueclara/parser";
const graph = await parseNextProject("/path/to/app", { pretty: true });Also exports Mermaid visualization helpers (generateMermaid, selectSubgraph, formatTraffic, hasGraphChanges) and the full set of graph types (Route, ApiRoute, Edge, ServerAction, Middleware, ParserOutput, …).
Docs
- Source: https://github.com/trueclara/trueclara-js
License
Apache-2.0
