feat: add pathOverrides support for Envied annotations#183
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds per-@Envied path override support to envied_generator via a new pathOverrides build option, while preserving existing global path override behavior and documenting configuration usage.
Changes:
- Introduces
BuildOptions.pathOverridesand parsing/validation from builder config. - Updates
EnviedGeneratorpath resolution to prefer overrides by@Envied(name)then original@Envied(path), with fallback to globalpaththen annotation/default. - Adds generator and build options tests plus fixture
.envfiles; updates README docs with YAML/CLI examples.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/envied_generator/lib/src/generator.dart | Implements path resolution precedence and updates generated_from to reflect resolved paths. |
| packages/envied_generator/lib/src/build_options.dart | Adds pathOverrides option and strict parsing/validation. |
| packages/envied_generator/test/envy_generator_test.dart | Registers new annotated-element tests covering override precedence and override disabled behavior. |
| packages/envied_generator/test/src/generator_tests_with_path_overrides.dart | Adds golden generation expectations for name/path/global fallback precedence. |
| packages/envied_generator/test/src/generator_tests_with_path_overrides_disabled.dart | Verifies pathOverrides are ignored when override: false. |
| packages/envied_generator/test/build_options_test.dart | Unit tests for pathOverrides parsing and invalid inputs. |
| packages/envied_generator/test/.env.path_overrides_* | Test env fixtures to validate override selection. |
| packages/envied/README.md | Documents pathOverrides in build.yaml and CLI usage, including precedence rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
pathOverridesbuilder option for per-@Enviedpath overrides.pathoverride behavior unchanged.@Envied(name)first, then original annotation path, then globalpath, then annotation/default path.pathOverrides.Addresses