@chahuadev/junk-sweeper-app 1.0.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.
Files changed (4) hide show
  1. package/README.md +86 -0
  2. package/index.js +47 -0
  3. package/install.js +99 -0
  4. package/package.json +40 -0
package/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # @chahuadev/junk-sweeper-app
2
+
3
+ **Chahuadev Junk Sweeper** β€” AST-based dead code & silent bug detector with an interactive architecture map.
4
+
5
+ <div align="center">
6
+
7
+ <p align="center">
8
+ <img src="https://huggingface.co/datasets/chahuadev/chahuadev-junk-sweeper/resolve/main/chahuadev-junk-sweeper.png" width="600" alt="Junk Sweeper β€” Main Dashboard">
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@chahuadev/junk-sweeper-app"><img src="https://img.shields.io/npm/v/@chahuadev/junk-sweeper-app?style=for-the-badge&color=blue" alt="NPM Version"></a>
13
+ <a href="https://www.npmjs.com/package/@chahuadev/junk-sweeper-app"><img src="https://img.shields.io/npm/dt/@chahuadev/junk-sweeper-app?style=for-the-badge&color=success" alt="NPM Downloads"></a>
14
+ <img src="https://img.shields.io/badge/Platform-Windows-0078D4?style=for-the-badge&logo=windows&logoColor=white" alt="Windows">
15
+ <img src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge" alt="MIT">
16
+ </p>
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ ## βš™οΈ Installation
23
+
24
+ > **Auto-download:** On install, the binary for your platform is downloaded automatically using `--foreground-scripts` so you can see the progress bar.
25
+
26
+ ### Global Install (Recommended)
27
+
28
+ ```bash
29
+ npm install -g @chahuadev/junk-sweeper-app --foreground-scripts --force
30
+ ```
31
+
32
+ ### Launch
33
+
34
+ ```bash
35
+ junk-sweeper
36
+ ```
37
+
38
+ ---
39
+
40
+ ## πŸš€ What It Does
41
+
42
+ While standard linters look for syntax errors, **Chahuadev Junk Sweeper** uses deep AST analysis to understand the *context* and *architecture* of your entire project.
43
+
44
+ ### πŸ› Silent Bug Catcher
45
+ Detects logical flaws that compile fine but silently break business logic:
46
+
47
+ | Pattern | What It Catches |
48
+ |---|---|
49
+ | **Empty Catch Blocks** | Errors swallowed with `catch(e) {}` β€” bugs disappear without a trace |
50
+ | **Zombie Event Listeners** | `.addEventListener()` without `.removeEventListener()` β€” memory leaks |
51
+ | **Scope Shadowing** | Inner variable re-declaring an outer name β€” wrong value runs silently |
52
+ | **Floating Promises** | `async` calls without `await` inside `try/catch` β€” rejections go unhandled |
53
+
54
+ ### πŸ—ΊοΈ Interactive Architecture Map (n8n-style)
55
+ - **Left-to-Right auto-layout** β€” see cross-file dependency flow instantly
56
+ - **Drag nodes freely** β€” organise your architecture your way
57
+ - **Save / Load / Copy Layout** β€” positions persist across sessions
58
+ - **Bidirectional issue ↔ map linking** β€” click an issue to fly to its node; click a node to filter issues
59
+
60
+ ### ⚑ One-Click VS Code Integration
61
+ Click any filename in the report β†’ VS Code opens at the **exact problematic line**.
62
+
63
+ ### 🧡 Multi-Threaded Performance
64
+ Worker Threads keep the UI responsive while scanning 1,000+ file projects.
65
+
66
+ ---
67
+
68
+ ## πŸ“¦ Platform Support
69
+
70
+ | Platform | Architecture | Status |
71
+ |---|---|---|
72
+ | Windows | x64 | βœ… Supported |
73
+ | Windows | ia32 | βœ… Supported |
74
+ | Linux | x64 | πŸ”œ Coming soon |
75
+ | macOS | arm64 / x64 | πŸ”œ Coming soon |
76
+
77
+ ---
78
+
79
+ ## πŸ”— Links
80
+
81
+ - [HuggingFace Dataset](https://huggingface.co/datasets/chahuadev/chahuadev-junk-sweeper)
82
+ - [NPM Package](https://www.npmjs.com/package/@chahuadev/junk-sweeper-app)
83
+
84
+ ---
85
+
86
+ *Made by [Chahuadev](https://chahuadev.com) | Security-First Code Analysis Tools*
package/index.js ADDED
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const path = require('path');
4
+ const { spawnSync } = require('child_process');
5
+ const os = require('os');
6
+ const fs = require('fs');
7
+
8
+ const platform = os.platform();
9
+ const arch = os.arch();
10
+
11
+ let exeName = '';
12
+
13
+ if (platform === 'win32') {
14
+ exeName = arch === 'ia32' ? 'junk-sweeper-win-ia32.exe' : 'junk-sweeper-win-x64.exe';
15
+ } else if (platform === 'linux') {
16
+ exeName = 'junk-sweeper.AppImage';
17
+ } else {
18
+ console.error(`❌ Chahuadev Junk Sweeper does not support ${platform} ${arch} yet.`);
19
+ process.exit(1);
20
+ }
21
+
22
+ const getPath = () => {
23
+ const exePath = path.join(__dirname, 'bin', exeName);
24
+ if (!fs.existsSync(exePath)) {
25
+ console.error(`\n❌ Executable not found: ${exePath}`);
26
+ console.error('πŸ‘‰ Try reinstalling: npm install -g @chahuadev/junk-sweeper-app --foreground-scripts --force\n');
27
+ process.exit(1);
28
+ }
29
+ return exePath;
30
+ };
31
+
32
+ const run = () => {
33
+ try {
34
+ const exePath = getPath();
35
+ const args = process.argv.slice(2);
36
+ spawnSync(exePath, args, { stdio: 'inherit' });
37
+ } catch (error) {
38
+ console.error('❌ Failed to start Chahuadev Junk Sweeper:', error.message);
39
+ process.exit(1);
40
+ }
41
+ };
42
+
43
+ if (require.main === module) {
44
+ run();
45
+ } else {
46
+ module.exports = { run, getPath };
47
+ }
package/install.js ADDED
@@ -0,0 +1,99 @@
1
+ 'use strict';
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const https = require('https');
5
+ const os = require('os');
6
+
7
+ const platform = os.platform();
8
+ const arch = os.arch();
9
+
10
+ let downloadUrl = '';
11
+ let fileName = '';
12
+
13
+ if (platform === 'win32') {
14
+ if (arch === 'x64') {
15
+ downloadUrl = 'https://huggingface.co/datasets/chahuadev/chahuadev-framework-binaries/resolve/main/Junk%20Sweeper%201.0.0.exe?download=true';
16
+ fileName = 'junk-sweeper-win-x64.exe';
17
+ } else if (arch === 'ia32') {
18
+ downloadUrl = 'https://huggingface.co/datasets/chahuadev/chahuadev-framework-binaries/resolve/main/Junk%20Sweeper%201.0.0.exe?download=true';
19
+ fileName = 'junk-sweeper-win-ia32.exe';
20
+ }
21
+ } else if (platform === 'linux') {
22
+ // Placeholder β€” Linux AppImage build coming in a future release
23
+ downloadUrl = '';
24
+ fileName = 'junk-sweeper.AppImage';
25
+ }
26
+
27
+ if (!downloadUrl) {
28
+ console.warn(`\n⚠️ Skipping download: Chahuadev Junk Sweeper does not support ${platform} ${arch} yet.`);
29
+ process.exit(0);
30
+ }
31
+
32
+ const binDir = path.join(__dirname, 'bin');
33
+ if (!fs.existsSync(binDir)) {
34
+ fs.mkdirSync(binDir, { recursive: true });
35
+ }
36
+
37
+ const filePath = path.join(binDir, fileName);
38
+
39
+ console.log(`\nπŸ” Chahuadev Junk Sweeper β€” Downloading binary for ${platform} (${arch})...`);
40
+ console.log(`⏳ Please wait, this may take a few minutes depending on your connection.\n`);
41
+
42
+ function downloadFile(url, dest) {
43
+ https.get(url, (response) => {
44
+ if (response.statusCode === 301 || response.statusCode === 302) {
45
+ return downloadFile(response.headers.location, dest);
46
+ }
47
+
48
+ if (response.statusCode !== 200) {
49
+ console.error(`\n❌ Download failed: HTTP ${response.statusCode}`);
50
+ process.exit(1);
51
+ }
52
+
53
+ const totalBytes = parseInt(response.headers['content-length'], 10);
54
+ let downloadedBytes = 0;
55
+
56
+ const file = fs.createWriteStream(dest);
57
+
58
+ response.on('data', (chunk) => {
59
+ downloadedBytes += chunk.length;
60
+
61
+ if (!isNaN(totalBytes)) {
62
+ const percent = ((downloadedBytes / totalBytes) * 100).toFixed(1);
63
+ const downloadedMB = (downloadedBytes / (1024 * 1024)).toFixed(1);
64
+ const totalMB = (totalBytes / (1024 * 1024)).toFixed(1);
65
+
66
+ const barLength = 30;
67
+ const filledLength = Math.round((barLength * downloadedBytes) / totalBytes);
68
+ const bar = 'β–ˆ'.repeat(filledLength) + 'β–‘'.repeat(barLength - filledLength);
69
+
70
+ process.stdout.write(`\r[${bar}] ${percent}% (${downloadedMB} MB / ${totalMB} MB)`);
71
+ } else {
72
+ const downloadedMB = (downloadedBytes / (1024 * 1024)).toFixed(1);
73
+ process.stdout.write(`\rDownloading... ${downloadedMB} MB`);
74
+ }
75
+ });
76
+
77
+ response.pipe(file);
78
+
79
+ file.on('finish', () => {
80
+ file.close();
81
+ console.log('\n');
82
+ console.log('βœ… Download completed successfully!');
83
+ console.log(`πŸ“‚ Saved to: ${dest}`);
84
+ console.log('');
85
+ console.log('πŸš€ Run the app with:');
86
+ console.log(' junk-sweeper');
87
+ console.log(' npx @chahuadev/junk-sweeper-app\n');
88
+
89
+ if (platform !== 'win32') fs.chmodSync(dest, 0o755);
90
+ });
91
+
92
+ }).on('error', (err) => {
93
+ fs.unlink(dest, () => {});
94
+ console.error('\n❌ Download failed:', err.message);
95
+ process.exit(1);
96
+ });
97
+ }
98
+
99
+ downloadFile(downloadUrl, filePath);
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@chahuadev/junk-sweeper-app",
3
+ "version": "1.0.0",
4
+ "description": "Chahuadev Junk Sweeper β€” AST-based dead code & silent bug detector with interactive architecture map",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "junk-sweeper": "index.js"
8
+ },
9
+ "scripts": {
10
+ "postinstall": "node install.js"
11
+ },
12
+ "files": [
13
+ "index.js",
14
+ "install.js"
15
+ ],
16
+ "keywords": [
17
+ "junk-sweeper",
18
+ "code-analysis",
19
+ "dead-code",
20
+ "unused-variables",
21
+ "silent-bugs",
22
+ "ast",
23
+ "electron",
24
+ "chahuadev"
25
+ ],
26
+ "author": {
27
+ "name": "Chahuadev",
28
+ "email": "chahuadev@gmail.com",
29
+ "url": "https://chahuadev.com"
30
+ },
31
+ "license": "MIT",
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://huggingface.co/datasets/chahuadev/chahuadev-junk-sweeper"
38
+ },
39
+ "homepage": "https://huggingface.co/datasets/chahuadev/chahuadev-junk-sweeper"
40
+ }