From 529f6877cec88c863fd2f0a5fc210c324c4ed5dd Mon Sep 17 00:00:00 2001 From: Harry Cordewener Date: Mon, 7 Sep 2026 02:31:58 -0500 Subject: [PATCH] Delete HtmlCss rather than deprecating it Marking it obsolete and forwarding to AnsiCss.Fixed was the wrong instinct: a deprecation buys a migration window for consumers you cannot reach, and this library is a day old with one consumer. What it actually bought was two public names for the same string and a member to carry forever. So it goes. AnsiCss.Fixed is the stylesheet; MarkupString.Html writes no ms-* class and has no reason to name one. The removal is recorded as *REMOVED* lines in PublicAPI.Unshipped.txt. Removing public API from a published version is a break, so this ships as 1.1.0 with 1.0.0 unlisted rather than as a major: 1.0.0 went out the same day and nothing consumes it, so unlisting makes "no one is broken" a fact rather than an assumption. PackageValidationBaselineVersion comes off for this build, because the surface being removed from is the surface it would validate against, and goes back to 1.1.0 once that is published. docs/releasing.md carries both halves. Co-Authored-By: Claude Opus 5 --- CHANGELOG.md | 11 +++++++---- MarkupString.Ansi/MarkupString.Ansi.csproj | 4 ++-- MarkupString.Html/HtmlCss.cs | 18 ------------------ MarkupString.Html/MarkupString.Html.csproj | 4 ++-- MarkupString.Html/PublicAPI.Shipped.txt | 2 -- MarkupString.Html/PublicAPI.Unshipped.txt | 2 ++ MarkupString/MarkupString.csproj | 4 ++-- docs/releasing.md | 13 +++++++++---- 8 files changed, 24 insertions(+), 34 deletions(-) delete mode 100644 MarkupString.Html/HtmlCss.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bc0eb0..499c933 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,15 @@ follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - `AnsiCss.Fixed` in `MarkupString.Ansi` — the stylesheet for the `ms-*` classes. Every one of those classes is written by this package's HTML emitter, so a consumer rendering HTML with - `MarkupString` + `MarkupString.Ansi` alone can now reach the rules; previously they existed only - in `MarkupString.Html`, a package such a consumer has no reason to take. + `MarkupString` + `MarkupString.Ansi` alone can now reach the rules; in 1.0.0 they existed only in + `MarkupString.Html`, a package such a consumer has no reason to take. -### Deprecated +### Removed -- `HtmlCss.Fixed` in `MarkupString.Html`. It returns `AnsiCss.Fixed` unchanged; move to that. +- **Breaking:** `HtmlCss` in `MarkupString.Html`. Use `AnsiCss.Fixed`; the rules are identical. + Nothing else in that package writes an `ms-*` class, so the type had no business being there. + A removal in a minor is a semver break; 1.0.0 is unlisted, having been published the same day + and consumed by nothing, so there is no one to break. ## 1.0.0 — 2026-09-07 diff --git a/MarkupString.Ansi/MarkupString.Ansi.csproj b/MarkupString.Ansi/MarkupString.Ansi.csproj index a762244..604ac0e 100644 --- a/MarkupString.Ansi/MarkupString.Ansi.csproj +++ b/MarkupString.Ansi/MarkupString.Ansi.csproj @@ -9,9 +9,9 @@ CS1591 + each time one goes out; drop it for a release that removes public API on purpose, and put + it back straight after. --> true - 1.0.0 Terminal styling for MarkupString: colours (16, 256 and truecolor), text attributes and links, an ansi() code parser, and emitters that fold a run's layers into one SGR sequence, HTML span, Pueblo/MXP tag or BBCode tag. diff --git a/MarkupString.Html/HtmlCss.cs b/MarkupString.Html/HtmlCss.cs deleted file mode 100644 index 29a3462..0000000 --- a/MarkupString.Html/HtmlCss.cs +++ /dev/null @@ -1,18 +0,0 @@ -using MarkupString.Ansi; - -namespace MarkupString.Html; - -/// -/// The stylesheet for the ms-* classes written when rendering to HTML. -/// -public static class HtmlCss -{ - /// - /// The rules from , which is where they live: every ms-* - /// class is written by the Ansi package's HTML emitter, and this package writes none of its - /// own. Reach for instead — it is available to a consumer that - /// renders HTML without taking this package at all. - /// - [Obsolete("Use AnsiCss.Fixed. Every ms-* class is written by MarkupString.Ansi, so the stylesheet belongs there; a consumer rendering HTML with only MarkupString.Ansi cannot reach it here.")] - public static readonly string Fixed = AnsiCss.Fixed; -} diff --git a/MarkupString.Html/MarkupString.Html.csproj b/MarkupString.Html/MarkupString.Html.csproj index d2e2908..d7f434a 100644 --- a/MarkupString.Html/MarkupString.Html.csproj +++ b/MarkupString.Html/MarkupString.Html.csproj @@ -9,9 +9,9 @@ CS1591 + each time one goes out; drop it for a release that removes public API on purpose, and put + it back straight after. --> true - 1.0.0 Raw HTML tag markup for MarkupString — an MXP <send>, an anchor, a span — rendered as itself in the HTML, Pueblo and MXP formats, folded into terminal styling elsewhere, with the stylesheet for the ms-* classes the emitters write. diff --git a/MarkupString.Html/PublicAPI.Shipped.txt b/MarkupString.Html/PublicAPI.Shipped.txt index 9bd8bc9..ed3d6db 100644 --- a/MarkupString.Html/PublicAPI.Shipped.txt +++ b/MarkupString.Html/PublicAPI.Shipped.txt @@ -1,5 +1,4 @@ #nullable enable -MarkupString.Html.HtmlCss MarkupString.Html.HtmlMarkup MarkupString.Html.HtmlMarkup.$() -> MarkupString.Html.HtmlMarkup! MarkupString.Html.HtmlMarkup.Attributes.get -> string? @@ -29,4 +28,3 @@ static MarkupString.Html.HtmlMarkup.Create(string! tagName, string? attributes = static MarkupString.Html.HtmlMarkup.operator !=(MarkupString.Html.HtmlMarkup? left, MarkupString.Html.HtmlMarkup? right) -> bool static MarkupString.Html.HtmlMarkup.operator ==(MarkupString.Html.HtmlMarkup? left, MarkupString.Html.HtmlMarkup? right) -> bool static MarkupString.Html.HtmlRegistration.WithHtml(this MarkupString.MarkupRegistry! registry) -> MarkupString.MarkupRegistry! -static readonly MarkupString.Html.HtmlCss.Fixed -> string! diff --git a/MarkupString.Html/PublicAPI.Unshipped.txt b/MarkupString.Html/PublicAPI.Unshipped.txt index 7dc5c58..e29b153 100644 --- a/MarkupString.Html/PublicAPI.Unshipped.txt +++ b/MarkupString.Html/PublicAPI.Unshipped.txt @@ -1 +1,3 @@ #nullable enable +*REMOVED*MarkupString.Html.HtmlCss +*REMOVED*static readonly MarkupString.Html.HtmlCss.Fixed -> string! diff --git a/MarkupString/MarkupString.csproj b/MarkupString/MarkupString.csproj index bdc22e4..278ed49 100644 --- a/MarkupString/MarkupString.csproj +++ b/MarkupString/MarkupString.csproj @@ -9,9 +9,9 @@ CS1591 + each time one goes out; drop it for a release that removes public API on purpose, and put + it back straight after. --> true - 1.0.0 Immutable styled text: a string plus layered markup runs, rendered to ANSI, HTML, Pueblo, MXP, BBCode or plain text through a registry of emitters, and round-tripped through JSON. diff --git a/docs/releasing.md b/docs/releasing.md index f816258..43325e1 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -33,9 +33,14 @@ build if the two ever disagree. The tag triggers `.github/workflows/release.yml`. `workflow_dispatch` with the tag name as input does the same thing by hand. -4. After the **first** ever release, set `PackageValidationBaselineVersion` to it in each of the - three package files. Package validation then diffs every later build against the published - baseline and fails on a break. +4. After the release lands on nuget.org, set `PackageValidationBaselineVersion` to it in each of + the three package files. Package validation then diffs every later build against that published + surface and fails on a break — including one you did not mean to make. + + A release that *does* remove or re-signature public API is the exception: drop the property for + that build, release, then set it to the new version. `PublicAPI.Unshipped.txt` still records each + removal as a `*REMOVED*` line, so the removal is reviewed rather than merely permitted — and + unlist the version being broken away from, so nobody resolves to a surface that no longer holds. ## What the release workflow does @@ -81,4 +86,4 @@ repository was set up; the first successful push claims them. - [ ] `PublicAPI.Unshipped.txt` promoted to `PublicAPI.Shipped.txt` in all three packages - [ ] Trusted publishing policy exists on nuget.org for `SharpMUSH/MarkupString` (first release only) - [ ] Tag pushed, `Release` workflow green -- [ ] `PackageValidationBaselineVersion` set (after the first release only) +- [ ] `PackageValidationBaselineVersion` raised to the version just published