Skip to content

feat: allow to combine overrides#145

Merged
nfroidure merged 1 commit into
mainfrom
feat/self_overrides
Jun 25, 2026
Merged

feat: allow to combine overrides#145
nfroidure merged 1 commit into
mainfrom
feat/self_overrides

Conversation

@nfroidure

Copy link
Copy Markdown
Owner

fix #143

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 __self and 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.

Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread src/util.ts
Comment thread README.md
Comment thread API.md
@nfroidure nfroidure force-pushed the feat/self_overrides branch from ed0c7f1 to 5abd933 Compare June 25, 2026 11:44
@nfroidure nfroidure merged commit d3dd5f7 into main Jun 25, 2026
1 check passed
@nfroidure nfroidure deleted the feat/self_overrides branch June 25, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support nested $overrides

2 participants