Compare commits

..

5 Commits

Author SHA1 Message Date
Matsubaa 039a39c2d4 First Examples: Added FireBurn effect, 2026-07-12 14:41:02 -05:00
Matsubaa e37e4c97d9 Framing Basics 2026-07-12 12:31:14 -05:00
Matsubaa 05a6eb9d3c Cleaning Up Template Remnants 2026-07-12 12:18:31 -05:00
Matsubaa 88c8e60efa Establishing project outline properly by adding necessary files 2026-07-12 12:16:09 -05:00
Matsubaa 914996cb6d Initial Pile Of Files 2026-07-12 11:56:23 -05:00
32 changed files with 650 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
# EditorConfig for .NET template
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
+2
View File
@@ -0,0 +1,2 @@
# Direnv configuration for Nix flakes
use flake
+14
View File
@@ -0,0 +1,14 @@
# .NET build artifacts
bin/
obj/
*.user
*.suo
.vs/
# IDE
.vscode/
.idea/
# Nix
result
.direnv/
+8
View File
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
+9
View File
@@ -0,0 +1,9 @@
# Contributing
Thank you for considering contributing!
- Please follow the project coding style and directory structure.
- Submit issues or pull requests for bugs, features, or improvements.
- Add tests for new features where possible.
- Ensure your code builds and passes tests before submitting.
- Contributions are licensed under CC BY-SA 4.0.
+10
View File
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
+3
View File
@@ -0,0 +1,3 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
+1
View File
@@ -0,0 +1 @@
*.feature.cs
+15
View File
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<PackageReference Include="Reqnroll.NUnit" Version="3.0.1"/>
<PackageReference Include="nunit" Version="4.0.1"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/>
<PackageReference Include="FluentAssertions" Version="6.12.0"/>
</ItemGroup>
</Project>
@@ -0,0 +1,10 @@
Feature: Calculator
Simple calculator for adding two numbers
@mytag
Scenario: Add two numbers
Given the first number is 50
And the second number is 70
When the two numbers are added
Then the result should be 120
@@ -0,0 +1,45 @@
using Reqnroll;
namespace EoM_Redux.Tests.StepDefinitions;
[Binding]
public sealed class CalculatorStepDefinitions
{
// For additional details on Reqnroll step definitions see https://go.reqnroll.net/doc-stepdef
[Given("the first number is {int}")]
public void GivenTheFirstNumberIs(int number)
{
//TODO: implement arrange (precondition) logic
// For storing and retrieving scenario-specific data see https://go.reqnroll.net/doc-sharingdata
// To use the multiline text or the table argument of the scenario,
// additional string/DataTable parameters can be defined on the step definition
// method.
throw new PendingStepException();
}
[Given("the second number is {int}")]
public void GivenTheSecondNumberIs(int number)
{
//TODO: implement arrange (precondition) logic
throw new PendingStepException();
}
[When("the two numbers are added")]
public void WhenTheTwoNumbersAreAdded()
{
//TODO: implement act (action) logic
throw new PendingStepException();
}
[Then("the result should be {int}")]
public void ThenTheResultShouldBe(int result)
{
//TODO: implement assert (verification) logic
throw new PendingStepException();
}
}
+5
View File
@@ -0,0 +1,5 @@
<Solution>
<Project Path="Demo/Demo.csproj"/>
<Project Path="EoM_Redux.Tests/EoM_Redux.Tests.csproj"/>
<Project Path="EoM_Redux/EoM_Redux.csproj"/>
</Solution>
+19
View File
@@ -0,0 +1,19 @@
namespace EoM_Redux;
public class FireBurn : IOvertEffect
{
public FireBurn(int damage = 0, int duration = 3)
{
Damage = damage;
Duration = duration;
}
public string Name { get; } = "Burning";
public int Damage { get; }
public int Duration { get; }
public void ApplyEffect()
{
throw new NotImplementedException();
}
}
+14
View File
@@ -0,0 +1,14 @@
namespace EoM_Redux;
public class Fire : IElement
{
public Fire(int damage)
{
Damage = damage;
}
public int Damage { get; set; }
public List<ISubtleEffect> ISubtleEffects { get; }
public List<IOvertEffect> IOvertEffects { get; }
}
+8
View File
@@ -0,0 +1,8 @@
namespace EoM_Redux;
public class FireBall : ISpell
{
public IOvertEffect OvertEffect => new FireBurn(10);
public SpellType Type => SpellType.Overt;
public IElement Element => new Fire(10);
}
+9
View File
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
+7
View File
@@ -0,0 +1,7 @@
namespace EoM_Redux;
public interface IElement
{
List<ISubtleEffect> ISubtleEffects { get; }
List<IOvertEffect> IOvertEffects { get; }
}
+6
View File
@@ -0,0 +1,6 @@
namespace EoM_Redux;
public interface IOvertEffect
{
void ApplyEffect();
}
+7
View File
@@ -0,0 +1,7 @@
namespace EoM_Redux;
public interface ISpell
{
public SpellType Type { get; }
public IElement Element { get; }
}
+6
View File
@@ -0,0 +1,6 @@
namespace EoM_Redux;
public interface ISubtleEffect
{
void ApplyEffect();
}
+7
View File
@@ -0,0 +1,7 @@
namespace EoM_Redux;
public enum SpellType
{
Subtle,
Overt
}
+17
View File
@@ -0,0 +1,17 @@
Creative Commons Attribution-ShareAlike 4.0 International
<https://creativecommons.org/licenses/by-sa/4.0/>
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
Under the following terms:
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
- ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
See the full license at the link above.
+16
View File
@@ -0,0 +1,16 @@
# Coding Agent Instructions
This project is intended for educational purposes. To support this, please adhere to the following guidelines:
## Allowed Actions
- **Environment Maintenance:** Feel free to update Nix flakes, shell configurations, or other environment-related setup.
- **Project Housekeeping:** Maintain a standard project layout, keep `README.md` up-to-date, and clean up temporary or build-related files.
- **Documentation:** Add comments, manage project documentation, and add links to relevant external resources.
## Restricted Actions
- **Source Code Editing:** You are NOT allowed to edit the executable source code (project root) except to improve documentation..
- **Code Generation:** Do not provide example code unless explicitly asked by the user.
## Communication Guidelines
- **Educational Focus:** When asked about code, prioritize explaining the concepts and providing advice over writing code.
- **Documentation Links:** Always include links to official language or library documentation for references.
+29
View File
@@ -0,0 +1,29 @@
{ pkgs }:
let
lib = pkgs.lib;
templateName = builtins.baseNameOf (toString ./.);
in
{
${templateName} = pkgs.stdenvNoCC.mkDerivation {
pname = templateName;
version = "0.1.0";
src = ./.;
dontBuild = true;
installPhase = ''
mkdir -p $out/share/${templateName}
if [ -d src ]; then
cp -r src $out/share/${templateName}/
fi
for f in README.md project.toml flake.nix default.nix shell.nix Makefile .editorconfig .gitignore; do
if [ -f "$f" ]; then
cp "$f" $out/share/${templateName}/
fi
done
'';
meta = with lib; {
description = "Template project: ${templateName}";
license = licenses.unfreeRedistributable;
platforms = platforms.all;
};
};
}
+2
View File
@@ -0,0 +1,2 @@
# Generated by nuget-to-nix (empty template for projects without external NuGet dependencies)
[]
Generated
+27
View File
@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1783776592,
"narHash": "sha256-UgCQzxeWI75XM8G+hPrPh+MKzEPjG3SpAj7dtqSbksA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e7a3ca8092b61ff85b6a45bf863ea2b2d6a661b3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+138
View File
@@ -0,0 +1,138 @@
# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
}: {
templates = {
default = {
description = ".NET dev environment (FHS) with SDK, EF Core, and optional Rider support";
welcomeText = ''
.NET skeletal project created.
- Build: dotnet build
- Run: dotnet run
- Rider: rider . (inside nix develop)
'';
path = ./.;
};
};
devShells = let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
in
nixpkgs.lib.genAttrs supportedSystems (
system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
fhs = pkgs.buildFHSEnv {
name = "dotnet-fhs-shell";
targetPkgs = pkgs: [
pkgs.dotnet-sdk
pkgs.dotnet-ef
pkgs.dotnet-aspnetcore
pkgs.csharpier
pkgs.icu
pkgs.openssl
pkgs.krb5
pkgs.zlib
pkgs.git
pkgs.gnumake
];
runScript = "bash";
profile = ''
export DOTNET_ROOT=${pkgs.dotnet-sdk}
export DOTNET_CLI_HOME=$HOME/.dotnet
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export PATH=${pkgs.dotnet-sdk}/bin:$PATH
'';
};
in {
default = fhs.env.overrideAttrs (_: {
shellHook = ''
# Initialize git repository if not already present
if [ ! -d .git ]; then
git init
echo " Initialized git repository"
fi
export DOTNET_ROOT=${pkgs.dotnet-sdk}
export DOTNET_CLI_HOME=$HOME/.dotnet
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export PATH=${pkgs.dotnet-sdk}/bin:$PATH
echo "FHS shell for .NET development"
echo "DOTNET_ROOT=$DOTNET_ROOT"
'';
});
}
);
packages = let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
in
nixpkgs.lib.genAttrs supportedSystems (
system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
default = pkgs.buildDotnetModule {
pname = "sample-dotnet-app";
version = "0.1.0";
src = ./.;
projectFile = "SampleApp.csproj";
nugetDeps = ./deps.nix;
selfContainedBuild = false;
meta.mainProgram = "SampleApp";
};
devHelper = pkgs.writeShellScriptBin "dev-helper" ''
echo ".NET dev environment"
command -v dotnet >/dev/null 2>&1 && dotnet --version || true
echo "This binary is built by Nix (packages.devHelper)."
'';
}
);
apps = let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
in
nixpkgs.lib.genAttrs supportedSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = {
type = "app";
program = pkgs.lib.getExe self.packages.${system}.default;
};
dev-helper = {
type = "app";
program = pkgs.lib.getExe self.packages.${system}.devHelper;
};
}
);
};
}
+22
View File
@@ -0,0 +1,22 @@
{
"app-id": "org.example.dotnetdevshell",
"runtime": "org.freedesktop.Platform",
"runtime-version": "23.08",
"sdk": "org.freedesktop.Sdk",
"command": "dotnetdevshell-app",
"modules": [
{
"name": "dotnetdevshell-app",
"buildsystem": "simple",
"build-commands": [
"dotnet publish -c Release -o out"
],
"sources": [
{
"type": "dir",
"path": ".."
}
]
}
]
}
+155
View File
@@ -0,0 +1,155 @@
#!/usr/bin/env bash
# Helper script to install popular .NET templates from NuGet
set -e
echo "🔧 .NET Template Installer"
echo "=========================="
echo ""
# Function to install a template
install_template() {
local name="$1"
local package="$2"
echo "📦 Installing $name..."
dotnet new install "$package" || echo "⚠️ Failed to install $name"
echo ""
}
# Parse arguments
if [ "$#" -eq 0 ]; then
echo "Usage: $0 [all|web|cloud|testing|mobile|list]"
echo ""
echo "Categories:"
echo " all - Install all popular templates"
echo " web - Web development templates"
echo " cloud - Cloud & AWS templates"
echo " testing - Testing frameworks"
echo " mobile - Mobile development"
echo " list - Show available categories"
echo ""
echo "Individual templates:"
echo " aws - AWS Lambda templates"
echo " blazor - Blazor templates"
echo " nunit - NUnit 3 test templates"
echo " xunit - xUnit test templates"
echo " reqnroll - Reqnroll BDD templates"
echo " avalonia - Avalonia UI (cross-platform)"
echo " boxed - ASP.NET Core Boxed templates"
echo " clean - Clean Architecture templates"
echo " giraffe - Giraffe F# web framework"
echo " safe - SAFE Stack (F#)"
exit 0
fi
case "$1" in
all)
echo "Installing all popular templates..."
install_template "AWS Lambda" "Amazon.Lambda.Templates"
install_template "NUnit 3" "NUnit3.DotNetNew.Template"
install_template "Reqnroll" "Reqnroll.Templates.DotNet"
install_template ".NET Boxed" "Boxed.Templates"
install_template "Avalonia UI" "Avalonia.Templates"
install_template "Clean Architecture (Manga)" "Paulovich.Manga"
;;
web)
echo "Installing web development templates..."
install_template ".NET Boxed" "Boxed.Templates"
install_template "Carter" "CarterTemplate"
install_template "Giraffe (F#)" "giraffe-template"
;;
cloud)
echo "Installing cloud templates..."
install_template "AWS Lambda" "Amazon.Lambda.Templates"
install_template "Azure Functions" "Microsoft.Azure.Functions.Templates"
;;
testing)
echo "Installing testing templates..."
install_template "NUnit 3" "NUnit3.DotNetNew.Template"
install_template "Reqnroll" "Reqnroll.Templates.DotNet"
install_template "NSpec" "dotnet-new-nspec"
install_template "Expecto (F#)" "Expecto.Template"
;;
mobile)
echo "Installing mobile development templates..."
install_template "Avalonia UI" "Avalonia.Templates"
install_template "Fabulous Xamarin.Forms" "Fabulous.XamarinForms.Templates"
;;
aws)
install_template "AWS Lambda" "Amazon.Lambda.Templates"
;;
blazor)
install_template "Blazor" "Microsoft.AspNetCore.Blazor.Templates::3.0.0-*"
;;
nunit)
install_template "NUnit 3" "NUnit3.DotNetNew.Template"
;;
xunit)
install_template "xUnit Test File" "GatewayProgrammingSchool.xUnit.CSharp"
;;
reqnroll)
install_template "Reqnroll" "Reqnroll.Templates.DotNet"
;;
avalonia)
install_template "Avalonia UI" "Avalonia.Templates"
;;
boxed)
install_template ".NET Boxed" "Boxed.Templates"
;;
clean)
install_template "Clean Architecture (Manga)" "Paulovich.Manga"
install_template "Clean Architecture (Caju)" "Paulovich.Caju"
;;
giraffe)
install_template "Giraffe (F#)" "giraffe-template"
;;
safe)
install_template "SAFE Stack (F#)" "SAFE.Template"
;;
list)
echo "Available categories and templates:"
echo ""
echo "Categories:"
echo " all - Install all popular templates"
echo " web - Web development (Boxed, Carter, Giraffe)"
echo " cloud - Cloud platforms (AWS Lambda, Azure Functions)"
echo " testing - Testing frameworks (NUnit, Reqnroll, NSpec)"
echo " mobile - Mobile development (Avalonia, Fabulous)"
echo ""
echo "Individual templates:"
echo " aws - AWS Lambda templates"
echo " blazor - Blazor templates"
echo " nunit - NUnit 3 test templates"
echo " xunit - xUnit test templates"
echo " reqnroll - Reqnroll BDD templates"
echo " avalonia - Avalonia UI (cross-platform)"
echo " boxed - ASP.NET Core Boxed templates"
echo " clean - Clean Architecture templates"
echo " giraffe - Giraffe F# web framework"
echo " safe - SAFE Stack (F#)"
;;
*)
echo "❌ Unknown option: $1"
echo "Run '$0' without arguments to see usage."
exit 1
;;
esac
echo ""
echo "✅ Done! List installed templates with: dotnet new list"
+7
View File
@@ -0,0 +1,7 @@
# Project metadata for .NET template
[project]
name = "dotnet-template"
description = "Nix flake template for .NET projects"
authors = ["Your Name <you@example.com>"]
version = "0.1.0"
license = "MIT"
+13
View File
@@ -0,0 +1,13 @@
# Legacy shell.nix for .NET template
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
buildInputs = [
pkgs.dotnet-sdk
pkgs.git
];
shellHook = "" "
echo 'Welcome to the .NET devShell!'
" "";
}
+9
View File
@@ -0,0 +1,9 @@
using Xunit;
public class SampleTest
{
[Fact]
public void TestSample()
{
Assert.Equal(1, 1);
}
}