Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
391 changes: 391 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
53 changes: 53 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## Purpose
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
* ...

## Does this introduce a breaking change?
<!-- Mark one with an "x". -->
```
[ ] Yes
[ ] No
```

## Pull Request Type
What kind of change does this Pull Request introduce?

<!-- Please check the one that applies to this PR using "x". -->
```
[ ] Bugfix
[ ] New feature
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:
```

## README updated?

The top-level readme for this repo contains a link to each sample in the repo. If you're adding a new sample did you update the readme?
<!-- Mark one with an "x". -->
```
[ ] Yes
[ ] No
[ ] N/A
```

## How to Test
* Get the code

```
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
```

* Test the code
<!-- Add steps to run the tests suite and/or manually test -->
```
```

## What to Check
Verify that the following are valid
* ...

## Other Information
<!-- Add any other helpful information that may be needed here. -->
58 changes: 58 additions & 0 deletions .github/agents/expert-dotnet-software-engineer.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
description: "Provide expert .NET software engineering guidance using modern software design patterns."
name: "Expert .NET software engineer mode instructions"
tools: ["agent", "edit", "execute", "read", "search", "todo", "vscode", "web", "microsoft-docs/*"]
---

# Agent Overview

You are in expert software engineer mode in .NET. Your task is to provide expert software engineering guidance using modern software design patterns as if you were a leader in the field.

## Core Objectives

You will provide:

- insights, best practices and recommendations for .NET software engineering as if you were Anders Hejlsberg, the original architect of C# and a key figure in the development of .NET as well as Mads Torgersen, the lead designer of C#.
- general software engineering guidance and best-practices, clean code and modern software design, as if you were Robert C. Martin (Uncle Bob), a renowned software engineer and author of "Clean Code" and "The Clean Coder".
- DevOps and CI/CD best practices, as if you were Jez Humble, co-author of "Continuous Delivery" and "The DevOps Handbook".
- Testing and test automation best practices, as if you were Kent Beck, the creator of Extreme Programming (XP) and a pioneer in Test-Driven Development (TDD).

## .NET-Specific Guidance

For .NET-specific guidance, focus on the following areas:

- **Design Patterns**: Use and explain modern design patterns such as Async/Await, Dependency Injection, Repository Pattern, Unit of Work, CQRS, Event Sourcing and of course the Gang of Four patterns.
- **SOLID Principles**: Emphasize the importance of SOLID principles in software design, ensuring that code is maintainable, scalable, and testable.
- **Testing**: Advocate for Test-Driven Development (TDD) and Behavior-Driven Development (BDD) practices, using frameworks like xUnit, NUnit, or MSTest.
- **Performance**: Provide insights on performance optimization techniques, including memory management, asynchronous programming, and efficient data access patterns.
- **Security**: Highlight best practices for securing .NET applications, including authentication, authorization, and data protection.

## Test Codes

- Write tests that cover both positive and negative scenarios.
- Ensure tests are isolated, repeatable, and independent of external systems.
- Always use xUnit as the testing framework.
- Use [Fact] for simple test cases.
- Use [Theory] with [InlineData] for parameterized test cases as many times as possible.
- Always use NSubstitute as the mocking framework.
- Always use Shouldly as the assertion library.
- Always use BUnit for Blazor component testing.
- Always use descriptive test method names that clearly indicate the purpose of the test.
- Test method names should follow the pattern: Given_[Conditions]_When_[MethodNameToInvoke]_Then_It_Should_[ExpectedBehaviour].
- In the code, always use comments to separate the Arrange, Act, and Assert sections of the test method.

## Plan-First Approach

- Begin by outlining a detailed migration plan for each Astro component, including its purpose, functionality, and how it maps to Blazor.
- Create a todo list of tasks required to complete the migration for each component.
- Wait for approval of each task list before proceeding with implementation.
- When necessary, hand off complex tasks to specialized subagents for further analysis or implementation.

### Research and Reference

- Utilize official documentation for Blazor components to ensure accurate translations of features and functionalities.
- Reference community best practices and patterns for both frameworks.
- The plugins are based on the types from the following URLs:
- https://github.com/getscissorhands/Scissorhands.NET/tree/vnext/src/ScissorHands.Plugin
- https://github.com/getscissorhands/Scissorhands.NET/tree/vnext/src/ScissorHands.Core/Manifests
- https://github.com/getscissorhands/Scissorhands.NET/tree/vnext/src/ScissorHands.Core/Models
157 changes: 157 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Build, Test and Publish

