Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net8 upgrade & add outdated action #18

Merged
merged 2 commits into from
Dec 31, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
DOTNET_VERSION: '7.x.x'
DOTNET_VERSION: '8.x.x'
NODE_VERSION: '16.x'
SOLUTION_PATH: 'src/JsonToPowershellClass.sln'
PROJECT_PATH: 'src/JsonToPowershellClass.Blazor/JsonToPowershellClass.Blazor.csproj'
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/outdated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Outdated package checks

# Run workflow on pull request to the main branch
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [ main ]

workflow_dispatch:

env:
SOLUTION_PATH: 'src/JsonToPowershellClass.sln'
PROJECT_DIR: 'src/JsonToPowershellClass.Blazor'

jobs:
outdated-packages-check:
runs-on: ubuntu-latest

steps:
- uses: trossr32/[email protected]
with:
use-dotnet-outdated: true
dotnet-solution-path: ${{ env.SOLUTION_PATH }}
use-npm-outdated: true
npm-project-directory: ${{ env.PROJECT_DIR }}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Blazor WASM app

A net7.0 Blazor WebAssembly web application that converts JSON to Powershell classes. JSON can be supplied as a string, an uploaded file or a URL API endpoint.
<a href="https://json2ps.app">![Static Badge](https://img.shields.io/badge/json2ps.app-8A2BE2?style=flat&logo=microsoftedge&link=https%3A%2F%2Fjson2ps.app)</a>

A net8.0 Blazor WebAssembly web application that converts JSON to Powershell classes. JSON can be supplied as a string, an uploaded file or a URL API endpoint.

Hosted with github pages at [json2ps.app](https://json2ps.app/)

Expand Down
21 changes: 7 additions & 14 deletions src/CodeMirror6/CodeMirror6.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -19,26 +18,20 @@
<RepositoryUrl>https://github.com/gaelj/BlazorCodeMirror6</RepositoryUrl>
<TrimUnusedDependencies>false</TrimUnusedDependencies>
</PropertyGroup>

<ItemGroup>
<SupportedPlatform Include="browser" />
<SupportedPlatform Include="browser-wasm" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.5" />
</ItemGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<Target Name="NpmInit" BeforeTargets="BeforeBuild;BeforeRebuild;Rollup">
<Target Name="NpmInit" BeforeTargets="BeforeBuild;BeforeRebuild;Rollup">
<Exec Command="cd NodeLib &amp;&amp; npm install" />
</Target>

<Target Name="Rollup" BeforeTargets="BeforeBuild;BeforeRebuild">
<Target Name="Rollup" BeforeTargets="BeforeBuild;BeforeRebuild">
<Exec Command="cd NodeLib &amp;&amp; npx rollup --config" />
</Target>

</Project>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace JsonToPowershellClass.Blazor.Extensions;

public static partial class UrlExtensions
{
[GeneratedRegex("^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$", RegexOptions.IgnoreCase | RegexOptions.Compiled, "en-GB")]
[GeneratedRegex(@"^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$", RegexOptions.IgnoreCase | RegexOptions.Compiled, "en-GB")]
private static partial Regex UrlRegex();

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,47 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<NpmLastInstall>node_modules/.last-install</NpmLastInstall>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.5" PrivateAssets="all" />
<PackageReference Include="PublishSPAforGitHubPages.Build" Version="2.0.2" />
<PackageReference Include="SoloX.BlazorJsBlob" Version="1.0.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CodeMirror6\CodeMirror6.csproj" />
<ProjectReference Include="..\JsonToPowershellClass\JsonToPowershellClass.Core.csproj" />
</ItemGroup>

<ItemGroup>
<Content Update="wwwroot\img\powershell.json.logo-1024x1024.png">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>

<Target Name="CheckForNpm" BeforeTargets="NpmInstall">
<Exec Command="npm -v" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="You must install NPM to build this project" />
</Target>

<Target Name="NpmInstall" BeforeTargets="BuildCSS" Inputs="package.json" Outputs="$(NpmLastInstall)">
<Exec Command="npm install" />
<Touch Files="$(NpmLastInstall)" AlwaysCreate="true" />
</Target>

<Target Name="BuildCSS" BeforeTargets="Compile">
<Exec Command="npm run build" Condition=" '$(Configuration)' == 'Debug' " />
<Exec Command="npm run release" Condition=" '$(Configuration)' == 'Release' " />
</Target>
</Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<NpmLastInstall>node_modules/.last-install</NpmLastInstall>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Flurl.Http" Version="4.0.0" />
<PackageReference Include="PublishSPAforGitHubPages.Build" Version="2.1.1" />
<PackageReference Include="SoloX.BlazorJsBlob" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CodeMirror6\CodeMirror6.csproj" />
<ProjectReference Include="..\JsonToPowershellClass\JsonToPowershellClass.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Content Update="wwwroot\img\powershell.json.logo-1024x1024.png">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<Target Name="CheckForNpm" BeforeTargets="NpmInstall">
<Exec Command="npm -v" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="You must install NPM to build this project" />
</Target>
<Target Name="NpmInstall" BeforeTargets="BuildCSS" Inputs="package.json" Outputs="$(NpmLastInstall)">
<Exec Command="npm install" />
<Touch Files="$(NpmLastInstall)" AlwaysCreate="true" />
</Target>
<Target Name="BuildCSS" BeforeTargets="Compile">
<Exec Command="npm run build" Condition=" '$(Configuration)' == 'Debug' " />
<Exec Command="npm run release" Condition=" '$(Configuration)' == 'Release' " />
</Target>
</Project>
2 changes: 1 addition & 1 deletion src/JsonToPowershellClass.Blazor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

builder.Services.AddTransient<IJsonClassGeneratorService, JsonClassGeneratorService>();
builder.Services.AddSingleton<BrowserService>();
Expand Down
2 changes: 1 addition & 1 deletion src/JsonToPowershellClass.Blazor/Shared/Footer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</div>
<div class="float-left mr-2">
<a href="https://robgreen.me" target="_blank">
<img src="img/transparent.white.logo.png" class="w-6 h-6"/>
<img src="img/transparent.white.logo.png" class="w-6 h-6" alt="Rob Green Engineering Ltd logo"/>
</a>
</div>
<div class="float-left mr-2">
Expand Down
Loading