Skip to content

Commit b07e66d

Browse files
authored
chore: restore the vite Rust binary (#247)
1 parent 8aaf814 commit b07e66d

3 files changed

Lines changed: 42 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ jobs:
179179

180180
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
181181

182-
- name: Build vt
183-
run: cargo build --bin vt --release
182+
- name: Build vite rust binary
183+
run: cargo build --bin vite --release
184184

185-
- name: Run vt install
185+
- name: Run vite install
186186
run: |
187187
export PATH=$PWD/target/release:$PATH
188188
189-
# Test vt install on various repositories with different package managers
189+
# Test vite install on various repositories with different package managers
190190
repos=(
191191
# pnpm workspace
192192
"pnpm/pnpm:pnpm"
@@ -201,16 +201,16 @@ jobs:
201201
202202
for repo_info in "${repos[@]}"; do
203203
IFS=':' read -r repo dir_name <<< "$repo_info"
204-
echo "Testing vt install on $repo..."
204+
echo "Testing vite install on $repo..."
205205
# remove the directory if it exists
206206
if [ -d "tmp/$dir_name" ]; then
207207
rm -rf "tmp/$dir_name"
208208
fi
209209
git clone --depth 1 "https://github.com/$repo.git" "tmp/$dir_name"
210210
cd "tmp/$dir_name"
211-
vt install
211+
vite install
212212
# run again to show install cache increase by time
213-
time vt install
213+
time vite install
214214
echo "✓ Successfully installed dependencies for $repo"
215215
echo ""
216216
done

packages/cli/binding/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name = "vite-plus-cli"
33
version = "0.0.1"
44
edition = "2024"
55

6+
[[bin]]
7+
name = "vite"
8+
path = "src/main.rs"
9+
610
[dependencies]
711
clap = { workspace = true, features = ["derive"] }
812
crossterm = { workspace = true }

packages/cli/binding/src/main.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use clap::Parser as _;
2+
use vite_error::Error;
3+
use vite_path::current_dir;
4+
5+
mod cli;
6+
mod commands;
7+
8+
use cli::{Args, CliOptions, init_tracing};
9+
10+
#[tokio::main]
11+
12+
async fn main() -> Result<(), Error> {
13+
init_tracing();
14+
15+
let args = Args::parse();
16+
17+
let result = cli::main(current_dir()?, args, None::<CliOptions>).await;
18+
19+
match result {
20+
Ok(exit_status) => std::process::exit(exit_status.code().unwrap_or(1)),
21+
22+
Err(err) => {
23+
tracing::error!("Error: {}", err);
24+
match err {
25+
// Standard exit code for Ctrl+C
26+
Error::UserCancelled => std::process::exit(130),
27+
_ => return Err(err),
28+
}
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)