viberadar 0.1.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 forlandeivan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # 🔭 VibeRadar
2
+
3
+ > Live module map with test coverage for vibecoding projects.
4
+
5
+ Run it in any project root — VibeRadar scans your source files, reads Playwright/Istanbul coverage, and opens an interactive dashboard in your browser.
6
+
7
+ ## Usage
8
+
9
+ ```bash
10
+ npx viberadar
11
+ ```
12
+
13
+ Opens `http://localhost:4242` with a live map of:
14
+ - All source modules (TypeScript, JavaScript, Vue, Svelte)
15
+ - Which ones have tests and which don't
16
+ - Coverage metrics (lines, statements, functions, branches)
17
+ - Module sizes and local dependency graph
18
+
19
+ ## Dashboard
20
+
21
+ - **Filter by type** — component, service, util, test, config
22
+ - **Search** by name or path
23
+ - **Click any card** to see full coverage breakdown and dependencies
24
+
25
+ ## Coverage data
26
+
27
+ VibeRadar reads coverage from `coverage/coverage-summary.json` (Istanbul/V8 format).
28
+
29
+ Generate it with:
30
+
31
+ ```bash
32
+ # Vitest
33
+ npx vitest run --coverage
34
+
35
+ # Jest
36
+ npx jest --coverage
37
+
38
+ # Playwright (with coverage plugin)
39
+ npx playwright test
40
+ ```
41
+
42
+ ## Tech
43
+
44
+ - CLI: TypeScript + Node.js
45
+ - Dashboard: vanilla HTML/JS (zero dependencies in browser)
46
+ - Server: Node.js `http` module
47
+ - Port: `4242`
48
+
49
+ ## License
50
+
51
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ const scanner_1 = require("./scanner");
38
+ const server_1 = require("./server");
39
+ const PROJECT_ROOT = process.cwd();
40
+ const PORT = 4242;
41
+ async function main() {
42
+ console.log('🔭 VibeRadar starting...');
43
+ console.log(` Project: ${PROJECT_ROOT}`);
44
+ console.log(' Scanning modules...');
45
+ const data = await (0, scanner_1.scanProject)(PROJECT_ROOT);
46
+ console.log(` Found ${data.modules.length} modules`);
47
+ await (0, server_1.startServer)({ data, port: PORT, projectRoot: PROJECT_ROOT });
48
+ console.log(`\n✅ Dashboard: http://localhost:${PORT}`);
49
+ console.log(' Press Ctrl+C to stop\n');
50
+ const { default: open } = await Promise.resolve().then(() => __importStar(require('open')));
51
+ await open(`http://localhost:${PORT}`);
52
+ }
53
+ main().catch((err) => {
54
+ console.error('❌ VibeRadar error:', err.message);
55
+ process.exit(1);
56
+ });
57
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,uCAAwC;AACxC,qCAAuC;AAEvC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AACnC,MAAM,IAAI,GAAG,IAAI,CAAC;AAElB,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,eAAe,YAAY,EAAE,CAAC,CAAC;IAE3C,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAW,EAAC,YAAY,CAAC,CAAC;IAE7C,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,MAAM,UAAU,CAAC,CAAC;IAEvD,MAAM,IAAA,oBAAW,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC;IAEnE,OAAO,CAAC,GAAG,CAAC,mCAAmC,IAAI,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAEzC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,wDAAa,MAAM,GAAC,CAAC;IAC/C,MAAM,IAAI,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ export interface ModuleInfo {
2
+ id: string;
3
+ name: string;
4
+ path: string;
5
+ relativePath: string;
6
+ type: 'component' | 'util' | 'service' | 'test' | 'config' | 'other';
7
+ hasTests: boolean;
8
+ testFile?: string;
9
+ coverage?: CoverageInfo;
10
+ size: number;
11
+ dependencies: string[];
12
+ }
13
+ export interface CoverageInfo {
14
+ lines: number;
15
+ statements: number;
16
+ functions: number;
17
+ branches: number;
18
+ }
19
+ export interface ScanResult {
20
+ projectRoot: string;
21
+ projectName: string;
22
+ scannedAt: string;
23
+ modules: ModuleInfo[];
24
+ totalCoverage?: CoverageInfo;
25
+ }
26
+ export declare function scanProject(projectRoot: string): Promise<ScanResult>;
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scanner/index.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrE,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,YAAY,CAAC;CAC9B;AAgED,wBAAsB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAoE1E"}
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.scanProject = scanProject;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const glob_1 = require("glob");
40
+ const IGNORE_DIRS = [
41
+ 'node_modules', 'dist', 'build', '.git', '.next',
42
+ 'coverage', '.nyc_output', '__pycache__', '.venv',
43
+ ];
44
+ const SOURCE_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx', '.vue', '.svelte'];
45
+ const TEST_PATTERNS = ['.test.', '.spec.', '__tests__'];
46
+ function detectType(filePath) {
47
+ const p = filePath.toLowerCase();
48
+ if (TEST_PATTERNS.some((t) => p.includes(t)))
49
+ return 'test';
50
+ if (p.includes('/component') || p.endsWith('.tsx') || p.endsWith('.jsx'))
51
+ return 'component';
52
+ if (p.includes('/service') || p.includes('/api'))
53
+ return 'service';
54
+ if (p.includes('/util') || p.includes('/helper') || p.includes('/lib'))
55
+ return 'util';
56
+ if (p.includes('config') || p.endsWith('.config.ts') || p.endsWith('.config.js'))
57
+ return 'config';
58
+ return 'other';
59
+ }
60
+ function extractDependencies(filePath) {
61
+ try {
62
+ const content = fs.readFileSync(filePath, 'utf-8');
63
+ const deps = [];
64
+ const importRe = /(?:import|require)\s*(?:.*?\s+from\s+)?['"]([^'"]+)['"]/g;
65
+ let match;
66
+ while ((match = importRe.exec(content)) !== null) {
67
+ const dep = match[1];
68
+ if (dep.startsWith('.'))
69
+ deps.push(dep);
70
+ }
71
+ return deps;
72
+ }
73
+ catch {
74
+ return [];
75
+ }
76
+ }
77
+ function loadPlaywrightCoverage(projectRoot) {
78
+ const coverageMap = new Map();
79
+ // Try Playwright JSON report
80
+ const playwrightReport = path.join(projectRoot, 'playwright-report', 'results.json');
81
+ // Try V8/Istanbul coverage
82
+ const v8Coverage = path.join(projectRoot, 'coverage', 'coverage-summary.json');
83
+ if (fs.existsSync(v8Coverage)) {
84
+ try {
85
+ const raw = JSON.parse(fs.readFileSync(v8Coverage, 'utf-8'));
86
+ for (const [filePath, data] of Object.entries(raw)) {
87
+ if (filePath === 'total')
88
+ continue;
89
+ coverageMap.set(filePath, {
90
+ lines: data.lines?.pct ?? 0,
91
+ statements: data.statements?.pct ?? 0,
92
+ functions: data.functions?.pct ?? 0,
93
+ branches: data.branches?.pct ?? 0,
94
+ });
95
+ }
96
+ }
97
+ catch {
98
+ // no coverage data
99
+ }
100
+ }
101
+ return coverageMap;
102
+ }
103
+ async function scanProject(projectRoot) {
104
+ const pkgPath = path.join(projectRoot, 'package.json');
105
+ let projectName = path.basename(projectRoot);
106
+ if (fs.existsSync(pkgPath)) {
107
+ try {
108
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
109
+ projectName = pkg.name || projectName;
110
+ }
111
+ catch { }
112
+ }
113
+ const ignorePattern = IGNORE_DIRS.map((d) => `**/${d}/**`);
114
+ const patterns = SOURCE_EXTENSIONS.map((ext) => `**/*${ext}`);
115
+ const files = await (0, glob_1.glob)(patterns, {
116
+ cwd: projectRoot,
117
+ ignore: ignorePattern,
118
+ absolute: true,
119
+ });
120
+ const coverageMap = loadPlaywrightCoverage(projectRoot);
121
+ const testFiles = new Set(files.filter((f) => TEST_PATTERNS.some((t) => f.includes(t))));
122
+ const modules = files.map((filePath) => {
123
+ const relativePath = path.relative(projectRoot, filePath);
124
+ const name = path.basename(filePath, path.extname(filePath));
125
+ const isTest = TEST_PATTERNS.some((t) => filePath.includes(t));
126
+ // Try to find test file for non-test modules
127
+ let testFile;
128
+ if (!isTest) {
129
+ const base = filePath.replace(/\.[^.]+$/, '');
130
+ const ext = path.extname(filePath);
131
+ const candidates = [
132
+ `${base}.test${ext}`,
133
+ `${base}.spec${ext}`,
134
+ filePath.replace('/src/', '/tests/').replace(ext, `.test${ext}`),
135
+ ];
136
+ testFile = candidates.find((c) => testFiles.has(c));
137
+ }
138
+ let size = 0;
139
+ try {
140
+ size = fs.statSync(filePath).size;
141
+ }
142
+ catch { }
143
+ return {
144
+ id: relativePath.replace(/[/\\]/g, '_'),
145
+ name,
146
+ path: filePath,
147
+ relativePath,
148
+ type: detectType(filePath),
149
+ hasTests: !!testFile || isTest,
150
+ testFile: testFile ? path.relative(projectRoot, testFile) : undefined,
151
+ coverage: coverageMap.get(filePath),
152
+ size,
153
+ dependencies: extractDependencies(filePath),
154
+ };
155
+ });
156
+ return {
157
+ projectRoot,
158
+ projectName,
159
+ scannedAt: new Date().toISOString(),
160
+ modules,
161
+ };
162
+ }
163
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scanner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,kCAoEC;AAlKD,uCAAyB;AACzB,2CAA6B;AAC7B,+BAA4B;AA8B5B,MAAM,WAAW,GAAG;IAClB,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO;IAChD,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO;CAClD,CAAC;A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;QACpC,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QAEV,OAAO;YACL,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;YACvC,IAAI;YACJ,IAAI,EAAE,QAAQ;YACd,YAAY;YACZ,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC;YAC1B,QAAQ,EAAE,CAAC,CAAC,QAAQ,IAAI,MAAM;YAC9B,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;YACrE,QAAQ,EAAE,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC;YACnC,IAAI;YACJ,YAAY,EAAE,mBAAmB,CAAC,QAAQ,CAAC;SAC5C,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,WAAW;QACX,WAAW;QACX,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import * as http from 'http';
2
+ import { ScanResult } from '../scanner';
3
+ interface ServerOptions {
4
+ data: ScanResult;
5
+ port: number;
6
+ projectRoot: string;
7
+ }
8
+ export declare function startServer({ data, port, projectRoot }: ServerOptions): Promise<http.Server>;
9
+ export {};
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,UAAU,aAAa;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAOD,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAuC5F"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.startServer = startServer;
37
+ const http = __importStar(require("http"));
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ const DASHBOARD_HTML = fs.readFileSync(path.join(__dirname, '../ui/dashboard.html'), 'utf-8');
41
+ function startServer({ data, port, projectRoot }) {
42
+ return new Promise((resolve, reject) => {
43
+ const server = http.createServer((req, res) => {
44
+ const url = req.url ?? '/';
45
+ if (url === '/') {
46
+ res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
47
+ res.end(DASHBOARD_HTML);
48
+ return;
49
+ }
50
+ if (url === '/api/data') {
51
+ res.writeHead(200, { 'Content-Type': 'application/json' });
52
+ res.end(JSON.stringify(data, null, 2));
53
+ return;
54
+ }
55
+ res.writeHead(404);
56
+ res.end('Not found');
57
+ });
58
+ server.on('error', (err) => {
59
+ if (err.code === 'EADDRINUSE') {
60
+ reject(new Error(`Port ${port} is already in use. Is VibeRadar already running?`));
61
+ }
62
+ else {
63
+ reject(err);
64
+ }
65
+ });
66
+ server.listen(port, '127.0.0.1', () => {
67
+ resolve(server);
68
+ });
69
+ // Graceful shutdown
70
+ process.on('SIGINT', () => {
71
+ console.log('\n👋 VibeRadar stopped.');
72
+ server.close(() => process.exit(0));
73
+ });
74
+ });
75
+ }
76
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,kCAuCC;AAvDD,2CAA6B;AAC7B,uCAAyB;AACzB,2CAA6B;AAS7B,MAAM,cAAc,GAAG,EAAE,CAAC,YAAY,CACpC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,sBAAsB,CAAC,EAC5C,OAAO,CACR,CAAC;AAEF,SAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAiB;IACpE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC5C,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC;YAE3B,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;gBAChB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,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<head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>VibeRadar</title>
7
+ <style>
8
+ * { box-sizing: border-box; margin: 0; padding: 0; }
9
+
10
+ body {
11
+ font-family: 'Segoe UI', system-ui, sans-serif;
12
+ background: #0d1117;
13
+ color: #e6edf3;
14
+ min-height: 100vh;
15
+ }
16
+
17
+ header {
18
+ display: flex;
19
+ align-items: center;
20
+ gap: 12px;
21
+ padding: 16px 24px;
22
+ border-bottom: 1px solid #21262d;
23
+ background: #161b22;
24
+ }
25
+
26
+ header h1 {
27
+ font-size: 20px;
28
+ font-weight: 700;
29
+ letter-spacing: -0.5px;
30
+ }
31
+
32
+ header .project-name {
33
+ font-size: 13px;
34
+ color: #7d8590;
35
+ margin-left: auto;
36
+ }
37
+
38
+ header .scanned-at {
39
+ font-size: 12px;
40
+ color: #484f58;
41
+ }
42
+
43
+ .stats-bar {
44
+ display: flex;
45
+ gap: 24px;
46
+ padding: 14px 24px;
47
+ background: #161b22;
48
+ border-bottom: 1px solid #21262d;
49
+ flex-wrap: wrap;
50
+ }
51
+
52
+ .stat {
53
+ display: flex;
54
+ flex-direction: column;
55
+ gap: 2px;
56
+ }
57
+
58
+ .stat-value {
59
+ font-size: 22px;
60
+ font-weight: 700;
61
+ color: #58a6ff;
62
+ }
63
+
64
+ .stat-label {
65
+ font-size: 11px;
66
+ color: #7d8590;
67
+ text-transform: uppercase;
68
+ letter-spacing: 0.5px;
69
+ }
70
+
71
+ .main {
72
+ display: grid;
73
+ grid-template-columns: 260px 1fr;
74
+ height: calc(100vh - 110px);
75
+ }
76
+
77
+ .sidebar {
78
+ border-right: 1px solid #21262d;
79
+ overflow-y: auto;
80
+ padding: 12px 0;
81
+ }
82
+
83
+ .filter-group {
84
+ padding: 8px 16px;
85
+ }
86
+
87
+ .filter-group label {
88
+ font-size: 11px;
89
+ color: #7d8590;
90
+ text-transform: uppercase;
91
+ letter-spacing: 0.5px;
92
+ display: block;
93
+ margin-bottom: 6px;
94
+ }
95
+
96
+ .filter-group input {
97
+ width: 100%;
98
+ padding: 6px 10px;
99
+ background: #21262d;
100
+ border: 1px solid #30363d;
101
+ border-radius: 6px;
102
+ color: #e6edf3;
103
+ font-size: 13px;
104
+ outline: none;
105
+ }
106
+
107
+ .filter-group input:focus {
108
+ border-color: #58a6ff;
109
+ }
110
+
111
+ .type-filters {
112
+ padding: 8px 16px;
113
+ display: flex;
114
+ flex-direction: column;
115
+ gap: 4px;
116
+ }
117
+
118
+ .type-filter {
119
+ display: flex;
120
+ align-items: center;
121
+ gap: 8px;
122
+ padding: 4px 6px;
123
+ border-radius: 4px;
124
+ cursor: pointer;
125
+ font-size: 13px;
126
+ color: #7d8590;
127
+ transition: background 0.1s;
128
+ }
129
+
130
+ .type-filter:hover { background: #21262d; }
131
+ .type-filter.active { color: #e6edf3; background: #21262d; }
132
+
133
+ .type-dot {
134
+ width: 8px;
135
+ height: 8px;
136
+ border-radius: 50%;
137
+ flex-shrink: 0;
138
+ }
139
+
140
+ .content {
141
+ overflow-y: auto;
142
+ padding: 16px;
143
+ }
144
+
145
+ .module-grid {
146
+ display: grid;
147
+ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
148
+ gap: 10px;
149
+ }
150
+
151
+ .module-card {
152
+ background: #161b22;
153
+ border: 1px solid #21262d;
154
+ border-radius: 8px;
155
+ padding: 12px;
156
+ cursor: pointer;
157
+ transition: border-color 0.15s, transform 0.1s;
158
+ }
159
+
160
+ .module-card:hover {
161
+ border-color: #58a6ff;
162
+ transform: translateY(-1px);
163
+ }
164
+
165
+ .module-card.selected {
166
+ border-color: #58a6ff;
167
+ background: #1c2230;
168
+ }
169
+
170
+ .module-card-header {
171
+ display: flex;
172
+ align-items: flex-start;
173
+ gap: 8px;
174
+ margin-bottom: 8px;
175
+ }
176
+
177
+ .module-name {
178
+ font-size: 13px;
179
+ font-weight: 600;
180
+ word-break: break-all;
181
+ flex: 1;
182
+ }
183
+
184
+ .badge {
185
+ font-size: 10px;
186
+ padding: 2px 6px;
187
+ border-radius: 10px;
188
+ font-weight: 600;
189
+ white-space: nowrap;
190
+ flex-shrink: 0;
191
+ }
192
+
193
+ .badge-green { background: #1a3a2a; color: #3fb950; }
194
+ .badge-red { background: #3a1a1a; color: #f85149; }
195
+ .badge-gray { background: #21262d; color: #7d8590; }
196
+
197
+ .module-path {
198
+ font-size: 11px;
199
+ color: #484f58;
200
+ margin-bottom: 8px;
201
+ word-break: break-all;
202
+ }
203
+
204
+ .coverage-bar {
205
+ height: 4px;
206
+ border-radius: 2px;
207
+ background: #21262d;
208
+ overflow: hidden;
209
+ margin-top: 6px;
210
+ }
211
+
212
+ .coverage-fill {
213
+ height: 100%;
214
+ border-radius: 2px;
215
+ transition: width 0.3s;
216
+ }
217
+
218
+ .detail-panel {
219
+ position: fixed;
220
+ right: 0;
221
+ top: 0;
222
+ width: 380px;
223
+ height: 100vh;
224
+ background: #161b22;
225
+ border-left: 1px solid #21262d;
226
+ padding: 20px;
227
+ overflow-y: auto;
228
+ transform: translateX(100%);
229
+ transition: transform 0.2s;
230
+ z-index: 100;
231
+ }
232
+
233
+ .detail-panel.open {
234
+ transform: translateX(0);
235
+ }
236
+
237
+ .detail-close {
238
+ position: absolute;
239
+ top: 16px;
240
+ right: 16px;
241
+ background: none;
242
+ border: none;
243
+ color: #7d8590;
244
+ cursor: pointer;
245
+ font-size: 18px;
246
+ padding: 4px;
247
+ }
248
+
249
+ .detail-close:hover { color: #e6edf3; }
250
+
251
+ .detail-title {
252
+ font-size: 16px;
253
+ font-weight: 700;
254
+ margin-bottom: 4px;
255
+ padding-right: 32px;
256
+ }
257
+
258
+ .detail-path {
259
+ font-size: 11px;
260
+ color: #484f58;
261
+ margin-bottom: 16px;
262
+ word-break: break-all;
263
+ }
264
+
265
+ .detail-section {
266
+ margin-bottom: 16px;
267
+ }
268
+
269
+ .detail-section-title {
270
+ font-size: 11px;
271
+ text-transform: uppercase;
272
+ letter-spacing: 0.5px;
273
+ color: #7d8590;
274
+ margin-bottom: 8px;
275
+ }
276
+
277
+ .detail-row {
278
+ display: flex;
279
+ justify-content: space-between;
280
+ font-size: 13px;
281
+ padding: 4px 0;
282
+ border-bottom: 1px solid #21262d;
283
+ }
284
+
285
+ .detail-row:last-child { border-bottom: none; }
286
+
287
+ .coverage-metric {
288
+ display: grid;
289
+ grid-template-columns: 1fr 1fr;
290
+ gap: 8px;
291
+ }
292
+
293
+ .coverage-metric-item {
294
+ background: #21262d;
295
+ border-radius: 6px;
296
+ padding: 8px;
297
+ text-align: center;
298
+ }
299
+
300
+ .coverage-metric-value {
301
+ font-size: 20px;
302
+ font-weight: 700;
303
+ }
304
+
305
+ .coverage-metric-label {
306
+ font-size: 10px;
307
+ color: #7d8590;
308
+ text-transform: uppercase;
309
+ }
310
+
311
+ .deps-list {
312
+ display: flex;
313
+ flex-direction: column;
314
+ gap: 4px;
315
+ }
316
+
317
+ .dep-item {
318
+ font-size: 12px;
319
+ color: #7d8590;
320
+ padding: 3px 8px;
321
+ background: #21262d;
322
+ border-radius: 4px;
323
+ font-family: monospace;
324
+ }
325
+
326
+ .loading {
327
+ display: flex;
328
+ align-items: center;
329
+ justify-content: center;
330
+ height: 200px;
331
+ color: #7d8590;
332
+ font-size: 14px;
333
+ }
334
+
335
+ .type-colors {
336
+ component: '#58a6ff';
337
+ service: '#d2a8ff';
338
+ util: '#ffa657';
339
+ test: '#3fb950';
340
+ config: '#f85149';
341
+ other: '#484f58';
342
+ }
343
+ </style>
344
+ </head>
345
+ <body>
346
+
347
+ <header>
348
+ <span style="font-size:22px">🔭</span>
349
+ <h1>VibeRadar</h1>
350
+ <span class="project-name" id="projectName">—</span>
351
+ <span class="scanned-at" id="scannedAt"></span>
352
+ </header>
353
+
354
+ <div class="stats-bar">
355
+ <div class="stat"><span class="stat-value" id="statModules">—</span><span class="stat-label">Modules</span></div>
356
+ <div class="stat"><span class="stat-value" id="statWithTests">—</span><span class="stat-label">With Tests</span></div>
357
+ <div class="stat"><span class="stat-value" id="statCoverage">—</span><span class="stat-label">Avg Coverage</span></div>
358
+ <div class="stat"><span class="stat-value" id="statTests">—</span><span class="stat-label">Test Files</span></div>
359
+ </div>
360
+
361
+ <div class="main">
362
+ <div class="sidebar">
363
+ <div class="filter-group">
364
+ <label>Search</label>
365
+ <input id="searchInput" type="text" placeholder="Filter modules..." />
366
+ </div>
367
+
368
+ <div style="padding: 8px 16px; font-size:11px; color:#7d8590; text-transform:uppercase; letter-spacing:0.5px; margin-top:8px;">
369
+ Type
370
+ </div>
371
+ <div class="type-filters" id="typeFilters"></div>
372
+ </div>
373
+
374
+ <div class="content">
375
+ <div class="loading" id="loading">Loading...</div>
376
+ <div class="module-grid" id="moduleGrid" style="display:none"></div>
377
+ </div>
378
+ </div>
379
+
380
+ <div class="detail-panel" id="detailPanel">
381
+ <button class="detail-close" id="detailClose">✕</button>
382
+ <div id="detailContent"></div>
383
+ </div>
384
+
385
+ <script>
386
+ const TYPE_COLORS = {
387
+ component: '#58a6ff',
388
+ service: '#d2a8ff',
389
+ util: '#ffa657',
390
+ test: '#3fb950',
391
+ config: '#e3b341',
392
+ other: '#484f58',
393
+ };
394
+
395
+ let allModules = [];
396
+ let activeTypes = new Set();
397
+ let searchQuery = '';
398
+ let selectedModule = null;
399
+
400
+ function coverageColor(pct) {
401
+ if (pct === undefined) return '#484f58';
402
+ if (pct >= 80) return '#3fb950';
403
+ if (pct >= 50) return '#e3b341';
404
+ return '#f85149';
405
+ }
406
+
407
+ function formatSize(bytes) {
408
+ if (bytes < 1024) return bytes + ' B';
409
+ return (bytes / 1024).toFixed(1) + ' KB';
410
+ }
411
+
412
+ function renderTypeFilters() {
413
+ const types = [...new Set(allModules.map(m => m.type))].sort();
414
+ const container = document.getElementById('typeFilters');
415
+ container.innerHTML = '';
416
+
417
+ const allBtn = document.createElement('div');
418
+ allBtn.className = 'type-filter' + (activeTypes.size === 0 ? ' active' : '');
419
+ allBtn.innerHTML = `<span class="type-dot" style="background:#7d8590"></span> All`;
420
+ allBtn.onclick = () => { activeTypes.clear(); renderAll(); };
421
+ container.appendChild(allBtn);
422
+
423
+ types.forEach(type => {
424
+ const count = allModules.filter(m => m.type === type).length;
425
+ const btn = document.createElement('div');
426
+ btn.className = 'type-filter' + (activeTypes.has(type) ? ' active' : '');
427
+ btn.innerHTML = `<span class="type-dot" style="background:${TYPE_COLORS[type] || '#484f58'}"></span> ${type} <span style="margin-left:auto;color:#484f58">${count}</span>`;
428
+ btn.onclick = () => {
429
+ if (activeTypes.has(type)) activeTypes.delete(type);
430
+ else activeTypes.add(type);
431
+ renderAll();
432
+ };
433
+ container.appendChild(btn);
434
+ });
435
+ }
436
+
437
+ function getFilteredModules() {
438
+ return allModules.filter(m => {
439
+ if (activeTypes.size > 0 && !activeTypes.has(m.type)) return false;
440
+ if (searchQuery && !m.name.toLowerCase().includes(searchQuery) && !m.relativePath.toLowerCase().includes(searchQuery)) return false;
441
+ return true;
442
+ });
443
+ }
444
+
445
+ function renderModules() {
446
+ const grid = document.getElementById('moduleGrid');
447
+ const filtered = getFilteredModules();
448
+ grid.innerHTML = '';
449
+
450
+ filtered.forEach(m => {
451
+ const card = document.createElement('div');
452
+ card.className = 'module-card' + (selectedModule?.id === m.id ? ' selected' : '');
453
+
454
+ const cov = m.coverage?.lines;
455
+ const covText = cov !== undefined ? cov.toFixed(0) + '%' : 'No data';
456
+ const badgeClass = m.hasTests ? 'badge-green' : 'badge-red';
457
+ const badgeText = m.hasTests ? '✓ tested' : '✗ no test';
458
+
459
+ card.innerHTML = `
460
+ <div class="module-card-header">
461
+ <span class="module-name">${m.name}</span>
462
+ <span class="badge ${badgeClass}">${badgeText}</span>
463
+ </div>
464
+ <div class="module-path">${m.relativePath}</div>
465
+ <div style="display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#7d8590">
466
+ <span style="display:flex;align-items:center;gap:4px">
467
+ <span class="type-dot" style="background:${TYPE_COLORS[m.type] || '#484f58'}"></span>
468
+ ${m.type}
469
+ </span>
470
+ <span>${formatSize(m.size)}</span>
471
+ </div>
472
+ ${cov !== undefined ? `
473
+ <div class="coverage-bar">
474
+ <div class="coverage-fill" style="width:${cov}%;background:${coverageColor(cov)}"></div>
475
+ </div>
476
+ ` : ''}
477
+ `;
478
+
479
+ card.onclick = () => openDetail(m);
480
+ grid.appendChild(card);
481
+ });
482
+ }
483
+
484
+ function renderAll() {
485
+ renderTypeFilters();
486
+ renderModules();
487
+ }
488
+
489
+ function openDetail(m) {
490
+ selectedModule = m;
491
+ renderModules();
492
+
493
+ const cov = m.coverage;
494
+ const panel = document.getElementById('detailPanel');
495
+ const content = document.getElementById('detailContent');
496
+
497
+ content.innerHTML = `
498
+ <div class="detail-title">${m.name}</div>
499
+ <div class="detail-path">${m.relativePath}</div>
500
+
501
+ <div class="detail-section">
502
+ <div class="detail-section-title">Info</div>
503
+ <div class="detail-row"><span>Type</span><span style="color:${TYPE_COLORS[m.type]}">${m.type}</span></div>
504
+ <div class="detail-row"><span>Size</span><span>${formatSize(m.size)}</span></div>
505
+ <div class="detail-row"><span>Tests</span><span class="${m.hasTests ? 'badge badge-green' : 'badge badge-red'}">${m.hasTests ? '✓ ' + (m.testFile || 'tested') : '✗ none'}</span></div>
506
+ ${m.testFile ? `<div class="detail-row"><span>Test file</span><span style="font-size:11px;color:#7d8590;text-align:right">${m.testFile}</span></div>` : ''}
507
+ </div>
508
+
509
+ ${cov ? `
510
+ <div class="detail-section">
511
+ <div class="detail-section-title">Coverage</div>
512
+ <div class="coverage-metric">
513
+ ${['lines','statements','functions','branches'].map(k => `
514
+ <div class="coverage-metric-item">
515
+ <div class="coverage-metric-value" style="color:${coverageColor(cov[k])}">${cov[k]?.toFixed(1)}%</div>
516
+ <div class="coverage-metric-label">${k}</div>
517
+ </div>
518
+ `).join('')}
519
+ </div>
520
+ </div>
521
+ ` : `
522
+ <div class="detail-section">
523
+ <div class="detail-section-title">Coverage</div>
524
+ <div style="font-size:13px;color:#484f58">No coverage data. Run tests with coverage to see metrics.</div>
525
+ </div>
526
+ `}
527
+
528
+ ${m.dependencies.length > 0 ? `
529
+ <div class="detail-section">
530
+ <div class="detail-section-title">Local Imports (${m.dependencies.length})</div>
531
+ <div class="deps-list">
532
+ ${m.dependencies.map(d => `<div class="dep-item">${d}</div>`).join('')}
533
+ </div>
534
+ </div>
535
+ ` : ''}
536
+ `;
537
+
538
+ panel.classList.add('open');
539
+ }
540
+
541
+ document.getElementById('detailClose').onclick = () => {
542
+ document.getElementById('detailPanel').classList.remove('open');
543
+ selectedModule = null;
544
+ renderModules();
545
+ };
546
+
547
+ document.getElementById('searchInput').oninput = (e) => {
548
+ searchQuery = e.target.value.toLowerCase();
549
+ renderModules();
550
+ };
551
+
552
+ async function init() {
553
+ try {
554
+ const res = await fetch('/api/data');
555
+ const data = await res.json();
556
+
557
+ allModules = data.modules;
558
+
559
+ document.getElementById('projectName').textContent = data.projectName;
560
+ document.getElementById('scannedAt').textContent = new Date(data.scannedAt).toLocaleTimeString();
561
+
562
+ const testCount = allModules.filter(m => m.type === 'test').length;
563
+ const withTests = allModules.filter(m => m.hasTests && m.type !== 'test').length;
564
+ const covModules = allModules.filter(m => m.coverage?.lines !== undefined);
565
+ const avgCov = covModules.length
566
+ ? (covModules.reduce((s, m) => s + m.coverage.lines, 0) / covModules.length).toFixed(0) + '%'
567
+ : '—';
568
+
569
+ document.getElementById('statModules').textContent = allModules.length;
570
+ document.getElementById('statWithTests').textContent = withTests;
571
+ document.getElementById('statCoverage').textContent = avgCov;
572
+ document.getElementById('statTests').textContent = testCount;
573
+
574
+ document.getElementById('loading').style.display = 'none';
575
+ document.getElementById('moduleGrid').style.display = 'grid';
576
+
577
+ renderAll();
578
+ } catch (err) {
579
+ document.getElementById('loading').textContent = 'Failed to load data: ' + err.message;
580
+ }
581
+ }
582
+
583
+ init();
584
+ </script>
585
+ </body>
586
+ </html>
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "viberadar",
3
+ "version": "0.1.0",
4
+ "description": "Live module map with test coverage for vibecoding projects",
5
+ "main": "./dist/cli.js",
6
+ "bin": {
7
+ "viberadar": "./dist/cli.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc && node scripts/bundle-ui.js",
11
+ "dev": "ts-node src/cli.ts",
12
+ "start": "node dist/cli.js",
13
+ "typecheck": "tsc --noEmit"
14
+ },
15
+ "type": "commonjs",
16
+ "keywords": ["vibe", "coverage", "modules", "cli", "dashboard"],
17
+ "author": "",
18
+ "license": "MIT",
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "dependencies": {
23
+ "open": "^10.1.0",
24
+ "chokidar": "^3.6.0",
25
+ "glob": "^11.0.0"
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "^22.0.0",
29
+ "typescript": "^5.7.0",
30
+ "ts-node": "^10.9.2"
31
+ },
32
+ "engines": {
33
+ "node": ">=18"
34
+ }
35
+ }