feat: make context optional#23
Open
jhult wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Makes the context store feature optional via Cargo feature flags. Context—grite's distributed file/symbol index that AI agents can query to understand project structure—is still enabled by default, but can now be disabled at compile time to reduce binary size and compilation time by excluding tree-sitter and language grammar dependencies.
Changes
Features
contextfeature flag togrite,libgrite-cli,libgrite-core, andlibgrite-gitcratesRefactoring
#[cfg(feature = "context")]guards to context-related CLI commands, types, store methods, event handlers, and testslibgrite-ipcto usedefault-features = falseforlibgrite-coreFiles Changed
Key files:
crates/libgrite-core/Cargo.toml- Feature flag definition with optional tree-sitter depscrates/libgrite-core/src/store/mod.rs- Conditional context store fields and methodscrates/grite/src/cli.rs- Conditional context subcommandcrates/libgrite-cli/src/types.rs- Conditional context option/result typesTest Plan
cargo test- Context tests run with default features enabledcargo test --no-default-features- Tests compile and pass without context featurecargo check --no-default-features- All crates compile successfully without contextcargo build- Binary builds with context enabled by defaultcargo build --no-default-features- Binary builds successfully without context