traceon-analyzer 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +91 -0
  2. package/package.json +8 -3
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # traceon-analyzer
2
+
3
+ Analyze any codebase into an interactive dependency graph — right from your terminal. Zero config, 100% offline, no signup, no database, no server required.
4
+
5
+ ```bash
6
+ npx traceon-analyzer
7
+ ```
8
+
9
+ That's it. Traceon scans your project, parses every source file into an AST via the TypeScript Compiler API, builds the full dependency graph, prints a metrics report to your terminal, and launches an interactive graph viewer in your browser.
10
+
11
+ ## What you get
12
+
13
+ **Terminal report** — file counts, dependency density, file type distribution, critical modules (most depended-upon files), and circular dependency chains:
14
+
15
+ ```
16
+ traceon - analyzed my-project in 1.2s
17
+ --------------------------------------------------------------
18
+
19
+ Files 1069
20
+ Dependencies 336
21
+ Density 0.31 edges / file
22
+
23
+ File types
24
+ ts ######################## 412
25
+ tsx ###### 128
26
+ ...
27
+
28
+ Critical modules (most depended-upon files)
29
+ lib/parser.ts 23 importers
30
+ lib/graph/builder.ts 18 importers
31
+
32
+ ! Circular dependencies (2)
33
+ lib/a.ts -> lib/b.ts -> lib/a.ts
34
+ --------------------------------------------------------------
35
+ ```
36
+
37
+ **Interactive viewer** — a local-only web app at `http://localhost:4323` with:
38
+
39
+ - Force-directed dependency graph (React Flow, dark theme)
40
+ - Click any file to see its **impact score (0–100)**, risk level, and blast radius — every direct and transitive dependent lights up
41
+ - Search to filter files by name or path
42
+ - Circular dependency detection
43
+ - Workspace / monorepo (npm, pnpm, yarn, lerna) package boundaries
44
+
45
+ Your code never leaves your machine — analysis happens entirely in local Node.js processes, and the viewer binds to `127.0.0.1` only.
46
+
47
+ ## Usage
48
+
49
+ ```bash
50
+ npx traceon-analyzer # analyze current directory + open viewer
51
+ npx traceon-analyzer ./packages/api # analyze a subdirectory
52
+ npx traceon-analyzer --json > report.json # machine-readable output for CI
53
+ npx traceon-analyzer --no-open --port 5000 # custom port, no auto browser open
54
+ npx traceon-analyzer --help # all options
55
+ ```
56
+
57
+ ### Options
58
+
59
+ | Flag | Description |
60
+ | --- | --- |
61
+ | `path` | Directory to analyze (default: current directory) |
62
+ | `--json` | Print machine-readable JSON report to stdout and exit (no viewer) |
63
+ | `--no-open` | Start the viewer server but do not open the browser |
64
+ | `--port <n>` | Preferred port for the local viewer (default 4323; auto-increments if busy) |
65
+ | `--help`, `-h` | Show help |
66
+
67
+ ### JSON mode
68
+
69
+ `--json` emits a single JSON document with the full graph — nodes (with type, LOC, imports, exports, in/out degree), edges, and metrics (critical modules, circular dependency cycles, file type distribution, workspace info). Ideal for CI pipelines, scripts, or piping into other tools.
70
+
71
+ ## What it understands
72
+
73
+ - **Languages:** TypeScript, JavaScript, TSX/JSX, plus first-class support for Vue, Svelte, and Astro project structures
74
+ - **Import resolution:** relative paths, `@/` and `~/` aliases, `tsconfig.json` `paths` (via `get-tsconfig`), `index.*` files, extensionless and suffix-loader imports (`?url`, `?raw`)
75
+ - **Node classification:** entry points (`page.tsx`, `route.ts`, `layout.tsx`, `main.tsx`, …), components, types, utilities, config, and generic modules
76
+ - **Monorepos:** npm / pnpm / yarn / lerna workspaces — detects packages and annotates which package every file belongs to
77
+ - **Impact analysis:** for every file, computes direct dependents, transitive dependents, and a weighted impact score with risk levels (low / moderate / critical)
78
+
79
+ ## Requirements
80
+
81
+ - Node.js >= 18
82
+
83
+ ## Why
84
+
85
+ Most dependency-graph tools need a plugin, an IDE, or a signup. Traceon is a single command that works in any project in seconds — useful before a refactor ("what breaks if I change this file?"), during code review, or when you just want to finally see the shape of a codebase.
86
+
87
+ Part of the [Traceon](https://github.com/rishabhx29/Traceon) project — a web app for repository analysis, profile DNA checks, and squad matching. The CLI shares the same analysis core, runs fully offline.
88
+
89
+ ## License
90
+
91
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "traceon-analyzer",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Analyze any codebase into an interactive dependency graph — right from your terminal. Zero config, works offline.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -8,16 +8,21 @@
8
8
  "traceon": "dist/cli.js"
9
9
  },
10
10
  "files": [
11
- "dist/cli.js"
11
+ "dist/cli.js",
12
+ "README.md"
12
13
  ],
13
14
  "engines": {
14
15
  "node": ">=18"
15
16
  },
17
+ "homepage": "https://github.com/rishabhx29/Traceon",
16
18
  "repository": {
17
19
  "type": "git",
18
- "url": "https://github.com/Rishabhworkspace/Traceon.git",
20
+ "url": "git+https://github.com/rishabhx29/Traceon.git",
19
21
  "directory": "packages/traceon"
20
22
  },
23
+ "bugs": {
24
+ "url": "https://github.com/rishabhx29/Traceon/issues"
25
+ },
21
26
  "keywords": [
22
27
  "dependency-graph",
23
28
  "code-analysis",