@m4trix/trace-viewer
v0.10.0
Published
Filesystem-backed trace viewer CLI with tRPC API and React UI
Readme
@m4trix/trace-viewer
Filesystem-backed trace viewer for @m4trix/tracing: a small HTTP server with a tRPC API (/trpc) and a Vite + React + Tailwind UI.
CLI
From the repo root (after pnpm install, which links this package’s bin):
pnpm exec m4trix-trace-viewer --adapter fs --path ./tmp/tracing-example --port 4319If pnpm exec still can’t find the command, run it via the workspace filter:
pnpm --filter @m4trix/trace-viewer exec m4trix-trace-viewer --adapter fs --path ./tmp/tracing-example --port 4319--adapter fs— read traces viaFsStructureStoreAdapter/FsPayloadStoreAdapterat--path.--adapter aws-stack— prints a clear “not implemented” message and exits.--port— HTTP listen port (default4319).--path— trace root forfs(defaulttmp/tracing-example).
Then open http://127.0.0.1:4319 in a browser.
Programmatic usage
import { createFsTraceViewerApi, startTraceViewerServer } from '@m4trix/trace-viewer';
const traceViewerApi = createFsTraceViewerApi('./tmp/tracing-example');
startTraceViewerServer({ traceViewerApi, port: 4319 });tRPC procedures
traces.list—TraceViewerApi.listTracestraces.getTree—TraceViewerApi.getTraceTreetraces.getPayload—TraceViewerApi.getPayload(lazy load in the UI)
Develop
The package build is intentionally split but still portable:
tsupbuilds the publishable Node library and CLI intodist/.vite buildbuilds the browser app fromsrc/app/index.htmlintodist/client/.pnpm run buildis justtsup && vite build, using package-local binaries resolved by the package manager.
pnpm --filter @m4trix/trace-viewer build
pnpm --filter @m4trix/trace-viewer test