Skip to content

Commit

Permalink
Update .NET and dependencies, add dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
albi005 committed Aug 4, 2024
1 parent f92b1b4 commit eed5edb
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
with:
app-name: blace-server
publish-profile: ${{ secrets.SERVER_PUBLISH_PROFILE }}
package: Blace.Server/bin/Release/net7.0/publish
package: Blace.Server/bin/Release/net8.0/publish

- name: Deploy Client
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.CLIENT_DEPLOYMENT_TOKEN }}
action: upload
skip_app_build: true
app_location: Blace.Client/bin/Release/net7.0/publish/wwwroot
app_location: Blace.Client/bin/Release/net8.0/publish/wwwroot
output_location: ''
16 changes: 8 additions & 8 deletions Blace.Client/Blace.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.5" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.5" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.7" PrivateAssets="all"/>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client.SourceGenerator" Version="7.0.0-preview.1.22109.13" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="7.0.5" />
<PackageReference Include="Sentry.Extensions.Logging" Version="3.31.0" />
<PackageReference Include="SkiaSharp.Views.Blazor" Version="2.88.3" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.7" />
<PackageReference Include="Sentry.Extensions.Logging" Version="4.9.0" />
<PackageReference Include="SkiaSharp.Views.Blazor" Version="2.88.8" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Blace.Client/Components/Place.razor
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</div>
<div class="d-flex justify-content-center mt-2 gap-2">
<CloseButton/>
<button class="btn btn-primary" disabled="@(!_canPlace && !_isAdmin)" @onclick="PlaceTile">
<button class="btn btn-dark" disabled="@(!_canPlace && !_isAdmin)" @onclick="PlaceTile">
@if (_canPlace || _isAdmin)
{
<span class="oi oi-check" aria-hidden="true"></span>
Expand Down Expand Up @@ -97,7 +97,7 @@
<span class="oi oi-ban"></span>
</button>
}
<button class="btn btn-primary" @onclick="() => _openMenu = OpenMenu.Draw">
<button class="btn btn-dark" style="box-shadow: rgba(0, 0, 0, 0.54) 0px 3px 8px;" @onclick="() => _openMenu = OpenMenu.Draw">
<span class="oi oi-pencil" aria-hidden="true"></span>
</button>
</div>
Expand Down
1 change: 0 additions & 1 deletion Blace.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Blace.Client.Services;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Sentry;

try
{
Expand Down
6 changes: 3 additions & 3 deletions Blace.Client/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"Blace.Client": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchBrowser": false,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:7150;http://*:7150",
"applicationUrl": "http://0.0.0.0:7150",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
}
1 change: 1 addition & 0 deletions Blace.Client/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>

<script src="_framework/blazor.webassembly.js"></script>
<script>
document.addEventListener('keydown', function (e){
Expand Down
4 changes: 2 additions & 2 deletions Blace.Console/Blace.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UserSecretsId>ad55cfe7-9c85-4a79-ba8a-0f4bc648be80</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenCvSharp4.Windows" Version="4.7.0.20230115" />
<PackageReference Include="OpenCvSharp4.Windows" Version="4.10.0.20240616" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Blace.Console/Timelapse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static async Task Execute()
using VideoWriter writer = new("1080.avi", FourCC.DIVX, 144, new(1080, 1080));
Rgb[] arr = new Rgb[128 * 128];
Array.Fill<Rgb>(arr, 0xFF_FFFF);
using Mat mat = new(128, 128, MatType.CV_8UC3, arr);
using Mat mat = Mat.FromPixelData(128, 128, MatType.CV_8UC3, arr);
using Mat resized = new();

int i = 0;
Expand Down
10 changes: 5 additions & 5 deletions Blace.Server/Blace.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>57b268f1-6a29-442f-90ab-fd404f070aac</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Blace.Shared\Blace.Shared.csproj" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="7.0.5" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.34.0" />
<PackageReference Include="Microsoft.Identity.Web" Version="2.11.0" />
<PackageReference Include="Sentry.AspNetCore" Version="3.31.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.7" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.42.0" />
<PackageReference Include="Microsoft.Identity.Web" Version="3.0.1" />
<PackageReference Include="Sentry.AspNetCore" Version="4.9.0" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions Blace.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@

await app.Services.GetRequiredService<PlaceService>().Initialize();

app.UseCors(cors => cors
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader());

if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
Expand All @@ -73,11 +78,6 @@

app.UseRouting();

app.UseCors(cors => cors
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader());

if (!app.Environment.IsDevelopment())
{
app.UseAuthentication();
Expand Down
2 changes: 1 addition & 1 deletion Blace.Server/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Blace.Server": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://localhost:7151;http://*:7151",
"applicationUrl": "http://localhost:7151",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down
2 changes: 1 addition & 1 deletion Blace.Shared/Blace.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions Blace.Tests/Blace.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
7 changes: 7 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
https://claude.ai/chat/eed598e2-139e-46ca-b8c5-104ac86d28b7

```bash
docker build -t dotnet-shell .

docker run -it --rm -v $PWD:/src dotnet-shell
```
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM mcr.microsoft.com/dotnet/sdk:latest

RUN dotnet workload install wasm-tools

RUN apt-get update
RUN apt-get install -y python3 python3-pip
RUN apt-get install -y procps

WORKDIR /src

CMD ["bash"]
3 changes: 3 additions & 0 deletions devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dockerFile": "Dockerfile"
}

0 comments on commit eed5edb

Please sign in to comment.