Reorganize cargo dependencies and upgrade most of them (#1815)

* Reorganize cargo dependencies and upgrade most

* cargo update

* Attempt 2

* Polishing changes

* Comment out specta typescript flag-dependent code

* Fix test
This commit is contained in:
Keavon Chambers
2024-07-09 04:08:28 -07:00
committed by GitHub
parent 97616e8019
commit f7ada701e5
30 changed files with 1042 additions and 974 deletions
+26 -22
View File
@@ -6,9 +6,14 @@ description = "API definitions for Graphene"
authors = ["Graphite Authors <contact@graphite.rs>"]
license = "MIT OR Apache-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = ["serde", "kurbo", "log", "std", "rand_chacha", "wasm"]
log = ["dep:log"]
gpu = ["spirv-std", "glam/bytemuck", "dyn-any", "glam/libm"]
nightly = []
alloc = ["dyn-any", "bezier-rs"]
type_id_logging = []
wasm = ["web-sys"]
std = [
"dyn-any",
"dyn-any/std",
@@ -19,8 +24,6 @@ std = [
"rustybuzz",
"image",
]
default = ["serde", "kurbo", "log", "std", "rand_chacha", "wasm"]
log = ["dep:log"]
serde = [
"dep:serde",
"glam/serde",
@@ -28,44 +31,45 @@ serde = [
"bezier-rs/serde",
"base64",
]
gpu = ["spirv-std", "glam/bytemuck", "dyn-any", "glam/libm"]
nightly = []
alloc = ["dyn-any", "bezier-rs"]
type_id_logging = []
wasm = ["web-sys"]
[dependencies]
# Workspace dependencies
bytemuck = { workspace = true, features = ["derive"] }
node-macro = { workspace = true }
num-derive = { workspace = true }
num-traits = { workspace = true, default-features = false, features = ["i128"] }
usvg = { workspace = true }
rand = { workspace = true, default-features = false, features = ["std_rng"] }
glam = { workspace = true, default-features = false, features = [
"scalar-math",
] }
# Optional workspace dependencies
dyn-any = { workspace = true, optional = true }
spirv-std = { workspace = true, optional = true }
bytemuck = { workspace = true, features = ["derive"] }
serde = { workspace = true, optional = true, features = ["derive"] }
log = { workspace = true, optional = true }
rand_chacha = { workspace = true, optional = true }
bezier-rs = { workspace = true, optional = true }
kurbo = { workspace = true, optional = true }
glam = { workspace = true, default-features = false, features = [
"scalar-math",
] }
node-macro = { workspace = true }
base64 = { workspace = true, optional = true }
image = { workspace = true, optional = true, default-features = false, features = [
"png",
] }
specta = { workspace = true, optional = true }
rustybuzz = { workspace = true, optional = true }
num-derive = { workspace = true }
num-traits = { workspace = true, default-features = false, features = ["i128"] }
wasm-bindgen = { workspace = true, optional = true }
js-sys = { workspace = true, optional = true }
web-sys = { workspace = true, optional = true, features = [
"HtmlCanvasElement",
] }
usvg = { workspace = true }
rand = { workspace = true, default-features = false, features = ["std_rng"] }
image = { workspace = true, optional = true, default-features = false, features = [
"png",
] }
[dev-dependencies]
# Workspace dependencies
tokio = { workspace = true, features = ["rt", "macros"] }
[lints.rust]
# the spirv target is not in the list of common cfgs so must be added manually
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_arch, values("spirv"))'] }
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_arch, values("spirv"))',
] }
+1 -1
View File
@@ -151,7 +151,7 @@ impl Image<Color> {
let (data, width, height) = self.to_flat_u8();
let mut png = Vec::new();
let encoder = ::image::codecs::png::PngEncoder::new(&mut png);
encoder.write_image(&data, width, height, ::image::ColorType::Rgba8).expect("failed to encode image as png");
encoder.write_image(&data, width, height, ::image::ExtendedColorType::Rgba8).expect("failed to encode image as png");
png
}
}