From df1a52a95120914a89878c026df6486a285c2a2d Mon Sep 17 00:00:00 2001 From: Adrian Henry Date: Wed, 28 Jan 2026 17:46:21 +0000 Subject: [PATCH 1/5] feat(cli): replace pumpfun template with ore-rust in scaffolding - Replace ReactPumpfun enum variant with RustOre in template registry - Update bundle-templates CI job to package ore-rust instead of pumpfun-react - Add Cargo.toml customization for Rust project scaffolding - Handle Rust projects differently (skip npm install, show cargo run) - Remove pumpfun-react and pumpfun-server example directories --- .github/workflows/release-please.yml | 8 +- Cargo.toml | 1 - cli/src/commands/create.rs | 48 +- cli/src/main.rs | 2 +- cli/src/templates.rs | 49 +- examples/README.md | 11 +- examples/pumpfun-react/.env.example | 1 - examples/pumpfun-react/index.html | 12 - examples/pumpfun-react/package.json | 25 - examples/pumpfun-react/src/App.tsx | 15 - .../src/components/PumpFunDashboard.tsx | 346 -- examples/pumpfun-react/src/main.tsx | 9 - examples/pumpfun-react/src/vite-env.d.ts | 9 - examples/pumpfun-react/tsconfig.json | 21 - examples/pumpfun-react/tsconfig.node.json | 11 - examples/pumpfun-react/vite.config.ts | 6 - examples/pumpfun-server/Cargo.lock | 3455 ----------------- examples/pumpfun-server/Cargo.toml | 20 - examples/pumpfun-server/README.md | 15 - examples/pumpfun-server/src/main.rs | 38 - 20 files changed, 85 insertions(+), 4017 deletions(-) delete mode 100644 examples/pumpfun-react/.env.example delete mode 100644 examples/pumpfun-react/index.html delete mode 100644 examples/pumpfun-react/package.json delete mode 100644 examples/pumpfun-react/src/App.tsx delete mode 100644 examples/pumpfun-react/src/components/PumpFunDashboard.tsx delete mode 100644 examples/pumpfun-react/src/main.tsx delete mode 100644 examples/pumpfun-react/src/vite-env.d.ts delete mode 100644 examples/pumpfun-react/tsconfig.json delete mode 100644 examples/pumpfun-react/tsconfig.node.json delete mode 100644 examples/pumpfun-react/vite.config.ts delete mode 100644 examples/pumpfun-server/Cargo.lock delete mode 100644 examples/pumpfun-server/Cargo.toml delete mode 100644 examples/pumpfun-server/README.md delete mode 100644 examples/pumpfun-server/src/main.rs 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