chore(dips): add rpc and db feature flags to indexer-dips crate #636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes various changes to the
crates/dips
package to introduce feature flags and improve modularity. The key changes involve adding feature flags for optional dependencies, modifying the build script to conditionally compile based on features, and updating imports and module definitions accordingly.Feature Flags and Dependencies:
rpc
anddb
inCargo.toml
to conditionally include dependencies ([crates/dips/Cargo.tomlR6-R35](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-271b41f6df2e65a887a3a18cd20536fb075df359339939c77d15843c117a070cR6-R35)
).Cargo.toml
to be optional based on the feature flags ([crates/dips/Cargo.tomlR6-R35](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-271b41f6df2e65a887a3a18cd20536fb075df359339939c77d15843c117a070cR6-R35)
).Build Script:
build.rs
to conditionally compile proto files if therpc
feature is enabled ([[1]](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-708ee7d06e2e6e35b9419c852e467adcc59e77d759acd12bcd6988aab627dba7R5-R8)
,[[2]](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-708ee7d06e2e6e35b9419c852e467adcc59e77d759acd12bcd6988aab627dba7R23)
).Codebase Updates:
database.rs
andipfs.rs
to useasync_trait
from theasync_trait
crate instead ofaxum
ortonic
([[1]](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-c8af91422fb1ed010565eac4fda150897bfbdba657084c76787d871da0fd27faL6-R6)
,[[2]](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-ca88c155ef694ceb70a734514fba168b1bd873c4efc481be50c7b8dab0b59aaaR6-L11)
).database
,proto
, andserver
inlib.rs
based on feature flags ([crates/dips/src/lib.rsR16-R22](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-43049e4db6e400dbf78fe60574626cb162e14dbb774b13f92bc9b05b68d08830R16-R22)
).From<DipsError>
fortonic::Status
if therpc
feature is enabled ([crates/dips/src/lib.rsR171](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-43049e4db6e400dbf78fe60574626cb162e14dbb774b13f92bc9b05b68d08830R171)
).