From 1bacbc8bb4bc1a4f684bdb46eebeae2c1e21c7e9 Mon Sep 17 00:00:00 2001 From: Janne Savolainen Date: Fri, 8 Jul 2022 13:30:41 +0300 Subject: [PATCH] Relocate stuff related to application update under behaviours Signed-off-by: Janne Savolainen --- .../analytics-for-installing-update.test.ts | 16 +++++++-------- .../discovered-update-version.injectable.ts | 6 +++--- .../progress-of-update-download.injectable.ts | 6 +++--- ...t-and-install-update-channel.injectable.ts | 4 ++-- .../default-update-channel.injectable.ts | 2 +- .../selected-update-channel.injectable.ts | 0 .../common}/update-channels.ts | 0 .../update-downloaded-date-time.injectable.ts | 4 ++-- .../update-is-being-downloaded.injectable.ts | 6 +++--- ...updates-are-being-discovered.injectable.ts | 6 +++--- .../downgrading-version-update.test.ts | 12 +++++------ ...g-time-since-update-was-downloaded.test.ts | 16 +++++++-------- ...alling-update-using-topbar-button.test.tsx | 14 ++++++------- .../installing-update-using-tray.test.ts | 10 +++++----- .../installing-update.test.ts | 14 ++++++------- .../check-for-platform-updates.injectable.ts | 6 +++--- .../check-for-platform-updates.test.ts | 12 +++++------ .../check-for-updates-tray-item.injectable.ts | 16 +++++++-------- ...pdates-starting-from-channel.injectable.ts | 2 +- ...process-checking-for-updates.injectable.ts | 12 +++++------ .../update-can-be-downgraded.injectable.ts | 4 ++-- .../download-platform-update.injectable.ts | 6 +++--- .../download-platform-update.test.ts | 10 +++++----- .../download-update.injectable.ts | 12 +++++------ ...current-version-to-analytics.injectable.ts | 8 ++++---- ...application-update-tray-item.injectable.ts | 8 ++++---- ...periodical-check-for-updates.injectable.ts | 4 ++-- .../start-checking-for-updates.injectable.ts | 2 +- .../stop-checking-for-updates.injectable.ts | 2 +- .../main}/publish-is-configured.injectable.ts | 2 +- .../quit-and-install-update.injectable.ts | 8 ++++---- ...-and-install-update-listener.injectable.ts | 4 ++-- ...ecking-for-updates-tray-icon.injectable.ts | 8 ++++---- ...dy-to-be-installed-tray-icon.injectable.ts | 4 ++-- ...ate-is-ready-to-be-installed.injectable.ts | 4 ++-- .../main}/updating-is-enabled.injectable.ts | 2 +- ...update-should-happen-on-quit.injectable.ts | 2 +- ...update-should-happen-on-quit.injectable.ts | 2 +- ...update-should-happen-on-quit.injectable.ts | 10 +++++----- .../periodical-checking-of-updates.test.ts | 6 +++--- ...e-modal-root-frame-component.injectable.ts | 4 ++-- .../force-update-modal.module.scss | 0 .../force-update-modal/force-update-modal.tsx | 8 ++++---- .../install-update-countdown.injectable.ts | 4 ++-- ...seconds-after-install-starts.injectable.ts | 0 ...ter-update-must-be-installed.injectable.ts | 0 ...-since-update-was-downloaded.injectable.ts | 4 ++-- .../renderer}/update-button/index.ts | 0 .../restart-and-install-update.injectable.ts | 4 ++-- .../update-button/styles.module.scss | 0 .../renderer}/update-button/update-button.tsx | 8 ++++---- .../update-warning-level.injectable.ts | 4 ++-- .../selection-of-update-stability.test.ts | 20 +++++++++---------- 53 files changed, 164 insertions(+), 164 deletions(-) rename src/{common/application-update => behaviours/application-update/common}/discovered-update-version/discovered-update-version.injectable.ts (72%) rename src/{common/application-update => behaviours/application-update/common}/progress-of-update-download/progress-of-update-download.injectable.ts (71%) rename src/{common/application-update => behaviours/application-update/common}/restart-and-install-update-channel/restart-and-install-update-channel.injectable.ts (72%) rename src/{common/application-update => behaviours/application-update/common}/selected-update-channel/default-update-channel.injectable.ts (87%) rename src/{common/application-update => behaviours/application-update/common}/selected-update-channel/selected-update-channel.injectable.ts (100%) rename src/{common/application-update => behaviours/application-update/common}/update-channels.ts (100%) rename src/{common/application-update => behaviours/application-update/common}/update-downloaded-date-time/update-downloaded-date-time.injectable.ts (74%) rename src/{common/application-update => behaviours/application-update/common}/update-is-being-downloaded/update-is-being-downloaded.injectable.ts (67%) rename src/{common/application-update => behaviours/application-update/common}/updates-are-being-discovered/updates-are-being-discovered.injectable.ts (68%) rename src/{main/application-update => behaviours/application-update/main}/check-for-platform-updates/check-for-platform-updates.injectable.ts (86%) rename src/{main/application-update => behaviours/application-update/main}/check-for-platform-updates/check-for-platform-updates.test.ts (88%) rename src/{main/application-update => behaviours/application-update/main}/check-for-updates-tray-item.injectable.ts (71%) rename src/{main/application-update => behaviours/application-update/main}/check-for-updates/check-for-updates-starting-from-channel.injectable.ts (94%) rename src/{main/application-update => behaviours/application-update/main}/check-for-updates/process-checking-for-updates.injectable.ts (76%) rename src/{main/application-update => behaviours/application-update/main}/check-for-updates/update-can-be-downgraded.injectable.ts (74%) rename src/{main/application-update => behaviours/application-update/main}/download-platform-update/download-platform-update.injectable.ts (81%) rename src/{main/application-update => behaviours/application-update/main}/download-platform-update/download-platform-update.test.ts (91%) rename src/{main/application-update => behaviours/application-update/main}/download-update/download-update.injectable.ts (67%) rename src/{main/application-update => behaviours/application-update/main}/emit-current-version-to-analytics.injectable.ts (65%) rename src/{main/application-update => behaviours/application-update/main}/install-application-update-tray-item.injectable.ts (78%) rename src/{main/application-update => behaviours/application-update/main}/periodical-check-for-updates/periodical-check-for-updates.injectable.ts (83%) rename src/{main/application-update => behaviours/application-update/main}/periodical-check-for-updates/start-checking-for-updates.injectable.ts (86%) rename src/{main/application-update => behaviours/application-update/main}/periodical-check-for-updates/stop-checking-for-updates.injectable.ts (83%) rename src/{main/application-update => behaviours/application-update/main}/publish-is-configured.injectable.ts (87%) rename src/{main/application-update => behaviours/application-update/main}/quit-and-install-update.injectable.ts (72%) rename src/{main/application-update => behaviours/application-update/main}/restart-and-install-update/restart-and-install-update-listener.injectable.ts (72%) rename src/{main/application-update => behaviours/application-update/main}/tray-icons/checking-for-updates-tray-icon.injectable.ts (64%) rename src/{main/application-update => behaviours/application-update/main}/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts (79%) rename src/{main/application-update => behaviours/application-update/main}/update-is-ready-to-be-installed.injectable.ts (71%) rename src/{main/application-update => behaviours/application-update/main}/updating-is-enabled.injectable.ts (84%) rename src/{main/application-update => behaviours/application-update/main}/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts (84%) rename src/{main/application-update => behaviours/application-update/main}/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts (84%) rename src/{main/application-update => behaviours/application-update/main}/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts (73%) rename src/{renderer/application-update => behaviours/application-update/renderer}/force-update-modal/force-update-modal-root-frame-component.injectable.ts (82%) rename src/{renderer/application-update => behaviours/application-update/renderer}/force-update-modal/force-update-modal.module.scss (100%) rename src/{renderer/application-update => behaviours/application-update/renderer}/force-update-modal/force-update-modal.tsx (85%) rename src/{renderer/application-update => behaviours/application-update/renderer}/force-update-modal/install-update-countdown.injectable.ts (79%) rename src/{renderer/application-update => behaviours/application-update/renderer}/force-update-modal/seconds-after-install-starts.injectable.ts (100%) rename src/{renderer/application-update => behaviours/application-update/renderer}/force-update-modal/time-after-update-must-be-installed.injectable.ts (100%) rename src/{renderer/application-update => behaviours/application-update/renderer}/force-update-modal/time-since-update-was-downloaded.injectable.ts (78%) rename src/{renderer/components => behaviours/application-update/renderer}/update-button/index.ts (100%) rename src/{renderer/components => behaviours/application-update/renderer}/update-button/restart-and-install-update.injectable.ts (69%) rename src/{renderer/components => behaviours/application-update/renderer}/update-button/styles.module.scss (100%) rename src/{renderer/components => behaviours/application-update/renderer}/update-button/update-button.tsx (89%) rename src/{renderer/components => behaviours/application-update/renderer}/update-button/update-warning-level.injectable.ts (82%) diff --git a/src/behaviours/application-update/analytics-for-installing-update.test.ts b/src/behaviours/application-update/analytics-for-installing-update.test.ts index e9dccb326e..556e42bf08 100644 --- a/src/behaviours/application-update/analytics-for-installing-update.test.ts +++ b/src/behaviours/application-update/analytics-for-installing-update.test.ts @@ -5,19 +5,19 @@ import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable"; -import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable"; +import publishIsConfiguredInjectable from "./main/publish-is-configured.injectable"; import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; -import type { CheckForPlatformUpdates } from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; -import checkForPlatformUpdatesInjectable from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; +import type { CheckForPlatformUpdates } from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; +import checkForPlatformUpdatesInjectable from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; import appEventBusInjectable from "../../common/app-event-bus/app-event-bus.injectable"; import type { DiContainer } from "@ogre-tools/injectable"; -import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; -import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable"; -import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable"; -import quitAndInstallUpdateInjectable from "../../main/application-update/quit-and-install-update.injectable"; +import processCheckingForUpdatesInjectable from "./main/check-for-updates/process-checking-for-updates.injectable"; +import type { DownloadPlatformUpdate } from "./main/download-platform-update/download-platform-update.injectable"; +import downloadPlatformUpdateInjectable from "./main/download-platform-update/download-platform-update.injectable"; +import quitAndInstallUpdateInjectable from "./main/quit-and-install-update.injectable"; import appVersionInjectable from "../../common/get-configuration-file-model/app-version/app-version.injectable"; -import periodicalCheckForUpdatesInjectable from "../../main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable"; +import periodicalCheckForUpdatesInjectable from "./main/periodical-check-for-updates/periodical-check-for-updates.injectable"; import { advanceFakeTime, useFakeTime } from "../../common/test-utils/use-fake-time"; describe("analytics for installing update", () => { diff --git a/src/common/application-update/discovered-update-version/discovered-update-version.injectable.ts b/src/behaviours/application-update/common/discovered-update-version/discovered-update-version.injectable.ts similarity index 72% rename from src/common/application-update/discovered-update-version/discovered-update-version.injectable.ts rename to src/behaviours/application-update/common/discovered-update-version/discovered-update-version.injectable.ts index 29e89d3ea3..1aefbb2c97 100644 --- a/src/common/application-update/discovered-update-version/discovered-update-version.injectable.ts +++ b/src/behaviours/application-update/common/discovered-update-version/discovered-update-version.injectable.ts @@ -3,10 +3,10 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import createSyncBoxInjectable from "../../utils/sync-box/create-sync-box.injectable"; +import createSyncBoxInjectable from "../../../../common/utils/sync-box/create-sync-box.injectable"; import type { UpdateChannel } from "../update-channels"; -import type { SyncBox } from "../../utils/sync-box/sync-box-injection-token"; -import { syncBoxInjectionToken } from "../../utils/sync-box/sync-box-injection-token"; +import type { SyncBox } from "../../../../common/utils/sync-box/sync-box-injection-token"; +import { syncBoxInjectionToken } from "../../../../common/utils/sync-box/sync-box-injection-token"; export type DiscoveredUpdateVersion = SyncBox<{ version: string; updateChannel: UpdateChannel } | null>; diff --git a/src/common/application-update/progress-of-update-download/progress-of-update-download.injectable.ts b/src/behaviours/application-update/common/progress-of-update-download/progress-of-update-download.injectable.ts similarity index 71% rename from src/common/application-update/progress-of-update-download/progress-of-update-download.injectable.ts rename to src/behaviours/application-update/common/progress-of-update-download/progress-of-update-download.injectable.ts index cf7b0cf7e0..ff0d5dc021 100644 --- a/src/common/application-update/progress-of-update-download/progress-of-update-download.injectable.ts +++ b/src/behaviours/application-update/common/progress-of-update-download/progress-of-update-download.injectable.ts @@ -3,9 +3,9 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import createSyncBoxInjectable from "../../utils/sync-box/create-sync-box.injectable"; -import type { SyncBox } from "../../utils/sync-box/sync-box-injection-token"; -import { syncBoxInjectionToken } from "../../utils/sync-box/sync-box-injection-token"; +import createSyncBoxInjectable from "../../../../common/utils/sync-box/create-sync-box.injectable"; +import type { SyncBox } from "../../../../common/utils/sync-box/sync-box-injection-token"; +import { syncBoxInjectionToken } from "../../../../common/utils/sync-box/sync-box-injection-token"; export interface ProgressOfDownload { percentage: number; diff --git a/src/common/application-update/restart-and-install-update-channel/restart-and-install-update-channel.injectable.ts b/src/behaviours/application-update/common/restart-and-install-update-channel/restart-and-install-update-channel.injectable.ts similarity index 72% rename from src/common/application-update/restart-and-install-update-channel/restart-and-install-update-channel.injectable.ts rename to src/behaviours/application-update/common/restart-and-install-update-channel/restart-and-install-update-channel.injectable.ts index b6d811e101..a7ac409d9f 100644 --- a/src/common/application-update/restart-and-install-update-channel/restart-and-install-update-channel.injectable.ts +++ b/src/behaviours/application-update/common/restart-and-install-update-channel/restart-and-install-update-channel.injectable.ts @@ -3,8 +3,8 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import type { MessageChannel } from "../../utils/channel/message-channel-injection-token"; -import { messageChannelInjectionToken } from "../../utils/channel/message-channel-injection-token"; +import type { MessageChannel } from "../../../../common/utils/channel/message-channel-injection-token"; +import { messageChannelInjectionToken } from "../../../../common/utils/channel/message-channel-injection-token"; export type RestartAndInstallUpdateChannel = MessageChannel; diff --git a/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts b/src/behaviours/application-update/common/selected-update-channel/default-update-channel.injectable.ts similarity index 87% rename from src/common/application-update/selected-update-channel/default-update-channel.injectable.ts rename to src/behaviours/application-update/common/selected-update-channel/default-update-channel.injectable.ts index 3d9101b672..ebc9df5679 100644 --- a/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts +++ b/src/behaviours/application-update/common/selected-update-channel/default-update-channel.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { SemVer } from "semver"; -import appVersionInjectable from "../../get-configuration-file-model/app-version/app-version.injectable"; +import appVersionInjectable from "../../../../common/get-configuration-file-model/app-version/app-version.injectable"; import type { UpdateChannelId } from "../update-channels"; import { updateChannels } from "../update-channels"; diff --git a/src/common/application-update/selected-update-channel/selected-update-channel.injectable.ts b/src/behaviours/application-update/common/selected-update-channel/selected-update-channel.injectable.ts similarity index 100% rename from src/common/application-update/selected-update-channel/selected-update-channel.injectable.ts rename to src/behaviours/application-update/common/selected-update-channel/selected-update-channel.injectable.ts diff --git a/src/common/application-update/update-channels.ts b/src/behaviours/application-update/common/update-channels.ts similarity index 100% rename from src/common/application-update/update-channels.ts rename to src/behaviours/application-update/common/update-channels.ts diff --git a/src/common/application-update/update-downloaded-date-time/update-downloaded-date-time.injectable.ts b/src/behaviours/application-update/common/update-downloaded-date-time/update-downloaded-date-time.injectable.ts similarity index 74% rename from src/common/application-update/update-downloaded-date-time/update-downloaded-date-time.injectable.ts rename to src/behaviours/application-update/common/update-downloaded-date-time/update-downloaded-date-time.injectable.ts index 32a15d310a..4caaa6654a 100644 --- a/src/common/application-update/update-downloaded-date-time/update-downloaded-date-time.injectable.ts +++ b/src/behaviours/application-update/common/update-downloaded-date-time/update-downloaded-date-time.injectable.ts @@ -3,8 +3,8 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import createSyncBoxInjectable from "../../utils/sync-box/create-sync-box.injectable"; -import { syncBoxInjectionToken } from "../../utils/sync-box/sync-box-injection-token"; +import createSyncBoxInjectable from "../../../../common/utils/sync-box/create-sync-box.injectable"; +import { syncBoxInjectionToken } from "../../../../common/utils/sync-box/sync-box-injection-token"; const updateDownloadedDateTimeInjectable = getInjectable({ id: "update-downloaded-date-time", diff --git a/src/common/application-update/update-is-being-downloaded/update-is-being-downloaded.injectable.ts b/src/behaviours/application-update/common/update-is-being-downloaded/update-is-being-downloaded.injectable.ts similarity index 67% rename from src/common/application-update/update-is-being-downloaded/update-is-being-downloaded.injectable.ts rename to src/behaviours/application-update/common/update-is-being-downloaded/update-is-being-downloaded.injectable.ts index 0eae5779ed..e10e5f5046 100644 --- a/src/common/application-update/update-is-being-downloaded/update-is-being-downloaded.injectable.ts +++ b/src/behaviours/application-update/common/update-is-being-downloaded/update-is-being-downloaded.injectable.ts @@ -3,9 +3,9 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import createSyncBoxInjectable from "../../utils/sync-box/create-sync-box.injectable"; -import type { SyncBox } from "../../utils/sync-box/sync-box-injection-token"; -import { syncBoxInjectionToken } from "../../utils/sync-box/sync-box-injection-token"; +import createSyncBoxInjectable from "../../../../common/utils/sync-box/create-sync-box.injectable"; +import type { SyncBox } from "../../../../common/utils/sync-box/sync-box-injection-token"; +import { syncBoxInjectionToken } from "../../../../common/utils/sync-box/sync-box-injection-token"; export type UpdateIsBeingDownloaded = SyncBox; diff --git a/src/common/application-update/updates-are-being-discovered/updates-are-being-discovered.injectable.ts b/src/behaviours/application-update/common/updates-are-being-discovered/updates-are-being-discovered.injectable.ts similarity index 68% rename from src/common/application-update/updates-are-being-discovered/updates-are-being-discovered.injectable.ts rename to src/behaviours/application-update/common/updates-are-being-discovered/updates-are-being-discovered.injectable.ts index 97ff920af4..d762771269 100644 --- a/src/common/application-update/updates-are-being-discovered/updates-are-being-discovered.injectable.ts +++ b/src/behaviours/application-update/common/updates-are-being-discovered/updates-are-being-discovered.injectable.ts @@ -3,9 +3,9 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import createSyncBoxInjectable from "../../utils/sync-box/create-sync-box.injectable"; -import type { SyncBox } from "../../utils/sync-box/sync-box-injection-token"; -import { syncBoxInjectionToken } from "../../utils/sync-box/sync-box-injection-token"; +import createSyncBoxInjectable from "../../../../common/utils/sync-box/create-sync-box.injectable"; +import type { SyncBox } from "../../../../common/utils/sync-box/sync-box-injection-token"; +import { syncBoxInjectionToken } from "../../../../common/utils/sync-box/sync-box-injection-token"; export type UpdatesAreBeingDiscovered = SyncBox; diff --git a/src/behaviours/application-update/downgrading-version-update.test.ts b/src/behaviours/application-update/downgrading-version-update.test.ts index 2abefa1ac8..ae19d65c12 100644 --- a/src/behaviours/application-update/downgrading-version-update.test.ts +++ b/src/behaviours/application-update/downgrading-version-update.test.ts @@ -5,16 +5,16 @@ import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable"; -import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable"; +import publishIsConfiguredInjectable from "./main/publish-is-configured.injectable"; import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; -import type { CheckForPlatformUpdates } from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; -import checkForPlatformUpdatesInjectable from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; -import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; -import selectedUpdateChannelInjectable from "../../common/application-update/selected-update-channel/selected-update-channel.injectable"; +import type { CheckForPlatformUpdates } from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; +import checkForPlatformUpdatesInjectable from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; +import processCheckingForUpdatesInjectable from "./main/check-for-updates/process-checking-for-updates.injectable"; +import selectedUpdateChannelInjectable from "./common/selected-update-channel/selected-update-channel.injectable"; import type { DiContainer } from "@ogre-tools/injectable"; import appVersionInjectable from "../../common/get-configuration-file-model/app-version/app-version.injectable"; -import { updateChannels } from "../../common/application-update/update-channels"; +import { updateChannels } from "./common/update-channels"; describe("downgrading version update", () => { let applicationBuilder: ApplicationBuilder; diff --git a/src/behaviours/application-update/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts b/src/behaviours/application-update/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts index 0a28239097..dba9df7952 100644 --- a/src/behaviours/application-update/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts +++ b/src/behaviours/application-update/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts @@ -4,20 +4,20 @@ */ import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; -import type { CheckForPlatformUpdates } from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; -import checkForPlatformUpdatesInjectable from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; -import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable"; -import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable"; +import type { CheckForPlatformUpdates } from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; +import checkForPlatformUpdatesInjectable from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; +import type { DownloadPlatformUpdate } from "./main/download-platform-update/download-platform-update.injectable"; +import downloadPlatformUpdateInjectable from "./main/download-platform-update/download-platform-update.injectable"; import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; import type { DiContainer } from "@ogre-tools/injectable"; -import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; +import processCheckingForUpdatesInjectable from "./main/check-for-updates/process-checking-for-updates.injectable"; import type { RenderResult } from "@testing-library/react"; import { fireEvent } from "@testing-library/react"; import { advanceFakeTime, useFakeTime } from "../../common/test-utils/use-fake-time"; -import quitAndInstallUpdateInjectable from "../../main/application-update/quit-and-install-update.injectable"; -import timeAfterUpdateMustBeInstalledInjectable from "../../renderer/application-update/force-update-modal/time-after-update-must-be-installed.injectable"; -import secondsAfterInstallStartsInjectable from "../../renderer/application-update/force-update-modal/seconds-after-install-starts.injectable"; +import quitAndInstallUpdateInjectable from "./main/quit-and-install-update.injectable"; +import timeAfterUpdateMustBeInstalledInjectable from "./renderer/force-update-modal/time-after-update-must-be-installed.injectable"; +import secondsAfterInstallStartsInjectable from "./renderer/force-update-modal/seconds-after-install-starts.injectable"; const TIME_AFTER_UPDATE_MUST_BE_INSTALLED = 1000; const TIME_AFTER_INSTALL_STARTS = 5 * 1000; diff --git a/src/behaviours/application-update/installing-update-using-topbar-button.test.tsx b/src/behaviours/application-update/installing-update-using-topbar-button.test.tsx index bd57a6c9da..de5daffc4d 100644 --- a/src/behaviours/application-update/installing-update-using-topbar-button.test.tsx +++ b/src/behaviours/application-update/installing-update-using-topbar-button.test.tsx @@ -6,16 +6,16 @@ import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; import type { RenderResult } from "@testing-library/react"; import { act } from "@testing-library/react"; -import type { CheckForPlatformUpdates } from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; -import checkForPlatformUpdatesInjectable from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; -import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable"; -import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable"; -import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable"; +import type { CheckForPlatformUpdates } from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; +import checkForPlatformUpdatesInjectable from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; +import type { DownloadPlatformUpdate } from "./main/download-platform-update/download-platform-update.injectable"; +import downloadPlatformUpdateInjectable from "./main/download-platform-update/download-platform-update.injectable"; +import publishIsConfiguredInjectable from "./main/publish-is-configured.injectable"; import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable"; import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; -import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; -import quitAndInstallUpdateInjectable from "../../main/application-update/quit-and-install-update.injectable"; +import processCheckingForUpdatesInjectable from "./main/check-for-updates/process-checking-for-updates.injectable"; +import quitAndInstallUpdateInjectable from "./main/quit-and-install-update.injectable"; import { advanceFakeTime, useFakeTime } from "../../common/test-utils/use-fake-time"; diff --git a/src/behaviours/application-update/installing-update-using-tray.test.ts b/src/behaviours/application-update/installing-update-using-tray.test.ts index 251cae45c8..ef486cfc2f 100644 --- a/src/behaviours/application-update/installing-update-using-tray.test.ts +++ b/src/behaviours/application-update/installing-update-using-tray.test.ts @@ -6,13 +6,13 @@ import type { ApplicationBuilder } from "../../renderer/components/test-utils/ge import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import type { RenderResult } from "@testing-library/react"; import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable"; -import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable"; -import type { CheckForPlatformUpdates } from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; -import checkForPlatformUpdatesInjectable from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; +import publishIsConfiguredInjectable from "./main/publish-is-configured.injectable"; +import type { CheckForPlatformUpdates } from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; +import checkForPlatformUpdatesInjectable from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; -import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable"; -import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable"; +import type { DownloadPlatformUpdate } from "./main/download-platform-update/download-platform-update.injectable"; +import downloadPlatformUpdateInjectable from "./main/download-platform-update/download-platform-update.injectable"; import showApplicationWindowInjectable from "../../main/start-main-application/lens-window/show-application-window.injectable"; describe("installing update using tray", () => { diff --git a/src/behaviours/application-update/installing-update.test.ts b/src/behaviours/application-update/installing-update.test.ts index 305e95d525..54383377e4 100644 --- a/src/behaviours/application-update/installing-update.test.ts +++ b/src/behaviours/application-update/installing-update.test.ts @@ -4,18 +4,18 @@ */ import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; -import quitAndInstallUpdateInjectable from "../../main/application-update/quit-and-install-update.injectable"; +import quitAndInstallUpdateInjectable from "./main/quit-and-install-update.injectable"; import type { RenderResult } from "@testing-library/react"; import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable"; -import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable"; -import type { CheckForPlatformUpdates } from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; -import checkForPlatformUpdatesInjectable from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; +import publishIsConfiguredInjectable from "./main/publish-is-configured.injectable"; +import type { CheckForPlatformUpdates } from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; +import checkForPlatformUpdatesInjectable from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; -import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable"; -import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable"; +import type { DownloadPlatformUpdate } from "./main/download-platform-update/download-platform-update.injectable"; +import downloadPlatformUpdateInjectable from "./main/download-platform-update/download-platform-update.injectable"; import setUpdateOnQuitInjectable from "../../main/electron-app/features/set-update-on-quit.injectable"; -import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; +import processCheckingForUpdatesInjectable from "./main/check-for-updates/process-checking-for-updates.injectable"; import { useFakeTime } from "../../common/test-utils/use-fake-time"; import staticFilesDirectoryInjectable from "../../common/vars/static-files-directory.injectable"; diff --git a/src/main/application-update/check-for-platform-updates/check-for-platform-updates.injectable.ts b/src/behaviours/application-update/main/check-for-platform-updates/check-for-platform-updates.injectable.ts similarity index 86% rename from src/main/application-update/check-for-platform-updates/check-for-platform-updates.injectable.ts rename to src/behaviours/application-update/main/check-for-platform-updates/check-for-platform-updates.injectable.ts index 286999c484..0e45bc6f54 100644 --- a/src/main/application-update/check-for-platform-updates/check-for-platform-updates.injectable.ts +++ b/src/behaviours/application-update/main/check-for-platform-updates/check-for-platform-updates.injectable.ts @@ -3,9 +3,9 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import electronUpdaterInjectable from "../../electron-app/features/electron-updater.injectable"; -import type { UpdateChannel } from "../../../common/application-update/update-channels"; -import loggerInjectable from "../../../common/logger.injectable"; +import electronUpdaterInjectable from "../../../../main/electron-app/features/electron-updater.injectable"; +import type { UpdateChannel } from "../../common/update-channels"; +import loggerInjectable from "../../../../common/logger.injectable"; import type { UpdateCheckResult } from "electron-updater"; export type CheckForUpdatesResult = { diff --git a/src/main/application-update/check-for-platform-updates/check-for-platform-updates.test.ts b/src/behaviours/application-update/main/check-for-platform-updates/check-for-platform-updates.test.ts similarity index 88% rename from src/main/application-update/check-for-platform-updates/check-for-platform-updates.test.ts rename to src/behaviours/application-update/main/check-for-platform-updates/check-for-platform-updates.test.ts index b826a1a5a7..a5bfb97711 100644 --- a/src/main/application-update/check-for-platform-updates/check-for-platform-updates.test.ts +++ b/src/behaviours/application-update/main/check-for-platform-updates/check-for-platform-updates.test.ts @@ -2,17 +2,17 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getDiForUnitTesting } from "../../getDiForUnitTesting"; -import electronUpdaterInjectable from "../../electron-app/features/electron-updater.injectable"; +import { getDiForUnitTesting } from "../../../../main/getDiForUnitTesting"; +import electronUpdaterInjectable from "../../../../main/electron-app/features/electron-updater.injectable"; import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; import type { AppUpdater, UpdateCheckResult } from "electron-updater"; import type { CheckForPlatformUpdates } from "./check-for-platform-updates.injectable"; import checkForPlatformUpdatesInjectable from "./check-for-platform-updates.injectable"; -import type { UpdateChannel, UpdateChannelId } from "../../../common/application-update/update-channels"; -import { getPromiseStatus } from "../../../common/test-utils/get-promise-status"; -import loggerInjectable from "../../../common/logger.injectable"; -import type { Logger } from "../../../common/logger"; +import type { UpdateChannel, UpdateChannelId } from "../../common/update-channels"; +import { getPromiseStatus } from "../../../../common/test-utils/get-promise-status"; +import loggerInjectable from "../../../../common/logger.injectable"; +import type { Logger } from "../../../../common/logger"; describe("check-for-platform-updates", () => { let checkForPlatformUpdates: CheckForPlatformUpdates; diff --git a/src/main/application-update/check-for-updates-tray-item.injectable.ts b/src/behaviours/application-update/main/check-for-updates-tray-item.injectable.ts similarity index 71% rename from src/main/application-update/check-for-updates-tray-item.injectable.ts rename to src/behaviours/application-update/main/check-for-updates-tray-item.injectable.ts index 984bfce378..d7f725637c 100644 --- a/src/main/application-update/check-for-updates-tray-item.injectable.ts +++ b/src/behaviours/application-update/main/check-for-updates-tray-item.injectable.ts @@ -5,17 +5,17 @@ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; import updatingIsEnabledInjectable from "./updating-is-enabled.injectable"; -import { trayMenuItemInjectionToken } from "../../behaviours/tray/main/tray-menu-item/tray-menu-item-injection-token"; -import showApplicationWindowInjectable from "../start-main-application/lens-window/show-application-window.injectable"; -import discoveredUpdateVersionInjectable from "../../common/application-update/discovered-update-version/discovered-update-version.injectable"; -import updateIsBeingDownloadedInjectable from "../../common/application-update/update-is-being-downloaded/update-is-being-downloaded.injectable"; -import updatesAreBeingDiscoveredInjectable from "../../common/application-update/updates-are-being-discovered/updates-are-being-discovered.injectable"; -import progressOfUpdateDownloadInjectable from "../../common/application-update/progress-of-update-download/progress-of-update-download.injectable"; +import { trayMenuItemInjectionToken } from "../../tray/main/tray-menu-item/tray-menu-item-injection-token"; +import showApplicationWindowInjectable from "../../../main/start-main-application/lens-window/show-application-window.injectable"; +import discoveredUpdateVersionInjectable from "../common/discovered-update-version/discovered-update-version.injectable"; +import updateIsBeingDownloadedInjectable from "../common/update-is-being-downloaded/update-is-being-downloaded.injectable"; +import updatesAreBeingDiscoveredInjectable from "../common/updates-are-being-discovered/updates-are-being-discovered.injectable"; +import progressOfUpdateDownloadInjectable from "../common/progress-of-update-download/progress-of-update-download.injectable"; import assert from "assert"; import processCheckingForUpdatesInjectable from "./check-for-updates/process-checking-for-updates.injectable"; -import { withErrorSuppression } from "../../common/utils/with-error-suppression/with-error-suppression"; +import { withErrorSuppression } from "../../../common/utils/with-error-suppression/with-error-suppression"; import { pipeline } from "@ogre-tools/fp"; -import withErrorLoggingInjectable from "../../common/utils/with-error-logging/with-error-logging.injectable"; +import withErrorLoggingInjectable from "../../../common/utils/with-error-logging/with-error-logging.injectable"; const checkForUpdatesTrayItemInjectable = getInjectable({ id: "check-for-updates-tray-item", diff --git a/src/main/application-update/check-for-updates/check-for-updates-starting-from-channel.injectable.ts b/src/behaviours/application-update/main/check-for-updates/check-for-updates-starting-from-channel.injectable.ts similarity index 94% rename from src/main/application-update/check-for-updates/check-for-updates-starting-from-channel.injectable.ts rename to src/behaviours/application-update/main/check-for-updates/check-for-updates-starting-from-channel.injectable.ts index caf695ff80..5214185b26 100644 --- a/src/main/application-update/check-for-updates/check-for-updates-starting-from-channel.injectable.ts +++ b/src/behaviours/application-update/main/check-for-updates/check-for-updates-starting-from-channel.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import type { UpdateChannel } from "../../../common/application-update/update-channels"; +import type { UpdateChannel } from "../../common/update-channels"; import checkForPlatformUpdatesInjectable from "../check-for-platform-updates/check-for-platform-updates.injectable"; import updateCanBeDowngradedInjectable from "./update-can-be-downgraded.injectable"; diff --git a/src/main/application-update/check-for-updates/process-checking-for-updates.injectable.ts b/src/behaviours/application-update/main/check-for-updates/process-checking-for-updates.injectable.ts similarity index 76% rename from src/main/application-update/check-for-updates/process-checking-for-updates.injectable.ts rename to src/behaviours/application-update/main/check-for-updates/process-checking-for-updates.injectable.ts index e737c67faf..7c394c081a 100644 --- a/src/main/application-update/check-for-updates/process-checking-for-updates.injectable.ts +++ b/src/behaviours/application-update/main/check-for-updates/process-checking-for-updates.injectable.ts @@ -3,15 +3,15 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import selectedUpdateChannelInjectable from "../../../common/application-update/selected-update-channel/selected-update-channel.injectable"; -import updatesAreBeingDiscoveredInjectable from "../../../common/application-update/updates-are-being-discovered/updates-are-being-discovered.injectable"; -import discoveredUpdateVersionInjectable from "../../../common/application-update/discovered-update-version/discovered-update-version.injectable"; +import selectedUpdateChannelInjectable from "../../common/selected-update-channel/selected-update-channel.injectable"; +import updatesAreBeingDiscoveredInjectable from "../../common/updates-are-being-discovered/updates-are-being-discovered.injectable"; +import discoveredUpdateVersionInjectable from "../../common/discovered-update-version/discovered-update-version.injectable"; import { runInAction } from "mobx"; import downloadUpdateInjectable from "../download-update/download-update.injectable"; import checkForUpdatesStartingFromChannelInjectable from "./check-for-updates-starting-from-channel.injectable"; -import withOrphanPromiseInjectable from "../../../common/utils/with-orphan-promise/with-orphan-promise.injectable"; -import emitEventInjectable from "../../../common/app-event-bus/emit-event.injectable"; -import { getCurrentDateTime } from "../../../common/utils/date/get-current-date-time"; +import withOrphanPromiseInjectable from "../../../../common/utils/with-orphan-promise/with-orphan-promise.injectable"; +import emitEventInjectable from "../../../../common/app-event-bus/emit-event.injectable"; +import { getCurrentDateTime } from "../../../../common/utils/date/get-current-date-time"; const processCheckingForUpdatesInjectable = getInjectable({ id: "process-checking-for-updates", diff --git a/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts b/src/behaviours/application-update/main/check-for-updates/update-can-be-downgraded.injectable.ts similarity index 74% rename from src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts rename to src/behaviours/application-update/main/check-for-updates/update-can-be-downgraded.injectable.ts index 72ea5c4023..4df4b8dc4e 100644 --- a/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts +++ b/src/behaviours/application-update/main/check-for-updates/update-can-be-downgraded.injectable.ts @@ -4,8 +4,8 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; -import selectedUpdateChannelInjectable from "../../../common/application-update/selected-update-channel/selected-update-channel.injectable"; -import appVersionInjectable from "../../../common/get-configuration-file-model/app-version/app-version.injectable"; +import selectedUpdateChannelInjectable from "../../common/selected-update-channel/selected-update-channel.injectable"; +import appVersionInjectable from "../../../../common/get-configuration-file-model/app-version/app-version.injectable"; import { SemVer } from "semver"; const updateCanBeDowngradedInjectable = getInjectable({ diff --git a/src/main/application-update/download-platform-update/download-platform-update.injectable.ts b/src/behaviours/application-update/main/download-platform-update/download-platform-update.injectable.ts similarity index 81% rename from src/main/application-update/download-platform-update/download-platform-update.injectable.ts rename to src/behaviours/application-update/main/download-platform-update/download-platform-update.injectable.ts index 374efd2caf..adbb9f192b 100644 --- a/src/main/application-update/download-platform-update/download-platform-update.injectable.ts +++ b/src/behaviours/application-update/main/download-platform-update/download-platform-update.injectable.ts @@ -3,10 +3,10 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import electronUpdaterInjectable from "../../electron-app/features/electron-updater.injectable"; -import loggerInjectable from "../../../common/logger.injectable"; +import electronUpdaterInjectable from "../../../../main/electron-app/features/electron-updater.injectable"; +import loggerInjectable from "../../../../common/logger.injectable"; import type { ProgressInfo } from "electron-updater"; -import type { ProgressOfDownload } from "../../../common/application-update/progress-of-update-download/progress-of-update-download.injectable"; +import type { ProgressOfDownload } from "../../common/progress-of-update-download/progress-of-update-download.injectable"; export type DownloadPlatformUpdate = ( onDownloadProgress: (arg: ProgressOfDownload) => void diff --git a/src/main/application-update/download-platform-update/download-platform-update.test.ts b/src/behaviours/application-update/main/download-platform-update/download-platform-update.test.ts similarity index 91% rename from src/main/application-update/download-platform-update/download-platform-update.test.ts rename to src/behaviours/application-update/main/download-platform-update/download-platform-update.test.ts index 04507be980..f15d01e2d1 100644 --- a/src/main/application-update/download-platform-update/download-platform-update.test.ts +++ b/src/behaviours/application-update/main/download-platform-update/download-platform-update.test.ts @@ -2,17 +2,17 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getDiForUnitTesting } from "../../getDiForUnitTesting"; -import electronUpdaterInjectable from "../../electron-app/features/electron-updater.injectable"; +import { getDiForUnitTesting } from "../../../../main/getDiForUnitTesting"; +import electronUpdaterInjectable from "../../../../main/electron-app/features/electron-updater.injectable"; import type { DownloadPlatformUpdate } from "./download-platform-update.injectable"; import downloadPlatformUpdateInjectable from "./download-platform-update.injectable"; import type { AppUpdater } from "electron-updater"; import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; -import { getPromiseStatus } from "../../../common/test-utils/get-promise-status"; +import { getPromiseStatus } from "../../../../common/test-utils/get-promise-status"; import type { DiContainer } from "@ogre-tools/injectable"; -import loggerInjectable from "../../../common/logger.injectable"; -import type { Logger } from "../../../common/logger"; +import loggerInjectable from "../../../../common/logger.injectable"; +import type { Logger } from "../../../../common/logger"; describe("download-platform-update", () => { let downloadPlatformUpdate: DownloadPlatformUpdate; diff --git a/src/main/application-update/download-update/download-update.injectable.ts b/src/behaviours/application-update/main/download-update/download-update.injectable.ts similarity index 67% rename from src/main/application-update/download-update/download-update.injectable.ts rename to src/behaviours/application-update/main/download-update/download-update.injectable.ts index 4def3b493a..83abb1752b 100644 --- a/src/main/application-update/download-update/download-update.injectable.ts +++ b/src/behaviours/application-update/main/download-update/download-update.injectable.ts @@ -4,13 +4,13 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import downloadPlatformUpdateInjectable from "../download-platform-update/download-platform-update.injectable"; -import updateIsBeingDownloadedInjectable from "../../../common/application-update/update-is-being-downloaded/update-is-being-downloaded.injectable"; -import discoveredUpdateVersionInjectable from "../../../common/application-update/discovered-update-version/discovered-update-version.injectable"; +import updateIsBeingDownloadedInjectable from "../../common/update-is-being-downloaded/update-is-being-downloaded.injectable"; +import discoveredUpdateVersionInjectable from "../../common/discovered-update-version/discovered-update-version.injectable"; import { action, runInAction } from "mobx"; -import type { ProgressOfDownload } from "../../../common/application-update/progress-of-update-download/progress-of-update-download.injectable"; -import progressOfUpdateDownloadInjectable from "../../../common/application-update/progress-of-update-download/progress-of-update-download.injectable"; -import { getCurrentDateTime } from "../../../common/utils/date/get-current-date-time"; -import updateDownloadedDateTimeInjectable from "../../../common/application-update/update-downloaded-date-time/update-downloaded-date-time.injectable"; +import type { ProgressOfDownload } from "../../common/progress-of-update-download/progress-of-update-download.injectable"; +import progressOfUpdateDownloadInjectable from "../../common/progress-of-update-download/progress-of-update-download.injectable"; +import { getCurrentDateTime } from "../../../../common/utils/date/get-current-date-time"; +import updateDownloadedDateTimeInjectable from "../../common/update-downloaded-date-time/update-downloaded-date-time.injectable"; const downloadUpdateInjectable = getInjectable({ id: "download-update", diff --git a/src/main/application-update/emit-current-version-to-analytics.injectable.ts b/src/behaviours/application-update/main/emit-current-version-to-analytics.injectable.ts similarity index 65% rename from src/main/application-update/emit-current-version-to-analytics.injectable.ts rename to src/behaviours/application-update/main/emit-current-version-to-analytics.injectable.ts index fd190ebf72..211a74d699 100644 --- a/src/main/application-update/emit-current-version-to-analytics.injectable.ts +++ b/src/behaviours/application-update/main/emit-current-version-to-analytics.injectable.ts @@ -3,10 +3,10 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { afterApplicationIsLoadedInjectionToken } from "../start-main-application/runnable-tokens/after-application-is-loaded-injection-token"; -import emitEventInjectable from "../../common/app-event-bus/emit-event.injectable"; -import { getCurrentDateTime } from "../../common/utils/date/get-current-date-time"; -import appVersionInjectable from "../../common/get-configuration-file-model/app-version/app-version.injectable"; +import { afterApplicationIsLoadedInjectionToken } from "../../../main/start-main-application/runnable-tokens/after-application-is-loaded-injection-token"; +import emitEventInjectable from "../../../common/app-event-bus/emit-event.injectable"; +import { getCurrentDateTime } from "../../../common/utils/date/get-current-date-time"; +import appVersionInjectable from "../../../common/get-configuration-file-model/app-version/app-version.injectable"; const emitCurrentVersionToAnalyticsInjectable = getInjectable({ id: "emit-current-version-to-analytics", diff --git a/src/main/application-update/install-application-update-tray-item.injectable.ts b/src/behaviours/application-update/main/install-application-update-tray-item.injectable.ts similarity index 78% rename from src/main/application-update/install-application-update-tray-item.injectable.ts rename to src/behaviours/application-update/main/install-application-update-tray-item.injectable.ts index e4ddb69218..5a85213324 100644 --- a/src/main/application-update/install-application-update-tray-item.injectable.ts +++ b/src/behaviours/application-update/main/install-application-update-tray-item.injectable.ts @@ -4,11 +4,11 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; -import { trayMenuItemInjectionToken } from "../../behaviours/tray/main/tray-menu-item/tray-menu-item-injection-token"; -import discoveredUpdateVersionInjectable from "../../common/application-update/discovered-update-version/discovered-update-version.injectable"; -import { withErrorSuppression } from "../../common/utils/with-error-suppression/with-error-suppression"; +import { trayMenuItemInjectionToken } from "../../tray/main/tray-menu-item/tray-menu-item-injection-token"; +import discoveredUpdateVersionInjectable from "../common/discovered-update-version/discovered-update-version.injectable"; +import { withErrorSuppression } from "../../../common/utils/with-error-suppression/with-error-suppression"; import { pipeline } from "@ogre-tools/fp"; -import withErrorLoggingInjectable from "../../common/utils/with-error-logging/with-error-logging.injectable"; +import withErrorLoggingInjectable from "../../../common/utils/with-error-logging/with-error-logging.injectable"; import quitAndInstallUpdateInjectable from "./quit-and-install-update.injectable"; import updateIsReadyToBeInstalledInjectable from "./update-is-ready-to-be-installed.injectable"; diff --git a/src/main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable.ts b/src/behaviours/application-update/main/periodical-check-for-updates/periodical-check-for-updates.injectable.ts similarity index 83% rename from src/main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable.ts rename to src/behaviours/application-update/main/periodical-check-for-updates/periodical-check-for-updates.injectable.ts index b6b5f7b852..27d18b39a0 100644 --- a/src/main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable.ts +++ b/src/behaviours/application-update/main/periodical-check-for-updates/periodical-check-for-updates.injectable.ts @@ -3,9 +3,9 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { getStartableStoppable } from "../../../common/utils/get-startable-stoppable"; +import { getStartableStoppable } from "../../../../common/utils/get-startable-stoppable"; import processCheckingForUpdatesInjectable from "../check-for-updates/process-checking-for-updates.injectable"; -import withOrphanPromiseInjectable from "../../../common/utils/with-orphan-promise/with-orphan-promise.injectable"; +import withOrphanPromiseInjectable from "../../../../common/utils/with-orphan-promise/with-orphan-promise.injectable"; const periodicalCheckForUpdatesInjectable = getInjectable({ id: "periodical-check-for-updates", diff --git a/src/main/application-update/periodical-check-for-updates/start-checking-for-updates.injectable.ts b/src/behaviours/application-update/main/periodical-check-for-updates/start-checking-for-updates.injectable.ts similarity index 86% rename from src/main/application-update/periodical-check-for-updates/start-checking-for-updates.injectable.ts rename to src/behaviours/application-update/main/periodical-check-for-updates/start-checking-for-updates.injectable.ts index 4c80e8178e..eafa1b1d06 100644 --- a/src/main/application-update/periodical-check-for-updates/start-checking-for-updates.injectable.ts +++ b/src/behaviours/application-update/main/periodical-check-for-updates/start-checking-for-updates.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable"; -import { afterRootFrameIsReadyInjectionToken } from "../../start-main-application/runnable-tokens/after-root-frame-is-ready-injection-token"; +import { afterRootFrameIsReadyInjectionToken } from "../../../../main/start-main-application/runnable-tokens/after-root-frame-is-ready-injection-token"; import updatingIsEnabledInjectable from "../updating-is-enabled.injectable"; const startCheckingForUpdatesInjectable = getInjectable({ diff --git a/src/main/application-update/periodical-check-for-updates/stop-checking-for-updates.injectable.ts b/src/behaviours/application-update/main/periodical-check-for-updates/stop-checking-for-updates.injectable.ts similarity index 83% rename from src/main/application-update/periodical-check-for-updates/stop-checking-for-updates.injectable.ts rename to src/behaviours/application-update/main/periodical-check-for-updates/stop-checking-for-updates.injectable.ts index 13aefe4d96..c5b208205c 100644 --- a/src/main/application-update/periodical-check-for-updates/stop-checking-for-updates.injectable.ts +++ b/src/behaviours/application-update/main/periodical-check-for-updates/stop-checking-for-updates.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { beforeQuitOfFrontEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-front-end-injection-token"; +import { beforeQuitOfFrontEndInjectionToken } from "../../../../main/start-main-application/runnable-tokens/before-quit-of-front-end-injection-token"; import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable"; const stopCheckingForUpdatesInjectable = getInjectable({ diff --git a/src/main/application-update/publish-is-configured.injectable.ts b/src/behaviours/application-update/main/publish-is-configured.injectable.ts similarity index 87% rename from src/main/application-update/publish-is-configured.injectable.ts rename to src/behaviours/application-update/main/publish-is-configured.injectable.ts index 321adc8a22..9d8b66ea46 100644 --- a/src/main/application-update/publish-is-configured.injectable.ts +++ b/src/behaviours/application-update/main/publish-is-configured.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import packageJsonInjectable from "../../common/vars/package-json.injectable"; +import packageJsonInjectable from "../../../common/vars/package-json.injectable"; import { has } from "lodash/fp"; // TOOO: Rename to something less technical diff --git a/src/main/application-update/quit-and-install-update.injectable.ts b/src/behaviours/application-update/main/quit-and-install-update.injectable.ts similarity index 72% rename from src/main/application-update/quit-and-install-update.injectable.ts rename to src/behaviours/application-update/main/quit-and-install-update.injectable.ts index 0ba82feac2..b82ac89206 100644 --- a/src/main/application-update/quit-and-install-update.injectable.ts +++ b/src/behaviours/application-update/main/quit-and-install-update.injectable.ts @@ -3,10 +3,10 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import electronQuitAndInstallUpdateInjectable from "../electron-app/features/electron-quit-and-install-update.injectable"; -import { getCurrentDateTime } from "../../common/utils/date/get-current-date-time"; -import emitEventInjectable from "../../common/app-event-bus/emit-event.injectable"; -import discoveredUpdateVersionInjectable from "../../common/application-update/discovered-update-version/discovered-update-version.injectable"; +import electronQuitAndInstallUpdateInjectable from "../../../main/electron-app/features/electron-quit-and-install-update.injectable"; +import { getCurrentDateTime } from "../../../common/utils/date/get-current-date-time"; +import emitEventInjectable from "../../../common/app-event-bus/emit-event.injectable"; +import discoveredUpdateVersionInjectable from "../common/discovered-update-version/discovered-update-version.injectable"; const quitAndInstallUpdateInjectable = getInjectable({ id: "quit-and-install-update", diff --git a/src/main/application-update/restart-and-install-update/restart-and-install-update-listener.injectable.ts b/src/behaviours/application-update/main/restart-and-install-update/restart-and-install-update-listener.injectable.ts similarity index 72% rename from src/main/application-update/restart-and-install-update/restart-and-install-update-listener.injectable.ts rename to src/behaviours/application-update/main/restart-and-install-update/restart-and-install-update-listener.injectable.ts index 0580114885..1df0b7433f 100644 --- a/src/main/application-update/restart-and-install-update/restart-and-install-update-listener.injectable.ts +++ b/src/behaviours/application-update/main/restart-and-install-update/restart-and-install-update-listener.injectable.ts @@ -3,8 +3,8 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import restartAndInstallUpdateChannel from "../../../common/application-update/restart-and-install-update-channel/restart-and-install-update-channel.injectable"; -import { messageChannelListenerInjectionToken } from "../../../common/utils/channel/message-channel-listener-injection-token"; +import restartAndInstallUpdateChannel from "../../common/restart-and-install-update-channel/restart-and-install-update-channel.injectable"; +import { messageChannelListenerInjectionToken } from "../../../../common/utils/channel/message-channel-listener-injection-token"; import quitAndInstallUpdateInjectable from "../quit-and-install-update.injectable"; const restartAndInstallUpdateListenerInjectable = getInjectable({ diff --git a/src/main/application-update/tray-icons/checking-for-updates-tray-icon.injectable.ts b/src/behaviours/application-update/main/tray-icons/checking-for-updates-tray-icon.injectable.ts similarity index 64% rename from src/main/application-update/tray-icons/checking-for-updates-tray-icon.injectable.ts rename to src/behaviours/application-update/main/tray-icons/checking-for-updates-tray-icon.injectable.ts index 38d9865240..db12a480c9 100644 --- a/src/main/application-update/tray-icons/checking-for-updates-tray-icon.injectable.ts +++ b/src/behaviours/application-update/main/tray-icons/checking-for-updates-tray-icon.injectable.ts @@ -4,10 +4,10 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; -import getTrayIconPathInjectable from "../../../behaviours/tray/main/menu-icon/get-tray-icon-path.injectable"; -import { trayIconInjectionToken } from "../../../behaviours/tray/main/menu-icon/tray-icon-injection-token"; -import updatesAreBeingDiscoveredInjectable from "../../../common/application-update/updates-are-being-discovered/updates-are-being-discovered.injectable"; -import updateIsBeingDownloadedInjectable from "../../../common/application-update/update-is-being-downloaded/update-is-being-downloaded.injectable"; +import getTrayIconPathInjectable from "../../../tray/main/menu-icon/get-tray-icon-path.injectable"; +import { trayIconInjectionToken } from "../../../tray/main/menu-icon/tray-icon-injection-token"; +import updatesAreBeingDiscoveredInjectable from "../../common/updates-are-being-discovered/updates-are-being-discovered.injectable"; +import updateIsBeingDownloadedInjectable from "../../common/update-is-being-downloaded/update-is-being-downloaded.injectable"; const checkingForUpdatesTrayIconInjectable = getInjectable({ id: "checking-for-updates-tray-icon", diff --git a/src/main/application-update/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts b/src/behaviours/application-update/main/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts similarity index 79% rename from src/main/application-update/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts rename to src/behaviours/application-update/main/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts index 14ac269353..d12e3a1065 100644 --- a/src/main/application-update/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts +++ b/src/behaviours/application-update/main/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts @@ -3,8 +3,8 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import getTrayIconPathInjectable from "../../../behaviours/tray/main/menu-icon/get-tray-icon-path.injectable"; -import { trayIconInjectionToken } from "../../../behaviours/tray/main/menu-icon/tray-icon-injection-token"; +import getTrayIconPathInjectable from "../../../tray/main/menu-icon/get-tray-icon-path.injectable"; +import { trayIconInjectionToken } from "../../../tray/main/menu-icon/tray-icon-injection-token"; import updateIsReadyToBeInstalledInjectable from "../update-is-ready-to-be-installed.injectable"; const updateIsReadyToBeInstalledTrayIconInjectable = getInjectable({ diff --git a/src/main/application-update/update-is-ready-to-be-installed.injectable.ts b/src/behaviours/application-update/main/update-is-ready-to-be-installed.injectable.ts similarity index 71% rename from src/main/application-update/update-is-ready-to-be-installed.injectable.ts rename to src/behaviours/application-update/main/update-is-ready-to-be-installed.injectable.ts index 157d1bbd6c..ef875f65a7 100644 --- a/src/main/application-update/update-is-ready-to-be-installed.injectable.ts +++ b/src/behaviours/application-update/main/update-is-ready-to-be-installed.injectable.ts @@ -4,8 +4,8 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; -import discoveredUpdateVersionInjectable from "../../common/application-update/discovered-update-version/discovered-update-version.injectable"; -import updateIsBeingDownloadedInjectable from "../../common/application-update/update-is-being-downloaded/update-is-being-downloaded.injectable"; +import discoveredUpdateVersionInjectable from "../common/discovered-update-version/discovered-update-version.injectable"; +import updateIsBeingDownloadedInjectable from "../common/update-is-being-downloaded/update-is-being-downloaded.injectable"; const updateIsReadyToBeInstalledInjectable = getInjectable({ id: "update-is-ready-to-be-installed", diff --git a/src/main/application-update/updating-is-enabled.injectable.ts b/src/behaviours/application-update/main/updating-is-enabled.injectable.ts similarity index 84% rename from src/main/application-update/updating-is-enabled.injectable.ts rename to src/behaviours/application-update/main/updating-is-enabled.injectable.ts index df5e264219..19b78fb603 100644 --- a/src/main/application-update/updating-is-enabled.injectable.ts +++ b/src/behaviours/application-update/main/updating-is-enabled.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import electronUpdaterIsActiveInjectable from "../electron-app/features/electron-updater-is-active.injectable"; +import electronUpdaterIsActiveInjectable from "../../../main/electron-app/features/electron-updater-is-active.injectable"; import publishIsConfiguredInjectable from "./publish-is-configured.injectable"; const updatingIsEnabledInjectable = getInjectable({ diff --git a/src/main/application-update/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts b/src/behaviours/application-update/main/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts similarity index 84% rename from src/main/application-update/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts rename to src/behaviours/application-update/main/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts index ef31cf5db5..1e68d8ac9f 100644 --- a/src/main/application-update/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts +++ b/src/behaviours/application-update/main/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token"; +import { onLoadOfApplicationInjectionToken } from "../../../../main/start-main-application/runnable-tokens/on-load-of-application-injection-token"; import watchIfUpdateShouldHappenOnQuitInjectable from "./watch-if-update-should-happen-on-quit.injectable"; const startWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({ diff --git a/src/main/application-update/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts b/src/behaviours/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts similarity index 84% rename from src/main/application-update/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts rename to src/behaviours/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts index b66cf927f2..19ab77fdbe 100644 --- a/src/main/application-update/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts +++ b/src/behaviours/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import watchIfUpdateShouldHappenOnQuitInjectable from "./watch-if-update-should-happen-on-quit.injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-back-end-injection-token"; +import { beforeQuitOfBackEndInjectionToken } from "../../../../main/start-main-application/runnable-tokens/before-quit-of-back-end-injection-token"; const stopWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({ id: "stop-watching-if-update-should-happen-on-quit", diff --git a/src/main/application-update/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts b/src/behaviours/application-update/main/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts similarity index 73% rename from src/main/application-update/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts rename to src/behaviours/application-update/main/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts index 12ec2d7c6e..1839ba83e1 100644 --- a/src/main/application-update/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts +++ b/src/behaviours/application-update/main/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts @@ -4,11 +4,11 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { autorun } from "mobx"; -import { getStartableStoppable } from "../../../common/utils/get-startable-stoppable"; -import setUpdateOnQuitInjectable from "../../electron-app/features/set-update-on-quit.injectable"; -import selectedUpdateChannelInjectable from "../../../common/application-update/selected-update-channel/selected-update-channel.injectable"; -import type { UpdateChannel } from "../../../common/application-update/update-channels"; -import discoveredUpdateVersionInjectable from "../../../common/application-update/discovered-update-version/discovered-update-version.injectable"; +import { getStartableStoppable } from "../../../../common/utils/get-startable-stoppable"; +import setUpdateOnQuitInjectable from "../../../../main/electron-app/features/set-update-on-quit.injectable"; +import selectedUpdateChannelInjectable from "../../common/selected-update-channel/selected-update-channel.injectable"; +import type { UpdateChannel } from "../../common/update-channels"; +import discoveredUpdateVersionInjectable from "../../common/discovered-update-version/discovered-update-version.injectable"; const watchIfUpdateShouldHappenOnQuitInjectable = getInjectable({ id: "watch-if-update-should-happen-on-quit", diff --git a/src/behaviours/application-update/periodical-checking-of-updates.test.ts b/src/behaviours/application-update/periodical-checking-of-updates.test.ts index 37c9d4e92b..696e78c007 100644 --- a/src/behaviours/application-update/periodical-checking-of-updates.test.ts +++ b/src/behaviours/application-update/periodical-checking-of-updates.test.ts @@ -6,11 +6,11 @@ import type { ApplicationBuilder } from "../../renderer/components/test-utils/ge import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import type { RenderResult } from "@testing-library/react"; import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable"; -import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable"; +import publishIsConfiguredInjectable from "./main/publish-is-configured.injectable"; import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; -import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; -import periodicalCheckForUpdatesInjectable from "../../main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable"; +import processCheckingForUpdatesInjectable from "./main/check-for-updates/process-checking-for-updates.injectable"; +import periodicalCheckForUpdatesInjectable from "./main/periodical-check-for-updates/periodical-check-for-updates.injectable"; import { advanceFakeTime, useFakeTime } from "../../common/test-utils/use-fake-time"; const ENOUGH_TIME = 1000 * 60 * 60 * 2; diff --git a/src/renderer/application-update/force-update-modal/force-update-modal-root-frame-component.injectable.ts b/src/behaviours/application-update/renderer/force-update-modal/force-update-modal-root-frame-component.injectable.ts similarity index 82% rename from src/renderer/application-update/force-update-modal/force-update-modal-root-frame-component.injectable.ts rename to src/behaviours/application-update/renderer/force-update-modal/force-update-modal-root-frame-component.injectable.ts index d8871b2b59..0570296f58 100644 --- a/src/renderer/application-update/force-update-modal/force-update-modal-root-frame-component.injectable.ts +++ b/src/behaviours/application-update/renderer/force-update-modal/force-update-modal-root-frame-component.injectable.ts @@ -4,10 +4,10 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; -import { rootFrameChildComponentInjectionToken } from "../../frames/root-frame/root-frame-child-component-injection-token"; +import { rootFrameChildComponentInjectionToken } from "../../../../renderer/frames/root-frame/root-frame-child-component-injection-token"; import { ForceUpdateModal } from "./force-update-modal"; import timeSinceUpdateWasDownloadedInjectable from "./time-since-update-was-downloaded.injectable"; -import updateDownloadedDateTimeInjectable from "../../../common/application-update/update-downloaded-date-time/update-downloaded-date-time.injectable"; +import updateDownloadedDateTimeInjectable from "../../common/update-downloaded-date-time/update-downloaded-date-time.injectable"; import timeAfterUpdateMustBeInstalledInjectable from "./time-after-update-must-be-installed.injectable"; const forceUpdateModalRootFrameComponentInjectable = getInjectable({ diff --git a/src/renderer/application-update/force-update-modal/force-update-modal.module.scss b/src/behaviours/application-update/renderer/force-update-modal/force-update-modal.module.scss similarity index 100% rename from src/renderer/application-update/force-update-modal/force-update-modal.module.scss rename to src/behaviours/application-update/renderer/force-update-modal/force-update-modal.module.scss diff --git a/src/renderer/application-update/force-update-modal/force-update-modal.tsx b/src/behaviours/application-update/renderer/force-update-modal/force-update-modal.tsx similarity index 85% rename from src/renderer/application-update/force-update-modal/force-update-modal.tsx rename to src/behaviours/application-update/renderer/force-update-modal/force-update-modal.tsx index 22c322be82..1665eccecd 100644 --- a/src/renderer/application-update/force-update-modal/force-update-modal.tsx +++ b/src/behaviours/application-update/renderer/force-update-modal/force-update-modal.tsx @@ -4,13 +4,13 @@ */ import { withInjectables } from "@ogre-tools/injectable-react"; import React from "react"; -import restartAndInstallUpdateInjectable from "../../components/update-button/restart-and-install-update.injectable"; -import { Countdown } from "../../components/countdown/countdown"; +import restartAndInstallUpdateInjectable from "../update-button/restart-and-install-update.injectable"; +import { Countdown } from "../../../../renderer/components/countdown/countdown"; import type { IComputedValue } from "mobx"; import { observer } from "mobx-react"; import installUpdateCountdownInjectable from "./install-update-countdown.injectable"; -import { Dialog } from "../../components/dialog"; -import { Button } from "../../components/button"; +import { Dialog } from "../../../../renderer/components/dialog"; +import { Button } from "../../../../renderer/components/button"; import styles from "./force-update-modal.module.scss"; interface Dependencies { diff --git a/src/renderer/application-update/force-update-modal/install-update-countdown.injectable.ts b/src/behaviours/application-update/renderer/force-update-modal/install-update-countdown.injectable.ts similarity index 79% rename from src/renderer/application-update/force-update-modal/install-update-countdown.injectable.ts rename to src/behaviours/application-update/renderer/force-update-modal/install-update-countdown.injectable.ts index eb1ee53371..ac67a7cb9c 100644 --- a/src/renderer/application-update/force-update-modal/install-update-countdown.injectable.ts +++ b/src/behaviours/application-update/renderer/force-update-modal/install-update-countdown.injectable.ts @@ -3,9 +3,9 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import countdownStateInjectable from "../../components/countdown/countdown-state.injectable"; +import countdownStateInjectable from "../../../../renderer/components/countdown/countdown-state.injectable"; import secondsAfterInstallStartsInjectable from "./seconds-after-install-starts.injectable"; -import restartAndInstallUpdateInjectable from "../../components/update-button/restart-and-install-update.injectable"; +import restartAndInstallUpdateInjectable from "../update-button/restart-and-install-update.injectable"; const installUpdateCountdownInjectable = getInjectable({ id: "install-update-countdown", diff --git a/src/renderer/application-update/force-update-modal/seconds-after-install-starts.injectable.ts b/src/behaviours/application-update/renderer/force-update-modal/seconds-after-install-starts.injectable.ts similarity index 100% rename from src/renderer/application-update/force-update-modal/seconds-after-install-starts.injectable.ts rename to src/behaviours/application-update/renderer/force-update-modal/seconds-after-install-starts.injectable.ts diff --git a/src/renderer/application-update/force-update-modal/time-after-update-must-be-installed.injectable.ts b/src/behaviours/application-update/renderer/force-update-modal/time-after-update-must-be-installed.injectable.ts similarity index 100% rename from src/renderer/application-update/force-update-modal/time-after-update-must-be-installed.injectable.ts rename to src/behaviours/application-update/renderer/force-update-modal/time-after-update-must-be-installed.injectable.ts diff --git a/src/renderer/application-update/force-update-modal/time-since-update-was-downloaded.injectable.ts b/src/behaviours/application-update/renderer/force-update-modal/time-since-update-was-downloaded.injectable.ts similarity index 78% rename from src/renderer/application-update/force-update-modal/time-since-update-was-downloaded.injectable.ts rename to src/behaviours/application-update/renderer/force-update-modal/time-since-update-was-downloaded.injectable.ts index e89657a72c..c961828f7f 100644 --- a/src/renderer/application-update/force-update-modal/time-since-update-was-downloaded.injectable.ts +++ b/src/behaviours/application-update/renderer/force-update-modal/time-since-update-was-downloaded.injectable.ts @@ -6,8 +6,8 @@ import { getInjectable } from "@ogre-tools/injectable"; import assert from "assert"; import { computed } from "mobx"; import moment from "moment"; -import updateDownloadedDateTimeInjectable from "../../../common/application-update/update-downloaded-date-time/update-downloaded-date-time.injectable"; -import { reactiveNow } from "../../../common/utils/reactive-now/reactive-now"; +import updateDownloadedDateTimeInjectable from "../../common/update-downloaded-date-time/update-downloaded-date-time.injectable"; +import { reactiveNow } from "../../../../common/utils/reactive-now/reactive-now"; const timeSinceUpdateWasDownloadedInjectable = getInjectable({ id: "time-since-update-was-downloaded", diff --git a/src/renderer/components/update-button/index.ts b/src/behaviours/application-update/renderer/update-button/index.ts similarity index 100% rename from src/renderer/components/update-button/index.ts rename to src/behaviours/application-update/renderer/update-button/index.ts diff --git a/src/renderer/components/update-button/restart-and-install-update.injectable.ts b/src/behaviours/application-update/renderer/update-button/restart-and-install-update.injectable.ts similarity index 69% rename from src/renderer/components/update-button/restart-and-install-update.injectable.ts rename to src/behaviours/application-update/renderer/update-button/restart-and-install-update.injectable.ts index 854e0a428f..1149c01003 100644 --- a/src/renderer/components/update-button/restart-and-install-update.injectable.ts +++ b/src/behaviours/application-update/renderer/update-button/restart-and-install-update.injectable.ts @@ -3,8 +3,8 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import restartAndInstallUpdateChannel from "../../../common/application-update/restart-and-install-update-channel/restart-and-install-update-channel.injectable"; -import messageToChannelInjectable from "../../utils/channel/message-to-channel.injectable"; +import restartAndInstallUpdateChannel from "../../common/restart-and-install-update-channel/restart-and-install-update-channel.injectable"; +import messageToChannelInjectable from "../../../../renderer/utils/channel/message-to-channel.injectable"; const restartAndInstallUpdateInjectable = getInjectable({ id: "restart-and-install-update", diff --git a/src/renderer/components/update-button/styles.module.scss b/src/behaviours/application-update/renderer/update-button/styles.module.scss similarity index 100% rename from src/renderer/components/update-button/styles.module.scss rename to src/behaviours/application-update/renderer/update-button/styles.module.scss diff --git a/src/renderer/components/update-button/update-button.tsx b/src/behaviours/application-update/renderer/update-button/update-button.tsx similarity index 89% rename from src/renderer/components/update-button/update-button.tsx rename to src/behaviours/application-update/renderer/update-button/update-button.tsx index 029b58f3fe..626ea69836 100644 --- a/src/renderer/components/update-button/update-button.tsx +++ b/src/behaviours/application-update/renderer/update-button/update-button.tsx @@ -7,10 +7,10 @@ import styles from "./styles.module.scss"; import type { HTMLAttributes } from "react"; import React, { useState } from "react"; -import { Menu, MenuItem } from "../menu"; -import { cssNames } from "../../utils"; -import type { IconProps } from "../icon"; -import { Icon } from "../icon"; +import { Menu, MenuItem } from "../../../../renderer/components/menu"; +import { cssNames } from "../../../../renderer/utils"; +import type { IconProps } from "../../../../renderer/components/icon"; +import { Icon } from "../../../../renderer/components/icon"; import { withInjectables } from "@ogre-tools/injectable-react"; import { observer } from "mobx-react"; import type { IComputedValue } from "mobx"; diff --git a/src/renderer/components/update-button/update-warning-level.injectable.ts b/src/behaviours/application-update/renderer/update-button/update-warning-level.injectable.ts similarity index 82% rename from src/renderer/components/update-button/update-warning-level.injectable.ts rename to src/behaviours/application-update/renderer/update-button/update-warning-level.injectable.ts index cc963ab27d..8a1614f492 100644 --- a/src/renderer/components/update-button/update-warning-level.injectable.ts +++ b/src/behaviours/application-update/renderer/update-button/update-warning-level.injectable.ts @@ -4,8 +4,8 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; -import updateDownloadedDateTimeInjectable from "../../../common/application-update/update-downloaded-date-time/update-downloaded-date-time.injectable"; -import { reactiveNow } from "../../../common/utils/reactive-now/reactive-now"; +import updateDownloadedDateTimeInjectable from "../../common/update-downloaded-date-time/update-downloaded-date-time.injectable"; +import { reactiveNow } from "../../../../common/utils/reactive-now/reactive-now"; const updateWarningLevelInjectable = getInjectable({ id: "update-warning-level", diff --git a/src/behaviours/application-update/selection-of-update-stability.test.ts b/src/behaviours/application-update/selection-of-update-stability.test.ts index c934e7fc43..f2ea9bf922 100644 --- a/src/behaviours/application-update/selection-of-update-stability.test.ts +++ b/src/behaviours/application-update/selection-of-update-stability.test.ts @@ -4,23 +4,23 @@ */ import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; -import quitAndInstallUpdateInjectable from "../../main/application-update/quit-and-install-update.injectable"; +import quitAndInstallUpdateInjectable from "./main/quit-and-install-update.injectable"; import type { RenderResult } from "@testing-library/react"; import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable"; -import publishIsConfiguredInjectable from "../../main/application-update/publish-is-configured.injectable"; -import type { CheckForPlatformUpdates } from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; -import checkForPlatformUpdatesInjectable from "../../main/application-update/check-for-platform-updates/check-for-platform-updates.injectable"; +import publishIsConfiguredInjectable from "./main/publish-is-configured.injectable"; +import type { CheckForPlatformUpdates } from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; +import checkForPlatformUpdatesInjectable from "./main/check-for-platform-updates/check-for-platform-updates.injectable"; import type { AsyncFnMock } from "@async-fn/jest"; import asyncFn from "@async-fn/jest"; -import type { UpdateChannel, UpdateChannelId } from "../../common/application-update/update-channels"; -import { updateChannels } from "../../common/application-update/update-channels"; -import type { DownloadPlatformUpdate } from "../../main/application-update/download-platform-update/download-platform-update.injectable"; -import downloadPlatformUpdateInjectable from "../../main/application-update/download-platform-update/download-platform-update.injectable"; -import selectedUpdateChannelInjectable from "../../common/application-update/selected-update-channel/selected-update-channel.injectable"; +import type { UpdateChannel, UpdateChannelId } from "./common/update-channels"; +import { updateChannels } from "./common/update-channels"; +import type { DownloadPlatformUpdate } from "./main/download-platform-update/download-platform-update.injectable"; +import downloadPlatformUpdateInjectable from "./main/download-platform-update/download-platform-update.injectable"; +import selectedUpdateChannelInjectable from "./common/selected-update-channel/selected-update-channel.injectable"; import type { IComputedValue } from "mobx"; import setUpdateOnQuitInjectable from "../../main/electron-app/features/set-update-on-quit.injectable"; import showInfoNotificationInjectable from "../../renderer/components/notifications/show-info-notification.injectable"; -import processCheckingForUpdatesInjectable from "../../main/application-update/check-for-updates/process-checking-for-updates.injectable"; +import processCheckingForUpdatesInjectable from "./main/check-for-updates/process-checking-for-updates.injectable"; import appVersionInjectable from "../../common/get-configuration-file-model/app-version/app-version.injectable"; describe("selection of update stability", () => {