@chahuadev/junk-sweeper-app 1.1.1 → 2.0.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.
package/LICENSE.md ADDED
@@ -0,0 +1,54 @@
1
+ # CHAHUADEV NON-COMMERCIAL & ACCEPTABLE USE LICENSE
2
+
3
+ Copyright (c) 2026 Chahuadev. All rights reserved.
4
+
5
+ This software and its source code are provided for educational, personal, and open-source community use. By downloading, accessing, or using this software, you agree to the following conditions:
6
+
7
+ ---
8
+
9
+ ## 1. FREE DISTRIBUTION ONLY (การแจกจ่ายต้องฟรีเท่านั้น)
10
+
11
+ You are permitted to download, copy, modify, and distribute the software and its source code, provided that such distribution is **strictly free of charge**.
12
+
13
+ ---
14
+
15
+ ## 2. NO COMMERCIAL USE (ห้ามใช้หรือดัดแปลงเพื่อการค้า)
16
+
17
+ You may **NOT** use, modify, distribute, or incorporate this software (or any of its parts) for any commercial purposes. This includes, but is not limited to:
18
+
19
+ - Selling the software or derived versions.
20
+ - Locking the software behind a paywall or subscription.
21
+ - Using the software to provide commercial services.
22
+ - Placing advertisements within the software.
23
+
24
+ ---
25
+
26
+ ## 3. ACCEPTABLE USE / NO MALICIOUS USE (ห้ามใช้ในทางที่ผิด)
27
+
28
+ This software must not be used for any illegal, malicious, or harmful activities. You are strictly prohibited from using this codebase to:
29
+
30
+ - Create malware, ransomware, or any destructive software.
31
+ - Bypass security systems, steal data, or perform unauthorized access.
32
+ - Violate any local, national, or international laws.
33
+
34
+ If the software is found to be used in violation of these terms, your license to use it is immediately and permanently terminated without notice.
35
+
36
+ ---
37
+
38
+ ## 4. ATTRIBUTION (ต้องแสดงแหล่งที่มา)
39
+
40
+ Any permitted distribution or modification must clearly credit the original author:
41
+
42
+ > Original work by **Chahuadev** — https://chahuadev.com
43
+
44
+ You may not remove, obscure, or alter any copyright notices or attribution present in the source code or documentation.
45
+
46
+ ---
47
+
48
+ ## 5. DISCLAIMER OF LIABILITY (ข้อสงวนสิทธิ์ความรับผิดชอบ)
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51
+
52
+ ---
53
+
54
+ For questions regarding licensing, contact: **Chahuadev** via https://chahuadev.com
package/README.md CHANGED
@@ -5,14 +5,14 @@
5
5
  <div align="center">
6
6
 
7
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">
8
+ <img src="https://huggingface.co/datasets/chahuadev/chahuadev-png/resolve/main/chahuadev-junk-sweeper.png" width="600" alt="Junk Sweeper — Main Dashboard">
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
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
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
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">
15
+ <a href="https://huggingface.co/datasets/chahuadev/chahuadev-junk-sweeper/blob/main/LICENSE.md"><img src="https://img.shields.io/badge/License-Non--Commercial-blue?style=for-the-badge" alt="Non-Commercial License"></a>
16
16
  </p>
17
17
 
18
18
  </div>
