{"id":30424831,"url":"https://github.com/StefanStolz/ShadowWriter","last_synced_at":"2025-08-22T11:04:22.490Z","repository":{"id":299497214,"uuid":"980153906","full_name":"StefanStolz/ShadowWriter","owner":"StefanStolz","description":"Leverage the capabilities of Roslyn source generators to help generate boilerplate code efficiently.","archived":false,"fork":false,"pushed_at":"2025-08-19T20:44:22.000Z","size":508,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-19T21:27:54.229Z","etag":null,"topics":["csharp","csharp-sourcegenerator","dotnet","roslyn","roslyn-generator"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StefanStolz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-08T16:46:34.000Z","updated_at":"2025-08-19T20:39:54.000Z","dependencies_parsed_at":"2025-06-16T21:42:00.779Z","dependency_job_id":"eff19a20-32c7-4f1f-b222-4badbb39c970","html_url":"https://github.com/StefanStolz/ShadowWriter","commit_stats":null,"previous_names":["stefanstolz/shadowwriter"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/StefanStolz/ShadowWriter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefanStolz%2FShadowWriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefanStolz%2FShadowWriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefanStolz%2FShadowWriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefanStolz%2FShadowWriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StefanStolz","download_url":"https://codeload.github.com/StefanStolz/ShadowWriter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StefanStolz%2FShadowWriter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271628166,"owners_count":24792821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","csharp-sourcegenerator","dotnet","roslyn","roslyn-generator"],"created_at":"2025-08-22T11:02:18.012Z","updated_at":"2025-08-22T11:04:22.473Z","avatar_url":"https://github.com/StefanStolz.png","language":"C#","funding_links":[],"categories":["Content"],"sub_categories":["206. [ShadowWriterBuilder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/ShadowWriterBuilder) , in the [Builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) category"],"readme":"# ShadowWriter\n\n[![NuGet](https://img.shields.io/nuget/v/ShadowWriter.svg)](https://www.nuget.org/packages/ShadowWriter)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Build](https://img.shields.io/github/actions/workflow/status/StefanStolz/ShadowWriter/build.yml?branch=main)](https://github.com/StefanStolz/ShadowWriter/actions)\n\n**ShadowWriter** is a Roslyn Source Generator designed to simplify and automate aspects of .NET development.  \nIt currently supports the following features:\n\n## ✨ Features\n\nSamples can be found in the [Source-Code](https://github.com/StefanStolz/ShadowWriter/tree/main/src/ShadowWriter.Sample) or in the [Wiki](https://github.com/StefanStolz/ShadowWriter/wiki).\n\n### 1. Generate Null Objects\nThe NullObject feature in ShadowWriter provides a simple way to automatically generate null object implementations for interfaces and classes. This pattern is useful for providing default \"do nothing\" implementations that can help avoid null reference exceptions and simplify code.\n\n#### Usage\nTo create a null object implementation, simply add the `[NullObject]` attribute to your class:\n\n```csharp\n[NullObject]\npublic partial class ImplementingMyInterface : IMyInterface\n{\n}\n```\n\n### 2. Inject Project Information\nEmbeds values from the project file (`*.csproj`) directly into your source code.  \nThis is useful for build metadata, version numbers, or project-specific configuration.\n\n#### Available Properties\nThe generated `TheProject` class provides the following static properties:\n\n| Property | Description | Example |\n|----------|-------------|---------|\n| `FullPath` | The complete path to the project file | `/path/to/YourProject.csproj` |\n| `ProjectDirectory` | The directory containing the project file | `/path/to/` |\n| `Name` | The name of the project | `YourProject` |\n| `OutDir` | The output directory for compiled artifacts | `/path/to/artifacts/bin/YourProject/debug/` |\n| `Version` | The current version of the project | `1.0.0` |\n| `RootNamespace` | The root namespace of the project | `YourProject` |\n\n#### Example Usage\n\n```csharp\n// Access project information anywhere in your code \nConsole.WriteLine($\"Project Name: {TheProject.Name}\"); \nConsole.WriteLine($\"Project Version: {TheProject.Version}\"); \nConsole.WriteLine($\"Project Output Directory: {TheProject.OutDir}\");\n```\n\n\n### 3. Experimental: Typed Access to EmbeddedResources\nGenerates strongly typed wrappers for `EmbeddedResources`, allowing safe and convenient access to resources at runtime.\n\n\u003e ⚠️ Feature #3 is experimental and may change significantly in future versions.\n\nDetails can be found in the [Wiki](https://github.com/StefanStolz/ShadowWriter/wiki/ProjectFiles).\n\n### 4. Generate Builders for Records\n\nThe **Builder** feature in ShadowWriter automatically generates builder classes for your `record` types. This significantly reduces boilerplate when constructing complex objects, especially with optional and nullable parameters or when you want to use a fluent API pattern for object creation.\n\n#### Usage\n\nTo enable builder generation, simply annotate your partial `record` with the `[Builder]` attribute:\n\n```csharp \n[Builder] \npublic partial record WithBuilder(int Number);\n```\n\nThe generator will create a corresponding builder class (e.g., `WithBuilder.Builder`) with mutable Properties for each Parameter.\n\n#### Examples\n\nA variety of record types are supported:\n\n```csharp \n// Record with a single value type \n[Builder] \npublic partial record WithBuilder(int Number);\n```\n\nThe generated builder enables you to create instances using a clear, chainable API. For example:\n\n```csharp\nvar builder = new WithBuilder.Builder();\nbuilder.Number = 1;\nvar item = builder.Build();\n```\n\n## 📦 Installation\n\nYou can install ShadowWriter via NuGet:\n\n```sh\ndotnet package add ShadowWriter\n```\n\n## ⚙️ Usage\nShadowWriter runs automatically during compilation.\nNo manual setup is needed. Documentation and configuration options will be expanded in future versions.\n\n## 📄 License\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStefanStolz%2FShadowWriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStefanStolz%2FShadowWriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStefanStolz%2FShadowWriter/lists"}