Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Keep CLI and codegen package names

laurenspriem68e735449160
diff --git a/rust/.cargo/config.toml b/rust/.cargo/config.toml
index 5a696505c5..02bf10b127 100644
--- a/rust/.cargo/config.toml
+++ b/rust/.cargo/config.toml
@@ -1,5 +1,5 @@
[alias]
-codegen = ["run", "-p", "ente-codegen", "--"]
+codegen = ["run", "-p", "codegen", "--"]
[env]
# Some targets, like armv7 Android, have no enabled target features, so Cargo
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index cb6466b29b..722cb4c2ca 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -1283,6 +1283,15 @@ version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a"
+[[package]]
+name = "codegen"
+version = "0.0.0"
+dependencies = [
+ "camino",
+ "flutter_rust_bridge_codegen",
+ "uniffi_bindgen",
+]
+
[[package]]
name = "codespan-reporting"
version = "0.13.1"
@@ -2427,47 +2436,6 @@ dependencies = [
"wasm-bindgen",
]
-[[package]]
-name = "ente-cli"
-version = "0.0.1"
-dependencies = [
- "chrono",
- "clap",
- "dialoguer",
- "dirs 5.0.1",
- "ente-accounts",
- "ente-core",
- "ente-paste",
- "ente-test-support",
- "env_logger 0.11.10",
- "futures",
- "indicatif",
- "log",
- "mockito",
- "open",
- "rusqlite",
- "serde",
- "serde_json",
- "sha2 0.11.0",
- "srp",
- "thiserror 2.0.18",
- "tokio",
- "url",
- "urlencoding",
- "uuid",
- "zeroize",
- "zip 2.4.2",
-]
-
-[[package]]
-name = "ente-codegen"
-version = "0.0.0"
-dependencies = [
- "camino",
- "flutter_rust_bridge_codegen",
- "uniffi_bindgen",
-]
-
[[package]]
name = "ente-contacts"
version = "0.0.0"
@@ -2696,6 +2664,38 @@ dependencies = [
"ort",
]
+[[package]]
+name = "ente-rs"
+version = "0.0.1"
+dependencies = [
+ "chrono",
+ "clap",
+ "dialoguer",
+ "dirs 5.0.1",
+ "ente-accounts",
+ "ente-core",
+ "ente-paste",
+ "ente-test-support",
+ "env_logger 0.11.10",
+ "futures",
+ "indicatif",
+ "log",
+ "mockito",
+ "open",
+ "rusqlite",
+ "serde",
+ "serde_json",
+ "sha2 0.11.0",
+ "srp",
+ "thiserror 2.0.18",
+ "tokio",
+ "url",
+ "urlencoding",
+ "uuid",
+ "zeroize",
+ "zip 2.4.2",
+]
+
[[package]]
name = "ente-space"
version = "0.0.1"
diff --git a/rust/README.md b/rust/README.md
index 067425b207..fde9c104ae 100644
--- a/rust/README.md
+++ b/rust/README.md
@@ -10,7 +10,7 @@ cargo clippy # Lint
cargo build # Build
cargo test # Test
-cargo run --bin ente-cli -- --help # Run the Ente Rust CLI
+cargo run --bin ente-rs -- --help # Run the Ente Rust CLI
```
CI runs with `RUSTFLAGS="-D warnings"` so warnings will cause checks to fail.
diff --git a/rust/apps/cli/Cargo.toml b/rust/apps/cli/Cargo.toml
index 44d0c3bd63..149bddc5c9 100644
--- a/rust/apps/cli/Cargo.toml
+++ b/rust/apps/cli/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "ente-cli"
+name = "ente-rs"
version = "0.0.1"
edition = "2024"
description = "Command-line interface for Ente"
diff --git a/rust/apps/cli/README.md b/rust/apps/cli/README.md
index 7c5e7dbf99..060cc1b0a0 100644
--- a/rust/apps/cli/README.md
+++ b/rust/apps/cli/README.md
@@ -3,16 +3,16 @@ WIP Ente Rust CLI.
## Development
```sh
-cargo run --bin ente-cli -- --help
+cargo run --bin ente-rs -- --help
```
## Integration tests
The integration tests run against a live Museum spun up by
[ente-test-support](../../crates/test-support) (see its README for setup). They
-are gated behind the `museum` Cargo feature, so a plain `cargo test -p ente-cli`
+are gated behind the `museum` Cargo feature, so a plain `cargo test -p ente-rs`
skips them. To run them:
```sh
-cargo test -p ente-cli --features museum
+cargo test -p ente-rs --features museum
```
diff --git a/rust/apps/cli/src/api/client.rs b/rust/apps/cli/src/api/client.rs
index dcab4e13e9..1de3628c22 100644
--- a/rust/apps/cli/src/api/client.rs
+++ b/rust/apps/cli/src/api/client.rs
@@ -4,7 +4,7 @@ use ente_core::http::{self, Api, ApiConfig, Auth, Http, RetryProfile};
use ente_core::urls::PRODUCTION_API_ORIGIN;
use std::sync::RwLock;
-pub(crate) const USER_AGENT: &str = concat!("ente-cli/", env!("CARGO_PKG_VERSION"));
+pub(crate) const USER_AGENT: &str = concat!("ente-rs/", env!("CARGO_PKG_VERSION"));
const FILES_ORIGIN: &str = "https://files.ente.com";
const THUMBNAILS_ORIGIN: &str = "https://thumbnails.ente.com";
diff --git a/rust/apps/cli/src/commands/export.rs b/rust/apps/cli/src/commands/export.rs
index 8643687f5b..d7a8e8a678 100644
--- a/rust/apps/cli/src/commands/export.rs
+++ b/rust/apps/cli/src/commands/export.rs
@@ -115,7 +115,7 @@ pub async fn run_export(account_email: Option<String>, filter: ExportFilter) ->
};
if accounts.is_empty() {
- println!("No accounts configured. Use 'ente-cli account add' first.");
+ println!("No accounts configured. Use 'ente-rs account add' first.");
return Ok(());
}
diff --git a/rust/apps/cli/src/commands/sync.rs b/rust/apps/cli/src/commands/sync.rs
index 5ff3714e50..affd72bd9f 100644
--- a/rust/apps/cli/src/commands/sync.rs
+++ b/rust/apps/cli/src/commands/sync.rs
@@ -36,7 +36,7 @@ pub async fn run_sync(
};
if accounts.is_empty() {
- println!("No accounts configured. Use 'ente-cli account add' first.");
+ println!("No accounts configured. Use 'ente-rs account add' first.");
return Ok(());
}
diff --git a/rust/apps/cli/src/main.rs b/rust/apps/cli/src/main.rs
index db64834cae..70198a484c 100644
--- a/rust/apps/cli/src/main.rs
+++ b/rust/apps/cli/src/main.rs
@@ -1,5 +1,5 @@
use clap::Parser;
-use ente_cli::{
+use ente_rs::{
Result,
cli::{Cli, Commands},
commands,
@@ -17,7 +17,7 @@ async fn main() {
async fn run() -> Result<()> {
env_logger::init();
- let config_dir = ente_cli::utils::get_cli_config_dir()?;
+ let config_dir = ente_rs::utils::get_cli_config_dir()?;
let db_path = config_dir.join("ente.db");
let storage = Storage::new(&db_path)?;
@@ -25,13 +25,13 @@ async fn run() -> Result<()> {
match cli.command {
Commands::Version => {
- println!("ente-cli version {}", ente_cli::cli::version::VERSION);
+ println!("ente-rs version {}", ente_rs::cli::version::VERSION);
}
Commands::Account(account_cmd) => {
commands::account::handle_account_command(account_cmd, &storage).await?;
}
Commands::Export(export_cmd) => {
- use ente_cli::models::filter::ExportFilter;
+ use ente_rs::models::filter::ExportFilter;
let filter = ExportFilter {
include_shared: export_cmd.shared,
diff --git a/rust/apps/cli/tests/support/cli.rs b/rust/apps/cli/tests/support/cli.rs
index 4db183096e..9716609def 100644
--- a/rust/apps/cli/tests/support/cli.rs
+++ b/rust/apps/cli/tests/support/cli.rs
@@ -17,7 +17,7 @@ pub struct Cli {
impl Cli {
pub fn new(config_dir: PathBuf) -> Self {
Self {
- bin: PathBuf::from(env!("CARGO_BIN_EXE_ente-cli")),
+ bin: PathBuf::from(env!("CARGO_BIN_EXE_ente-rs")),
config_dir,
}
}
@@ -50,7 +50,7 @@ impl Cli {
child
.stdin
.take()
- .expect("ente-cli stdin should be piped")
+ .expect("ente-rs stdin should be piped")
.write_all(stdin.as_bytes())?;
Ok(child.wait_with_output()?)
@@ -72,7 +72,7 @@ fn output_stdout(args: &[&str], output: Output) -> TestResult<String> {
Ok(String::from_utf8(output.stdout)?)
} else {
Err(format!(
- "ente-cli {} failed\nstatus: {}\nstdout:\n{}\nstderr:\n{}",
+ "ente-rs {} failed\nstatus: {}\nstdout:\n{}\nstderr:\n{}",
args.join(" "),
output.status,
String::from_utf8_lossy(&output.stdout),
diff --git a/rust/apps/codegen/Cargo.toml b/rust/apps/codegen/Cargo.toml
index bfe91808c1..f310be4fab 100644
--- a/rust/apps/codegen/Cargo.toml
+++ b/rust/apps/codegen/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "ente-codegen"
+name = "codegen"
edition = "2024"
[dependencies]
diff --git a/rust/crates/test-support/README.md b/rust/crates/test-support/README.md
index 4e7983fa1e..4864e0d89d 100644
--- a/rust/crates/test-support/README.md
+++ b/rust/crates/test-support/README.md
@@ -11,5 +11,5 @@ Requires `go` on PATH to build and run Museum. The Postgres binary ([postgresql_
Tests that use it are gated behind a Cargo feature so that a plain `cargo test` skips them. They can be run by enabling the `museum` feature, e.g.:
```sh
-cargo test -p ente-cli --features museum
+cargo test -p ente-rs --features museum
```