Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract some simple cleanups from 2779 #2966

Merged
merged 18 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,790 changes: 1,117 additions & 673 deletions Cargo.lock

Large diffs are not rendered by default.

35 changes: 31 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ dioxus-liveview = { path = "packages/liveview", version = "0.6.0-alpha.0" }
dioxus-autofmt = { path = "packages/autofmt", version = "0.6.0-alpha.0" }
dioxus-check = { path = "packages/check", version = "0.6.0-alpha.0" }
dioxus-rsx = { path = "packages/rsx", version = "0.6.0-alpha.0" }
rsx-rosetta = { path = "packages/rsx-rosetta", version = "0.6.0-alpha.0" }
dioxus-rsx-rosetta = { path = "packages/rsx-rosetta", version = "0.6.0-alpha.0" }
dioxus-signals = { path = "packages/signals", version = "0.6.0-alpha.0" }
dioxus-cli-config = { path = "packages/cli-config", version = "0.6.0-alpha.0", default-features = false}
generational-box = { path = "packages/generational-box", version = "0.6.0-alpha.0" }
Expand Down Expand Up @@ -147,12 +147,39 @@ once_cell = "1.17.1"
uuid = "1.9.1"
convert_case = "0.6.0"
tokio-tungstenite = { version = "0.23.1" }

# cli, cli-config
gloo-timers = "0.3.0"
fluent-uri = { version = "0.2.0", features = ["serde"] }
internment = { version = "0.7.0" }
proc-macro2-diagnostics = { version = "0.10", default-features = false }
env_logger = "0.11.0"
tracing-subscriber = "0.3.17"
chrono = { version = "0.4.34" }
gloo = { version = "0.8.0" }
gloo-utils = { version = "0.1.6" }
rustversion = "1.0.17"
rand = "0.8.5"
longest-increasing-subsequence = "0.1.0"
trybuild = "1.0"
js-sys = "0.3.56"
web-sys = { version = "0.3.56", default-features = false }
dirs = "5.0.1"

cargo-config2 = "0.1.26"
criterion = { version = "0.5" }

# desktop
wry = { version = "0.43.0", default-features = false }
tao = { version = "0.30.0", features = ["rwh_05"] }
webbrowser = "1.0.1"
infer = "0.16.0"
dunce = "1.0.2"
urlencoding = "2.1.2"
global-hotkey = "0.6.0"
rfd = { version = "0.14", default-features = false }
muda = "0.14.0"
cocoa = "0.26"
core-foundation = "0.10.0"
objc = { version = "0.2.7", features = ["exception"] }
objc_id = "0.1.1"

[profile.dev.package.dioxus-core-macro]
opt-level = 3
Expand Down
10 changes: 0 additions & 10 deletions packages/cli-config/build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// warn if the "read-config" feature is enabled, but the DIOXUS_CONFIG environment variable is not set
// This means that some library is trying to access the crate's configuration, but the dioxus CLI was not used to build the application.

fn main() {
built::write_built_file().expect("Failed to acquire build-time information");

println!("cargo:rerun-if-env-changed=DIOXUS_CONFIG");
let dioxus_config = std::env::var("DIOXUS_CONFIG");
let built_with_dioxus = dioxus_config.is_ok();
if cfg!(feature = "read-config") && !built_with_dioxus {
println!("cargo:warning=A library is trying to access the crate's configuration, but the dioxus CLI was not used to build the application. Information about the Dioxus CLI is available at https://dioxuslabs.com/learn/0.5/CLI/installation");
}
}
6 changes: 0 additions & 6 deletions packages/cli/.vscode/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ brotli = "6.0.0"

dioxus-autofmt = { workspace = true }
dioxus-check = { workspace = true }
rsx-rosetta = { workspace = true }
dioxus-rsx-rosetta = { workspace = true }
dioxus-rsx = { workspace = true, features = ["serde"]}
dioxus-html = { workspace = true, features = ["hot-reload-context"] }
dioxus-core = { workspace = true, features = ["serialize"] }
Expand Down
13 changes: 2 additions & 11 deletions packages/cli/src/cli/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl Translate {
}

pub fn convert_html_to_formatted_rsx(dom: &Dom, component: bool) -> String {
let callbody = rsx_rosetta::rsx_from_html(dom);
let callbody = dioxus_rsx_rosetta::rsx_from_html(dom);

match component {
true => write_callbody_with_icon_section(callbody),
Expand All @@ -61,7 +61,7 @@ pub fn convert_html_to_formatted_rsx(dom: &Dom, component: bool) -> String {
fn write_callbody_with_icon_section(mut callbody: CallBody) -> String {
let mut svgs = vec![];

rsx_rosetta::collect_svgs(&mut callbody.body.roots, &mut svgs);
dioxus_rsx_rosetta::collect_svgs(&mut callbody.body.roots, &mut svgs);

let mut out = write_component_body(dioxus_autofmt::write_block_out(&callbody).unwrap());

Expand Down Expand Up @@ -130,12 +130,3 @@ fn determine_input(file: Option<String>, raw: Option<String>) -> Result<String>

Ok(buffer.trim().to_string())
}

#[test]
fn generates_svgs() {
let st = include_str!("../../tests/svg.html");

let out = convert_html_to_formatted_rsx(&html_parser::Dom::parse(st).unwrap(), true);

println!("{}", out);
}
1 change: 0 additions & 1 deletion packages/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub mod error;
pub mod metadata;
pub mod serve;
pub mod settings;
pub mod tools;
pub mod tracer;

pub(crate) use cli::*;
Expand Down
Loading
Loading