Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ jobs:

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

- name: Build vt
run: cargo build --bin vt --release
- name: Build vite rust binary
run: cargo build --bin vite --release

- name: Run vt install
- name: Run vite install
run: |
export PATH=$PWD/target/release:$PATH

# Test vt install on various repositories with different package managers
# Test vite install on various repositories with different package managers
repos=(
# pnpm workspace
"pnpm/pnpm:pnpm"
Expand All @@ -201,16 +201,16 @@ jobs:

for repo_info in "${repos[@]}"; do
IFS=':' read -r repo dir_name <<< "$repo_info"
echo "Testing vt install on $repo..."
echo "Testing vite install on $repo..."
# remove the directory if it exists
if [ -d "tmp/$dir_name" ]; then
rm -rf "tmp/$dir_name"
fi
git clone --depth 1 "https://github.com/$repo.git" "tmp/$dir_name"
cd "tmp/$dir_name"
vt install
vite install
# run again to show install cache increase by time
time vt install
time vite install
echo "✓ Successfully installed dependencies for $repo"
echo ""
done
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/binding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name = "vite-plus-cli"
version = "0.0.1"
edition = "2024"

[[bin]]
name = "vite"
path = "src/main.rs"

[dependencies]
clap = { workspace = true, features = ["derive"] }
crossterm = { workspace = true }
Expand Down
31 changes: 31 additions & 0 deletions packages/cli/binding/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
use clap::Parser as _;
use vite_error::Error;
use vite_path::current_dir;

mod cli;
mod commands;

use cli::{Args, CliOptions, init_tracing};

#[tokio::main]

async fn main() -> Result<(), Error> {
init_tracing();

let args = Args::parse();

let result = cli::main(current_dir()?, args, None::<CliOptions>).await;

match result {
Ok(exit_status) => std::process::exit(exit_status.code().unwrap_or(1)),

Err(err) => {
tracing::error!("Error: {}", err);
match err {
// Standard exit code for Ctrl+C
Error::UserCancelled => std::process::exit(130),
_ => return Err(err),
}
}
}
}
Loading