Skip to content

Commit

Permalink
Merge pull request #200 from azriel91/maintenance/update-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel91 authored Jan 17, 2025
2 parents 5cef63d + 2e4bad9 commit 39b0621
Show file tree
Hide file tree
Showing 27 changed files with 374 additions and 224 deletions.
8 changes: 7 additions & 1 deletion .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ ignore = [
# `proc-macro-error` is Unmaintained.
#
# Transitive dependency of `syn_derive`.
# Pending https://github.com/Kyuuhachi/syn_derive/issues/4.
# Pending <https://github.com/rs-tml/rstml/issues/56>.
"RUSTSEC-2024-0370",

# `derivative` is unmaintained.
#
# Transitive dependency of `log4rs`.
# Pending <https://github.com/estk/log4rs/issues/391>.
"RUSTSEC-2024-0388",
]
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Render progress and outcome diagram using `dot_ix`. ([#182], [#189], [#191])
* Experimented renaming `Item` trait to `Step` (reverted). ([#187], [#192])
* Rename `peace_resources` crate to `peace_resource_rt`. ([#182], [#187], [#193], [#194])
* Add experimental web frontend using `leptos 0.7`. ([#182], [#197], [#200])


[#182]: https://github.com/azriel91/peace/issues/182
Expand All @@ -16,6 +17,8 @@
[#192]: https://github.com/azriel91/peace/pull/192
[#193]: https://github.com/azriel91/peace/pull/193
[#194]: https://github.com/azriel91/peace/pull/194
[#197]: https://github.com/azriel91/peace/pull/197
[#200]: https://github.com/azriel91/peace/pull/200


## 0.0.13 (2024-02-03)
Expand Down
73 changes: 37 additions & 36 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -163,58 +163,59 @@ peace_item_tar_x = { path = "items/tar_x", version = "0.0.13" }
#
# This does not include examples' dependencies, because we want it to be easy for
# developers to see the dependencies to create an automation tool.
async-trait = "0.1.81"
axum = "0.7.5"
async-trait = "0.1.85"
axum = "0.7.9"
base64 = "0.22.1"
bytes = "1.7.1"
bytes = "1.9.0"
cfg-if = "1.0.0"
chrono = { version = "0.4.38", default-features = false, features = ["clock", "serde"] }
console = "0.15.8"
chrono = { version = "0.4.39", default-features = false, features = ["clock", "serde"] }
console = "0.15.10"
derivative = "2.2.0"
diff-struct = "0.5.3"
dot_ix = { version = "0.8.1", default-features = false }
dot_ix_model = "0.8.1"
downcast-rs = "1.2.1"
dot_ix = { version = "0.9.1", default-features = false }
dot_ix_model = "0.9.1"
downcast-rs = "2.0.1"
dyn-clone = "1.0.17"
enser = "0.1.4"
erased-serde = "0.4.5"
fn_graph = { version = "0.13.3", features = ["async", "graph_info", "interruptible", "resman"] }
futures = "0.3.30"
fn_graph = { version = "0.15.0", features = ["async", "graph_info", "interruptible", "resman"] }
futures = "0.3.31"
gloo-timers = "0.3.0"
heck = "0.5.0"
indexmap = "2.5.0"
indicatif = "0.17.8"
indexmap = "2.7.0"
indicatif = "0.17.9"
interruptible = "0.2.4"
leptos = { version = "0.6" }
leptos_axum = "0.6"
leptos_meta = { version = "0.6" }
leptos_router = { version = "0.6" }
libc = "0.2.158"
miette = "7.2.0"
leptos = { version = "0.7" }
leptos_axum = "0.7"
leptos_config = "0.7"
leptos_meta = { version = "0.7" }
leptos_router = { version = "0.7" }
libc = "0.2.169"
miette = "7.4.0"
own = "0.1.3"
pretty_assertions = "1.4.0"
proc-macro2 = "1.0.86"
quote = "1.0.37"
pretty_assertions = "1.4.1"
proc-macro2 = "1.0.93"
quote = "1.0.38"
raw_tty = "0.1.0"
reqwest = "0.12.7"
resman = "0.17.2"
serde = "1.0.209"
reqwest = "0.12.12"
resman = "0.18.0"
serde = "1.0.217"
serde-wasm-bindgen = "0.6.5"
serde_json = "1.0.127"
serde_json = "1.0.135"
serde_yaml = "0.9.34"
smallvec = "1.13.2"
syn = "2.0.77"
tar = "0.4.41"
tempfile = "3.12.0"
thiserror = "1.0.63"
tokio = "1.40"
tokio-util = "0.7.11"
tower-http = "0.5.2"
syn = "2.0.96"
tar = "0.4.43"
tempfile = "3.15.0"
thiserror = "2.0.11"
tokio = "1.43"
tokio-util = "0.7.13"
tower-http = "0.6.2"
tynm = "0.1.10"
type_reg = { version = "0.7.0", features = ["debug", "untagged", "ordered"] }
url = "2.5.2"
wasm-bindgen = "0.2.95"
web-sys = "0.3.70"
type_reg = { version = "0.8.0", features = ["debug", "untagged", "ordered"] }
url = "2.5.4"
wasm-bindgen = "0.2.100"
web-sys = "0.3.77"

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
18 changes: 18 additions & 0 deletions about.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,21 @@ accepted = [
"OpenSSL",
"Zlib",
]

# `cbindgen` has MPL-2.0 as a build dependency, which doesn't apply to our
# compiled software.
ignore-build-dependencies = true

# `cargo-about generate licenses` fails on `ring`:
#
# ```
# error: failed to satisfy license requirements
# ┌─ /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/Cargo.toml:171:79
#
# 171 │ license = "((ISC AND (OpenSSL AND ISC)) AND (MIT AND OpenSSL) AND OpenSSL AND OpenSSL-standalone AND (SSLeay-standalone AND ISC AND MIT) AND MIT) AND (ISC) AND (ISC AND (ISC AND (OpenSSL AND ISC) AND MIT AND OpenSSL AND OpenSSL-standalone AND SSLeay-standalone)) AND (ISC AND (OpenSSL AND ISC) AND MIT AND OpenSSL AND OpenSSL-standalone AND SSLeay-standalone) AND (ISC AND LicenseRef-scancode-public-domain) AND (LicenseRef-scancode-unknown-license-reference) AND (MIT) AND (OpenSSL) AND (OpenSSL AND ((OpenSSL OR BSD-3-Clause) AND GPL-1.0-or-later)) AND (OpenSSL AND (OpenSSL OR BSD-3-Clause OR GPL-1.0-or-later OR GPL-2.0-only)) AND (OpenSSL AND (OpenSSL OR BSD-3-Clause OR GPL-1.0-or-later)) AND (OpenSSL AND (OpenSSL OR BSD-3-Clause)) AND (OpenSSL-standalone) AND (SSLeay-standalone) AND (SSLeay-standalone AND OpenSSL-standalone)"
# │ ------------------ ----------------- ------------------ ----------------- ------------------ ----------------- --------------------------------- --------------------------------------------- ---------------- ---------------- ------------ ---------------- ------------------ ----------------- ----------------- ------------------
#
# 2025-01-17 5:30:42.442908775 +00:00:00 [ERROR] encountered 1 errors resolving licenses, unable to generate output
# Error: Process completed with exit code 1.
# ```
workarounds = ["ring"]
4 changes: 2 additions & 2 deletions crate/cli/src/output/cli_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ where
Ok(())
}

async fn output_yaml<'f, E, T, F>(&mut self, t: &T, fn_error: F) -> Result<(), E>
async fn output_yaml<E, T, F>(&mut self, t: &T, fn_error: F) -> Result<(), E>
where
E: std::error::Error + From<Error>,
T: Serialize + ?Sized,
Expand All @@ -247,7 +247,7 @@ where
Ok(())
}

async fn output_json<'f, E, T, F>(&mut self, t: &T, fn_error: F) -> Result<(), E>
async fn output_json<E, T, F>(&mut self, t: &T, fn_error: F) -> Result<(), E>
where
E: std::error::Error + From<Error>,
T: Serialize + ?Sized,
Expand Down
4 changes: 2 additions & 2 deletions crate/cmd_rt/src/cmd_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ where
}

/// Returns the result of executing the command.
pub async fn exec<'ctx>(
pub async fn exec(
&mut self,
cmd_ctx: &mut CmdCtx<SingleProfileSingleFlow<'ctx, CmdCtxTypesT>>,
cmd_ctx: &mut CmdCtx<SingleProfileSingleFlow<'_, CmdCtxTypesT>>,
) -> Result<
CmdOutcome<ExecutionOutcome, <CmdCtxTypesT as CmdCtxTypesConstrained>::AppError>,
<CmdCtxTypesT as CmdCtxTypesConstrained>::AppError,
Expand Down
2 changes: 1 addition & 1 deletion crate/flow_model/src/flow_spec_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use dot_ix::model::{
common::{EdgeId, Edges, NodeHierarchy, NodeId, NodeNames},
info_graph::{GraphDir, GraphStyle, InfoGraph},
};
use fn_graph::{daggy::Walker, Edge, GraphInfo};
use fn_graph::{daggy2::Walker, Edge, GraphInfo};
use peace_core::FlowId;
use serde::{Deserialize, Serialize};

Expand Down
3 changes: 2 additions & 1 deletion crate/params/src/any_spec_data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

use std::{any::Any, fmt};

use downcast_rs::DowncastSync;
use dyn_clone::DynClone;
use peace_resource_rt::type_reg::untagged::DataType;

use crate::AnySpecRt;

/// A [`DataType`] that is also an [`AnySpecRt`].
pub trait AnySpecDataType: DataType + AnySpecRt {}
pub trait AnySpecDataType: AnySpecRt + DataType + DowncastSync {}

impl<T> AnySpecDataType for T where
T: Any + DynClone + fmt::Debug + AnySpecRt + erased_serde::Serialize + Send + Sync
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
use leptos::{component, view, IntoView};
use std::time::Duration;

use leptos::{
component,
prelude::{signal, ClassAttribute, ElementChild, Get},
view, IntoView,
};
use leptos_meta::{provide_meta_context, Link, Stylesheet};
use leptos_router::{Route, Router, Routes};
use leptos_router::{
components::{Route, Router, Routes, RoutingProgress},
StaticSegment,
};

use crate::ChildrenFn;

Expand All @@ -10,26 +19,41 @@ use crate::ChildrenFn;
///
/// * `flow_component`: The web component to render for the flow.
#[component]
pub fn Home(app_home: ChildrenFn) -> impl IntoView {
pub fn App(app_home: ChildrenFn) -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();

let site_prefix = option_env!("SITE_PREFIX").unwrap_or("");
let favicon_path = format!("{site_prefix}/webi/favicon.ico");
let fonts_path = format!("{site_prefix}/webi/fonts/fonts.css");

let (is_routing, set_is_routing) = signal(false);

view! {
<Link rel="shortcut icon" type_="image/ico" href=favicon_path />
<Stylesheet id="fonts" href=fonts_path />
<Router>
<Router set_is_routing>
<div class="routing-progress">
<RoutingProgress is_routing max_time=Duration::from_millis(250)/>
</div>
<main>
<Routes>
<Routes fallback=RouterFallback>
<Route
path=site_prefix
path=StaticSegment(site_prefix)
view=move || app_home.call()
/>
</Routes>
</main>
</Router>
}
}

#[component]
fn RouterFallback() -> impl IntoView {
let location = leptos_router::hooks::use_location();
let pathname = move || location.pathname.get();

view! {
<p>"Path not found: " {pathname}</p>
}
}
21 changes: 13 additions & 8 deletions crate/webi_components/src/children_fn.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use std::{fmt, sync::Arc};

use leptos::{Fragment, IntoView, ToChildren};
use leptos::{
children::ToChildren,
prelude::{AnyView, IntoAny, Render},
IntoView,
};

/// Allows a consumer to pass in the view fragment for a
/// [`leptos_router::Route`].
Expand All @@ -15,40 +19,41 @@ use leptos::{Fragment, IntoView, ToChildren};
/// When we migrate to `leptos 0.7`, `ChildrenFn` is an alias for `Arc<_>` so we
/// can use it directly.
#[derive(Clone)]
pub struct ChildrenFn(Arc<dyn Fn() -> Fragment + Send + Sync>);
pub struct ChildrenFn(Arc<dyn Fn() -> AnyView + Send + Sync>);

impl ChildrenFn {
/// Returns a new `ChildrenFn`;
pub fn new<F, IV>(f: F) -> Self
where
F: Fn() -> IV + Send + Sync + 'static,
IV: IntoView,
IV: IntoView + 'static,
<IV as Render>::State: 'static,
{
Self(Arc::new(move || Fragment::from(f().into_view())))
Self(Arc::new(move || f().into_view().into_any()))
}

/// Returns the underlying function.
pub fn into_inner(self) -> Arc<dyn Fn() -> Fragment + Send + Sync> {
pub fn into_inner(self) -> Arc<dyn Fn() -> AnyView + Send + Sync> {
self.0
}

/// Calls the inner function to render the view.
pub fn call(&self) -> Fragment {
pub fn call(&self) -> AnyView {
(self.0)()
}
}

impl fmt::Debug for ChildrenFn {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple("ChildrenFn")
.field(&"Arc<dyn Fn() -> Fragment + Send + Sync>")
.field(&"Arc<dyn Fn() -> AnyView + Send + Sync>")
.finish()
}
}

impl<F> ToChildren<F> for ChildrenFn
where
F: Fn() -> Fragment + 'static + Send + Sync,
F: Fn() -> AnyView + 'static + Send + Sync,
{
#[inline]
fn to_children(f: F) -> Self {
Expand Down
Loading

0 comments on commit 39b0621

Please sign in to comment.