Repository navigation
Add the extension point mechanism - #2439
Merged
Merged
Conversation
ExtensionPoint marker, extension catalog, and registration by explicit call or assembly discovery, with Core discovering its own built-ins the same way. Refs #2438
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.
Closes #2438
What
The mechanism every extension point uses, landed before any domain interface exists (first slice of #2429).
[ExtensionPoint]marks an interface inFluentCMS.Core.Extensionsas a seam.IExtensionCataloglists every registered extension with its contract, implementation and whether it is built in (FluentCMS.Core.Builtin).AddFluentCmsExtension<TContract, TImplementation>()registers explicitly;AddFluentCmsExtensions(assembly)discovers every concrete implementation of an extension-point interface. Both produce the same catalog entry and the sameIEnumerable<TContract>resolution, and a discovered type already registered explicitly is not duplicated.AddFluentCmsCore()discovers the Core assembly's built-ins through the same call a plugin assembly would use, so there is no privileged path (EXT-02).CONTRIBUTING.mdgains an "Extension points" section.Why
Field types (F-SCH), check types (F-CHK), tool providers (F-MCP), storage, scorers and notification channels all need one registration and discovery story. Landing it first means each of those interfaces arrives with its first consumer on top of a mechanism that is already tested.
Tests
Explicit registration resolves and is catalogued; assembly discovery finds every implementation of an extension point and nothing else; discovery after an explicit registration does not duplicate; a contract without the attribute is rejected; Core provides a catalog with no built-ins yet.
Checklist
v2