feat(welcome): per-role app recipes in the first-boot wizard #17

Merged
SilverLABS merged 11 commits from feat/app-recipes into main 2026-06-09 23:54:29 +00:00
2 changed files with 49 additions and 0 deletions
Showing only changes of commit bfb53bd295 - Show all commits

View File

@@ -0,0 +1,28 @@
using System.Text.Json;
namespace SilverOS.Welcome.Core.Apps;
public sealed record AppSource
{
public string? Winget { get; init; }
// Future: public string? Mirror { get; init; } // swappable to a curated mirror.
}
public sealed record AppCatalogEntry
{
public string Id { get; init; } = "";
public string Name { get; init; } = "";
public string Description { get; init; } = "";
public AppSource Source { get; init; } = new();
public string Group { get; init; } = "";
public IReadOnlyList<string> Roles { get; init; } = Array.Empty<string>();
public IReadOnlyList<string> DefaultFor { get; init; } = Array.Empty<string>();
public string? Configure { get; init; }
public static readonly JsonSerializerOptions JsonOptions = new()
{
PropertyNameCaseInsensitive = true,
ReadCommentHandling = JsonCommentHandling.Skip,
AllowTrailingCommas = true
};
}

View File

@@ -0,0 +1,21 @@
using System.Text.Json;
using SilverOS.Welcome.Core.Apps;
using Xunit;
public class AppCatalogTests
{
[Fact]
public void Deserializes_a_catalog_entry()
{
var json = """
{ "id":"vscodium","name":"VSCodium","description":"Telemetry-free VS Code.",
"source":{"winget":"VSCodium.VSCodium"},"group":"developer",
"roles":["developer"],"defaultFor":["developer"],"configure":null }
""";
var e = JsonSerializer.Deserialize<AppCatalogEntry>(json, AppCatalogEntry.JsonOptions)!;
Assert.Equal("vscodium", e.Id);
Assert.Equal("VSCodium.VSCodium", e.Source.Winget);
Assert.Contains("developer", e.Roles);
Assert.Contains("developer", e.DefaultFor);
}
}