@chahuadev/chahuadev-hub-app 1.0.6 → 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/README.md +23 -62
- package/index.js +10 -16
- package/install.js +24 -47
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# @chahuadev/chahuadev-hub-app
|
|
2
2
|
|
|
3
|
-
**Chahuadev Hub** — The official
|
|
3
|
+
**Chahuadev Hub** — The official desktop hub by Chahuadev. Browse repositories, download apps, explore npm packages, and chat with the community — all in one dark-mode Electron app.
|
|
4
4
|
|
|
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-hub/resolve/main/chahuadev-hub.png" width="600" alt="Chahuadev Hub">
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
## ⚙️ Installation
|
|
23
23
|
|
|
24
|
-
> **
|
|
24
|
+
> **Requires Node.js 18+.** Use `--foreground-scripts` to see install progress.
|
|
25
25
|
|
|
26
26
|
### 🪟 Windows — Global Install
|
|
27
27
|
|
|
@@ -54,58 +54,39 @@ sudo npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
|
|
|
54
54
|
```bash
|
|
55
55
|
chahuadev-hub
|
|
56
56
|
```
|
|
57
|
-
> **Note:** Downloaded apps will be automatically saved to your `Downloads/ChahuadevHub` folder.
|
|
58
57
|
|
|
59
|
-
> **
|
|
60
|
-
|
|
61
|
-
> ```bash
|
|
62
|
-
> cd ~/.npm-global/lib/node_modules/@chahuadev/chahuadev-hub-app/bin
|
|
63
|
-
> ./chahuadev_hub
|
|
64
|
-
> ```
|
|
65
|
-
>
|
|
66
|
-
> If you installed with `sudo`, the folder may be under `/usr/local/lib/` instead:
|
|
67
|
-
> ```bash
|
|
68
|
-
> cd /usr/local/lib/node_modules/@chahuadev/chahuadev-hub-app/bin
|
|
69
|
-
> ./chahuadev_hub
|
|
70
|
-
> ```
|
|
58
|
+
> **Note:** Downloaded apps are saved automatically to your `Downloads/ChahuadevHub` folder.
|
|
59
|
+
|
|
71
60
|
---
|
|
72
61
|
|
|
73
|
-
##
|
|
62
|
+
## 🛠️ Troubleshooting
|
|
74
63
|
|
|
75
|
-
### `node\r: No such file or directory`
|
|
64
|
+
### `node\r: No such file or directory` (Linux)
|
|
76
65
|
|
|
77
|
-
|
|
78
|
-
If you're on an older version, reinstall:
|
|
66
|
+
The entry script has Windows line endings (CRLF). Reinstall to fix:
|
|
79
67
|
|
|
80
68
|
```bash
|
|
81
69
|
rm -rf ~/.npm-global/lib/node_modules/@chahuadev/chahuadev-hub-app
|
|
82
70
|
npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
|
|
83
71
|
```
|
|
84
72
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
cd ~/.npm-global/lib/node_modules/@chahuadev/chahuadev-hub-app/bin
|
|
89
|
-
./chahuadev_hub
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### ENOTEMPTY error on Linux (directory not empty)
|
|
73
|
+
### `ENOTEMPTY` error on Linux
|
|
93
74
|
|
|
94
|
-
|
|
75
|
+
A previous failed install left files behind. Clear them first:
|
|
95
76
|
|
|
96
77
|
```bash
|
|
97
|
-
#
|
|
78
|
+
# With npm-global prefix
|
|
98
79
|
rm -rf ~/.npm-global/lib/node_modules/@chahuadev/chahuadev-hub-app
|
|
99
80
|
npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
|
|
100
81
|
|
|
101
|
-
#
|
|
82
|
+
# With sudo
|
|
102
83
|
sudo rm -rf /usr/lib/node_modules/@chahuadev/chahuadev-hub-app
|
|
103
84
|
sudo npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
|
|
104
85
|
```
|
|
105
86
|
|
|
106
|
-
###
|
|
87
|
+
### `chahuadev-hub` command not found
|
|
107
88
|
|
|
108
|
-
|
|
89
|
+
Make sure `~/.npm-global/bin` is in your PATH:
|
|
109
90
|
|
|
110
91
|
```bash
|
|
111
92
|
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
|
|
@@ -113,44 +94,24 @@ source ~/.bashrc
|
|
|
113
94
|
chahuadev-hub
|
|
114
95
|
```
|
|
115
96
|
|
|
116
|
-
### `ModuleNotFoundError: No module named 'tkinter'` (Linux)
|
|
117
|
-
|
|
118
|
-
The Linux binary requires `tkinter` to be present at build time. If you see this error, the downloaded binary was built on a system without `tkinter` installed. You need to build from source:
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
# 1. Install tkinter
|
|
122
|
-
sudo apt-get install python3-tk python3-dev -y
|
|
123
|
-
|
|
124
|
-
# 2. Install Python dependencies
|
|
125
|
-
pip3 install customtkinter requests pyinstaller
|
|
126
|
-
|
|
127
|
-
# 3. Go into the project folder
|
|
128
|
-
cd /path/to/Chahuadev-Hub-Python
|
|
129
|
-
|
|
130
|
-
# 4. Build the binary
|
|
131
|
-
python3 -m PyInstaller --onefile chahuadev_hub.py
|
|
132
|
-
|
|
133
|
-
# 5. Run it
|
|
134
|
-
cd dist
|
|
135
|
-
./chahuadev_hub
|
|
136
|
-
```
|
|
137
|
-
|
|
138
97
|
---
|
|
139
98
|
|
|
140
|
-
##
|
|
99
|
+
## 🚀 What It Does
|
|
141
100
|
|
|
142
|
-
|
|
101
|
+
Chahuadev Hub is an Electron desktop app that brings everything from the Chahuadev ecosystem into one place.
|
|
143
102
|
|
|
144
103
|
### ✨ Features
|
|
145
104
|
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
105
|
+
- 📊 **Dashboard** — Live stats and a full landing page webview with real-time download counts
|
|
106
|
+
- 📦 **npm Packages** — Browse all `@chahuadev` packages with version, description, and monthly download stats
|
|
107
|
+
- 🤗 **Hugging Face** — Explore all public datasets, models, and spaces with file browser and commit history
|
|
108
|
+
- ⬇️ **Downloads** — Download and manage official Chahuadev desktop apps (Windows & Linux) with progress tracking
|
|
109
|
+
- 💬 **Community Chat** — Real-time chat via Firebase with auto-translation across 11 languages
|
|
110
|
+
- 🌐 **Cross-Platform** — Windows & Linux
|
|
150
111
|
|
|
151
112
|
---
|
|
152
113
|
|
|
153
114
|
## 🔗 Links
|
|
154
115
|
|
|
116
|
+
- [npm](https://www.npmjs.com/package/@chahuadev/chahuadev-hub-app)
|
|
155
117
|
- [Hugging Face](https://huggingface.co/chahuadev)
|
|
156
|
-
- [PyPI](https://pypi.org/project/chahuadev-hub/)
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const { spawnSync } = require('child_process');
|
|
@@ -9,21 +9,20 @@ const platform = os.platform();
|
|
|
9
9
|
const arch = os.arch();
|
|
10
10
|
|
|
11
11
|
let exeName = '';
|
|
12
|
-
|
|
13
12
|
if (platform === 'win32') {
|
|
14
|
-
exeName = '
|
|
13
|
+
exeName = 'Chahuadev-Hub.exe';
|
|
15
14
|
} else if (platform === 'linux') {
|
|
16
|
-
exeName = '
|
|
15
|
+
exeName = 'Chahuadev-Hub.AppImage';
|
|
17
16
|
} else {
|
|
18
|
-
console.error(
|
|
17
|
+
console.error(`Chahuadev Hub does not support ${platform} ${arch}`);
|
|
19
18
|
process.exit(1);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
const getPath = () => {
|
|
23
22
|
const exePath = path.join(__dirname, 'bin', exeName);
|
|
24
23
|
if (!fs.existsSync(exePath)) {
|
|
25
|
-
console.error(
|
|
26
|
-
console.error('
|
|
24
|
+
console.error(`Executable not found: ${exePath}`);
|
|
25
|
+
console.error('Try running "npm install" again to download the binary.');
|
|
27
26
|
process.exit(1);
|
|
28
27
|
}
|
|
29
28
|
return exePath;
|
|
@@ -31,17 +30,12 @@ const getPath = () => {
|
|
|
31
30
|
|
|
32
31
|
const run = () => {
|
|
33
32
|
try {
|
|
34
|
-
|
|
35
|
-
const args = process.argv.slice(2);
|
|
36
|
-
spawnSync(exePath, args, { stdio: 'inherit' });
|
|
33
|
+
spawnSync(getPath(), process.argv.slice(2), { stdio: 'inherit' });
|
|
37
34
|
} catch (error) {
|
|
38
|
-
console.error('
|
|
35
|
+
console.error('Failed to start Chahuadev Hub:', error.message);
|
|
39
36
|
process.exit(1);
|
|
40
37
|
}
|
|
41
38
|
};
|
|
42
39
|
|
|
43
|
-
if (require.main === module)
|
|
44
|
-
|
|
45
|
-
} else {
|
|
46
|
-
module.exports = { run, getPath };
|
|
47
|
-
}
|
|
40
|
+
if (require.main === module) run();
|
|
41
|
+
else module.exports = { run, getPath };
|
package/install.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const https = require('https');
|
|
@@ -7,92 +7,69 @@ const os = require('os');
|
|
|
7
7
|
const platform = os.platform();
|
|
8
8
|
const arch = os.arch();
|
|
9
9
|
|
|
10
|
+
const R2_BASE = 'https://pub-419d22521da042dfb27d1f404b3eb8a6.r2.dev';
|
|
11
|
+
|
|
10
12
|
let downloadUrl = '';
|
|
11
13
|
let fileName = '';
|
|
12
14
|
|
|
13
15
|
if (platform === 'win32') {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
fileName = 'chahuadev_hub.exe';
|
|
16
|
+
downloadUrl = `${R2_BASE}/Chahuadev-Hub.exe`;
|
|
17
|
+
fileName = 'Chahuadev-Hub.exe';
|
|
17
18
|
} else if (platform === 'linux') {
|
|
18
|
-
downloadUrl =
|
|
19
|
-
fileName = '
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (!downloadUrl) {
|
|
23
|
-
console.warn(`\n⚠️ Skipping download: Chahuadev Hub does not support ${platform} ${arch} yet.`);
|
|
19
|
+
downloadUrl = `${R2_BASE}/Chahuadev-Hub.AppImage`;
|
|
20
|
+
fileName = 'Chahuadev-Hub.AppImage';
|
|
21
|
+
} else {
|
|
22
|
+
console.warn(`Chahuadev Hub does not support ${platform} ${arch} yet.`);
|
|
24
23
|
process.exit(0);
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
const binDir = path.join(__dirname, 'bin');
|
|
28
|
-
if (!fs.existsSync(binDir)) {
|
|
29
|
-
fs.mkdirSync(binDir, { recursive: true });
|
|
30
|
-
}
|
|
27
|
+
if (!fs.existsSync(binDir)) fs.mkdirSync(binDir, { recursive: true });
|
|
31
28
|
|
|
32
29
|
const filePath = path.join(binDir, fileName);
|
|
33
|
-
|
|
34
|
-
console.log(
|
|
35
|
-
console.log(`⏳ Please wait, this may take a few minutes depending on your connection.\n`);
|
|
30
|
+
console.log(`\nChahuadev Hub -- Downloading binary for ${platform} (${arch})...`);
|
|
31
|
+
console.log('Please wait, this may take a few minutes.\n');
|
|
36
32
|
|
|
37
33
|
function downloadFile(url, dest) {
|
|
38
34
|
https.get(url, (response) => {
|
|
39
35
|
if (response.statusCode === 301 || response.statusCode === 302) {
|
|
40
36
|
return downloadFile(response.headers.location, dest);
|
|
41
37
|
}
|
|
42
|
-
|
|
43
38
|
if (response.statusCode !== 200) {
|
|
44
|
-
console.error(
|
|
39
|
+
console.error(`Download failed: HTTP ${response.statusCode}`);
|
|
45
40
|
process.exit(1);
|
|
46
41
|
}
|
|
47
|
-
|
|
48
42
|
const totalBytes = parseInt(response.headers['content-length'], 10);
|
|
49
43
|
let downloadedBytes = 0;
|
|
50
|
-
|
|
51
44
|
const file = fs.createWriteStream(dest);
|
|
52
|
-
|
|
53
45
|
response.on('data', (chunk) => {
|
|
54
46
|
downloadedBytes += chunk.length;
|
|
55
|
-
|
|
56
47
|
if (!isNaN(totalBytes)) {
|
|
57
48
|
const percent = ((downloadedBytes / totalBytes) * 100).toFixed(1);
|
|
58
|
-
const
|
|
49
|
+
const dlMB = (downloadedBytes / (1024 * 1024)).toFixed(1);
|
|
59
50
|
const totalMB = (totalBytes / (1024 * 1024)).toFixed(1);
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
const bar = '█'.repeat(filledLength) + '░'.repeat(barLength - filledLength);
|
|
64
|
-
|
|
65
|
-
process.stdout.write(`\r[${bar}] ${percent}% (${downloadedMB} MB / ${totalMB} MB)`);
|
|
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)`);
|
|
66
54
|
} else {
|
|
67
|
-
|
|
68
|
-
process.stdout.write(`\rDownloading... ${downloadedMB} MB`);
|
|
55
|
+
process.stdout.write(`\rDownloading... ${(downloadedBytes / (1024 * 1024)).toFixed(1)} MB`);
|
|
69
56
|
}
|
|
70
57
|
});
|
|
71
|
-
|
|
72
58
|
response.pipe(file);
|
|
73
|
-
|
|
74
59
|
file.on('finish', () => {
|
|
75
60
|
file.close();
|
|
76
|
-
console.log('\n');
|
|
77
|
-
console.log(
|
|
78
|
-
console.log(
|
|
79
|
-
console.log('');
|
|
80
|
-
console.log('🚀 Launch the app with:');
|
|
61
|
+
console.log('\n\nDownload completed.');
|
|
62
|
+
console.log(`Saved to: ${dest}`);
|
|
63
|
+
console.log('\nLaunch the app with:');
|
|
81
64
|
console.log(' chahuadev-hub');
|
|
82
65
|
console.log(' npx @chahuadev/chahuadev-hub-app\n');
|
|
83
|
-
|
|
84
|
-
// Make executable on Linux/macOS
|
|
85
|
-
if (platform !== 'win32') {
|
|
86
|
-
fs.chmodSync(dest, 0o755);
|
|
87
|
-
console.log(' chmod +x applied');
|
|
88
|
-
}
|
|
66
|
+
if (platform !== 'win32') fs.chmodSync(dest, 0o755);
|
|
89
67
|
});
|
|
90
|
-
|
|
91
68
|
}).on('error', (err) => {
|
|
92
69
|
fs.unlink(dest, () => {});
|
|
93
|
-
console.error('\
|
|
70
|
+
console.error('\nDownload failed:', err.message);
|
|
94
71
|
process.exit(1);
|
|
95
72
|
});
|
|
96
73
|
}
|
|
97
74
|
|
|
98
|
-
downloadFile(downloadUrl, filePath);
|
|
75
|
+
downloadFile(downloadUrl, filePath);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
2
|
"name": "@chahuadev/chahuadev-hub-app",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Chahuadev Hub
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "Chahuadev Hub” Official app launcher and distribution hub by Chahuadev",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"chahuadev-hub": "index.js"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
36
|
-
"url": "https://huggingface.co/datasets/chahuadev/chahuadev-
|
|
36
|
+
"url": "https://huggingface.co/datasets/chahuadev/chahuadev-hub"
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://huggingface.co/chahuadev"
|
|
39
39
|
}
|