From 934500a1dbf2eea3014f15f4f756ff2ba1c36008 Mon Sep 17 00:00:00 2001 From: Pandipipas Date: Thu, 4 Jun 2026 14:51:21 +0200 Subject: [PATCH] refactor: remove loading dashboard route references from configuration and tests --- .env.example | 1 - README.md | 1 - src/main/app/paths.ts | 4 +--- src/main/config/runtime-config.ts | 2 -- src/tests/app-paths.test.ts | 1 - src/tests/application-controller.test.ts | 5 ----- src/tests/icon-path.test.ts | 1 - src/tests/process-manager.test.ts | 1 - src/tests/runtime-config.test.ts | 3 --- src/tests/update-config.test.ts | 1 - 10 files changed, 1 insertion(+), 19 deletions(-) diff --git a/.env.example b/.env.example index b8b94d2..396f40f 100644 --- a/.env.example +++ b/.env.example @@ -11,7 +11,6 @@ SCOREKO_APP_ICON_PATH=static/icons/icon.ico NODECG_BUNDLE_NAME=scoreko-dev NODECG_PORT=9090 SCOREKO_DASHBOARD_ROUTE=dashboard/scoreko-dev/main.html?standalone=true -SCOREKO_LOADING_ROUTE=dashboard/loading/main.html?standalone=true # Timing & Lifecycles (Required) ELECTRON_LOAD_DELAY_MS=10000 diff --git a/README.md b/README.md index b3bd041..e1bc51a 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,6 @@ The app ships with sensible defaults that match our development bundle: - `NODECG_BUNDLE_NAME=scoreko-dev` - `NODECG_PORT=9090` - `SCOREKO_DASHBOARD_ROUTE=dashboard/scoreko-dev/main.html?standalone=true` -- `SCOREKO_LOADING_ROUTE=dashboard/loading/main.html?standalone=true` - `SCOREKO_UPDATES_ENABLED=true` - `SCOREKO_UPDATE_ASSET_PATTERN=Scoreko-setup-.*\.exe$` diff --git a/src/main/app/paths.ts b/src/main/app/paths.ts index 9508202..a7b7cbc 100644 --- a/src/main/app/paths.ts +++ b/src/main/app/paths.ts @@ -8,7 +8,6 @@ export type ApplicationPaths = { userDataPath: string; nodecgBaseUrl: string; mainDashboardUrl: string; - loadingDashboardUrl: string; staticLoadingHtmlPath: string; staticErrorHtmlPath: string; }; @@ -64,7 +63,7 @@ export function getApplicationPaths({ }: { appConfig: Pick< AppRuntimeConfig, - "bundleName" | "loadingDashboardRoute" | "mainDashboardRoute" | "nodecgPort" | "userDataDirectoryName" + "bundleName" | "mainDashboardRoute" | "nodecgPort" | "userDataDirectoryName" >; appDataPath: string; compiledMainDir: string; @@ -79,7 +78,6 @@ export function getApplicationPaths({ userDataPath: getUserDataPath(appDataPath, appConfig.userDataDirectoryName), nodecgBaseUrl: getNodecgBaseUrl(appConfig.nodecgPort), mainDashboardUrl: getDashboardUrl(appConfig.nodecgPort, appConfig.bundleName, appConfig.mainDashboardRoute), - loadingDashboardUrl: getDashboardUrl(appConfig.nodecgPort, appConfig.bundleName, appConfig.loadingDashboardRoute), staticLoadingHtmlPath: path.join(rootPath, "static", "loading.html"), staticErrorHtmlPath: path.join(rootPath, "static", "error.html"), }; diff --git a/src/main/config/runtime-config.ts b/src/main/config/runtime-config.ts index cdb0c90..6e057de 100644 --- a/src/main/config/runtime-config.ts +++ b/src/main/config/runtime-config.ts @@ -9,7 +9,6 @@ export type AppRuntimeConfig = { nodecgPort: string; bundleName: string; mainDashboardRoute: string; - loadingDashboardRoute: string; loadDelayMs: number; startupTimeoutMs: number; nodecgKillTimeoutMs: number; @@ -59,7 +58,6 @@ export function getRuntimeConfig(): AppRuntimeConfig { nodecgPort: parseRequiredEnvPort("NODECG_PORT"), bundleName: getRequiredEnv("NODECG_BUNDLE_NAME"), mainDashboardRoute: getRequiredEnv("SCOREKO_DASHBOARD_ROUTE"), - loadingDashboardRoute: getRequiredEnv("SCOREKO_LOADING_ROUTE"), loadDelayMs: parseRequiredEnvIntInRange("ELECTRON_LOAD_DELAY_MS", 0, 600000), startupTimeoutMs: parseRequiredEnvIntInRange("NODECG_STARTUP_TIMEOUT_MS", 1000, 600000), nodecgKillTimeoutMs: parseRequiredEnvIntInRange("NODECG_KILL_TIMEOUT_MS", 0, 120000), diff --git a/src/tests/app-paths.test.ts b/src/tests/app-paths.test.ts index a0f21e8..c457ac1 100644 --- a/src/tests/app-paths.test.ts +++ b/src/tests/app-paths.test.ts @@ -37,7 +37,6 @@ test("getApplicationPaths keeps packaged root under Electron resources", () => { nodecgPort: "9090", bundleName: "scoreko-dev", mainDashboardRoute: "dashboard/scoreko-dev/main.html?standalone=true", - loadingDashboardRoute: "dashboard/loading/main.html?standalone=true", }, appDataPath: "/users/test/AppData/Roaming", compiledMainDir: "/app/dist/main", diff --git a/src/tests/application-controller.test.ts b/src/tests/application-controller.test.ts index a68998e..7adc973 100644 --- a/src/tests/application-controller.test.ts +++ b/src/tests/application-controller.test.ts @@ -57,7 +57,6 @@ function getBaseConfig(): AppRuntimeConfig { nodecgPort: "9090", bundleName: "scoreko-dev", mainDashboardRoute: "dashboard/scoreko-dev/main.html?standalone=true", - loadingDashboardRoute: "dashboard/loading/main.html?standalone=true", loadDelayMs: 0, startupTimeoutMs: 100, nodecgKillTimeoutMs: 10, @@ -90,7 +89,6 @@ test("ApplicationController preserves startup ordering and schedules updates aft userDataPath: "/user-data/scoreko", nodecgBaseUrl: "http://127.0.0.1:9090", mainDashboardUrl: "http://localhost:9090/bundles/scoreko-dev/dashboard/main.html?standalone=true", - loadingDashboardUrl: "http://localhost:9090/bundles/scoreko-dev/dashboard/loading/main.html?standalone=true", staticLoadingHtmlPath: "/app/static/loading.html", staticErrorHtmlPath: "/app/static/error.html", }; @@ -164,7 +162,6 @@ test("ApplicationController directly launches packaged app after runtime install userDataPath: "/user-data/scoreko", nodecgBaseUrl: "http://127.0.0.1:9090", mainDashboardUrl: "http://localhost:9090/main", - loadingDashboardUrl: "http://localhost:9090/loading", staticLoadingHtmlPath: "/app/static/loading.html", staticErrorHtmlPath: "/app/static/error.html", }, @@ -226,7 +223,6 @@ test("ApplicationController activation before readiness routes through launch", userDataPath: "/user-data/scoreko", nodecgBaseUrl: "http://127.0.0.1:9090", mainDashboardUrl: "http://localhost:9090/main", - loadingDashboardUrl: "http://localhost:9090/loading", staticLoadingHtmlPath: "/app/static/loading.html", staticErrorHtmlPath: "/app/static/error.html", }, @@ -268,7 +264,6 @@ test("ApplicationController shutdown is idempotent", async () => { userDataPath: "/user-data/scoreko", nodecgBaseUrl: "http://127.0.0.1:9090", mainDashboardUrl: "http://localhost:9090/main", - loadingDashboardUrl: "http://localhost:9090/loading", staticLoadingHtmlPath: "/app/static/loading.html", staticErrorHtmlPath: "/app/static/error.html", }, diff --git a/src/tests/icon-path.test.ts b/src/tests/icon-path.test.ts index dc6e8a9..1d7c19b 100644 --- a/src/tests/icon-path.test.ts +++ b/src/tests/icon-path.test.ts @@ -13,7 +13,6 @@ function getBaseConfig(): AppRuntimeConfig { nodecgPort: "9090", bundleName: "scoreko-dev", mainDashboardRoute: "dashboard/scoreko-dev/main.html?standalone=true", - loadingDashboardRoute: "dashboard/loading/main.html?standalone=true", loadDelayMs: 10000, startupTimeoutMs: 30000, nodecgKillTimeoutMs: 2500, diff --git a/src/tests/process-manager.test.ts b/src/tests/process-manager.test.ts index bbb50d7..2f6aeb1 100644 --- a/src/tests/process-manager.test.ts +++ b/src/tests/process-manager.test.ts @@ -26,7 +26,6 @@ function getBaseConfig(): AppRuntimeConfig { nodecgPort: "9090", bundleName: "scoreko-dev", mainDashboardRoute: "dashboard/scoreko-dev/main.html?standalone=true", - loadingDashboardRoute: "dashboard/loading/main.html?standalone=true", loadDelayMs: 10000, startupTimeoutMs: 100, nodecgKillTimeoutMs: 10, diff --git a/src/tests/runtime-config.test.ts b/src/tests/runtime-config.test.ts index 853580d..1772c75 100644 --- a/src/tests/runtime-config.test.ts +++ b/src/tests/runtime-config.test.ts @@ -214,7 +214,6 @@ test("getRuntimeConfig throws if required variables are missing", () => { NODECG_PORT: "9090", NODECG_BUNDLE_NAME: "scoreko-dev", SCOREKO_DASHBOARD_ROUTE: "dashboard/scoreko-dev/main.html?standalone=true", - SCOREKO_LOADING_ROUTE: "dashboard/loading/main.html?standalone=true", ELECTRON_LOAD_DELAY_MS: "10000", NODECG_STARTUP_TIMEOUT_MS: "120000", NODECG_KILL_TIMEOUT_MS: "2500", @@ -236,7 +235,6 @@ test("getRuntimeConfig parses successfully when all required variables are set", NODECG_PORT: "9191", NODECG_BUNDLE_NAME: "scoreko-dev-test", SCOREKO_DASHBOARD_ROUTE: "dashboard/scoreko-dev/test.html", - SCOREKO_LOADING_ROUTE: "dashboard/loading/test.html", ELECTRON_LOAD_DELAY_MS: "5000", NODECG_STARTUP_TIMEOUT_MS: "60000", NODECG_KILL_TIMEOUT_MS: "1500", @@ -251,7 +249,6 @@ test("getRuntimeConfig parses successfully when all required variables are set", assert.equal(config.nodecgPort, "9191"); assert.equal(config.bundleName, "scoreko-dev-test"); assert.equal(config.mainDashboardRoute, "dashboard/scoreko-dev/test.html"); - assert.equal(config.loadingDashboardRoute, "dashboard/loading/test.html"); assert.equal(config.loadDelayMs, 5000); assert.equal(config.startupTimeoutMs, 60000); assert.equal(config.nodecgKillTimeoutMs, 1500); diff --git a/src/tests/update-config.test.ts b/src/tests/update-config.test.ts index ab1751e..a7a7e66 100644 --- a/src/tests/update-config.test.ts +++ b/src/tests/update-config.test.ts @@ -11,7 +11,6 @@ const baseConfig: AppRuntimeConfig = { nodecgPort: "9090", bundleName: "scoreko-dev", mainDashboardRoute: "dashboard/scoreko-dev/main.html?standalone=true", - loadingDashboardRoute: "dashboard/loading/main.html?standalone=true", loadDelayMs: 0, startupTimeoutMs: 30000, nodecgKillTimeoutMs: 2500,