Skip to content

Commit 259c452

Browse files
committed
feat: upgrade to .NET 8 and .NET 9 support, drop .NET 6/7
- Update target frameworks to net8.0;net9.0 - Upgrade McMaster.Extensions.CommandLineUtils to 4.1.1 - Update GitHub Actions workflow for .NET 8/9 SDK support - Update documentation and requirements in README.md - Bump version to 1.3.0 BREAKING CHANGE: Removed support for .NET 6.0 and .NET 7.0. Minimum required version is now .NET 8.0. .NET 8 provides LTS support until November 2026, while .NET 9 offers latest features with 18-month STS support. The project now targets modern .NET versions: .NET 8 (LTS until November 2026) and .NET 9 (STS with 18-month support), positioning it well for future compatibility while leveraging the latest .NET features and performance improvements.
1 parent 51491c5 commit 259c452

File tree

7 files changed

+149
-6
lines changed

7 files changed

+149
-6
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ csharp_preserve_single_line_blocks = true
8585
csharp_preserve_single_line_statements = false
8686
dotnet_separate_import_directive_groups = false
8787

88-
# IDE0005: Remove unnessecary using statements
88+
# IDE0005: Remove unnecessary using statements
8989
dotnet_diagnostic.IDE0005.severity = error
9090

9191
# Expression-level preferences

.github/copilot-instructions.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# AI Coding Agent Instructions for SeedFolder
2+
3+
## Project Overview
4+
This is a .NET Global Tool that creates project directories and seeds them with standard dotfiles. The entire application is contained in a single file (`src/Program.cs`) for simplicity.
5+
6+
## Architecture Patterns
7+
8+
### Single-File Console Application
9+
- All logic exists in `src/Program.cs` - no complex project structure
10+
- Uses `McMaster.Extensions.CommandLineUtils` for CLI interactions, `Figgle` for ASCII headers, `Colorful.Console` for output formatting
11+
- Command-line parsing is handled manually in `Main()` - check for help flags before processing folder names
12+
13+
### Embedded Resources Pattern
14+
Template files in `src/Data/` are embedded as resources, not file system copies:
15+
```xml
16+
<EmbeddedResource Include="Data/dockerignore" />
17+
<EmbeddedResource Include="Data/editorconfig" />
18+
```
19+
Access via `Assembly.GetManifestResourceStream("solrevdev.seedfolder.Data.{filename}")` in `WriteFileAsync()`
20+
21+
### Multi-Framework Targeting
22+
Targets `net8.0;net9.0` for modern .NET compatibility. .NET 8 is LTS (supported until November 2026) and .NET 9 is STS (18-month support). Version bumps in `.csproj` trigger NuGet deployment.
23+
24+
## Key Development Workflows
25+
26+
### Local Testing Cycle
27+
```bash
28+
# Build and test locally (use build/test-local.sh script)
29+
dotnet pack -c release -o artifacts/nupkg
30+
dotnet tool uninstall -g solrevdev.seedfolder
31+
dotnet tool install -g --add-source artifacts/nupkg solrevdev.seedfolder
32+
```
33+
34+
### Version Management
35+
- Bump `<Version>` in `src/solrevdev.seedfolder.csproj` to trigger CI/CD
36+
- CI only runs on pushes to `master` branch (exclude commits with `***NO_CI***`, `[ci skip]`, `[skip ci]`)
37+
- GitHub Actions automatically publishes to NuGet on master pushes
38+
39+
### Running During Development
40+
```bash
41+
# Interactive mode
42+
dotnet run --project src/solrevdev.seedfolder.csproj
43+
44+
# With folder name argument
45+
dotnet run --project src/solrevdev.seedfolder.csproj myfolder
46+
```
47+
48+
## Project-Specific Conventions
49+
50+
### Input Sanitization
51+
Always use `RemoveSpaces()` and `SafeNameForFileSystem()` for folder names:
52+
```csharp
53+
folderName = RemoveSpaces(folderName); // Spaces → dashes
54+
folderName = SafeNameForFileSystem(folderName); // Invalid chars → dashes
55+
```
56+
57+
### Date Prefixing Logic
58+
Interactive mode offers date prefixing: `YYYY-MM-DD_foldername` format using `StringBuilder` for performance.
59+
60+
### Error Handling Pattern
61+
- Check if folder exists before creation - exit with colored error message
62+
- Use `Directory.Exists()` check, then `ConsoleColor.DarkRed` for error output
63+
- No exceptions for user errors - graceful CLI messaging
64+
65+
## File Structure Details
66+
- `src/Data/` contains template files without leading dots (e.g., `gitignore` not `.gitignore`)
67+
- Files are copied with proper dotfile names during `WriteFileAsync()`
68+
- `omnisharp.json` is copied without dot prefix (special case)
69+
70+
## CI/CD Integration Points
71+
- GitHub Actions workflow in `.github/workflows/ci.yml` handles build → pack → publish
72+
- Requires `NUGET_API_KEY` secret for automated publishing
73+
- Uses `rohith/[email protected]` action for NuGet deployment
74+
- Build scripts in `build/` folder provide cross-platform local testing

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ jobs:
3737
uses: actions/checkout@v4
3838

