From 6e6e9f19f29a9a0a1dc935abd57db7c9e100e222 Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Wed, 30 Sep 2026 15:28:49 +0100 Subject: [PATCH] feat: add the results project to the catalogue Adds purview-dev/results as a preview application-framework project: - docs aggregated from `docs/wiki` with `rootPage: Getting-Started.md` and `_Sidebar.md`/`Home.md`/`index.md` excluded (14 pages), - five packages (`Purview.Results` primary, plus the source generator targeting `netstandard2.0`, the ASP.NET Core adapter, and the two ZodSharp bridges), - four use cases with deep links into the aggregated documentation, - relationships to `zodsharp` and `sourcegenerator-framework`, - release fixtures for the new repository, packages, and search entries. Status is `preview` because every package is still on a `1.0.0-prerelease.N` channel. --- src/fixtures/github/releases/results.json | 88 ++++++++ src/fixtures/github/repos/results.json | 193 ++++++++++++++++++ .../nuget/purview.results.aspnetcore.json | 6 + src/fixtures/nuget/purview.results.json | 6 + .../purview.results.sourcegenerator.json | 6 + .../purview.results.zodsharp.aspnetcore.json | 6 + .../nuget/purview.results.zodsharp.json | 6 + .../search/Purview.Results.AspNetCore.json | 8 + .../Purview.Results.SourceGenerator.json | 8 + .../Purview.Results.ZodSharp.AspNetCore.json | 8 + .../search/Purview.Results.ZodSharp.json | 8 + .../nuget/search/Purview.Results.json | 8 + src/fixtures/releases/index.json | 92 ++++++++- src/src/data/projects.yml | 132 ++++++++++++ 14 files changed, 573 insertions(+), 2 deletions(-) create mode 100644 src/fixtures/github/releases/results.json create mode 100644 src/fixtures/github/repos/results.json create mode 100644 src/fixtures/nuget/purview.results.aspnetcore.json create mode 100644 src/fixtures/nuget/purview.results.json create mode 100644 src/fixtures/nuget/purview.results.sourcegenerator.json create mode 100644 src/fixtures/nuget/purview.results.zodsharp.aspnetcore.json create mode 100644 src/fixtures/nuget/purview.results.zodsharp.json create mode 100644 src/fixtures/nuget/search/Purview.Results.AspNetCore.json create mode 100644 src/fixtures/nuget/search/Purview.Results.SourceGenerator.json create mode 100644 src/fixtures/nuget/search/Purview.Results.ZodSharp.AspNetCore.json create mode 100644 src/fixtures/nuget/search/Purview.Results.ZodSharp.json create mode 100644 src/fixtures/nuget/search/Purview.Results.json diff --git a/src/fixtures/github/releases/results.json b/src/fixtures/github/releases/results.json new file mode 100644 index 0000000..c4d0f37 --- /dev/null +++ b/src/fixtures/github/releases/results.json @@ -0,0 +1,88 @@ +[ + { + "url": "https://api.github.com/repos/purview-dev/results/releases/400107240", + "assets_url": "https://api.github.com/repos/purview-dev/results/releases/400107240/assets", + "upload_url": "https://uploads.github.com/repos/purview-dev/results/releases/400107240/assets{?name,label}", + "html_url": "https://github.com/purview-dev/results/releases/tag/v1.0.0-prerelease.2", + "id": 400107240, + "author": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "node_id": "RE_kwDOUz-6es4X2Sbo", + "tag_name": "v1.0.0-prerelease.2", + "target_commitish": "main", + "name": "v1.0.0-prerelease.2", + "draft": false, + "immutable": false, + "prerelease": true, + "created_at": "2026-09-30T14:03:25Z", + "updated_at": "2026-09-30T14:05:29Z", + "published_at": "2026-09-30T14:05:29Z", + "assets": [], + "tarball_url": "https://api.github.com/repos/purview-dev/results/tarball/v1.0.0-prerelease.2", + "zipball_url": "https://api.github.com/repos/purview-dev/results/zipball/v1.0.0-prerelease.2", + "body": "## What's Changed\n* docs: added docs by @kieronlanning in https://github.com/purview-dev/results/pull/2\n\n\n**Full Changelog**: https://github.com/purview-dev/results/compare/v1.0.0-prerelease.1...v1.0.0-prerelease.2", + "mentions_count": 1 + }, + { + "url": "https://api.github.com/repos/purview-dev/results/releases/400028085", + "assets_url": "https://api.github.com/repos/purview-dev/results/releases/400028085/assets", + "upload_url": "https://uploads.github.com/repos/purview-dev/results/releases/400028085/assets{?name,label}", + "html_url": "https://github.com/purview-dev/results/releases/tag/v1.0.0-prerelease.1", + "id": 400028085, + "author": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "node_id": "RE_kwDOUz-6es4X1_G1", + "tag_name": "v1.0.0-prerelease.1", + "target_commitish": "main", + "name": "v1.0.0-prerelease.1", + "draft": false, + "immutable": false, + "prerelease": true, + "created_at": "2026-09-30T12:33:12Z", + "updated_at": "2026-09-30T12:35:07Z", + "published_at": "2026-09-30T12:35:07Z", + "assets": [], + "tarball_url": "https://api.github.com/repos/purview-dev/results/tarball/v1.0.0-prerelease.1", + "zipball_url": "https://api.github.com/repos/purview-dev/results/zipball/v1.0.0-prerelease.1", + "body": "## What's Changed\n* Docs update by @kieronlanning in https://github.com/purview-dev/results/pull/1\n\n## New Contributors\n* @kieronlanning made their first contribution in https://github.com/purview-dev/results/pull/1\n\n**Full Changelog**: https://github.com/purview-dev/results/commits/v1.0.0-prerelease.1", + "mentions_count": 1 + } +] diff --git a/src/fixtures/github/repos/results.json b/src/fixtures/github/repos/results.json new file mode 100644 index 0000000..f2f727d --- /dev/null +++ b/src/fixtures/github/repos/results.json @@ -0,0 +1,193 @@ +{ + "id": 1396685434, + "node_id": "R_kgDOUz-6eg", + "name": "results", + "full_name": "purview-dev/results", + "private": false, + "owner": { + "login": "purview-dev", + "id": 96894084, + "node_id": "O_kgDOBcZ8hA", + "avatar_url": "https://avatars.githubusercontent.com/u/96894084?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/purview-dev", + "html_url": "https://github.com/purview-dev", + "followers_url": "https://api.github.com/users/purview-dev/followers", + "following_url": "https://api.github.com/users/purview-dev/following{/other_user}", + "gists_url": "https://api.github.com/users/purview-dev/gists{/gist_id}", + "starred_url": "https://api.github.com/users/purview-dev/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/purview-dev/subscriptions", + "organizations_url": "https://api.github.com/users/purview-dev/orgs", + "repos_url": "https://api.github.com/users/purview-dev/repos", + "events_url": "https://api.github.com/users/purview-dev/events{/privacy}", + "received_events_url": "https://api.github.com/users/purview-dev/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/purview-dev/results", + "description": "Result types for .NET - a small, dependency-light Result where expected failures are values instead of exceptions, C# 15 union error cases with generated AsFailure() helpers, and ASP.NET Core and ZodSharp integrations that map failures to HTTP responses.", + "fork": false, + "url": "https://api.github.com/repos/purview-dev/results", + "forks_url": "https://api.github.com/repos/purview-dev/results/forks", + "keys_url": "https://api.github.com/repos/purview-dev/results/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/purview-dev/results/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/purview-dev/results/teams", + "hooks_url": "https://api.github.com/repos/purview-dev/results/hooks", + "issue_events_url": "https://api.github.com/repos/purview-dev/results/issues/events{/number}", + "events_url": "https://api.github.com/repos/purview-dev/results/events", + "assignees_url": "https://api.github.com/repos/purview-dev/results/assignees{/user}", + "branches_url": "https://api.github.com/repos/purview-dev/results/branches{/branch}", + "tags_url": "https://api.github.com/repos/purview-dev/results/tags", + "blobs_url": "https://api.github.com/repos/purview-dev/results/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/purview-dev/results/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/purview-dev/results/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/purview-dev/results/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/purview-dev/results/statuses/{sha}", + "languages_url": "https://api.github.com/repos/purview-dev/results/languages", + "stargazers_url": "https://api.github.com/repos/purview-dev/results/stargazers", + "contributors_url": "https://api.github.com/repos/purview-dev/results/contributors", + "subscribers_url": "https://api.github.com/repos/purview-dev/results/subscribers", + "subscription_url": "https://api.github.com/repos/purview-dev/results/subscription", + "commits_url": "https://api.github.com/repos/purview-dev/results/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/purview-dev/results/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/purview-dev/results/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/purview-dev/results/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/purview-dev/results/contents/{+path}", + "compare_url": "https://api.github.com/repos/purview-dev/results/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/purview-dev/results/merges", + "archive_url": "https://api.github.com/repos/purview-dev/results/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/purview-dev/results/downloads", + "issues_url": "https://api.github.com/repos/purview-dev/results/issues{/number}", + "pulls_url": "https://api.github.com/repos/purview-dev/results/pulls{/number}", + "milestones_url": "https://api.github.com/repos/purview-dev/results/milestones{/number}", + "notifications_url": "https://api.github.com/repos/purview-dev/results/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/purview-dev/results/labels{/name}", + "releases_url": "https://api.github.com/repos/purview-dev/results/releases{/id}", + "deployments_url": "https://api.github.com/repos/purview-dev/results/deployments", + "created_at": "2026-09-29T23:01:43Z", + "updated_at": "2026-09-30T14:05:36Z", + "pushed_at": "2026-09-30T14:05:29Z", + "git_url": "git://github.com/purview-dev/results.git", + "ssh_url": "git@github.com:purview-dev/results.git", + "clone_url": "https://github.com/purview-dev/results.git", + "svn_url": "https://github.com/purview-dev/results", + "homepage": "https://purview.dev/projects/results/", + "size": 317, + "stargazers_count": 0, + "watchers_count": 0, + "language": "C#", + "has_issues": true, + "has_projects": false, + "has_downloads": false, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "has_pull_requests": true, + "pull_request_creation_policy": "all", + "topics": [ + "aspnetcore", + "c-sharp", + "csharp", + "discriminated-unions", + "dotnet", + "error-handling", + "minimal-apis", + "nuget", + "problem-details", + "result-type", + "roslyn", + "source-generator", + "union-types", + "zodsharp" + ], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": true, + "delete_branch_on_merge": true, + "allow_update_branch": true, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "custom_properties": {}, + "organization": { + "login": "purview-dev", + "id": 96894084, + "node_id": "O_kgDOBcZ8hA", + "avatar_url": "https://avatars.githubusercontent.com/u/96894084?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/purview-dev", + "html_url": "https://github.com/purview-dev", + "followers_url": "https://api.github.com/users/purview-dev/followers", + "following_url": "https://api.github.com/users/purview-dev/following{/other_user}", + "gists_url": "https://api.github.com/users/purview-dev/gists{/gist_id}", + "starred_url": "https://api.github.com/users/purview-dev/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/purview-dev/subscriptions", + "organizations_url": "https://api.github.com/users/purview-dev/orgs", + "repos_url": "https://api.github.com/users/purview-dev/repos", + "events_url": "https://api.github.com/users/purview-dev/events{/privacy}", + "received_events_url": "https://api.github.com/users/purview-dev/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "security_and_analysis": { + "secret_scanning": { + "status": "enabled" + }, + "secret_scanning_push_protection": { + "status": "enabled" + }, + "dependabot_security_updates": { + "status": "disabled" + }, + "secret_scanning_non_provider_patterns": { + "status": "disabled" + }, + "secret_scanning_ai_detection": { + "status": "disabled" + }, + "secret_scanning_validity_checks": { + "status": "disabled" + }, + "secret_scanning_delegated_alert_dismissal": { + "status": "disabled" + }, + "secret_scanning_delegated_bypass": { + "status": "disabled" + } + }, + "network_count": 0, + "subscribers_count": 0 +} diff --git a/src/fixtures/nuget/purview.results.aspnetcore.json b/src/fixtures/nuget/purview.results.aspnetcore.json new file mode 100644 index 0000000..6204766 --- /dev/null +++ b/src/fixtures/nuget/purview.results.aspnetcore.json @@ -0,0 +1,6 @@ +{ + "versions": [ + "1.0.0-prerelease.1", + "1.0.0-prerelease.2" + ] +} diff --git a/src/fixtures/nuget/purview.results.json b/src/fixtures/nuget/purview.results.json new file mode 100644 index 0000000..6204766 --- /dev/null +++ b/src/fixtures/nuget/purview.results.json @@ -0,0 +1,6 @@ +{ + "versions": [ + "1.0.0-prerelease.1", + "1.0.0-prerelease.2" + ] +} diff --git a/src/fixtures/nuget/purview.results.sourcegenerator.json b/src/fixtures/nuget/purview.results.sourcegenerator.json new file mode 100644 index 0000000..6204766 --- /dev/null +++ b/src/fixtures/nuget/purview.results.sourcegenerator.json @@ -0,0 +1,6 @@ +{ + "versions": [ + "1.0.0-prerelease.1", + "1.0.0-prerelease.2" + ] +} diff --git a/src/fixtures/nuget/purview.results.zodsharp.aspnetcore.json b/src/fixtures/nuget/purview.results.zodsharp.aspnetcore.json new file mode 100644 index 0000000..6204766 --- /dev/null +++ b/src/fixtures/nuget/purview.results.zodsharp.aspnetcore.json @@ -0,0 +1,6 @@ +{ + "versions": [ + "1.0.0-prerelease.1", + "1.0.0-prerelease.2" + ] +} diff --git a/src/fixtures/nuget/purview.results.zodsharp.json b/src/fixtures/nuget/purview.results.zodsharp.json new file mode 100644 index 0000000..6204766 --- /dev/null +++ b/src/fixtures/nuget/purview.results.zodsharp.json @@ -0,0 +1,6 @@ +{ + "versions": [ + "1.0.0-prerelease.1", + "1.0.0-prerelease.2" + ] +} diff --git a/src/fixtures/nuget/search/Purview.Results.AspNetCore.json b/src/fixtures/nuget/search/Purview.Results.AspNetCore.json new file mode 100644 index 0000000..b6b988b --- /dev/null +++ b/src/fixtures/nuget/search/Purview.Results.AspNetCore.json @@ -0,0 +1,8 @@ +{ + "@context": { + "@vocab": "http://schema.nuget.org/schema#", + "@base": "https://api.nuget.org/v3/registration5-semver1/" + }, + "totalHits": 0, + "data": [] +} diff --git a/src/fixtures/nuget/search/Purview.Results.SourceGenerator.json b/src/fixtures/nuget/search/Purview.Results.SourceGenerator.json new file mode 100644 index 0000000..b6b988b --- /dev/null +++ b/src/fixtures/nuget/search/Purview.Results.SourceGenerator.json @@ -0,0 +1,8 @@ +{ + "@context": { + "@vocab": "http://schema.nuget.org/schema#", + "@base": "https://api.nuget.org/v3/registration5-semver1/" + }, + "totalHits": 0, + "data": [] +} diff --git a/src/fixtures/nuget/search/Purview.Results.ZodSharp.AspNetCore.json b/src/fixtures/nuget/search/Purview.Results.ZodSharp.AspNetCore.json new file mode 100644 index 0000000..b6b988b --- /dev/null +++ b/src/fixtures/nuget/search/Purview.Results.ZodSharp.AspNetCore.json @@ -0,0 +1,8 @@ +{ + "@context": { + "@vocab": "http://schema.nuget.org/schema#", + "@base": "https://api.nuget.org/v3/registration5-semver1/" + }, + "totalHits": 0, + "data": [] +} diff --git a/src/fixtures/nuget/search/Purview.Results.ZodSharp.json b/src/fixtures/nuget/search/Purview.Results.ZodSharp.json new file mode 100644 index 0000000..b6b988b --- /dev/null +++ b/src/fixtures/nuget/search/Purview.Results.ZodSharp.json @@ -0,0 +1,8 @@ +{ + "@context": { + "@vocab": "http://schema.nuget.org/schema#", + "@base": "https://api.nuget.org/v3/registration5-semver1/" + }, + "totalHits": 0, + "data": [] +} diff --git a/src/fixtures/nuget/search/Purview.Results.json b/src/fixtures/nuget/search/Purview.Results.json new file mode 100644 index 0000000..b6b988b --- /dev/null +++ b/src/fixtures/nuget/search/Purview.Results.json @@ -0,0 +1,8 @@ +{ + "@context": { + "@vocab": "http://schema.nuget.org/schema#", + "@base": "https://api.nuget.org/v3/registration5-semver1/" + }, + "totalHits": 0, + "data": [] +} diff --git a/src/fixtures/releases/index.json b/src/fixtures/releases/index.json index 513f9d3..adf130d 100644 --- a/src/fixtures/releases/index.json +++ b/src/fixtures/releases/index.json @@ -284,6 +284,34 @@ "defaultBranch": "main", "updatedAt": "2024-04-28T11:21:49Z", "hasDiscussions": false + }, + "purview-dev/results": { + "name": "results", + "fullName": "purview-dev/results", + "description": "Result types for .NET - a small, dependency-light Result where expected failures are values instead of exceptions, C# 15 union error cases with generated AsFailure() helpers, and ASP.NET Core and ZodSharp integrations that map failures to HTTP responses.", + "archived": false, + "homepage": "https://purview.dev/projects/results/", + "topics": [ + "aspnetcore", + "c-sharp", + "csharp", + "discriminated-unions", + "dotnet", + "error-handling", + "minimal-apis", + "nuget", + "problem-details", + "result-type", + "roslyn", + "source-generator", + "union-types", + "zodsharp" + ], + "stargazersCount": 0, + "openIssuesCount": 0, + "defaultBranch": "main", + "updatedAt": "2026-09-30T14:05:36Z", + "hasDiscussions": false } }, "releases": { @@ -1394,7 +1422,27 @@ "htmlUrl": "https://github.com/purview-dev/build-sdk/releases/tag/v1.0.0-prerelease.43" } ], - "purview-dev/dotnet-logging-source-generators": [] + "purview-dev/dotnet-logging-source-generators": [], + "purview-dev/results": [ + { + "tagName": "v1.0.0-prerelease.2", + "name": "v1.0.0-prerelease.2", + "body": "## What's Changed\n* docs: added docs by @kieronlanning in https://github.com/purview-dev/results/pull/2\n\n\n**Full Changelog**: https://github.com/purview-dev/results/compare/v1.0.0-prerelease.1...v1.0.0-prerelease.2", + "prerelease": true, + "draft": false, + "publishedAt": "2026-09-30T14:05:29Z", + "htmlUrl": "https://github.com/purview-dev/results/releases/tag/v1.0.0-prerelease.2" + }, + { + "tagName": "v1.0.0-prerelease.1", + "name": "v1.0.0-prerelease.1", + "body": "## What's Changed\n* Docs update by @kieronlanning in https://github.com/purview-dev/results/pull/1\n\n## New Contributors\n* @kieronlanning made their first contribution in https://github.com/purview-dev/results/pull/1\n\n**Full Changelog**: https://github.com/purview-dev/results/commits/v1.0.0-prerelease.1", + "prerelease": true, + "draft": false, + "publishedAt": "2026-09-30T12:35:07Z", + "htmlUrl": "https://github.com/purview-dev/results/releases/tag/v1.0.0-prerelease.1" + } + ] }, "packages": { "Purview.Telemetry.SourceGenerator": { @@ -1947,6 +1995,41 @@ "1.0.0-prerelease.56", "1.0.0-prerelease.57" ] + }, + "Purview.Results": { + "id": "Purview.Results", + "versions": [ + "1.0.0-prerelease.1", + "1.0.0-prerelease.2" + ] + }, + "Purview.Results.SourceGenerator": { + "id": "Purview.Results.SourceGenerator", + "versions": [ + "1.0.0-prerelease.1", + "1.0.0-prerelease.2" + ] + }, + "Purview.Results.AspNetCore": { + "id": "Purview.Results.AspNetCore", + "versions": [ + "1.0.0-prerelease.1", + "1.0.0-prerelease.2" + ] + }, + "Purview.Results.ZodSharp": { + "id": "Purview.Results.ZodSharp", + "versions": [ + "1.0.0-prerelease.1", + "1.0.0-prerelease.2" + ] + }, + "Purview.Results.ZodSharp.AspNetCore": { + "id": "Purview.Results.ZodSharp.AspNetCore", + "versions": [ + "1.0.0-prerelease.1", + "1.0.0-prerelease.2" + ] } }, "packageSearch": { @@ -2033,6 +2116,11 @@ "deprecated": false, "listed": true }, - "Purview.BuildSdk": null + "Purview.BuildSdk": null, + "Purview.Results": null, + "Purview.Results.SourceGenerator": null, + "Purview.Results.AspNetCore": null, + "Purview.Results.ZodSharp": null, + "Purview.Results.ZodSharp.AspNetCore": null } } diff --git a/src/src/data/projects.yml b/src/src/data/projects.yml index 6f01593..f4d0e0f 100644 --- a/src/src/data/projects.yml +++ b/src/src/data/projects.yml @@ -439,6 +439,138 @@ projects: surface in CI. docsPage: testing + - id: results + name: Results + shortDescription: Result for .NET — expected failures as values the caller must handle. + description: >- + A small, dependency-free Result for .NET that makes + expected failures part of a method's contract: not found, invalid, and + conflict are values rather than exceptions. A Roslyn source generator adds + C# 15 union ergonomics for the error cases, and companion packages carry + the result into ASP.NET Core responses and ZodSharp validation problems. + origin: >- + Services kept re-declaring their own error types and hand-writing the same + failure helpers and HTTP mapping, so the result type, the generated + helpers, and the adapter packages became one shared package family. + useWhen: >- + Expected failures are part of your domain model and you want them returned + as values the caller must handle, with a strongly typed error case that + still reaches the client as a standard HTTP problem response. + avoidWhen: >- + You target a runtime below .NET 11 with C# 15 preview, or the failures you + are modelling are exceptional circumstances that belong in exceptions. + repository: purview-dev/results + category: application-framework + status: preview + order: 45 + docs: + source: github-path + path: docs/wiki + rootPage: Getting-Started.md + exclude: + - _Sidebar.md + - Home.md + - index.md + targetFrameworks: + - net11.0 + packages: + - id: Purview.Results + description: The result type, its factories, and IResultValue. No dependencies. + primary: true + - id: Purview.Results.SourceGenerator + description: Incremental generator that emits AsFailure helpers for annotated unions, with a code fix and diagnostic suppression. + targetFrameworks: + - netstandard2.0 + - id: Purview.Results.AspNetCore + description: Result-to-response mapping, endpoint filter, and dependency-injection registration. + - id: Purview.Results.ZodSharp + description: Bridges ZodSharp validation results into results. + - id: Purview.Results.ZodSharp.AspNetCore + description: Renders validation-carrying failures as HttpValidationProblemDetails. + related: + - zodsharp + - sourcegenerator-framework + useCases: + - audience: developer + title: Return expected failures as values + scenario: >- + You call a store that can fail in ways you expect — not found, disabled, + already exists — and you do not want a thrown exception or a generic error + string to be the only way the caller learns what happened. + code: | + Result GetTenant(TenantId tenantId) => + _tenants.TryGet(tenantId, out var tenant) + ? Result.Success(tenant) + : new TenantNotFound(tenantId).AsFailure(); + language: csharp + outcome: >- + The caller branches on the error value itself, so TenantNotFound keeps carrying + its TenantId instead of being flattened into a message. + evidence: >- + The core package has no dependencies: it ships the result type, its factories, + and IResultValue without pulling anything else in. + docsPage: core-concepts + - audience: developer + title: Generate the failure helper for every union case + scenario: >- + You model errors as a C# 15 union and need each case to become the failure side + of a result without writing one conversion helper per case by hand. + code: | + [GenerateResult] + public readonly union TenantError(TenantNotFound, TenantDisabled, TenantAlreadyExists); + language: csharp + outcome: >- + The generator emits AsFailure() for every case of an annotated union, + plus a code fix and a CA1815 suppression, so the declaration needs no pragma. + evidence: >- + C# forbids the implicit conversion a bare case value would need — no operators + in static classes, no conversion operators in extension members, one + user-defined conversion per sequence — which is why the helper is per case. + docsPage: union-errors + - audience: architect + title: Map one error union onto HTTP responses + scenario: >- + The same domain error union surfaces from many minimal-API endpoints, and you do + not want a hand-written switch deciding the status code at each one. + code: | + builder.Services.AddResultsHttp(options => options + .Map(error => TypedResults.NotFound()) + .Map(error => TypedResults.Problem(statusCode: StatusCodes.Status409Conflict)) + ); + + app.MapGet("/tenants/{id:int}", (int id) => GetTenant(id)).WithResultsHttp(); + language: csharp + outcome: >- + The mapping is declared once at startup, WithResultsHttp() applies it to the + endpoints, and a host can replace IResultsHttpMapper when it needs different + behaviour. + evidence: >- + Mappings resolve in declaration order — any mapping or failure mapper the host + declared earlier always wins — so the most specific rule is registered first. + docsPage: aspnetcore-integration + - audience: team-lead + title: Let ZodSharp validation failures become validation problems + scenario: >- + Endpoints validate input with ZodSharp, and a failed validation should reach the + client as the standard ASP.NET Core validation-problem payload rather than an + error shape the API has to document separately. + code: | + { + "title": "One or more validation errors occurred.", + "status": 400, + "errors": { "TenantId": ["Required field 'TenantId' is null"] }, + "issues": [{ "code": "missing_field", "path": ["TenantId"], "message": "Required field 'TenantId' is null" }] + } + language: json + outcome: >- + A failure that implements IValidationErrorCarrier becomes + HttpValidationProblemDetails without the host mapping it, unless a per-code or + per-category rule answers that failure first. + evidence: >- + The response is ASP.NET Core's own HttpValidationProblemDetails contract, so API + clients keep the error shape they already parse. + docsPage: zodsharp-problemdetails + - id: aspire-resourcekit name: Aspire ResourceKit shortDescription: Strongly typed, source-generated resource kits for .NET Aspire.