From c3b6f29fc89642818bcebe5746dbd359e067c717 Mon Sep 17 00:00:00 2001 From: ShortArrow Date: Wed, 22 Jul 2026 15:20:02 +0900 Subject: [PATCH] chore(deps): upgrade Tomlyn 0.19.0 -> 2.10.1 Tomlyn v1/v2 is a major redesign with a System.Text.Json-style API; the static `Toml` entry point is gone. Migrate the untyped-model call sites (config, scenario, api-token, and plugin-manifest parsers): - `Toml.ToModel(s)` -> `TomlSerializer.Deserialize(s) ?? new TomlTable()` - `Toml.FromModel(m)` -> `TomlSerializer.Serialize(m)` `TomlTable` / `TomlTableArray` (Tomlyn.Model) and `TomlException` are unchanged, so the model access and syntax-error handling stay as-is. Tomlyn v2 targets TOML 1.1; our config/scenario/token documents round-trip unchanged. Verified by the full suite (incl. 11 invalid-syntax tests) and a real-binary config add/list round-trip. Lock files refreshed. --- Directory.Packages.props | 2 +- src/IviCli.Cli/packages.lock.json | 8 ++++---- src/IviCli.Infrastructure/Auth/TomlApiTokenStore.cs | 4 ++-- .../Configuration/TomlConfigParser.cs | 2 +- src/IviCli.Infrastructure/Mock/TomlScenarioParser.cs | 2 +- src/IviCli.Infrastructure/Plugins/PluginLoader.cs | 2 +- src/IviCli.Infrastructure/packages.lock.json | 6 +++--- tests/IviCli.Api.Tests/packages.lock.json | 8 ++++---- tests/IviCli.Cli.Tests/packages.lock.json | 8 ++++---- tests/IviCli.Infrastructure.Tests/packages.lock.json | 8 ++++---- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index da91e10..3f699df 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -10,7 +10,7 @@ Version="10.0.9" /> - + diff --git a/src/IviCli.Cli/packages.lock.json b/src/IviCli.Cli/packages.lock.json index 2d012d8..b1ed129 100644 --- a/src/IviCli.Cli/packages.lock.json +++ b/src/IviCli.Cli/packages.lock.json @@ -525,7 +525,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[10.0.9, )", "TestableIO.System.IO.Abstractions": "[22.2.0, )", "TestableIO.System.IO.Abstractions.Wrappers": "[22.2.0, )", - "Tomlyn": "[0.19.0, )" + "Tomlyn": "[2.10.1, )" } }, "ivicli.plugin": { @@ -622,9 +622,9 @@ }, "Tomlyn": { "type": "CentralTransitive", - "requested": "[0.19.0, )", - "resolved": "0.19.0", - "contentHash": "GlI2o8R8jbZIaE+YX6uA/VoAOH7zIxYeqxDm7jHW2hqUhuB+q19oKold35FkMuv8IZDoCqsTMolaBv2eBLBmrQ==" + "requested": "[2.10.1, )", + "resolved": "2.10.1", + "contentHash": "ykjOY3IpYmC4SpPcAZRTl/w2jTmhPMDydHq8xcV7tTBAQ22nKBsOkPqauIrZlMjHm03cmKfV23UOPscKp+J4Og==" } } } diff --git a/src/IviCli.Infrastructure/Auth/TomlApiTokenStore.cs b/src/IviCli.Infrastructure/Auth/TomlApiTokenStore.cs index ac03bf6..2747de3 100644 --- a/src/IviCli.Infrastructure/Auth/TomlApiTokenStore.cs +++ b/src/IviCli.Infrastructure/Auth/TomlApiTokenStore.cs @@ -38,7 +38,7 @@ public async Task> LoadAsync(Cancel return Result.Success(ApiTokenDocument.Empty); } var text = await _fs.File.ReadAllTextAsync(_path, ct); - var model = Toml.ToModel(text); + var model = TomlSerializer.Deserialize(text) ?? new TomlTable(); var tokens = ImmutableArray.CreateBuilder(); if (model.TryGetValue("token", out var raw) && raw is TomlTableArray array) { @@ -157,6 +157,6 @@ private static string Serialize(ApiTokenDocument document) array.Add(table); } model["token"] = array; - return Toml.FromModel(model); + return TomlSerializer.Serialize(model); } } diff --git a/src/IviCli.Infrastructure/Configuration/TomlConfigParser.cs b/src/IviCli.Infrastructure/Configuration/TomlConfigParser.cs index 4a1b354..d06a940 100644 --- a/src/IviCli.Infrastructure/Configuration/TomlConfigParser.cs +++ b/src/IviCli.Infrastructure/Configuration/TomlConfigParser.cs @@ -64,7 +64,7 @@ public static Result Parse(string toml) TomlTable model; try { - model = Toml.ToModel(toml); + model = TomlSerializer.Deserialize(toml) ?? new TomlTable(); } catch (TomlException ex) { diff --git a/src/IviCli.Infrastructure/Mock/TomlScenarioParser.cs b/src/IviCli.Infrastructure/Mock/TomlScenarioParser.cs index c7817c6..2248130 100644 --- a/src/IviCli.Infrastructure/Mock/TomlScenarioParser.cs +++ b/src/IviCli.Infrastructure/Mock/TomlScenarioParser.cs @@ -61,7 +61,7 @@ public static Result Parse(ScenarioName name, TomlTable model; try { - model = Toml.ToModel(toml); + model = TomlSerializer.Deserialize(toml) ?? new TomlTable(); } catch (TomlException ex) { diff --git a/src/IviCli.Infrastructure/Plugins/PluginLoader.cs b/src/IviCli.Infrastructure/Plugins/PluginLoader.cs index 003e32e..77e665a 100644 --- a/src/IviCli.Infrastructure/Plugins/PluginLoader.cs +++ b/src/IviCli.Infrastructure/Plugins/PluginLoader.cs @@ -180,7 +180,7 @@ private static Result ParseManifest(string toml TomlTable model; try { - model = Toml.ToModel(toml); + model = TomlSerializer.Deserialize(toml) ?? new TomlTable(); } catch (TomlException ex) { diff --git a/src/IviCli.Infrastructure/packages.lock.json b/src/IviCli.Infrastructure/packages.lock.json index f69ee4c..cb53eb0 100644 --- a/src/IviCli.Infrastructure/packages.lock.json +++ b/src/IviCli.Infrastructure/packages.lock.json @@ -37,9 +37,9 @@ }, "Tomlyn": { "type": "Direct", - "requested": "[0.19.0, )", - "resolved": "0.19.0", - "contentHash": "GlI2o8R8jbZIaE+YX6uA/VoAOH7zIxYeqxDm7jHW2hqUhuB+q19oKold35FkMuv8IZDoCqsTMolaBv2eBLBmrQ==" + "requested": "[2.10.1, )", + "resolved": "2.10.1", + "contentHash": "ykjOY3IpYmC4SpPcAZRTl/w2jTmhPMDydHq8xcV7tTBAQ22nKBsOkPqauIrZlMjHm03cmKfV23UOPscKp+J4Og==" }, "Testably.Abstractions.FileSystem.Interface": { "type": "Transitive", diff --git a/tests/IviCli.Api.Tests/packages.lock.json b/tests/IviCli.Api.Tests/packages.lock.json index 146224a..fcf644d 100644 --- a/tests/IviCli.Api.Tests/packages.lock.json +++ b/tests/IviCli.Api.Tests/packages.lock.json @@ -216,7 +216,7 @@ "IviCli.Plugin": "[0.2.8, )", "TestableIO.System.IO.Abstractions": "[22.2.0, )", "TestableIO.System.IO.Abstractions.Wrappers": "[22.2.0, )", - "Tomlyn": "[0.19.0, )" + "Tomlyn": "[2.10.1, )" } }, "ivicli.plugin": { @@ -264,9 +264,9 @@ }, "Tomlyn": { "type": "CentralTransitive", - "requested": "[0.19.0, )", - "resolved": "0.19.0", - "contentHash": "GlI2o8R8jbZIaE+YX6uA/VoAOH7zIxYeqxDm7jHW2hqUhuB+q19oKold35FkMuv8IZDoCqsTMolaBv2eBLBmrQ==" + "requested": "[2.10.1, )", + "resolved": "2.10.1", + "contentHash": "ykjOY3IpYmC4SpPcAZRTl/w2jTmhPMDydHq8xcV7tTBAQ22nKBsOkPqauIrZlMjHm03cmKfV23UOPscKp+J4Og==" } } } diff --git a/tests/IviCli.Cli.Tests/packages.lock.json b/tests/IviCli.Cli.Tests/packages.lock.json index d684797..afda7b0 100644 --- a/tests/IviCli.Cli.Tests/packages.lock.json +++ b/tests/IviCli.Cli.Tests/packages.lock.json @@ -636,7 +636,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[10.0.9, )", "TestableIO.System.IO.Abstractions": "[22.2.0, )", "TestableIO.System.IO.Abstractions.Wrappers": "[22.2.0, )", - "Tomlyn": "[0.19.0, )" + "Tomlyn": "[2.10.1, )" } }, "ivicli.plugin": { @@ -859,9 +859,9 @@ }, "Tomlyn": { "type": "CentralTransitive", - "requested": "[0.19.0, )", - "resolved": "0.19.0", - "contentHash": "GlI2o8R8jbZIaE+YX6uA/VoAOH7zIxYeqxDm7jHW2hqUhuB+q19oKold35FkMuv8IZDoCqsTMolaBv2eBLBmrQ==" + "requested": "[2.10.1, )", + "resolved": "2.10.1", + "contentHash": "ykjOY3IpYmC4SpPcAZRTl/w2jTmhPMDydHq8xcV7tTBAQ22nKBsOkPqauIrZlMjHm03cmKfV23UOPscKp+J4Og==" } } } diff --git a/tests/IviCli.Infrastructure.Tests/packages.lock.json b/tests/IviCli.Infrastructure.Tests/packages.lock.json index 6bdc210..3f095bb 100644 --- a/tests/IviCli.Infrastructure.Tests/packages.lock.json +++ b/tests/IviCli.Infrastructure.Tests/packages.lock.json @@ -229,7 +229,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[10.0.9, )", "TestableIO.System.IO.Abstractions": "[22.2.0, )", "TestableIO.System.IO.Abstractions.Wrappers": "[22.2.0, )", - "Tomlyn": "[0.19.0, )" + "Tomlyn": "[2.10.1, )" } }, "ivicli.plugin": { @@ -280,9 +280,9 @@ }, "Tomlyn": { "type": "CentralTransitive", - "requested": "[0.19.0, )", - "resolved": "0.19.0", - "contentHash": "GlI2o8R8jbZIaE+YX6uA/VoAOH7zIxYeqxDm7jHW2hqUhuB+q19oKold35FkMuv8IZDoCqsTMolaBv2eBLBmrQ==" + "requested": "[2.10.1, )", + "resolved": "2.10.1", + "contentHash": "ykjOY3IpYmC4SpPcAZRTl/w2jTmhPMDydHq8xcV7tTBAQ22nKBsOkPqauIrZlMjHm03cmKfV23UOPscKp+J4Og==" } } }