Skip to content

Commit 312fd89

Browse files
authored
Clean up setup scripts (linux) & docs for next release (#340)
* Add more install docs for Linux Additional packages are needed to make `git2` and `ssh2` work * Unify setup scripts into one `setup.ts` can run OS-specific setup scripts by detecting OS * Automate deps install for git2 and ssh2 on Linux * Remove nodejs install, use Bun instead
1 parent d46c75c commit 312fd89

File tree

5 files changed

+38
-35
lines changed

5 files changed

+38
-35
lines changed

bun.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"@commitlint/cli": "^19.8.1",
5252
"@tailwindcss/vite": "^4.1.11",
5353
"@tauri-apps/cli": "^2",
54+
"@types/bun": "^1.2.21",
5455
"@types/node": "^24.1.0",
5556
"@types/react": "^19.1.8",
5657
"@types/react-dom": "^19.1.6",
@@ -452,6 +453,8 @@
452453

453454
"@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.20.7" } }, "sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng=="],
454455

456+
"@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.2.21" } }, "sha512-NiDnvEqmbfQ6dmZ3EeUO577s4P5bf4HCTXtI6trMc6f6RzirY5IrF3aIookuSpyslFzrnvv2lmEWv5HyC1X79A=="],
457+
455458
"@types/conventional-commits-parser": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-7uz5EHdzz2TqoMfV7ee61Egf5y6NkcO4FB/1iCCQnbeiI1F3xzv3vK5dBCXUCLQgGYS+mUeigK1iKQzvED+QnQ=="],
456459

