Skip to content

Commit 1923df5

Browse files
(v0.0.4) Merge pull request #6 from Ulrich-Tonmoy/0.0.4
0.0.4
2 parents 62a5ae8 + cf76545 commit 1923df5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1363
-1144
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616

1717
### Features
1818

19-
- [x] Show LTS, Current, Stable and Unstable old available Node Version.
20-
- [x] Download/install Multiple Node versions.
21-
- [x] Change Node version from the installed/downloaded version.
22-
- [x] Change Theme dark/light/system
23-
- [x] Change font Monaspace {Argon, Krypton, Neon, Radon, Xenon}
19+
- [x] Search by version, sort and filter by version, release date, npm & v8 version, type (LTS, Current, Stable, Unstable) and status (Active, Installed).
20+
- [x] Simultaneously download and install multiple Node.js versions, and switch between them with ease.
21+
- [x] Change theme and font style (dark/light/system theme and monospace fonts such as Argon, Krypton, Neon, Radon, Xenon)
22+
- [x] Download multiple node version concurrently.
2423

2524
### Technologies
2625

docs/v-features.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
### 0.0.4:
2+
3+
- [x] Migrate from Tailwind css v3 to v4.
4+
- [x] Upgrade deps to latest and fix window resizing.
5+
- [x] Updated UI from flat name to table with more info and sorting.
6+
- [x] Download multiple node version concurrently.
7+
18
### 0.0.3:
29

310
- [x] Cleanup unused code and resources.

docs/vm-old.png

148 KB
Loading

docs/vm.png

107 KB
Loading

package-lock.json

Lines changed: 316 additions & 143 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "version-manager",
33
"private": true,
4-
"version": "0.0.3",
4+
"version": "0.0.4",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -17,6 +17,7 @@
1717
"@radix-ui/react-label": "^2.1.2",
1818
"@radix-ui/react-slot": "^1.1.2",
1919
"@radix-ui/react-tooltip": "^1.1.8",
20+
"@tanstack/react-table": "^8.21.2",
2021
"@tauri-apps/api": "^2",
2122
"@tauri-apps/plugin-dialog": "^2.2.0",
2223
"@tauri-apps/plugin-fs": "^2.2.0",
@@ -35,13 +36,13 @@
3536
"@types/node": "^22.13.4",
3637
"@types/react": "^19.0.8",
3738
"@types/react-dom": "^19.0.3",
38-
"@vitejs/plugin-react": "^4.3.4",
39+
"@vitejs/plugin-react": "^1.3.2",
3940
"clsx": "^2.1.1",
4041
"path": "^0.12.7",
4142
"postcss": "^8.5.2",
4243
"tailwind-merge": "^3.0.1",
4344
"tailwindcss": "^4.0.6",
4445
"typescript": "^5.7.3",
45-
"vite": "^6.1.0"
46+
"vite": "^6.1.1"
4647
}
4748
}

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "version-manager"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
description = "Version Manager"
55
authors = ["Ulrich-Tonmoy"]
66
edition = "2021"

src-tauri/src/download.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use reqwest::Client;
2+
use std::collections::HashMap;
23
use std::fs::{File, OpenOptions};
34
use std::io::Write;
45
use std::sync::{Arc, Mutex};
@@ -8,7 +9,7 @@ use tauri::{Emitter, Manager};
89
use tokio::fs;
910
use zip::read::ZipArchive;
1011

11-
pub struct ProgressState(pub Arc<Mutex<f32>>);
12+
pub struct DownloadState(pub Arc<Mutex<HashMap<String, f32>>>);
1213

1314
#[tauri::command]
1415
pub async fn download_and_unzip<R: tauri::Runtime>(
@@ -17,10 +18,15 @@ pub async fn download_and_unzip<R: tauri::Runtime>(
1718
dest: String,
1819
old_name: String,
1920
new_name: String,
20-
state: State<'_, ProgressState>, // State containing Arc<Mutex<f32>>
21+
state: State<'_, DownloadState>,
2122
) -> Result<(), String> {
22-
let progress_arc = state.0.clone(); // Clone the Arc for use in async task
23-
let (tx, mut rx) = channel::<f32>(100);
23+
let progress_arc = state.0.clone();
24+
{
25+
let mut progress_map = progress_arc.lock().unwrap();
26+
progress_map.insert(new_name.clone(), 0.0);
27+
}
28+
29+
let (tx, mut rx) = channel::<(String, f32)>(100);
2430

2531
// Ensure the destination directory exists
2632
if !std::path::Path::new(&dest).exists() {
@@ -48,11 +54,11 @@ pub async fn download_and_unzip<R: tauri::Runtime>(
4854

4955
let progress = downloaded / total_size * 100.0;
5056
{
51-
let mut progress_lock = progress_arc.lock().unwrap(); // Use cloned Arc
52-
*progress_lock = progress; // Update the progress in the state
57+
let mut progress_map = progress_arc.lock().unwrap();
58+
progress_map.insert(new_name.clone(), progress);
5359
}
5460

55-
tx.send(progress).await.unwrap();
61+
tx.send((new_name.clone(), progress)).await.unwrap();
5662
}
5763

5864
let file = File::open(&zip_path).map_err(|e| e.to_string()).unwrap();
@@ -115,9 +121,11 @@ pub async fn download_and_unzip<R: tauri::Runtime>(
115121
});
116122

117123
tauri::async_runtime::spawn(async move {
118-
while let Some(progress) = rx.recv().await {
124+
while let Some((version, progress)) = rx.recv().await {
119125
let window = app_handle.get_webview_window("main").unwrap();
120-
window.emit("download_progress", progress).unwrap();
126+
window
127+
.emit("download_progress", (version, progress))
128+
.unwrap();
121129
}
122130
});
123131

src-tauri/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
22
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
33

4+
use std::collections::HashMap;
45
use std::sync::{Arc, Mutex};
56

67
mod download;
@@ -12,7 +13,9 @@ fn main() {
1213
.plugin(tauri_plugin_http::init())
1314
.plugin(tauri_plugin_shell::init())
1415
.plugin(tauri_plugin_fs::init())
15-
.manage(download::ProgressState(Arc::new(Mutex::new(0.0))))
16+
.manage(download::DownloadState(Arc::new(
17+
Mutex::new(HashMap::new()),
18+
)))
1619
.invoke_handler(tauri::generate_handler![
1720
win_path::get_user_path,
1821
win_path::set_user_path,

0 commit comments

Comments
 (0)