Skip to content

Refactor/zero dependency enums - #7

Merged
baughj merged 5 commits into
mainfrom
refactor/zero-dependency-enums
Aug 17, 2026
Merged

Refactor/zero dependency enums#7
baughj merged 5 commits into
mainfrom
refactor/zero-dependency-enums

Conversation

@baughj

@baughj baughj commented Aug 17, 2026

Copy link
Copy Markdown
Member

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.

baughj added 5 commits August 16, 2026 22:13
- 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.
@baughj
baughj merged commit 3fac74d into main Aug 17, 2026
1 check passed
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.11%. Comparing base (cd14ca0) to head (32ec86f).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/Manager/XmlManager.cs 79.16% 3 Missing and 2 partials ⚠️
src/Manager/XmlResultSummary.cs 87.50% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant