@@ -8,14 +8,14 @@ NET Changesets is a .NET CLI tool for managing versioning and changelogs in mult
88
99## Technology stack
1010
11- ** Language:** C# 12.0 with nullable reference types and implicit usings enabled
12- ** Runtime:** .NET 8.0 (SDK 8.0.406)
13- ** CLI Framework:** Spectre.Console v0.50.0 (interactive prompts, tables, markup rendering)
14- ** Dependency Injection:** Microsoft.Extensions.DependencyInjection v9.0.9
15- ** Testing:** NUnit 4.4.0, Moq 4.20.72, AwesomeAssertions 9.1.0, Spectre.Console.Testing
16- ** Code Analysis:** Microsoft .NET analyzers (all enabled, warnings-as-errors), Spectre.Console.Analyzer
17- ** Package Management:** Central Package Management via ` Directory.Packages.props `
18- ** CI/CD:** GitHub Actions (build, test, pack, format verification)
11+ ** Language:** C# 12.0 with nullable reference types and implicit usings enabled
12+ ** Runtime:** .NET 8.0 (SDK 8.0.406)
13+ ** CLI Framework:** Spectre.Console v0.50.0 (interactive prompts, tables, markup rendering)
14+ ** Dependency Injection:** Microsoft.Extensions.DependencyInjection v9.0.9
15+ ** Testing:** NUnit 4.4.0, Moq 4.20.72, AwesomeAssertions 9.1.0, Spectre.Console.Testing
16+ ** Code Analysis:** Microsoft .NET analyzers (all enabled, warnings-as-errors), Spectre.Console.Analyzer
17+ ** Package Management:** Central Package Management via ` Directory.Packages.props `
18+ ** CI/CD:** GitHub Actions (build, test, pack, format verification)
1919** External Tools:** Git CLI (for diff detection), dotnet CLI (for pack/publish)
2020
2121## Directory structure
@@ -44,6 +44,7 @@ SolarWinds.Changesets.sln # Main solution file
4444** CLI Framework:** Uses Spectre.Console.Cli with ` CommandApp<AddChangesetCommand> ` (Add is default). Commands registered in ` Program.cs ` via ` config.AddCommand<T>() ` . All commands inherit from ` ConfigurationCommandBase ` which loads ` .changeset/config.json ` .
4545
4646** Dependency Injection:** Services registered in ` ServiceCollection ` and integrated via custom ` TypeRegistrar ` /` TypeResolver ` (required by Spectre.Console.Cli). Main services:
47+
4748- ` IConfigurationService ` : Loads/validates ` .changeset/config.json `
4849- ` IChangesetsRepository ` : Reads/writes/deletes changeset markdown files
4950- ` ICsProjectsRepository ` : Parses .csproj files, updates ` <VersionPrefix> ` elements
@@ -55,6 +56,7 @@ SolarWinds.Changesets.sln # Main solution file
5556** Semantic Versioning:** Custom ` Semver ` class (Major.Minor.Patch) with methods ` RaiseMajor() ` , ` RaiseMinor() ` , ` RaisePatch() ` . Parses version strings from ` <VersionPrefix> ` in .csproj files. Version bumps cascade dependencies (updating dependent projects).
5657
5758** Command Flow Example (version command):**
59+
58601 . ` VersionChangesetCommand.ExecuteCommandAsync() ` calls ` IChangesetsRepository.GetChangesetsAsync() `
59612 . Reads all ` .md ` files from ` .changeset/ ` directory
60623 . Parses YAML front matter (project names, bump types) and markdown content
@@ -69,28 +71,33 @@ SolarWinds.Changesets.sln # Main solution file
6971** Prerequisites:** .NET 8.0 SDK (version 8.0.406 or compatible via rollForward in ` global.json ` )
7072
7173** Build:**
74+
7275``` bash
7376dotnet restore --packages ./packages
7477dotnet build -c Release --no-restore
7578```
7679
7780** Test:**
81+
7882``` bash
7983dotnet test -c Release --no-restore --no-build --verbosity normal
8084```
8185
8286** Pack:**
87+
8388``` bash
8489dotnet pack -c Release --no-restore --no-build
8590# Output: ./nupkg/SolarWinds.Changesets.0.1.1.nupkg
8691```
8792
8893** Code Style Check:**
94+
8995``` bash
9096dotnet format --no-restore --verify-no-changes
9197```
9298
9399** Local Installation for Testing:**
100+
94101``` bash
95102dotnet tool uninstall solarwinds.changesets --global
96103dotnet tool install solarwinds.changesets --global --add-source ./nupkg
@@ -109,6 +116,7 @@ dotnet run --project .\src\SolarWinds.Changesets\SolarWinds.Changesets.csproj
109116```
110117
111118** Verification checklist:**
119+
1121201 . ✅ Build succeeds: ` dotnet build -c Release --no-restore `
1131212 . ✅ All tests pass: ` dotnet test -c Release --no-restore --no-build `
1141223 . ✅ Code formatting: ` dotnet format --no-restore --verify-no-changes `
@@ -118,15 +126,18 @@ dotnet run --project .\src\SolarWinds.Changesets\SolarWinds.Changesets.csproj
118126## Domain configurations
119127
120128** Changeset Config (` .changeset/config.json ` ):**
129+
121130``` json
122131{
123- "sourcePath" : " src" , // Relative path to projects folder
124- "packageSource" : " nuget" // NuGet source name from NuGet.config
132+ "sourcePath" : " src" , // Relative path to projects folder
133+ "packageSource" : " nuget" // NuGet source name from NuGet.config
125134}
126135```
136+
127137Created by ` changeset init ` . Loaded by ` ConfigurationService ` . Default ` packageSource ` is ` nuget.org ` .
128138
129139** NuGet.config:** Optional file for custom package sources. Example:
140+
130141``` xml
131142<packageSources >
132143 <add key =" nuget" value =" https://api.nuget.org/v3/index.json" />
@@ -135,6 +146,7 @@ Created by `changeset init`. Loaded by `ConfigurationService`. Default `packageS
135146```
136147
137148** Changeset File Format (` .changeset/{randomname}.md ` ):**
149+
138150``` markdown
139151---
140152"ProjectA": minor
@@ -143,16 +155,19 @@ Created by `changeset init`. Loaded by `ConfigurationService`. Default `packageS
143155
144156Added new feature X and fixed bug Y in ProjectB
145157```
158+
146159Generated by ` add ` command. Filename: 10 random lowercase letters + ` .md ` . Projects listed in YAML front matter with bump type (major/minor/patch).
147160
148161** Project File Requirements:**
162+
149163- Must contain ` <VersionPrefix> ` element (e.g., ` <VersionPrefix>1.0.0</VersionPrefix> ` )
150164- Supported format: ` Major.Minor.Patch ` (parsed via ` System.Version ` )
151165- ` version ` command updates this element in-place using XML manipulation
152166
153167## Conventions
154168
155169** Code Style:**
170+
156171- ** Implicit usings enabled** (no need for common System namespaces)
157172- ** Nullable reference types enabled** (treat null warnings as errors)
158173- ** File-scoped namespaces** (e.g., ` namespace SolarWinds.Changesets.Commands.Add; ` )
@@ -161,54 +176,63 @@ Generated by `add` command. Filename: 10 random lowercase letters + `.md`. Proje
161176- ** IDE rules enforced in CI** via ` dotnet format ` (not in build)
162177
163178** Testing:**
179+
164180- NUnit framework with ` [TestFixture] ` and ` [Test] ` attributes
165181- Global using for ` NUnit.Framework ` (defined in test .csproj)
166182- Test data in ` TestData/ ` folders, copied to output directory
167183- Use ` Spectre.Console.Testing.TestConsole ` for command output assertions
168184- Mock external processes using ` Moq ` on ` IProcessExecutor `
169185
170186** Naming:**
187+
171188- Commands: ` {Action}ChangesetCommand ` (e.g., ` AddChangesetCommand ` )
172189- Interfaces: Standard ` I ` prefix (e.g., ` IConfigurationService ` )
173190- Internal classes: Most implementation classes are ` internal sealed `
174191- Constants: Defined in ` Constants ` static class (e.g., ` Constants.WorkingDirectoryFullPath ` )
175192
176193** Dependency Constraints:**
194+
177195- ** Only allowed third-party dependency:** Spectre.Console (and related packages)
178196- Rationale: Minimize external dependencies for a CLI tool
179197- All other needs met by .NET BCL or Microsoft.Extensions packages
180198
181199** Git Workflow:**
200+
182201- Branch naming: ` {type}/{issueID}-{description} ` (e.g., ` feature/123-add-new-command ` )
183202- Commit messages: Start with issue ID (e.g., ` 123 Implement status command ` )
184203- GPG signing required for commits
185204- PR title format: ` {Type} #{issueID} {Description} `
186205
187206** Error Handling:**
207+
188208- ` ExceptionHandler.Handle() ` registered in Spectre.Console CLI config
189209- Custom exception: ` InitializationException ` for config validation errors
190210- Return codes defined in ` ResultCodes ` class (not yet fully implemented)
191211
192212## Integration points
193213
194214** Git Integration:**
215+
195216- ` GitService.GetDiff() ` calls ` git diff --name-only {sourcePath} ` to detect modified .csproj files
196217- Used by ` publish ` command to identify packages needing publication
197218- Requires git executable in PATH
198219
199220** Dotnet CLI Integration:**
221+
200222- ` DotnetService.Pack() ` calls ` dotnet pack {projectPath} --output {Constants.NupkgOutputFullPath} `
201223- ` DotnetService.Publish() ` calls ` dotnet nuget push {nupkgPath} --source {packageSource} `
202224- NuGet API key expected in environment or nuget.config (standard dotnet behavior)
203225- Output directory: ` ./nupkg/ ` (created if not exists)
204226
205227** File System Operations:**
228+
206229- Changeset files: ` .changeset/ ` directory (created by ` init ` command)
207230- CHANGELOG.md: Root of repository
208231- .csproj files: Located via recursive search from ` sourcePath ` config
209232- All paths resolved relative to ` Constants.WorkingDirectoryFullPath ` (current directory)
210233
211234** NuGet Sources:**
235+
212236- Resolved via standard dotnet/NuGet.config mechanisms
213237- Default: ` nuget ` source (typically nuget.org)
214238- Custom sources defined in ` NuGet.config ` (repository or user-level)
@@ -219,11 +243,13 @@ Generated by `add` command. Filename: 10 random lowercase letters + `.md`. Proje
219243** Current State:** MVP stage with manual CLI operations. All 5 commands implemented (` init ` , ` add ` , ` version ` , ` publish ` , ` status ` ).
220244
221245** Known Limitations:**
246+
222247- ` add ` command supports only single bump type for all selected projects (npm version allows per-project bumps)
223248- No command-line options for ` add ` (interactive mode only)
224249- Manual execution required (no GitHub Action yet)
225250
226251** Planned Features:**
252+
227253- ** GitHub Action** (primary roadmap item): Automated PR creation for version bumps, reusing existing codebase. See ` .NET GitHub Action ` documentation.
228254- Future improvements open for discussion via GitHub issues
229255
0 commit comments