Skip to content

Commit

Permalink
just: Fix check-crates-wasm recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jan 28, 2025
1 parent ac3a665 commit 4858ce8
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 10 deletions.
14 changes: 7 additions & 7 deletions .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ check-crates:
check-crates-wasm:
cargo check --locked --all-targets --features js --target wasm32-unknown-unknown -p aoide-core
cargo check --locked --all-targets --features js,serde --target wasm32-unknown-unknown -p aoide-core
cargo check --locked --all-targets --target wasm32-unknown-unknown -p aoide-core-json
cargo check --locked --all-targets --target wasm32-unknown-unknown -p aoide-core-api
cargo check --locked --all-targets --features frontend --target wasm32-unknown-unknown -p aoide-core-api-json
cargo check --locked --all-targets --features backend --target wasm32-unknown-unknown -p aoide-core-api-json
cargo check --locked --all-targets --features backend,frontend --target wasm32-unknown-unknown -p aoide-core-api-json
cargo check --locked --all-targets --target wasm32-unknown-unknown -p aoide-repo
cargo check --locked --all-targets --target wasm32-unknown-unknown -p aoide-usecases
cargo check --locked --all-targets --features js --target wasm32-unknown-unknown -p aoide-core-json
cargo check --locked --all-targets --features js --target wasm32-unknown-unknown -p aoide-core-api
cargo check --locked --all-targets --features js,frontend --target wasm32-unknown-unknown -p aoide-core-api-json
cargo check --locked --all-targets --features js,backend --target wasm32-unknown-unknown -p aoide-core-api-json
cargo check --locked --all-targets --features js,backend,frontend --target wasm32-unknown-unknown -p aoide-core-api-json
cargo check --locked --all-targets --features js --target wasm32-unknown-unknown -p aoide-repo
cargo check --locked --all-targets --features js --target wasm32-unknown-unknown -p aoide-usecases

# Run clippy on the workspace (both dev and release profile)
clippy:
Expand Down
1 change: 1 addition & 0 deletions crates/core-api-json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ aoide-core-json.workspace = true

[features]
default = []
js = ["aoide-core-api/js"]
frontend = []
backend = []
json-schema = ["dep:schemars", "aoide-core/json-schema", "aoide-core-json/json-schema"]
1 change: 1 addition & 0 deletions crates/core-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ aoide-core.workspace = true

[features]
default = []
js = ["aoide-core/js"]
1 change: 1 addition & 0 deletions crates/core-json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ aoide-core = { "workspace" = true, features = ["serde"] }

[features]
default = []
js = ["aoide-core/js"]
json-schema = ["dep:schemars", "dep:chrono", "aoide-core/json-schema"]

[dev-dependencies]
Expand Down
3 changes: 3 additions & 0 deletions crates/repo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ rand = "0.8.5"
# Workspace dependencies
aoide-core.workspace = true
aoide-core-api.workspace = true

[features]
js = ["aoide-core-api/js"]
1 change: 1 addition & 0 deletions crates/usecases/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ walkdir = { version = "2.5.0", optional = true }
# Feature to enable JavaScript bindings on wasm32-unknown-unknown
[features]
default = []
js = ["aoide-repo/js"]
expensive-debug-assertions = []
media-file = ["dep:aoide-media-file", "dep:blake3", "dep:url", "dep:walkdir"]
21 changes: 18 additions & 3 deletions crates/usecases/src/track/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use std::time::Instant;

use aoide_core::track::Entity;
use aoide_core::CollectionUid;
use aoide_core_api::{
track::search::{Filter, Params, SortOrder},
Pagination,
Expand Down Expand Up @@ -39,7 +40,7 @@ where
#[cfg(not(target_family = "wasm"))]
pub fn search_with_params<Repo>(
repo: &mut Repo,
collection_uid: &aoide_core::CollectionUid,
collection_uid: &CollectionUid,
params: &Params,
pagination: &Pagination,
collector: &mut impl ReservableRecordCollector<Header = RecordHeader, Record = Entity>,
Expand Down Expand Up @@ -116,9 +117,23 @@ where
if resolve_url_from_content_path.is_some() {
// TODO: Support relative paths for URLs?
log::warn!("Ignoring unsupported parameter {resolve_url_from_content_path:?}");
search(repo, collection_id, pagination, filter, ordering, collector)
search(
repo,
collection_id,
pagination,
filter.as_ref(),
&ordering,
collector,
)
} else {
search(repo, collection_id, pagination, filter, ordering, collector)
search(
repo,
collection_id,
pagination,
filter.as_ref(),
&ordering,
collector,
)
}
.map_err(Into::into)
}

0 comments on commit 4858ce8

Please sign in to comment.