From cafd430dad22cdeca2a5aa60d2b5015d13733380 Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Sat, 1 Nov 2025 15:31:19 +0100 Subject: [PATCH 1/3] drop: removed bundle feature from cli --- .github/workflows/release.yml | 20 --------- crates/cli/src/command/bundle.rs | 75 -------------------------------- crates/cli/src/main.rs | 9 +--- 3 files changed, 1 insertion(+), 103 deletions(-) delete mode 100644 crates/cli/src/command/bundle.rs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f3516f..0d06b2e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,27 +53,8 @@ jobs: - name: Checkout Code uses: actions/checkout@v5 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache cargo registry - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- - - - name: Build project - run: cargo run bundle --path ../definitions --out ../bundles - working-directory: "./crates/cli" - - name: Archive definitions folder run: | - zip -r bundles.zip bundles zip -r definitions.zip definitions - name: Create GitHub Release @@ -82,7 +63,6 @@ jobs: tag_name: ${{ github.ref_name }} name: Release ${{ github.ref_name }} files: | - bundles.zip definitions.zip generate_release_notes: true make_latest: true diff --git a/crates/cli/src/command/bundle.rs b/crates/cli/src/command/bundle.rs deleted file mode 100644 index fb3162a..0000000 --- a/crates/cli/src/command/bundle.rs +++ /dev/null @@ -1,75 +0,0 @@ -use crate::parser::Parser; -use prost::Message; -use std::fs; -use std::io::Write; - -pub fn bundle(path: Option, out: Option) { - let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); - let out_path = out.unwrap_or_else(|| "./bundles".to_string()); - match fs::create_dir_all(&out_path) { - Ok(_) => {} - Err(err) => { - panic!("Error creating output directory: {:?}", err); - } - } - - let parser = match Parser::from_path(dir_path.as_str()) { - Some(reader) => reader, - None => { - panic!("Error reading definitions"); - } - }; - - for feature in parser.features { - feature.data_types.iter().for_each(|data_type| { - let mut buf = Vec::new(); - if data_type.encode(&mut buf).is_ok() { - let path = format!( - "{}/{}_{}_{}.pb", - &out_path, - feature.name, - "data_type", - data_type.identifier.to_lowercase() - ); - fs::File::create(&path) - .expect("abc") - .write_all(&buf) - .expect("a"); - } - }); - - feature.flow_types.iter().for_each(|flow_type| { - let mut buf = Vec::new(); - if flow_type.encode(&mut buf).is_ok() { - let path = format!( - "{}/{}_{}_{}.pb", - &out_path, - feature.name, - "flow_type", - flow_type.identifier.to_lowercase() - ); - fs::File::create(&path) - .expect("abc") - .write_all(&buf) - .expect("a"); - } - }); - - feature.runtime_functions.iter().for_each(|function| { - let mut buf = Vec::new(); - if function.encode(&mut buf).is_ok() { - let path = format!( - "{}/{}_{}_{}.pb", - &out_path, - feature.name, - "function", - function.runtime_name.to_lowercase() - ); - fs::File::create(&path) - .expect("abc") - .write_all(&buf) - .expect("a"); - } - }); - } -} diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 5fc12b9..272c37f 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -54,13 +54,7 @@ enum Commands { tag: Option, #[clap(short, long, value_parser, num_args = 1.., value_delimiter = ' ')] features: Option>, - }, - Bundle { - #[arg(short, long)] - path: Option, - #[arg(short, long)] - out: Option, - }, + } } #[tokio::main] @@ -68,7 +62,6 @@ async fn main() { let cli = Cli::parse(); match cli.command { - Commands::Bundle { path, out } => command::bundle::bundle(path, out), Commands::Report { path } => command::report::report_errors(path), Commands::Feature { name, path } => command::feature::search_feature(name, path), Commands::Definition { name, path } => command::definition::search_definition(name, path), From 0b526405cf85aec3e7e97a2fcf68e1648bf5800d Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Sat, 1 Nov 2025 15:31:32 +0100 Subject: [PATCH 2/3] drop: removed bundle feature from cli --- crates/cli/src/command/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/cli/src/command/mod.rs b/crates/cli/src/command/mod.rs index 98036f8..351e876 100644 --- a/crates/cli/src/command/mod.rs +++ b/crates/cli/src/command/mod.rs @@ -1,4 +1,3 @@ -pub mod bundle; pub mod definition; pub mod download; pub mod feature; From e9bc8c72c223308fabe035bd9b993a4fc708eb1e Mon Sep 17 00:00:00 2001 From: raphael-goetz Date: Sat, 1 Nov 2025 15:32:33 +0100 Subject: [PATCH 3/3] ref: cargo fmt --- crates/cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 272c37f..cac35fe 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -54,7 +54,7 @@ enum Commands { tag: Option, #[clap(short, long, value_parser, num_args = 1.., value_delimiter = ' ')] features: Option>, - } + }, } #[tokio::main]