Skip to content

Commit 4d809cc

Browse files
Colin MackayColin Mackay
authored andcommitted
WIP
1 parent f34ac6d commit 4d809cc

File tree

9,099 files changed

+9539
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

9,099 files changed

+9539
-12
lines changed

.github/dependabot.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
11
version: 2
22
updates:
3+
# Keep NuGet dependencies up to date across the solution
34
- package-ecosystem: "nuget"
45
directory: "/"
56
schedule:
6-
interval: "daily"
7-
time: "14:30"
8-
timezone: "Europe/London"
7+
interval: "weekly"
8+
day: "saturday"
9+
time: "08:00"
10+
open-pull-requests-limit: 10
11+
labels:
12+
- "dependencies"
13+
commit-message:
14+
prefix: "dependabot"
15+
include: "scope"
16+
17+
# Also scan under src specifically (helps when solutions are nested)
18+
- package-ecosystem: "nuget"
19+
directory: "/src"
20+
schedule:
21+
interval: "weekly"
22+
day: "wednesday"
23+
time: "14:00"
24+
open-pull-requests-limit: 10
25+
labels:
26+
- "dependencies"
27+
commit-message:
28+
prefix: "dependabot"
29+
include: "scope"
30+
31+
# Keep GitHub Actions up to date
32+
- package-ecosystem: "github-actions"
33+
directory: "/"
34+
schedule:
35+
interval: "weekly"
36+
day: "monday"
37+
time: "04:00"
38+
open-pull-requests-limit: 5
39+
labels:
40+
- "dependencies"
41+
commit-message:
42+
prefix: "dependabot"
43+
include: "scope"
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Path to the selection.json from the Phosphor Icons repository
2+
$iconPath = "$PSScriptRoot/../../src/Stravaig.Avalonia.Controls.Icons/Assets/PhosphorIcons"
3+
4+
# Output C# file path
5+
$outputPath = Join-Path $PSScriptRoot "../../src/Stravaig.Avalonia.Controls.Icons/PhosphorIcons" | Convert-Path
6+
$outputPath += "/PhosphorIconName.cs"
7+
8+
# Read and parse JSON
9+
$svgFiles = Get-ChildItem -Path $iconPath -Filter "*.svg" -Recurse -File
10+
11+
$iconData = $svgFiles | ForEach-Object {
12+
$fileName = $_.BaseName
13+
if ($fileName -match '^(.+)-([^-]+)$') {
14+
[PSCustomObject]@{
15+
BaseName = $matches[1]
16+
Style = $matches[2]
17+
}
18+
}
19+
} | Group-Object -Property BaseName | ForEach-Object {
20+
[PSCustomObject]@{
21+
Name = $_.Name
22+
Styles = ($_.Group | Select-Object -ExpandProperty Style | Sort-Object -Unique)
23+
}
24+
}
25+
26+
# $json = @{
27+
# icons = $iconData | ForEach-Object {
28+
# @{
29+
# properties = @{
30+
# name = $_.Name
31+
# styles = $_.Styles
32+
# }
33+
# }
34+
# }
35+
# }
36+
37+
# Extract icon name and code, format as required
38+
$entries = foreach ($icon in $iconData) {
39+
$rawName = $icon.Name;
40+
$styles = if ($icon.Styles.Count -gt 1) {
41+
($icon.Styles[0..($icon.Styles.Count-2)] -join ', ') + ', and ' + $icon.Styles[-1]
42+
} else {
43+
$icon.Styles -join ''
44+
}
45+
46+
# Split by comma to handle multiple names
47+
$names = $rawName -split ',' | ForEach-Object { $_.Trim() }
48+
49+
foreach ($singleName in $names) {
50+
$name = (($singleName -split '-') | ForEach-Object { $_.Substring(0,1).ToUpperInvariant() + $_.Substring(1) }) -join ''
51+
[PSCustomObject]@{ Name = $name; RawName = $rawName; Styles = $styles }
52+
}
53+
}
54+
55+
# Generate C# dictionary entries
56+
$dictEntries = $entries | Sort-Object -Property Name | ForEach-Object {
57+
" /// <Summary>`n" +
58+
" /// Phosphor icon '$($_.RawName)', available in styles $($_.Styles).`n" +
59+
" /// </Summary>`n" +
60+
" $($_.Name) = $($_.Value),`n"
61+
}
62+
63+
# Write C# file
64+
@"
65+
// Auto-generated file. Do not modify directly.
66+
// Use helpers/Phosphor-Icons/ConvertToEnum.ps1 to regenerate.
67+
68+
// Some icon codes have multiple names, leading to duplicate enum values which triggers CA1069 warning.
69+
#pragma warning disable CA1069
70+
71+
namespace Stravaig.Controls.Icons;
72+
73+
public enum PhosphorIconName
74+
{
75+
$($dictEntries -join "`n")
76+
}
77+
"@ | Set-Content $outputPath
78+
79+
Write-Host "C# file generated at $outputPath"

src/.idea/.idea.Stravaig.Avalonia.Controls.Icons/.idea/.gitignore

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.Stravaig.Avalonia.Controls.Icons/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.Stravaig.Avalonia.Controls.Icons/.idea/avalonia.xml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.Stravaig.Avalonia.Controls.Icons/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.idea/.idea.Stravaig.Avalonia.Controls.Icons/.idea/vcs.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Directory.Build.props

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/Stravaig.XXXX.sln renamed to src/Stravaig.Avalonia.Controls.Icons.sln

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,29 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "__Documentation", "__Docume
2222
..\release-notes\wip-release-notes.md = ..\release-notes\wip-release-notes.md
2323
EndProjectSection
2424
EndProject
25+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stravaig.Icons.Example", "Stravaig.Icons.Example\Stravaig.Icons.Example.csproj", "{03C805E0-8AC5-4322-9548-1D26146F934C}"
26+
EndProject
27+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stravaig.Avalonia.Controls.Icons", "Stravaig.Avalonia.Controls.Icons\Stravaig.Avalonia.Controls.Icons.csproj", "{29492B94-726A-4F42-B976-D9FE067A8531}"
28+
EndProject
2529
Global
2630
GlobalSection(SolutionProperties) = preSolution
2731
HideSolutionNode = FALSE
2832
EndGlobalSection
2933
GlobalSection(ExtensibilityGlobals) = postSolution
3034
SolutionGuid = {064958BE-42C5-4268-8132-49EF6D009D99}
3135
EndGlobalSection
36+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
37+
{29492B94-726A-4F42-B976-D9FE067A8531}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{29492B94-726A-4F42-B976-D9FE067A8531}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{29492B94-726A-4F42-B976-D9FE067A8531}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{29492B94-726A-4F42-B976-D9FE067A8531}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{03C805E0-8AC5-4322-9548-1D26146F934C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42+
{03C805E0-8AC5-4322-9548-1D26146F934C}.Debug|Any CPU.Build.0 = Debug|Any CPU
43+
{03C805E0-8AC5-4322-9548-1D26146F934C}.Release|Any CPU.ActiveCfg = Release|Any CPU
44+
{03C805E0-8AC5-4322-9548-1D26146F934C}.Release|Any CPU.Build.0 = Release|Any CPU
45+
EndGlobalSection
46+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
47+
Debug|Any CPU = Debug|Any CPU
48+
Release|Any CPU = Release|Any CPU
49+
EndGlobalSection
3250
EndGlobal

0 commit comments

Comments
 (0)