on:
push:
branches:
- main
- feat/*
- hotfix/*
tags:
- 'v*'
pull_request:
branches:
- main

env:
GH_PACKAGE_USERNAME: '${{ secrets.GH_PACKAGE_USERNAME }}'
GH_PACKAGE_TOKEN: '${{ secrets.GH_PACKAGE_TOKEN }}'

jobs:
build_and_test:
name: Build and test packages
strategy:
matrix:
os: [ 'windows-latest', 'macos-latest', 'ubuntu-latest' ]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout the repository
uses: actions/checkout@v6

- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'

- name: Check package version
id: version
shell: pwsh
run: |
$version = $env:GITHUB_REF -replace 'refs/tags/v', ''
if ($($env:GITHUB_REF).StartsWith('refs/tags/v') -eq $false) {
$version = "1.0.0"
}

"value=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append

- name: Update package version
shell: pwsh
run: |
$csprojPaths = (Get-ChildItem -Path ./src/*.csproj -Recurse).FullName
$csprojPaths | ForEach-Object {
$csprojPath = $_
[xml]$xmlDoc = Get-Content -Path $csprojPath

# Find and replace the Version node value
$versionNode = $xmlDoc.SelectSingleNode("//PropertyGroup/Version")
if ($versionNode -ne $null) {
$versionNode.InnerText = "${{ steps.version.outputs.value }}"
Write-Host "Version updated to: $($versionNode.InnerText) in file $csprojPath"
} else {
Write-Host "Version node not found in file $csprojPath!"
}

# Save it with .xml extension
$xmlDoc.Save($csprojPath)
Write-Host "File saved: $csprojPath"
}

- name: Clear NuGet local cache
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
dotnet nuget locals all --clear

- name: Restore NuGet packages
shell: pwsh
run: |
dotnet restore

- name: Build solution
shell: pwsh
run: |
dotnet build -c Release -p:Version=${{ steps.version.outputs.value }}

- name: Run unit tests
shell: pwsh
run: |
dotnet test -c Release --no-build --verbosity normal

- name: Pack NuGet package
if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' }}
shell: pwsh
run: |
dotnet pack ./src/ScissorHands.Plugin.GoogleAnalytics -c Release -o published --include-symbols -p:Version=${{ steps.version.outputs.value }}

- name: Upload Artifact
if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v5
with:
name: artifacts
path: ./published/

release:
name: Release packages
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs:
- build_and_test

runs-on: ubuntu-latest

permissions:
packages: write
contents: write

steps:
- name: Check package version
id: version
shell: pwsh
run: |
$version = $env:GITHUB_REF -replace 'refs/tags/v', ''
if ($($env:GITHUB_REF).StartsWith('refs/tags/v') -eq $false) {
$version = "1.0.0"
}

"value=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append

- name: Download Artifact
uses: actions/download-artifact@v6
with:
name: artifacts
path: ./published

- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'

- name: Create Release to GitHub
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: "v${{ steps.version.outputs.value }}"
files: ./published/*.*
generate_release_notes: true

- name: Release to GitHub Package Registry
shell: bash
run: |
dotnet nuget push ./published/*.nupkg \
--source "https://nuget.pkg.github.com/getscissorhands/index.json" \
--api-key "${{ secrets.GITHUB_TOKEN }}"

# - name: Release to NuGet
# shell: bash
# run: |
# dotnet nuget push ./published/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,8 @@ FodyWeavers.xsd
*.msix
*.msm
*.msp

# Repository specific
.DS_Store
preview/
Preview.sln
40 changes: 40 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"markdownlint.config": {
"MD028": false,
"MD025": {
"front_matter_title": ""
}
},
"chat.tools.terminal.autoApprove": {
".specify/scripts/bash/": true,
".specify/scripts/powershell/": true,
"/^dotnet\\b.*$/": true,
"/^git\\b.*$/": true,
"/^npm\\b.*$/": true,
"/^pwsh\\b.*$/": true,
"awk": true,
"cat": true,
"cd": true,
"curl": true,
"grep": true,
"jq": true,
"mv": true,
"mkdir": true,
"pushd": true,
"popd": true,
"pwd": true,
"sed": true,
"Get-ChildItem": true,
"Get-Content": true,
"Get-Item": true,
"Invoke-RestMethod": true,
"Invoke-WebRequest": true,
"New-Item": true,
"Push-Location": true,
"Pop-Location": true,
"Select-String": true,
"Test-Path": true,
"Where-Object": true,
"Write-Host": true
}
}
Loading
Loading