From 5c51aa6b87bc37697df248ee3a46245a6ca33c2f Mon Sep 17 00:00:00 2001 From: Stephan van Stekelenburg Date: Sun, 9 Aug 2026 12:00:49 +0200 Subject: [PATCH 1/2] Modernize NuGet package support --- global.json | 7 +++++++ src/D2Text.cs | 4 ++-- src/Polyfills/IsExternalInit.cs | 7 +++++++ src/d2lang-cs.csproj | 34 +++++++++++++++++++++++++-------- 4 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 global.json create mode 100644 src/Polyfills/IsExternalInit.cs diff --git a/global.json b/global.json new file mode 100644 index 0000000..d46d21e --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "10.0.100", + "rollForward": "latestFeature", + "allowPrerelease": false + } +} diff --git a/src/D2Text.cs b/src/D2Text.cs index 34067c0..ce1080f 100644 --- a/src/D2Text.cs +++ b/src/D2Text.cs @@ -13,10 +13,10 @@ internal IEnumerable Lines() return new List() .Append($"{Property}:{sep}{Format}") - .Concat(Text.Split(Environment.NewLine)) + .Concat(Text.Split(new[] { Environment.NewLine }, StringSplitOptions.None)) .Append(sep); } public override string ToString() => string.Join(Environment.NewLine, Lines()); -} \ No newline at end of file +} diff --git a/src/Polyfills/IsExternalInit.cs b/src/Polyfills/IsExternalInit.cs new file mode 100644 index 0000000..e296364 --- /dev/null +++ b/src/Polyfills/IsExternalInit.cs @@ -0,0 +1,7 @@ +#if NETSTANDARD2_0 +namespace System.Runtime.CompilerServices; + +internal static class IsExternalInit +{ +} +#endif diff --git a/src/d2lang-cs.csproj b/src/d2lang-cs.csproj index e13368c..f6b71d7 100644 --- a/src/d2lang-cs.csproj +++ b/src/d2lang-cs.csproj @@ -1,28 +1,46 @@ - net10.0 + netstandard2.0;net8.0;net10.0 + 10.0 enable enable d2 + + + 1.1.0 + local + + true + true + portable + true + true + true + true + snupkg + true + 1.0.0 + d2lang-cs - 1.0.0 + D2 for .NET Stephan van Stekelenburg + Copyright (c) Stephan van Stekelenburg https://github.com/Stephanvs/d2lang-cs.git + git https://github.com/Stephanvs/d2lang-cs D2;D2 Lang;Declarative Diagramming;Diagram;Text Diagram;Text to Diagram MIT - D2 is A modern, open-source DSL designed specifically for software architecture diagrams. + A .NET library for generating diagrams in D2, the modern declarative diagramming language. d2_logo.png README.md - - - - - + + + + From 53099fdd8ca0b2804d634dbdc68f7eba17cefbf4 Mon Sep 17 00:00:00 2001 From: Stephan van Stekelenburg Date: Sun, 9 Aug 2026 13:10:28 +0200 Subject: [PATCH 2/2] Allow prerelease package in CI smoke test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d644214..b3b4f9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,7 +149,7 @@ jobs: shell: bash run: | dotnet new console --framework net10.0 --output artifacts/package-smoke --no-restore - dotnet add artifacts/package-smoke/package-smoke.csproj package d2lang-cs --source "$PWD/artifacts/packages" + dotnet add artifacts/package-smoke/package-smoke.csproj package d2lang-cs --prerelease --source "$PWD/artifacts/packages" dotnet build artifacts/package-smoke/package-smoke.csproj --configuration Release --no-restore - name: Upload package