From 541c436a556cd0ebdd668c300dd1293002196f38 Mon Sep 17 00:00:00 2001 From: David Kallesen Date: Tue, 1 Mar 2022 17:04:47 +0100 Subject: [PATCH 1/5] refactor: Change path to scripts - to simplify use --- sample/Atc.Blazor.Sample/wwwroot/index.html | 32 +++++++++---------- .../ColorThemePreferenceDetector.cs | 2 +- .../ColorThemePreferenceDetector.js | 0 3 files changed, 17 insertions(+), 17 deletions(-) rename src/Atc.Blazor.ColorThemePreference/wwwroot/{scripts => }/ColorThemePreferenceDetector.js (100%) diff --git a/sample/Atc.Blazor.Sample/wwwroot/index.html b/sample/Atc.Blazor.Sample/wwwroot/index.html index af33c0d..85d1051 100644 --- a/sample/Atc.Blazor.Sample/wwwroot/index.html +++ b/sample/Atc.Blazor.Sample/wwwroot/index.html @@ -2,25 +2,25 @@ - - - Atc.Blazor.Sample - - - - + + + Atc.Blazor.Sample + + + + -
Loading...
+
Loading...
-
- An unhandled error has occurred. - Reload - 🗙 -
- - +
+ An unhandled error has occurred. + Reload + 🗙 +
+ + - + \ No newline at end of file diff --git a/src/Atc.Blazor.ColorThemePreference/ColorThemePreferenceDetector.cs b/src/Atc.Blazor.ColorThemePreference/ColorThemePreferenceDetector.cs index d1aabee..1f6b1e1 100644 --- a/src/Atc.Blazor.ColorThemePreference/ColorThemePreferenceDetector.cs +++ b/src/Atc.Blazor.ColorThemePreference/ColorThemePreferenceDetector.cs @@ -12,7 +12,7 @@ public ColorThemePreferenceDetector(IJSRuntime jsRuntime) moduleTask = new Lazy>(() => jsRuntime .InvokeAsync( "import", - "./_content/Atc.Blazor.ColorThemePreference/scripts/ColorThemePreferenceDetector.js") + "./_content/Atc.Blazor.ColorThemePreference/ColorThemePreferenceDetector.js") .AsTask()); } diff --git a/src/Atc.Blazor.ColorThemePreference/wwwroot/scripts/ColorThemePreferenceDetector.js b/src/Atc.Blazor.ColorThemePreference/wwwroot/ColorThemePreferenceDetector.js similarity index 100% rename from src/Atc.Blazor.ColorThemePreference/wwwroot/scripts/ColorThemePreferenceDetector.js rename to src/Atc.Blazor.ColorThemePreference/wwwroot/ColorThemePreferenceDetector.js From c40aabb61b961c825085bc33687858023d94a0c7 Mon Sep 17 00:00:00 2001 From: David Kallesen Date: Tue, 1 Mar 2022 17:05:39 +0100 Subject: [PATCH 2/5] fix: Add readme to solution-file --- Atc.Blazor.sln | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Atc.Blazor.sln b/Atc.Blazor.sln index 85c10d9..f720b6d 100644 --- a/Atc.Blazor.sln +++ b/Atc.Blazor.sln @@ -7,6 +7,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Blazor.ColorThemePrefer EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Blazor.Sample", "sample\Atc.Blazor.Sample\Atc.Blazor.Sample.csproj", "{3875CEE1-DBED-4999-B1F6-F5D45E14BEF6}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{DCB86DDD-727D-461E-8D80-7FC6ACFF6232}" + ProjectSection(SolutionItems) = preProject + README.md = README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU From 5769d0d6c1c68b9d1fef4819c89c3d5ade2847d0 Mon Sep 17 00:00:00 2001 From: David Kallesen Date: Tue, 1 Mar 2022 17:13:58 +0100 Subject: [PATCH 3/5] fix: Update readme --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 97b257a..aaab8ca 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ This repository contains packages with components for Blazor application: |---|---| | Atc.Blazor.ColorThemePreference | A library for detecting the user preferred color theme | +## Get started Atc.Blazor.ColorThemePreference + ### Requirements * [.NET 6 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) @@ -21,6 +23,7 @@ Install-Package Atc.Blazor.ColorThemePreference ### How to Setup Modify `Program.cs` by adding to the service builder: + ```csharp var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); @@ -34,8 +37,9 @@ await builder.Build().RunAsync(); ``` Modify `index.html` by adding: + ```html - + ``` ### How to Use From 2bf35f3def7715bd09e4f4468b74211bd3bdc74a Mon Sep 17 00:00:00 2001 From: David Kallesen Date: Tue, 1 Mar 2022 17:14:42 +0100 Subject: [PATCH 4/5] chore: Update nuget and coding rules --- .editorconfig | 21 +++++++++++++++---- Directory.Build.props | 4 ++-- sample/.editorconfig | 7 ++++--- .../Atc.Blazor.Sample.csproj | 4 ++-- src/.editorconfig | 7 ++++--- .../Atc.Blazor.ColorThemePreference.csproj | 2 +- test/.editorconfig | 8 ++++--- test/Directory.Build.props | 2 +- 8 files changed, 36 insertions(+), 19 deletions(-) diff --git a/.editorconfig b/.editorconfig index 56aad56..0c58012 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,8 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.7 -# Updated: 18-06-2021 +# Version: 1.0.9 +# Updated: 01-02-2022 # Location: Root +# Distribution: DotNet6 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## @@ -45,6 +46,7 @@ indent_size = 2 # Markdown Files [*.md] +trim_trailing_whitespace = false # Web Files [*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,svg,vue}] @@ -54,8 +56,13 @@ indent_size = 2 [*.{cmd,bat}] end_of_line = crlf -# Shell scripts/files -[*.{sh,ps1}] +# Bash Files +[*.sh] +end_of_line = lf +indent_size = 2 + +# Powershell +[*.ps1] end_of_line = lf indent_size = 2 @@ -487,6 +494,12 @@ dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md +########################################## +# Custom - File Extension Settings +########################################## + + ########################################## # Custom - Code Analyzers Rules ########################################## +[*.{cs,csx,cake}] \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 139fd6f..b14fb18 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -43,10 +43,10 @@ - + - + \ No newline at end of file diff --git a/sample/.editorconfig b/sample/.editorconfig index c6998d8..e777d03 100644 --- a/sample/.editorconfig +++ b/sample/.editorconfig @@ -1,7 +1,8 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.0 -# Updated: 04-12-2020 -# Location: Sample +# Version: 1.0.9 +# Updated: 01-02-2022 +# Location: sample +# Distribution: DotNet6 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## diff --git a/sample/Atc.Blazor.Sample/Atc.Blazor.Sample.csproj b/sample/Atc.Blazor.Sample/Atc.Blazor.Sample.csproj index cddda2b..9d6e21f 100644 --- a/sample/Atc.Blazor.Sample/Atc.Blazor.Sample.csproj +++ b/sample/Atc.Blazor.Sample/Atc.Blazor.Sample.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/.editorconfig b/src/.editorconfig index 90a5739..c2b78c6 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -1,7 +1,8 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.5 -# Updated: 02-05-2021 -# Location: Src +# Version: 1.0.9 +# Updated: 01-02-2022 +# Location: src +# Distribution: DotNet6 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## diff --git a/src/Atc.Blazor.ColorThemePreference/Atc.Blazor.ColorThemePreference.csproj b/src/Atc.Blazor.ColorThemePreference/Atc.Blazor.ColorThemePreference.csproj index 4a978db..899ba12 100644 --- a/src/Atc.Blazor.ColorThemePreference/Atc.Blazor.ColorThemePreference.csproj +++ b/src/Atc.Blazor.ColorThemePreference/Atc.Blazor.ColorThemePreference.csproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/test/.editorconfig b/test/.editorconfig index 0b16bcd..d51c7b5 100644 --- a/test/.editorconfig +++ b/test/.editorconfig @@ -1,7 +1,8 @@ # ATC coding rules - https://github.com/atc-net/atc-coding-rules -# Version: 1.0.7 -# Updated: 18-06-2021 -# Location: Test +# Version: 1.0.9 +# Updated: 01-02-2022 +# Location: test +# Distribution: DotNet6 # Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options ########################################## @@ -50,4 +51,5 @@ dotnet_diagnostic.SA1133.severity = none # https://github.com/atc-net ########################################## # Custom - Code Analyzers Rules +########################################## ######################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################## \ No newline at end of file diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 71cb4ac..492ab44 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -11,7 +11,7 @@ - + From 1d79ebf67b5ed63a6892ddebde3ca1ac586f74d4 Mon Sep 17 00:00:00 2001 From: David Kallesen Date: Tue, 1 Mar 2022 17:18:22 +0100 Subject: [PATCH 5/5] ci: fix job-naming --- .github/workflows/pre-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-integration.yml b/.github/workflows/pre-integration.yml index 57d7b09..07a0336 100644 --- a/.github/workflows/pre-integration.yml +++ b/.github/workflows/pre-integration.yml @@ -8,7 +8,7 @@ on: - reopened jobs: - dotnet5-build: + dotnet-build: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -36,7 +36,7 @@ jobs: dotnet-test: runs-on: ubuntu-latest needs: - - dotnet5-build + - dotnet-build steps: - name: 🛒 Checkout repository uses: actions/checkout@v2