Skip to content

Commit 278b5d3

Browse files
authored
Merge pull request #180 from noahbald/fix/179-fix-napi-ci-error
fix: #179 resolve napi ci error
2 parents 9be92b6 + c6b45b1 commit 278b5d3

File tree

20 files changed

+1232
-1169
lines changed

20 files changed

+1232
-1169
lines changed

Cargo.lock

Lines changed: 199 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ oxvg_path = { path = "crates/oxvg_path", version = ">=0.0" }
3131
anyhow = "1.0"
3232
bitflags = { version = "2.7.0" }
3333
cfg-if = { version = "1.0" }
34-
clap = { version = "4.5.4", features = ["derive"] }
34+
clap = { version = "4.5", features = ["derive"] }
3535
# NOTE: Out of date version used for compatibility with selectors
3636
# https://github.com/servo/stylo/blob/main/Cargo.toml#L35
3737
cssparser = "0.34.0"
38+
dashmap = "6.1"
3839
derive_more = "2.0"
3940
derive-where = "1.2"
4041
getrandom = { version = "0.2", features = ["js"] }
@@ -47,10 +48,12 @@ lightningcss = { version = "1.0.0-alpha.63", default-features = false, features
4748
] }
4849
log = "0.4"
4950
markup5ever = "0.14"
50-
napi = { version = "3.0.0-alpha.33", default-features = false, features = [
51-
"napi4",
51+
napi = { version = "3.4", default-features = false, features = [
52+
"serde-json",
53+
"napi7",
5254
] }
53-
napi-derive = "3.0.0-alpha.29"
55+
napi-build = { version = "2.2", default-features = false }
56+
napi-derive = { version = "3.3" }
5457
phf = { version = "0.11", features = ["macros"] }
5558
precomputed-hash = "0.1"
5659
rcdom = { package = "markup5ever_rcdom", version = "=0.5.0-unofficial" }
@@ -60,7 +63,7 @@ selectors = "0.26"
6063
serde = "1.0"
6164
serde_json = "1.0"
6265
serde-wasm-bindgen = "0.6"
63-
serde_with = "3.12"
66+
serde_with = "3.15"
6467
string_cache = "0.8"
6568
tendril = "0.4"
6669
tsify = { version = "0.5", default-features = false, features = ["js"] }

crates/oxvg_optimiser/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ oxvg_collections = { workspace = true }
3636

3737
anyhow = { workspace = true }
3838
clap = { workspace = true, optional = true }
39+
dashmap = { workspace = true }
3940
derive_more = { workspace = true }
4041
derive-where = { workspace = true }
4142
itertools = { workspace = true }

crates/oxvg_optimiser/src/jobs/convert_colors.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ use tsify::Tsify;
3131
pub enum ConvertCase {
3232
Upper,
3333
Lower,
34+
#[doc(hidden)]
35+
#[cfg(feature = "napi")]
36+
/// Compatibility option for NAPI
37+
// FIXME: force discriminated union to prevent NAPI from failing CI
38+
Napi(),
3439
}
3540

3641
#[cfg_attr(feature = "wasm", derive(Tsify))]

crates/oxvg_optimiser/src/jobs/minify_styles.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ pub enum RemoveUnused {
3030
#[default]
3131
True,
3232
Force,
33+
#[doc(hidden)]
34+
#[cfg(feature = "napi")]
35+
/// Compatibility option for NAPI
36+
// FIXME: force discriminated union to prevent NAPI from failing CI
37+
Napi(),
3338
}
3439

3540
#[cfg_attr(feature = "wasm", derive(Tsify))]
@@ -280,6 +285,8 @@ impl Serialize for RemoveUnused {
280285
RemoveUnused::True => true.serialize(serializer),
281286
RemoveUnused::False => false.serialize(serializer),
282287
RemoveUnused::Force => "force".serialize(serializer),
288+
#[cfg(feature = "napi")]
289+
Self::Napi() => panic!("Napi variant is not allowed!"),
283290
}
284291
}
285292
}

crates/oxvg_optimiser/src/jobs/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ use oxvg_ast::{
77
use serde::{Deserialize, Serialize};
88
use serde_with::skip_serializing_none;
99

10-
pub use prefix_ids::PrefixGenerator;
11-
1210
#[cfg(feature = "wasm")]
1311
use tsify::Tsify;
1412

0 commit comments

Comments
 (0)