Skip to content

Commit

Permalink
Merge branch 'ml_feed' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
komal-sai-yral committed Aug 8, 2024
2 parents 21f9871 + 5013938 commit 5ca08c4
Show file tree
Hide file tree
Showing 22 changed files with 766 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ jobs:
target/x86_64-unknown-linux-musl/release/hot-or-not-web-leptos-ssr
target/release/hash.txt
target/site
.empty
.empty
134 changes: 125 additions & 9 deletions Cargo.lock

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

40 changes: 31 additions & 9 deletions ssr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ leptos_meta = { version = "0.6", features = ["nightly"] }
leptos_router = { version = "0.6", features = ["nightly"] }
log = "0.4"
simple_logger = "4.0"
tokio = { version = "1", optional = true, features = ["rt-multi-thread", "signal"] }
tokio = { version = "1", optional = true, features = [
"rt-multi-thread",
"signal",
] }
tower = { version = "0.4", optional = true }
tower-http = { version = "0.5", features = ["fs"], optional = true }
wasm-bindgen = "=0.2.92"
Expand Down Expand Up @@ -86,12 +89,27 @@ gloo-utils = { version = "0.2.0", features = ["serde"] }
tonic = { version = "0.11.0", features = [
"tls",
"tls-webpki-roots",
"transport", # for clippy
], optional = true }
prost = { version = "0.12.4", optional = true }
hmac = { version = "0.12.1", optional = true }
wasm-bindgen-futures = { version = "0.4.42", optional = true }
testcontainers = { version = "0.20.0", optional = true }
yral-testcontainers = { git = "https://github.com/go-bazzinga/yral-testcontainers", rev = "f9d2c01c498d58fca0595a48bdc3f9400e57ec2f", optional = true }
tonic-web-wasm-client = { version = "0.6" }

[dependencies.tonic_2]
package = "tonic"
version = "0.12.0"
optional = true
default-features = false
features = ["prost", "codegen"]


[dependencies.prost_2]
package = "prost"
version = "0.13.0"
optional = true

[build-dependencies]
serde = { version = "1.0", features = ["derive"] }
Expand All @@ -101,6 +119,12 @@ convert_case = "0.6.0"
tonic-build = "0.11.0"
anyhow = "1.0.86"

[build-dependencies.tonic_build_2]
package = "tonic-build"
version = "=0.12.0"
default-features = false
features = ["prost"]

[features]
hydrate = [
"leptos/hydrate",
Expand All @@ -110,7 +134,9 @@ hydrate = [
"dep:web-sys",
"reqwest/native-tls",
"dep:rand_chacha",
"dep:wasm-bindgen-futures"
"dep:wasm-bindgen-futures",
"tonic_2",
"prost_2",
]
ssr = [
"dep:axum",
Expand Down Expand Up @@ -150,6 +176,7 @@ redis-kv = []
cloudflare = ["dep:gob-cloudflare"]
backend-admin = []
ga4 = []
local-feed = []
mock-wallet-history = ["dep:rand_chacha"]
release-bin = [
"ssr",
Expand All @@ -176,12 +203,7 @@ local-bin = [
"dep:testcontainers",
"dep:yral-testcontainers",
]
local-lib = [
"hydrate",
"redis-kv",
"local-auth",
"backend-admin",
]
local-lib = ["hydrate", "redis-kv", "local-auth", "backend-admin"]

[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
Expand Down Expand Up @@ -238,7 +260,7 @@ env = "DEV"
# The features to use when compiling the bin target
#
# Optional. Can be over-ridden with the command line parameter --bin-features
bin-features = ["ssr","local-auth"]
bin-features = ["ssr", "local-auth"]

# If the --no-default-features flag should be used when compiling the bin target
#
Expand Down
25 changes: 25 additions & 0 deletions ssr/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,33 @@ mod build_common {
Ok(())
}

fn build_gprc_client() -> Result<()> {
let ml_feed_proto = "contracts/projects/ml_feed/ml_feed.proto";
let mut out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());

tonic_build::configure()
.build_client(true)
.build_server(false)
.out_dir(out_dir.clone())
.compile(&[ml_feed_proto], &["proto"])?;

out_dir = out_dir.join("grpc-web");
fs::create_dir_all(&out_dir)?;

tonic_build_2::configure()
.build_client(true)
.build_server(false)
.out_dir(out_dir)
.compile(&[ml_feed_proto], &["proto"])?;

Ok(())
}

pub fn build_common() -> Result<()> {
build_did_intf()?;

build_gprc_client()?;

Ok(())
}
}
Expand Down
2 changes: 1 addition & 1 deletion ssr/contracts
Loading

0 comments on commit 5ca08c4

Please sign in to comment.