Skip to content

Commit

Permalink
refactor: move generator to api
Browse files Browse the repository at this point in the history
  • Loading branch information
hougesen committed Oct 8, 2024
1 parent 79f24ca commit 79ede4d
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 252 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### Unreleased

- build(deps): bump reqwest from 0.12.7 to 0.12.8 [`#34`](https://github.com/i18nhero/cli/pull/34)
- build(deps): bump tempfile from 3.12.0 to 3.13.0 [`#33`](https://github.com/i18nhero/cli/pull/33)
- refactor: change DEFAULT_API_HOST to api.cli.i18nhero.com [`#32`](https://github.com/i18nhero/cli/pull/32)
- feat: login command [`#31`](https://github.com/i18nhero/cli/pull/31)
- build(deps): bump clap_complete from 4.5.26 to 4.5.29 [`#30`](https://github.com/i18nhero/cli/pull/30)
- build(deps): bump serde from 1.0.209 to 1.0.210 [`#26`](https://github.com/i18nhero/cli/pull/26)
- build(deps): bump clap from 4.5.17 to 4.5.18 [`#27`](https://github.com/i18nhero/cli/pull/27)
Expand All @@ -27,6 +31,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- chore: validation workflow [`#2`](https://github.com/i18nhero/cli/pull/2)
- build: setup publishing [`#1`](https://github.com/i18nhero/cli/pull/1)
- feat(cli): json5 output (#19) [`#15`](https://github.com/i18nhero/cli/issues/15)
- feat(auth): load auth on init [`32c2455`](https://github.com/i18nhero/cli/commit/32c2455e24b2fd6aa1a5d2cd2fa2710391b5defb)
- chore: setup workspace [`11b6f6c`](https://github.com/i18nhero/cli/commit/11b6f6c749b6ff69b7cf84a9131c05be73bde525)
- Initial commit [`d96cebc`](https://github.com/i18nhero/cli/commit/d96cebc79c1f5243aa1ed05b2e68aaf5e380c61a)
162 changes: 1 addition & 161 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ clap_complete = "4.5.29"
console = { version = "0.15.8" }
dirs = { version = "5.0.1" }
dialoguer = { version = "0.11.0" }
json5 = "0.4.1"
reqwest = { version = "0.12.8", default-features = false, features = [
"brotli",
"charset",
Expand All @@ -37,7 +36,6 @@ reqwest = { version = "0.12.8", default-features = false, features = [
schemars = "0.8.21"
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.128"
serde_yml = "0.0.12"
supports-hyperlinks = "3.0.0"
tempfile = "3.13.0"
terminal-link = "0.1.0"
Expand Down
2 changes: 0 additions & 2 deletions packages/i18nhero/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ clap_complete = { workspace = true }
console = { workspace = true }
dialoguer = { workspace = true }
dirs = { workspace = true }
json5 = { workspace = true }
reqwest = { workspace = true }
schemars = { workspace = true, optional = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_yml = { workspace = true }
supports-hyperlinks = { workspace = true }
terminal-link = { workspace = true }
tokio = { workspace = true }
Expand Down
6 changes: 0 additions & 6 deletions packages/i18nhero/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,13 @@ pub enum CliConfigOutputFormat {
#[default]
#[serde(rename = "json")]
Json,
#[serde(rename = "json5")]
Json5,
#[serde(rename = "yaml")]
Yaml,
}

impl CliConfigOutputFormat {
#[inline]
pub const fn to_file_ext(&self) -> &'static str {
match self {
Self::Json => "json",
Self::Json5 => "json5",
Self::Yaml => "yml",
}
}
}
Expand Down
12 changes: 0 additions & 12 deletions packages/i18nhero/src/error/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#[derive(Debug)]
pub enum CliError {
Io(std::io::Error),
SerializeJson(serde_json::Error),
SerializeJson5(json5::Error),
SerializeYml(serde_yml::Error),
DeserializeJson(serde_json::Error),
DeserializeJson5(json5::Error),
DeserializeYml(serde_yml::Error),
PushLocaleHttp(reqwest::Error),
PullLocaleHttp(reqwest::Error),
ConfigAlreadyExists,
Expand Down Expand Up @@ -49,12 +43,6 @@ impl core::fmt::Display for CliError {
Self::ConfigLoad(e) => write!(f, "Error loading config - {e}"),
Self::ConfigSave(e) => write!(f, "Error saving config - {e}"),
Self::ConfigParse(e) => write!(f, "Error parsing config - {e}"),
Self::SerializeJson(e) => write!(f, "Error serializing file - {e}"),
Self::SerializeJson5(e) => write!(f, "Error serializing file - {e}"),
Self::SerializeYml(e) => write!(f, "Error serializing file - {e}"),
Self::DeserializeJson(e) => write!(f, "Error deserializing file - {e}"),
Self::DeserializeJson5(e) => write!(f, "Error deserializing file - {e}"),
Self::DeserializeYml(e) => write!(f, "Error deserializing file - {e}"),
Self::ConfigSerialize(e) => write!(f, "Error serializing config - {e}"),
Self::AuthConfigSerialize(e) => write!(f, "Error serializing auth config - {e}"),
Self::AuthConfigDeserialize(e) => write!(f, "Error deserializing auth config - {e}"),
Expand Down
42 changes: 0 additions & 42 deletions packages/i18nhero/src/generators/mod.rs

This file was deleted.

Loading

0 comments on commit 79ede4d

Please sign in to comment.