diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 1939dad..ace7860 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -169,15 +169,17 @@ jobs: VERSION="${{ needs.release-please.outputs.cli_version }}" echo "Bundling templates for version ${VERSION}" - # Create tarball with only the template directories (excluding node_modules, dist, .env) + # Create tarball with only the template directories (excluding build artifacts) tar -czvf "hyperstack-templates-v${VERSION}.tar.gz" \ --exclude='node_modules' \ --exclude='dist' \ --exclude='.env' \ --exclude='package-lock.json' \ + --exclude='target' \ + --exclude='Cargo.lock' \ -C examples \ - pumpfun-react \ - ore-react + ore-react \ + ore-rust - name: Upload templates to CLI release env: diff --git a/Cargo.toml b/Cargo.toml index d800578..3950ba8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,6 @@ exclude = [ "stacks/pumpfun", "stacks/ore", "examples/rust-client", - "examples/pumpfun-server", "examples/ore-server", ] diff --git a/cli/src/commands/create.rs b/cli/src/commands/create.rs index 3b63695..89284e4 100644 --- a/cli/src/commands/create.rs +++ b/cli/src/commands/create.rs @@ -33,10 +33,7 @@ pub fn create( let selected_template = match template { Some(t) => Template::from_str(&t).ok_or_else(|| { - anyhow::anyhow!( - "Unknown template: {}. Available: react-pumpfun, react-ore", - t - ) + anyhow::anyhow!("Unknown template: {}. Available: react-ore, rust-ore", t) })?, None => { let items: Vec = Template::ALL @@ -99,22 +96,29 @@ pub fn create( println!(" {} Project scaffolded", ui::symbols::SUCCESS.green()); - let pm = detect_package_manager(); - let install_succeeded = if skip_install { - false + let is_rust_project = selected_template.is_rust(); + + if is_rust_project { + println!(); + print_rust_next_steps(&project_name); } else { - run_install(project_dir, pm)? - }; + let pm = detect_package_manager(); + let install_succeeded = if skip_install { + false + } else { + run_npm_install(project_dir, pm)? + }; - println!(); - print_next_steps(&project_name, pm, install_succeeded); + println!(); + print_js_next_steps(&project_name, pm, install_succeeded); + } telemetry::record_create_completed(selected_template.display_name(), start.elapsed()); Ok(()) } -fn run_install(project_dir: &Path, pm: &str) -> Result { +fn run_npm_install(project_dir: &Path, pm: &str) -> Result { ui::print_step("Installing dependencies..."); let (cmd, args) = match pm { @@ -149,7 +153,7 @@ fn run_install(project_dir: &Path, pm: &str) -> Result { } } -fn print_next_steps(project_name: &str, pm: &str, install_succeeded: bool) { +fn print_js_next_steps(project_name: &str, pm: &str, install_succeeded: bool) { println!( "{} {}", ui::symbols::SUCCESS.green().bold(), @@ -180,3 +184,21 @@ fn print_next_steps(project_name: &str, pm: &str, install_succeeded: bool) { println!(); } + +fn print_rust_next_steps(project_name: &str) { + println!( + "{} {}", + ui::symbols::SUCCESS.green().bold(), + "Ready!".bold() + ); + println!(); + println!("Build and run:"); + println!(); + println!( + " {} {} && {}", + "$".dimmed(), + format!("cd {}", project_name).cyan(), + "cargo run".cyan() + ); + println!(); +} diff --git a/cli/src/main.rs b/cli/src/main.rs index f06e578..32890a4 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -64,7 +64,7 @@ enum Commands { /// Project name (creates directory) name: Option, - /// Template: react-pumpfun, react-ore + /// Template: react-ore, rust-ore #[arg(short, long)] template: Option, diff --git a/cli/src/templates.rs b/cli/src/templates.rs index 56f524d..9ecb807 100644 --- a/cli/src/templates.rs +++ b/cli/src/templates.rs @@ -13,46 +13,50 @@ use tar::Archive; /// Available project templates. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Template { - ReactPumpfun, ReactOre, + RustOre, } impl Template { /// All available templates. - pub const ALL: &'static [Template] = &[Template::ReactPumpfun, Template::ReactOre]; + pub const ALL: &'static [Template] = &[Template::ReactOre, Template::RustOre]; /// Template directory name (as stored in tarball). pub fn dir_name(&self) -> &'static str { match self { - Template::ReactPumpfun => "pumpfun-react", Template::ReactOre => "ore-react", + Template::RustOre => "ore-rust", } } /// Human-readable display name. pub fn display_name(&self) -> &'static str { match self { - Template::ReactPumpfun => "react-pumpfun", Template::ReactOre => "react-ore", + Template::RustOre => "rust-ore", } } /// Description for interactive selection. pub fn description(&self) -> &'static str { match self { - Template::ReactPumpfun => "PumpFun token dashboard (React + Vite)", Template::ReactOre => "ORE mining rounds viewer (React + Vite)", + Template::RustOre => "ORE mining rounds client (Rust + Tokio)", } } /// Parse from string (CLI argument). pub fn from_str(s: &str) -> Option