package/index.js CHANGED
@@ -1,47 +1,41 @@
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
- }
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
+ if (platform === 'win32') {
13
+ exeName = 'Junk Sweeper 1.0.0.exe';
14
+ } else if (platform === 'linux') {
15
+ exeName = 'Junk Sweeper-1.0.0.AppImage';
16
+ } else {
17
+ console.error(`Chahuadev Junk Sweeper does not support ${platform} ${arch} yet.`);
18
+ process.exit(1);
19
+ }
20
+
21
+ const getPath = () => {
22
+ const exePath = path.join(__dirname, 'bin', exeName);
23
+ if (!fs.existsSync(exePath)) {
24
+ console.error(`Executable not found: ${exePath}`);
25
+ console.error('Try reinstalling: npm install -g @chahuadev/junk-sweeper-app --foreground-scripts --force');
26
+ process.exit(1);
27
+ }
28
+ return exePath;
29
+ };
30
+
31
+ const run = () => {
32
+ try {
33
+ spawnSync(getPath(), process.argv.slice(2), { stdio: 'inherit' });
34
+ } catch (error) {
35
+ console.error('Failed to start Chahuadev Junk Sweeper:', error.message);
36
+ process.exit(1);
37
+ }
38
+ };
39
+
40
+ if (require.main === module) run();
41
+ else module.exports = { run, getPath };
package/install.js CHANGED
@@ -1,99 +1,75 @@
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 = 'https://huggingface.co/datasets/chahuadev/chahuadev-framework-binaries/resolve/main/Junk%20Sweeper-1.0.0.AppImage?download=true';
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);
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
+ const R2_BASE = 'https://pub-419d22521da042dfb27d1f404b3eb8a6.r2.dev';
11
+
12
+ let downloadUrl = '';
13
+ let fileName = '';
14
+
15
+ if (platform === 'win32') {
16
+ downloadUrl = `${R2_BASE}/Junk-Sweeper.exe`;
17
+ fileName = 'Junk Sweeper.exe';
18
+ } else if (platform === 'linux') {
19
+ downloadUrl = `${R2_BASE}/Junk-Sweeper.AppImage`;
20
+ fileName = 'Junk Sweeper.AppImage';
21
+ } else {
22
+ console.warn(`Chahuadev Junk Sweeper does not support ${platform} ${arch} yet.`);
23
+ process.exit(0);
24
+ }
25
+
26
+ const binDir = path.join(__dirname, 'bin');
27
+ if (!fs.existsSync(binDir)) fs.mkdirSync(binDir, { recursive: true });
28
+
29
+ const filePath = path.join(binDir, fileName);
30
+ console.log(`\nChahuadev Junk Sweeper -- Downloading binary for ${platform} (${arch})...`);
31
+ console.log('Please wait, this may take a few minutes.\n');
32
+
33
+ function downloadFile(url, dest) {
34
+ https.get(url, (response) => {
35
+ if (response.statusCode === 301 || response.statusCode === 302) {
36
+ return downloadFile(response.headers.location, dest);
37
+ }
38
+ if (response.statusCode !== 200) {
39
+ console.error(`Download failed: HTTP ${response.statusCode}`);
40
+ process.exit(1);
41
+ }
42
+ const totalBytes = parseInt(response.headers['content-length'], 10);
43
+ let downloadedBytes = 0;
44
+ const file = fs.createWriteStream(dest);
45
+ response.on('data', (chunk) => {
46
+ downloadedBytes += chunk.length;
47
+ if (!isNaN(totalBytes)) {
48
+ const percent = ((downloadedBytes / totalBytes) * 100).toFixed(1);
49
+ const dlMB = (downloadedBytes / (1024 * 1024)).toFixed(1);
50
+ const totalMB = (totalBytes / (1024 * 1024)).toFixed(1);
51
+ const filled = Math.round(30 * downloadedBytes / totalBytes);
52
+ const bar = '#'.repeat(filled) + '-'.repeat(30 - filled);
53
+ process.stdout.write(`\r[${bar}] ${percent}% (${dlMB} MB / ${totalMB} MB)`);
54
+ } else {
55
+ process.stdout.write(`\rDownloading... ${(downloadedBytes / (1024 * 1024)).toFixed(1)} MB`);
56
+ }
57
+ });
58
+ response.pipe(file);
59
+ file.on('finish', () => {
60
+ file.close();
61
+ console.log('\n\nDownload completed.');
62
+ console.log(`Saved to: ${dest}`);
63
+ console.log('\nRun the app with:');
64
+ console.log(' junk-sweeper');
65
+ console.log(' npx @chahuadev/junk-sweeper-app\n');
66
+ if (platform !== 'win32') fs.chmodSync(dest, 0o755);
67
+ });
68
+ }).on('error', (err) => {
69
+ fs.unlink(dest, () => {});
70
+ console.error('\nDownload failed:', err.message);
71
+ process.exit(1);
72
+ });
73
+ }
74
+
75
+ downloadFile(downloadUrl, filePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chahuadev/junk-sweeper-app",
3
- "version": "1.1.1",
3
+ "version": "2.0.1",
4
4
  "description": "Chahuadev Junk Sweeper — AST-based dead code & silent bug detector with interactive architecture map",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "email": "chahuadev@gmail.com",
29
29
  "url": "https://chahuadev.com"
30
30
  },
31
- "license": "MIT",
31
+ "license": "SEE LICENSE IN LICENSE.md",
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },