Skip to content
Open
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
48 changes: 48 additions & 0 deletions .github/workflows/Darnton.Blazor.DeviceInterop.Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Darnton.Blazor.DeviceInterop

env:
SUBFOLDER: './Darnton.Blazor.DeviceInterop'
PROJECT: 'Darnton.Blazor.DeviceInterop.csproj'

on:
workflow_dispatch:
push:
paths:
- 'Darnton.Blazor.DeviceInterop/**'
branches:
- master

jobs:
build:
runs-on: [self-hosted, webpx, build]

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Restore dependencies
run: dotnet restore ${{ env.SUBFOLDER }}/${{ env.PROJECT }}

- name: Build (Release)
run: dotnet build ${{ env.SUBFOLDER }}/${{ env.PROJECT }} --configuration Release --no-restore

- name: Pack NuGet package
run: dotnet pack ${{ env.SUBFOLDER }}/${{ env.PROJECT }} --configuration Release --no-build --output ${{ github.workspace }}\nupkgs

- name: Publish to GitHub Packages
run: dotnet nuget push ${{ github.workspace }}\nupkgs\*.nupkg --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload package as workflow artifact (optional)
uses: actions/upload-artifact@v4
with:
name: Absractions

Copilot AI Sep 30, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The artifact name contains a typo. 'Absractions' should be 'Abstractions'.

Suggested change
name: Absractions
name: Abstractions

Copilot uses AI. Check for mistakes.
path: ./nupkgs/*.nupkg

- name: Clean up (optional)
run: rm -Force -Recurse ./nupkgs
5 changes: 5 additions & 0 deletions BlazorDeviceTestRig/wwwroot/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"App": {
"BasePath": "./"
}
}
14 changes: 10 additions & 4 deletions Darnton.Blazor.DeviceInterop/Darnton.Blazor.DeviceInterop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,31 @@
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>Darnton.Blazor.DeviceInterop</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.1.3</Version>
<Version>0.1.4</Version>
<Authors>Bernard Darnton</Authors>
<Product>Blazor device interop library</Product>
<Description>Blazor device interop library including wrappers for Geolocation API. Updated to .NET 5</Description>
<Copyright>2020 Bernard Darnton</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/darnton/BlazorDeviceInterop</RepositoryUrl>
<AssemblyVersion>0.0.1.3</AssemblyVersion>
<FileVersion>0.0.1.3</FileVersion>
<AssemblyVersion>0.0.1.4</AssemblyVersion>
<FileVersion>0.0.1.4</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>C:\Users\user\source\repos\BlazorDeviceInterop\Darnton.Blazor.DeviceInterop\Darnton.Blazor.DeviceInterop.xml</DocumentationFile>
<!--<DocumentationFile>C:\Users\user\source\repos\BlazorDeviceInterop\Darnton.Blazor.DeviceInterop\Darnton.Blazor.DeviceInterop.xml</DocumentationFile>-->
</PropertyGroup>

<ItemGroup>
<None Remove="Darnton.Blazor.DeviceInterop.xml" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
<PackageReference Include="System.Reactive" Version="6.0.2" />

Copilot AI Sep 30, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The System.Reactive package appears to be unrelated to the configuration changes being made. This addition should be explained or removed if not needed for the current changes.

Suggested change
<PackageReference Include="System.Reactive" Version="6.0.2" />

Copilot uses AI. Check for mistakes.
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.JSInterop;
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;

namespace Darnton.Blazor.DeviceInterop.Geolocation
{
Expand All @@ -14,14 +15,16 @@ public class GeolocationService : IGeolocationService

/// <inheritdoc/>
public event EventHandler<GeolocationEventArgs> WatchPositionReceived;
private readonly IConfiguration configuration;

Comment on lines +18 to 19

Copilot AI Sep 30, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration field is assigned but never used after the constructor. Consider storing only the basePath value instead of the entire configuration object.

Suggested change
private readonly IConfiguration configuration;

Copilot uses AI. Check for mistakes.
/// <summary>
/// Constructs a <see cref="GeolocationService"/> object.
/// </summary>
/// <param name="JSRuntime"></param>
public GeolocationService(IJSRuntime JSRuntime)
public GeolocationService(IJSRuntime JSRuntime, IConfiguration configuration)
{
_jsBinder = new JSBinder(JSRuntime, "./_content/Darnton.Blazor.DeviceInterop/js/Geolocation.js");
var basePath = configuration["App:BasePath"] ?? "./";
_jsBinder = new JSBinder(JSRuntime, $"{basePath}/_content/Darnton.Blazor.DeviceInterop/js/Geolocation.js");
}

/// <inheritdoc/>
Expand Down