3939
- name: setup .net core sdk
40-
uses: actions/setup-dotnet@v3
40+
uses: actions/setup-dotnet@v4
4141
with:
42-
dotnet-version: '8.0.x' # SDK Version to use; x will use the latest version of the 3.1 channel
42+
dotnet-version: |
43+
8.0.x
44+
9.0.x
4345
4446
- name: dotnet build
4547
run: dotnet build solrevdev.seedfolder.sln --configuration Release

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"Figgle",
1010
"gitattributes",
1111
"locproj",
12+
"myfolder",
1213
"nativeproj",
1314
"NOLOGO",
1415
"Nuget",

CLAUDE.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is a .NET Core Global Tool called `seedfolder` that creates directories and populates them with standard dotfiles. The tool is designed to quickly scaffold project folders with common configuration files.
8+
9+
## Development Commands
10+
11+
### Build and Test
12+
```bash
13+
# Build the solution
14+
dotnet build solrevdev.seedfolder.sln --configuration Release
15+
16+
# Pack for local installation
17+
dotnet pack
18+
19+
# Install locally for testing
20+
dotnet tool install --global --add-source ./nupkg solrevdev.seedfolder
21+
22+
# Uninstall after testing
23+
dotnet tool uninstall -g solrevdev.seedfolder
24+
```
25+
26+
### Run the Tool During Development
27+
```bash
28+
# Run with interactive prompts
29+
dotnet run --project src/solrevdev.seedfolder.csproj
30+
31+
# Run with folder name argument
32+
dotnet run --project src/solrevdev.seedfolder.csproj myfolder
33+
```
34+
35+
## Architecture
36+
37+
### Single File Structure
38+
The entire application is contained in `src/Program.cs` - a single-file console application using:
39+
- **McMaster.Extensions.CommandLineUtils** for command-line parsing and prompts
40+
- **Figgle** for ASCII art header generation
41+
- **Colorful.Console** for colored console output
42+
43+
### Embedded Resources
44+
Template files are stored as embedded resources in `src/Data/` and copied to new folders:
45+
- `dockerignore``.dockerignore`
46+
- `editorconfig``.editorconfig`
47+
- `gitattributes``.gitattributes`
48+
- `gitignore``.gitignore`
49+
- `prettierignore``.prettierignore`
50+
- `prettierrc``.prettierrc`
51+
- `omnisharp.json``omnisharp.json`
52+
53+
### Key Methods
54+
- `WriteFileAsync()` - Extracts embedded resources and writes them to the target directory
55+
- `RemoveSpaces()` - Sanitizes folder names by replacing spaces with dashes
56+
- `SafeNameForFileSystem()` - Removes invalid filesystem characters from folder names
57+
58+
## Multi-Target Framework Support
59+
The project targets .NET 8.0 (LTS) and 9.0 (STS) to support current and modern .NET versions. .NET 8 provides long-term support until November 2026, while .NET 9 offers the latest features with 18-month support.
60+
61+
## CI/CD
62+
GitHub Actions workflow builds, packs, and publishes to NuGet on pushes to master branch. Version is controlled by the `<Version>` property in the .csproj file.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ It will also copy the following dotfiles from the `src/Data` folder over:
7272
* .prettierignore
7373
* .prettierrc
7474

75+
## Requirements
76+
77+
This tool requires .NET 8.0 or .NET 9.0 SDK to be installed on your system.
78+
7579
## Installation
7680

7781
Locally without publishing it on NuGet

src/solrevdev.seedfolder.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
5+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
66
<LangVersion>latest</LangVersion>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<PackAsTool>true</PackAsTool>
99
<ToolCommandName>seedfolder</ToolCommandName>
1010
<PackageOutputPath>./nupkg</PackageOutputPath>
1111
<NoDefaultExcludes>true</NoDefaultExcludes>
12-
<Version>1.2.7</Version>
12+
<Version>1.3.0</Version>
1313
<Title>solrevdev.seedfolder</Title>
1414
<Description>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</Description>
1515
<PackageDescription>.NET Core Global Tool that creates a folder and copies dotfiles into it therefore seeding a folder.</PackageDescription>
@@ -29,7 +29,7 @@
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.0" />
32+
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
3333
<PackageReference Include="Colorful.Console" Version="1.2.15" />
3434
<PackageReference Include="Figgle" Version="0.5.1" />
3535
</ItemGroup>

0 commit comments

Comments
 (0)