457460
"@types/estree": ["@types/[email protected]", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
@@ -514,6 +517,8 @@
514517

515518
"browserslist": ["[email protected]", "", { "dependencies": { "caniuse-lite": "^1.0.30001726", "electron-to-chromium": "^1.5.173", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw=="],
516519

520+
"bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-sa2Tj77Ijc/NTLS0/Odjq/qngmEPZfbfnOERi0KRUYhT9R8M4VBioWVmMWE5GrYbKMc+5lVybXygLdibHaqVqw=="],
521+
517522
"callsites": ["[email protected]", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="],
518523

519524
"caniuse-lite": ["[email protected]", "", {}, "sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q=="],

docs/develop/linux.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ bun setup
1515
1. **Install Bun**: Visit [bun.sh](https://bun.sh) for installation instructions
1616
2. **Install Rust**: Visit [rustup.rs](https://rustup.rs) for installation instructions
1717

18+
**Additional Packages**
19+
20+
When installing `git2` and `ssh2` crates using `vendored-openssl` features, there are additional packages you may need to prevent installation failure
21+
22+
This one's for Fedora, but the packages should be the same for other distros
23+
```sh
24+
sudo dnf install openssl-devel pkgconf perl-FindBin perl-IPC-Cmd perl
25+
```
26+
1827
### Setup
1928

2029
```bash

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
"clean": "concurrently --names \"node,rust\" --prefix-colors \"cyan,yellow\" \"rimraf dist build node_modules bun.lockb && bun install\" \"cargo clean && cargo build\"",
1717
"prepare": "simple-git-hooks",
1818
"commitlint": "commitlint",
19-
"setup": "chmod +x scripts/linux/setup.sh && ./scripts/linux/setup.sh",
20-
"setup:linux": "chmod +x scripts/linux/setup.sh && ./scripts/linux/setup.sh",
21-
"setup-win": "powershell -ExecutionPolicy Bypass -File ./scripts/windows/setup.ps1",
19+
"setup": "bun setup.ts",
2220
"dev": "bun run tauri dev"
2321
},
2422
"dependencies": {
@@ -69,6 +67,7 @@
6967
"@commitlint/cli": "^19.8.1",
7068
"@tailwindcss/vite": "^4.1.11",
7169
"@tauri-apps/cli": "^2",
70+
"@types/bun": "^1.2.21",
7271
"@types/node": "^24.1.0",
7372
"@types/react": "^19.1.8",
7473
"@types/react-dom": "^19.1.6",

scripts/linux/setup.sh

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,23 @@ install_system_deps() {
4040
"ubuntu")
4141
sudo apt update
4242
sudo apt install -y build-essential curl wget file libssl-dev libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev libayatana-appindicator3-dev librsvg2-dev pkg-config
43+
# Deps for git2 and ssh2
44+
sudo apt install -y openssl-devel pkgconf perl-FindBin perl-IPC-Cmd perl
4345
;;
4446
"fedora")
4547
sudo dnf install -y gcc gcc-c++ make curl wget file openssl-devel gtk3-devel webkit2gtk4.1-devel libsoup3-devel libayatana-appindicator-gtk3-devel librsvg2-devel pkgconf-pkg-config
48+
# Deps for git2 and ssh2
49+
sudo dnf install -y openssl-devel pkgconf perl-FindBin perl-IPC-Cmd perl
4650
;;
4751
"arch")
4852
sudo pacman -S --needed --noconfirm base-devel curl wget file openssl gtk3 webkit2gtk-4.1 libsoup3 libayatana-appindicator librsvg pkgconf
53+
# Deps for git2 and ssh2
54+
sudo pacman -S --needed --noconfirm openssl-devel pkgconf perl-FindBin perl-IPC-Cmd perl
4955
;;
5056
"opensuse")
5157
sudo zypper install -y gcc gcc-c++ make curl wget file libopenssl-devel gtk3-devel webkit2gtk3-devel libsoup3-devel libayatana-appindicator3-devel librsvg-devel pkg-config
58+
# Deps for git2 and ssh2
59+
sudo zypper install -y openssl-devel pkgconf perl-FindBin perl-IPC-Cmd perl
5260
;;
5361
*)
5462
print_error "Unsupported Linux distribution: $DISTRO"
@@ -95,34 +103,6 @@ install_bun() {
95103
fi
96104
}
97105

98-
install_node() {
99-
if command_exists node; then
100-
NODE_VERSION=$(node --version | cut -d'v' -f2 | cut -d'.' -f1)
101-
if [ "$NODE_VERSION" -ge 18 ]; then
102-
print_success "Node.js is already installed ($(node --version))"
103-
return
104-
fi
105-
fi
106-
107-
print_status "Installing Node.js LTS..."
108-
case $DISTRO in
109-
"ubuntu")
110-
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
111-
sudo apt-get install -y nodejs
112-
;;
113-
"fedora")
114-
sudo dnf install -y nodejs npm
115-
;;
116-
"arch")
117-
sudo pacman -S --needed --noconfirm nodejs npm
118-
;;
119-
"opensuse")
120-
sudo zypper install -y nodejs18 npm18
121-
;;
122-
esac
123-
print_success "Node.js installation completed"
124-
}
125-
126106
install_project_deps() {
127107
print_status "Installing project dependencies..."
128108

@@ -131,9 +111,6 @@ install_project_deps() {
131111
if command_exists bun; then
132112
bun install
133113
print_success "Dependencies installed with Bun"
134-
elif command_exists npm; then
135-
npm install
136-
print_success "Dependencies installed with npm"
137114
else
138115
print_warning "Package manager not found, but continuing..."
139116
fi
@@ -173,7 +150,6 @@ main() {
173150
install_rust
174151
install_tauri_cli
175152
install_bun
176-
install_node
177153
install_project_deps
178154
verify_basic
179155

setup.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os from "node:os";
2+
import { $ } from "bun";
3+
4+
const WINDOWS = "win32";
5+
const MAC = "darwin";
6+
const LINUX = "linux";
7+
8+
const platform = os.platform();
9+
10+
if (platform === WINDOWS) {
11+
await $`powershell -ExecutionPolicy Bypass -File ./scripts/windows/setup.ps1`;
12+
} else if (platform === MAC || platform === LINUX) {
13+
await $`chmod +x scripts/linux/setup.sh && ./scripts/linux/setup.sh`;
14+
}

0 commit comments

Comments
 (0)