Skip to content

Commit

Permalink
fix: rename RivetClient back to Rivet (#1536)
Browse files Browse the repository at this point in the history
<!-- Please make sure there is an issue that this PR is correlated to. -->
Fixes RVT-4247
## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
MasterPtato committed Dec 9, 2024
1 parent 04ec2bd commit 2dff9e5
Show file tree
Hide file tree
Showing 137 changed files with 3,156 additions and 3,110 deletions.
2 changes: 1 addition & 1 deletion packages/common/config/src/config/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use global_error::prelude::*;
use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

pub mod server;

Expand Down
2 changes: 1 addition & 1 deletion packages/common/config/src/config/server/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::collections::HashMap;

use global_error::prelude::*;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use url::Url;
use schemars::JsonSchema;

use crate::secret::Secret;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::net::Ipv4Addr;

use ipnet::{Ipv4AddrRange, Ipv4Net};
use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use url::Url;

#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashMap;

use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema)]
#[serde(rename_all = "snake_case", deny_unknown_fields)]
Expand Down
2 changes: 1 addition & 1 deletion packages/common/config/src/config/server/rivet/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use global_error::prelude::*;
use maplit::hashmap;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, net::IpAddr, path::PathBuf};
use url::Url;
use schemars::JsonSchema;
use uuid::Uuid;

use crate::secret::Secret;
Expand Down
2 changes: 1 addition & 1 deletion packages/common/config/src/secret.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::fmt;
use schemars::JsonSchema;

/// Wraps a given value in a container that does not implement `Debug` or `Display` in order to
/// prevent accidentally logging the inner secret.
Expand Down
2 changes: 1 addition & 1 deletion packages/infra/client/config/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use std::{
};

use pegboard::protocol;
use schemars::JsonSchema;
use serde::Deserialize;
use url::Url;
use schemars::JsonSchema;
use uuid::Uuid;

#[derive(Clone, Deserialize)]
Expand Down
34 changes: 23 additions & 11 deletions packages/infra/schema-generator/build.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
use std::{fs::File, path::PathBuf, io::Write};
use std::{fs::File, io::Write, path::PathBuf};

use anyhow::*;
use schemars::{JsonSchema, gen::{SchemaSettings, SchemaGenerator}};
use schemars::{
gen::{SchemaGenerator, SchemaSettings},
JsonSchema,
};

fn main() -> Result<()> {
let cwd = std::env::current_dir()?;
let docs_output_path = cwd.join("../../../docs/src/content/docs/");

let settings = SchemaSettings::draft07().with(|s| {
s.option_nullable = true;
s.option_add_null_type = false;
});
let generator = settings.into_generator();
s.option_nullable = true;
s.option_add_null_type = false;
});
let generator = settings.into_generator();

generate_spec::<rivet_config::config::server::Server>(generator.clone(), docs_output_path.join("self-hosting/server-spec.json"))?;
generate_spec::<pegboard_config::Client>(generator.clone(), docs_output_path.join("self-hosting/client-spec.json"))?;
generate_spec::<rivet_toolchain::config::Root>(generator.clone(), docs_output_path.join("toolchain-spec.json"))?;
generate_spec::<rivet_config::config::server::Server>(
generator.clone(),
docs_output_path.join("self-hosting/server-spec.json"),
)?;
generate_spec::<pegboard_config::Client>(
generator.clone(),
docs_output_path.join("self-hosting/client-spec.json"),
)?;
generate_spec::<rivet_toolchain::config::Root>(
generator.clone(),
docs_output_path.join("toolchain-spec.json"),
)?;

Ok(())
}

fn generate_spec<T: JsonSchema>(generator: SchemaGenerator, path: PathBuf) -> Result<()> {
let schema = generator.into_root_schema_for::<T>();
let schema_text = serde_json::to_string_pretty(&schema)?;

let mut file = File::create(path)?;
file.write_all(schema_text.as_bytes())?;

Ok(())
}
}
1 change: 1 addition & 0 deletions packages/infra/schema-generator/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 1 addition & 2 deletions packages/toolchain/cli/src/commands/actor/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ use clap::{Parser, ValueEnum};
use serde::Deserialize;
use std::collections::HashMap;
use toolchain::{
build,
build, errors,
rivet_api::{apis, models},
errors,
};
use uuid::Uuid;

Expand Down
2 changes: 1 addition & 1 deletion packages/toolchain/toolchain/src/config/build/docker.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashMap;

use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use super::Compression;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use super::Compression;

Expand Down
2 changes: 1 addition & 1 deletion packages/toolchain/toolchain/src/config/build/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

pub mod docker;
pub mod javascript;
Expand Down
5 changes: 2 additions & 3 deletions packages/toolchain/toolchain/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::{
};

use anyhow::*;
use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

pub mod build;

Expand Down Expand Up @@ -86,12 +86,11 @@ pub struct Unstable {
#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case", deny_unknown_fields)]
pub struct ManagerUnstable {
pub enable: Option<bool>
pub enable: Option<bool>,
}

impl ManagerUnstable {
pub fn enable(&self) -> bool {
self.enable.unwrap_or(true)
}

}
2 changes: 1 addition & 1 deletion packages/toolchain/toolchain/src/tasks/deploy/docker.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::*;
use std::collections::HashMap;
use std::path::Path;
use uuid::Uuid;
use std::collections::HashMap;

use crate::{
config, paths,
Expand Down
2 changes: 1 addition & 1 deletion packages/toolchain/toolchain/src/tasks/deploy/js.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::*;
use futures_util::{StreamExt, TryStreamExt};
use rivet_api::{apis, models};
use std::{path::PathBuf, sync::Arc, collections::HashMap};
use std::{collections::HashMap, path::PathBuf, sync::Arc};
use tokio::fs;
use uuid::Uuid;

Expand Down
4 changes: 2 additions & 2 deletions sdks/api/fern/generators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ groups:
path: ../runtime/typescript/src
config:
outputSourceFiles: true
namespaceExport: RivetClient
namespaceExport: Rivet
defaultTimeoutInSeconds: 180
skipResponseValidation: true
allowCustomFetcher: true
Expand All @@ -41,7 +41,7 @@ groups:
path: ../full/typescript/src
config:
outputSourceFiles: true
namespaceExport: RivetClient
namespaceExport: Rivet
defaultTimeoutInSeconds: 180
skipResponseValidation: true
allowCustomFetcher: true
Expand Down
8 changes: 4 additions & 4 deletions sdks/api/full/typescript/src/Client.ts

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

Loading

0 comments on commit 2dff9e5

Please sign in to comment.