Skip to content

Commit

Permalink
Rename LocalWebApp to FwLiteWeb and reword other local-web-app refere…
Browse files Browse the repository at this point in the history
…nces
  • Loading branch information
myieye committed Dec 20, 2024
1 parent 4dceaf4 commit 7050665
Show file tree
Hide file tree
Showing 43 changed files with 137 additions and 137 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/fw-lite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@ jobs:
dotnet-version: '9.x'

- name: Dotnet build
working-directory: backend/FwLite/LocalWebApp
working-directory: backend/FwLite/FwLiteWeb
run: dotnet build --configuration Release

- name: Publish OSX
working-directory: backend/FwLite/LocalWebApp
working-directory: backend/FwLite/FwLiteWeb
run: dotnet publish -r osx-x64 --artifacts-path ../artifacts -p:Version=${{ needs.build-and-test.outputs.semver-version }}

- name: Publish OSX ARM
working-directory: backend/FwLite/LocalWebApp
working-directory: backend/FwLite/FwLiteWeb
run: dotnet publish -r osx-arm64 --artifacts-path ../artifacts -p:Version=${{ needs.build-and-test.outputs.semver-version }}
#todo sign the app
- name: Upload local web app artifacts
uses: actions/upload-artifact@v4
with:
name: fw-lite-local-web-app-mac
name: fw-lite-web-mac
if-no-files-found: error
path: backend/FwLite/artifacts/publish/LocalWebApp/*
path: backend/FwLite/artifacts/publish/FwLiteWeb/*

publish-linux:
name: Publish FW Lite app for Linux
Expand All @@ -123,15 +123,15 @@ jobs:
dotnet-version: '9.x'

- name: Publish Linux
working-directory: backend/FwLite/LocalWebApp
working-directory: backend/FwLite/FwLiteWeb
run: dotnet publish -r linux-x64 --artifacts-path ../artifacts -p:PublishSingleFile=true -p:Version=${{ needs.build-and-test.outputs.semver-version }}

- name: Upload FWLite Linux artifacts
uses: actions/upload-artifact@v4
with:
name: fw-lite-local-web-app-linux
name: fw-lite-web-linux
if-no-files-found: error
path: backend/FwLite/artifacts/publish/LocalWebApp/*
path: backend/FwLite/artifacts/publish/FwLiteWeb/*

publish-android:
name: Publish FW Lite app for Android
Expand Down Expand Up @@ -254,8 +254,8 @@ jobs:
path: fw-lite-portable
- uses: actions/download-artifact@v4
with:
name: fw-lite-local-web-app-linux
path: fw-lite-local-web-app-linux
name: fw-lite-web-linux
path: fw-lite-web-linux
- uses: actions/download-artifact@v4
with:
name: fw-lite-android
Expand All @@ -264,8 +264,8 @@ jobs:
- name: Zip artifacts
run: |
zip -r fw-lite-portable.zip fw-lite-portable
chmod +x fw-lite-local-web-app-linux/*/LocalWebApp
zip -r fw-lite-local-web-app-linux.zip fw-lite-local-web-app-linux
chmod +x fw-lite-web-linux/*/FwLiteWeb
zip -r fw-lite-web-linux.zip fw-lite-web-linux
- name: Create Release
uses: softprops/action-gh-release@v2
Expand All @@ -276,7 +276,7 @@ jobs:
files: |
fw-lite-msix/*
fw-lite-portable.zip
fw-lite-local-web-app-linux.zip
fw-lite-web-linux.zip
fw-lite-android/*.apk
fw-lite-android/*.aab
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "C#: LocalWebApp Debug",
"name": "C#: FwLiteWeb Debug",
"type": "dotnet",
"request": "launch",
"projectPath": "${workspaceFolder}/backend/FwLite/LocalWebApp/LocalWebApp.csproj"
"projectPath": "${workspaceFolder}/backend/FwLite/FwLiteWeb/FwLiteWeb.csproj"
},
{
"name": "FwLite Blazor",
Expand Down
2 changes: 1 addition & 1 deletion FwLiteOnly.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"backend\\harmony\\src\\SIL.Harmony\\SIL.Harmony.csproj",
"backend\\FwLite\\LcmCrdt\\LcmCrdt.csproj",
"backend\\FwLite\\LcmCrdt.Tests\\LcmCrdt.Tests.csproj",
"backend\\FWLite\\LocalWebApp\\LocalWebApp.csproj",
"backend\\FWLite\\FwLiteWeb\\FwLiteWeb.csproj",
"backend\\FwLite\\FwLiteMaui\\FwLiteMaui.csproj",
"backend\\FwLite\\FwLiteShared\\FwLiteShared.csproj",
"backend\\FWLite\\FwDataMiniLcmBridge\\FwDataMiniLcmBridge.csproj",
Expand Down
2 changes: 1 addition & 1 deletion LexBox.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LfClassicData", "backend\Lf
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniLcm", "backend\FwLite\MiniLcm\MiniLcm.csproj", "{6D4062DC-1B1A-4A24-9C61-0F6A18A39882}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalWebApp", "backend\FwLite\LocalWebApp\LocalWebApp.csproj", "{2CDF7126-733B-46E8-9B93-7DC31DE39682}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FwLiteWeb", "backend\FwLite\FwLiteWeb\FwLiteWeb.csproj", "{2CDF7126-733B-46E8-9B93-7DC31DE39682}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LcmCrdt", "backend\FwLite\LcmCrdt\LcmCrdt.csproj", "{6B857F83-72E3-43E6-91C3-A946F3F988D8}"
EndProject
Expand Down
8 changes: 4 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ tasks:
deps: [ infra-up, api:only, k8s:infra-forward ]
interactive: true

local-web-app-for-develop:
deps: [ ui:viewer-dev, fw-lite:local-web-app-for-develop, ui:https-oauth-authority ]
web-for-develop:
deps: [ ui:viewer-dev, fw-lite:lweb-for-develop, ui:https-oauth-authority ]

local-web-app:
deps: [ ui:viewer-dev, fw-lite:local-web-app, ui:https-oauth-authority ]
web:
deps: [ ui:viewer-dev, fw-lite:web, ui:https-oauth-authority ]
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<ItemGroup>
<ProjectReference Include="..\FwDataMiniLcmBridge.Tests\FwDataMiniLcmBridge.Tests.csproj" />
<ProjectReference Include="..\FwLiteProjectSync\FwLiteProjectSync.csproj" />
<ProjectReference Include="..\LocalWebApp\LocalWebApp.csproj" />
<ProjectReference Include="..\FwLiteWeb\FwLiteWeb.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using FwLiteShared
@using LocalWebApp
@using LocalWebApp.Components
@using FwLiteWeb
@using FwLiteWeb.Components
23 changes: 23 additions & 0 deletions backend/FwLite/FwLiteWeb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["FwLiteWeb/FwLiteWeb.csproj", "FwLiteWeb/"]
RUN dotnet restore "FwLiteWeb/FwLiteWeb.csproj"
COPY . .
WORKDIR "/src/FwLiteWeb"
RUN dotnet build "FwLiteWeb.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "FwLiteWeb.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "FwLiteWeb.dll"]
File renamed without changes.
7 changes: 7 additions & 0 deletions backend/FwLite/FwLiteWeb/FwLiteWeb.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@FwLiteWeb_HostAddress = http://localhost:5173

GET {{FwLiteWeb_HostAddress}}/api/auth/login/default
Accept: application/json


###
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace LocalWebApp;
namespace FwLiteWeb;

public class LocalWebAppConfig
public class FwLiteWebConfig
{
public bool CorsAllowAny { get; init; } = false;
public bool OpenBrowser { get; init; } = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
using FwLiteShared;
using FwLiteShared.Auth;
using LcmCrdt;
using LocalWebApp.Services;
using FwLiteWeb.Services;
using Microsoft.AspNetCore.Http.Json;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Options;

namespace LocalWebApp;
namespace FwLiteWeb;

public static class LocalAppKernel
public static class FwLiteWebKernel
{
public static IServiceCollection AddLocalAppServices(this IServiceCollection services, IHostEnvironment environment)
public static IServiceCollection AddFwLiteWebServices(this IServiceCollection services, IHostEnvironment environment)
{
services.AddHttpContextAccessor();
services.AddSingleton<UrlContext>();
services.AddSingleton<IRedirectUrlProvider, ServerRedirectUrlProvider>();
services.AddFwLiteShared(environment);

services.AddOptions<LocalWebAppConfig>().BindConfiguration("LocalWebApp");
services.AddOptions<FwLiteWebConfig>().BindConfiguration("FwLiteWeb");

services.AddOptions<JsonOptions>().PostConfigure<IOptions<CrdtConfig>>((jsonOptions, crdtConfig) =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
using FwDataMiniLcmBridge.LcmUtils;
using FwLiteShared.Auth;
using LcmCrdt;
using LocalWebApp;
using LocalWebApp.Components;
using LocalWebApp.Hubs;
using LocalWebApp.Routes;
using LocalWebApp.Utils;
using FwLiteWeb;
using FwLiteWeb.Components;
using FwLiteWeb.Hubs;
using FwLiteWeb.Routes;
using FwLiteWeb.Utils;
using Microsoft.AspNetCore.SignalR;
using Microsoft.AspNetCore.StaticFiles.Infrastructure;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Options;
using NReco.Logging.File;

namespace LocalWebApp;
namespace FwLiteWeb;

public static class LocalWebAppServer
public static class FwLiteWebServer
{
public static WebApplication SetupAppServer(WebApplicationOptions options, Action<WebApplicationBuilder>? configure = null)
{
Expand All @@ -39,12 +39,12 @@ public static WebApplication SetupAppServer(WebApplicationOptions options, Actio
builder.Services.Configure<AuthConfig>(c => c.ClientId = "becf2856-0690-434b-b192-a4032b72067f");
builder.Logging.AddDebug();
builder.Services.AddRazorComponents().AddInteractiveServerComponents();
if (builder.Configuration.GetValue<string>("LocalWebApp:LogFileName") is { Length: > 0 } logFileName)
if (builder.Configuration.GetValue<string>("FwLiteWeb:LogFileName") is { Length: > 0 } logFileName)
{
builder.Logging.AddFile(logFileName);
}
builder.Services.AddCors();
builder.Services.AddLocalAppServices(builder.Environment);
builder.Services.AddFwLiteWebServices(builder.Environment);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSignalR(options =>
Expand All @@ -55,7 +55,7 @@ public static WebApplication SetupAppServer(WebApplicationOptions options, Actio

configure?.Invoke(builder);
var app = builder.Build();
app.Logger.LogInformation("FwLite LocalWebApp startup");
app.Logger.LogInformation("FwLite FwLiteWeb startup");
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
Expand All @@ -64,7 +64,7 @@ public static WebApplication SetupAppServer(WebApplicationOptions options, Actio
app.UseDirectoryBrowser();
}

if (app.Services.GetRequiredService<IOptions<LocalWebAppConfig>>().Value.CorsAllowAny)
if (app.Services.GetRequiredService<IOptions<FwLiteWebConfig>>().Value.CorsAllowAny)
{
app.UseCors(policyBuilder =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using LocalWebApp.Hubs;
using FwLiteWeb.Hubs;

namespace LocalWebApp;
namespace FwLiteWeb;

public static class HttpHelpers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
using FwLiteShared.Sync;
using LcmCrdt;
using LcmCrdt.Data;
using LocalWebApp.Services;
using FwLiteWeb.Services;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Caching.Memory;
using MiniLcm;
using MiniLcm.Models;
using SystemTextJsonPatch;

namespace LocalWebApp.Hubs;
namespace FwLiteWeb.Hubs;

public class CrdtMiniLcmApiHub(
IMiniLcmApi miniLcmApi,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using SIL.LCModel;
using SystemTextJsonPatch;

namespace LocalWebApp.Hubs;
namespace FwLiteWeb.Hubs;

public class FwDataMiniLcmHub([FromKeyedServices(FwDataBridgeKernel.FwDataApiKey)] IMiniLcmApi miniLcmApi, FwDataFactory fwDataFactory,
FwDataProjectContext context) : MiniLcmApiHubBase(miniLcmApi)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MiniLcm.Models;

namespace LocalWebApp.Hubs;
namespace FwLiteWeb.Hubs;

public interface ILexboxHubClient
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.SignalR;
using SIL.LCModel;

namespace LocalWebApp.Hubs;
namespace FwLiteWeb.Hubs;

public class LockedProjectFilter: IHubFilter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using MiniLcm.Models;
using SystemTextJsonPatch;

namespace LocalWebApp.Hubs;
namespace FwLiteWeb.Hubs;

public abstract class MiniLcmApiHubBase(IMiniLcmApi miniLcmApi) : Hub<ILexboxHubClient>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace LocalWebApp;
namespace FwLiteWeb;

public class LocalAppLauncher
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

using LocalWebApp;
using FwLiteWeb;
using Microsoft.Extensions.Options;

var app = LocalWebAppServer.SetupAppServer(new() {Args = args});
var app = FwLiteWebServer.SetupAppServer(new() {Args = args});
await using (app)
{
await app.StartAsync();
var openBrowser = app.Services.GetRequiredService<IOptions<LocalWebAppConfig>>().Value.OpenBrowser;
var openBrowser = app.Services.GetRequiredService<IOptions<FwLiteWebConfig>>().Value.OpenBrowser;

if (openBrowser)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
using SIL.Harmony.Db;
using LcmCrdt;
using LcmCrdt.Changes;
using LocalWebApp.Hubs;
using FwLiteWeb.Hubs;
using Microsoft.EntityFrameworkCore;
using Microsoft.OpenApi.Models;
using SIL.Harmony.Entities;

namespace LocalWebApp.Routes;
namespace FwLiteWeb.Routes;

public static class ActivityRoutes
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace LocalWebApp.Routes;
namespace FwLiteWeb.Routes;

public static class AuthRoutes
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Reflection;

namespace LocalWebApp.Routes;
namespace FwLiteWeb.Routes;

public static class FeedbackRoute
{
Expand Down
Loading

0 comments on commit 7050665

Please sign in to comment.