feat: allow to combine overrides#145
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements support for nested $overrides using a __self key so a service can be overridden while still allowing overrides for its dependencies (addressing issue #143). It also reserves the __self service name to avoid collisions with the new override syntax.
Changes:
- Extend override resolution to support nested override maps containing
__self, including dependency overrides for the overridden target. - Prevent registering a service named
__selfand add a dedicated error code for that case. - Add test coverage for the new override behavior and the reserved-name guard.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/overrides.ts |
Adds __self support to the override lookup logic and updates the Overrides type. |
src/overrides.test.ts |
Adds unit tests for nested __self overrides and dependency override lookup. |
src/index.ts |
Rejects registration of the reserved service name __self. |
src/index.test.ts |
Adds integration tests for reserved name rejection and nested __self overrides end-to-end. |
src/errors.ts |
Registers the new E_RESERVED_SERVICE_NAME error type for TypeScript consumers. |
README.md |
Updates an import in the usage example (currently introduces a mismatch with the rest of the snippet). |
ARCHITECTURE.md |
Updates an internal “See in context” line-number link. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ca7b495 to
ed0c7f1
Compare
ed0c7f1 to
5abd933
Compare
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.
fix #143