@chahuadev/framework 5.0.7 → 6.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.
- package/LICENSE.md +54 -0
- package/README.md +2 -2
- package/index.js +26 -31
- package/install.js +71 -97
- package/package.json +2 -1
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,7 +5,7 @@ The official core executable framework for Chahuadev.
|
|
|
5
5
|
<div align="center">
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<img src="https://huggingface.co/datasets/chahuadev/chahuadev-
|
|
8
|
+
<img src="https://huggingface.co/datasets/chahuadev/chahuadev-emoji-cleaner-tool/blob/main/chahuadev-framework.png" width="600" alt="Chahuadev Framework">
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
@@ -101,7 +101,7 @@ Your OS/architecture combination is not yet supported. Check the Platform Suppor
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
103
|
## License
|
|
104
|
-
|
|
104
|
+
Non-Commercial & Acceptable Use — See [LICENSE.md](LICENSE.md)
|
|
105
105
|
|
|
106
106
|
---
|
|
107
107
|
|
package/index.js
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
let exeName = '';
|
|
10
|
-
|
|
11
|
-
if (platform === 'win32') {
|
|
12
|
-
exeName =
|
|
13
|
-
} else
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const args = process.argv.slice(2);
|
|
29
|
-
const result = spawnSync(exePath, args, { stdio: 'inherit' });
|
|
30
|
-
|
|
31
|
-
process.exit(result.status || 0);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const { spawnSync } = require('child_process');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
|
|
8
|
+
const platform = os.platform();
|
|
9
|
+
let exeName = '';
|
|
10
|
+
|
|
11
|
+
if (platform === 'win32') {
|
|
12
|
+
exeName = 'Chahuadev-Framework.exe';
|
|
13
|
+
} else {
|
|
14
|
+
console.error(`Chahuadev Framework does not support ${platform} yet.`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const exePath = path.join(__dirname, 'bin', exeName);
|
|
19
|
+
if (!fs.existsSync(exePath)) {
|
|
20
|
+
console.error(`Executable not found: ${exePath}`);
|
|
21
|
+
console.error('Try running "npm install" again to download the binary.');
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const result = spawnSync(exePath, process.argv.slice(2), { stdio: 'inherit' });
|
|
26
|
+
process.exit(result.status ?? 0);
|
package/install.js
CHANGED
|
@@ -1,98 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const downloadedMB = (downloadedBytes / (1024 * 1024)).toFixed(2);
|
|
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\n✅ Download completed successfully!');
|
|
82
|
-
|
|
83
|
-
// *** ชี้เป้าหมายที่อยู่ไฟล์แบบชัดเจน ***
|
|
84
|
-
console.log(`📂 File saved to: ${dest}\n`);
|
|
85
|
-
|
|
86
|
-
// ให้สิทธิ์รันบน Linux
|
|
87
|
-
if (platform !== 'win32') fs.chmodSync(dest, 0o755);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
}).on('error', (err) => {
|
|
91
|
-
fs.unlink(dest, () => {}); // ถ้า error ให้ลบไฟล์ที่โหลดค้างทิ้ง
|
|
92
|
-
console.error('\n❌ Download failed:', err.message);
|
|
93
|
-
process.exit(1);
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// เริ่มดาวน์โหลด
|
|
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}/Chahuadev-Framework.exe`;
|
|
17
|
+
fileName = 'Chahuadev-Framework.exe';
|
|
18
|
+
} else {
|
|
19
|
+
console.warn(`Chahuadev Framework does not have a binary for ${platform} ${arch} yet.`);
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const binDir = path.join(__dirname, 'bin');
|
|
24
|
+
if (!fs.existsSync(binDir)) fs.mkdirSync(binDir, { recursive: true });
|
|
25
|
+
|
|
26
|
+
const filePath = path.join(binDir, fileName);
|
|
27
|
+
console.log(`Downloading Chahuadev Framework for ${platform} (${arch})...`);
|
|
28
|
+
console.log('Please wait, this may take a few minutes.\n');
|
|
29
|
+
|
|
30
|
+
function downloadFile(url, dest) {
|
|
31
|
+
https.get(url, (response) => {
|
|
32
|
+
if (response.statusCode === 301 || response.statusCode === 302) {
|
|
33
|
+
return downloadFile(response.headers.location, dest);
|
|
34
|
+
}
|
|
35
|
+
if (response.statusCode !== 200) {
|
|
36
|
+
console.error(`Download failed: HTTP ${response.statusCode}`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const totalBytes = parseInt(response.headers['content-length'], 10);
|
|
41
|
+
let downloadedBytes = 0;
|
|
42
|
+
const file = fs.createWriteStream(dest);
|
|
43
|
+
|
|
44
|
+
response.on('data', (chunk) => {
|
|
45
|
+
downloadedBytes += chunk.length;
|
|
46
|
+
if (!isNaN(totalBytes)) {
|
|
47
|
+
const percent = ((downloadedBytes / totalBytes) * 100).toFixed(1);
|
|
48
|
+
const dlMB = (downloadedBytes / (1024 * 1024)).toFixed(1);
|
|
49
|
+
const totalMB = (totalBytes / (1024 * 1024)).toFixed(1);
|
|
50
|
+
const filled = Math.round(30 * downloadedBytes / totalBytes);
|
|
51
|
+
const bar = '#'.repeat(filled) + '-'.repeat(30 - filled);
|
|
52
|
+
process.stdout.write(`\r[${bar}] ${percent}% (${dlMB} MB / ${totalMB} MB)`);
|
|
53
|
+
} else {
|
|
54
|
+
process.stdout.write(`\rDownloading... ${(downloadedBytes / (1024 * 1024)).toFixed(1)} MB`);
|
|
55
|
+
}
|
|
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}\n`);
|
|
63
|
+
if (platform !== 'win32') fs.chmodSync(dest, 0o755);
|
|
64
|
+
});
|
|
65
|
+
}).on('error', (err) => {
|
|
66
|
+
fs.unlink(dest, () => {});
|
|
67
|
+
console.error('\nDownload failed:', err.message);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
98
72
|
downloadFile(downloadUrl, filePath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chahuadev/framework",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Chahuadev Framework",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postinstall": "node install.js"
|
|
11
11
|
},
|
|
12
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
12
13
|
"publishConfig": {
|
|
13
14
|
"access": "public"
|
|
14
15
|
}
|