Refactor/zero dependency enums - #7
Merged
Merged
Conversation
- net7.0 went out of support in May 2024 and pins the language to C# 11, which blocks collection expressions and anything later in the library. net8.0 is the oldest supported runtime and the oldest worth carrying.
- LogResult(ILogger) formatted load results for the caller; it becomes GetResultSummaries(), which returns them and lets the consumer log. SuccessCount and AdditionalCount are nullable so "none" stays distinguishable from "not applicable". - Pluralize.NET served one live call site deriving a world-data directory name, plus a dead field in XmlManager. WorldDataDirectory covers the two English rules these type names exercise. - A wrong directory name loads zero files and reports nothing, so the name for every ILoadOnStart type is now pinned against a table. - The package now has no dependencies at all.
- xscgen emits no explicit values, so a member number was its position in the XSD. Several of these enums are cast to a byte and put on the wire, which made an xs:enumeration reorder a silent wire change with no compile error and no diff at the call site. - Values now come from tools/enum-values.json rather than declaration order, applied by regenerate.sh. Reordering the schema no longer moves a number; adding a member fails until one is allocated. - Current values are preserved exactly; this changes no wire byte. - DALib already declares the corresponding enums explicitly as the wire encoding. These matched by coincidence and now match by intent.
- The enums are shared vocabulary and, since their values are allocated in enum-values.json and permanent, they carry a different maintenance contract from the generated data model. The namespace now says so, and CastableFilter and XmlError are no longer the only two enums living there. - xscgen emits fully-qualified references, so namespace-enums.py rewrites both the declarations and the 111 references in the model. It runs from regenerate.sh and is strict about leftovers. - Consumers take the namespace with one project-level Using item rather than a using per file. Note that a global using can surface a name collision a per-file using kept hidden.
- The package now has no dependencies, requires net8.0, and moves every enum to Hybrasyl.Xml.Enums. All three are breaking for a consumer, so the version moves with them.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
==========================================
+ Coverage 60.35% 61.11% +0.76%
==========================================
Files 41 43 +2
Lines 1541 1538 -3
Branches 355 349 -6
==========================================
+ Hits 930 940 +10
+ Misses 495 484 -11
+ Partials 116 114 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This PR removes serilog / pluralizer.NET dependencies, drops .NET 7, moves enums to a new namespace (in preparation for being used with Brigid), and sets defaults for all enums to prevent reordering causing breakage.