JoJoJet / bevy-trait-query

adds trait queries to the bevy game engine
Apache License 2.0
65 stars 11 forks source link

Allow usage outside of the Bevy engine (ECS-only scenarios) #48

Closed csh closed 9 months ago

csh commented 9 months ago

This should allow for people who wish to use bevy_ecs outside of the Bevy ecosystem to take advantage of this crate without pulling in dependencies that aren't necessary for their projects.

The bevy feature is active by default so current users should be unaffected when upgrading, using this in an ECS-only scenario simply requires disabling default features.

[dependencies.bevy-trait-query]
default-features = false

Great crate by the way, has been extremely useful for a hobby project of mine so far!👍

JoJoJet commented 9 months ago

Thanks for the PR! Would it work to have an optional app feature that depends on bevy_app directly, rather than depending on all of bevy?

csh commented 9 months ago

I believe that should cover it, although I did have to put bevy in [dev-dependencies] in order to keep doctests/examples looking as an end-user would expect - there may be another way, I'm not sure though.

JoJoJet commented 9 months ago

Can you make sure that CI runs with default features disabled? in the file .github/workflows/ci.yml, add the line

run: cargo test --no-default-features

to the end of the first CI job, right before

run: cargo test