From 97e04632ca245cb9cfe0730e8b8b2f901be0f775 Mon Sep 17 00:00:00 2001 From: Iku-turso Date: Mon, 15 Aug 2022 10:05:38 +0300 Subject: [PATCH] Move some code for application update to feature directory The rest of the code could not be moved yet because of work-in-progress refactorings for OCP compliance. Co-authored-by: Janne Savolainen Signed-off-by: Iku-turso --- .../user-store/user-store.injectable.ts | 2 +- src/common/user-store/user-store.ts | 4 ++-- .../analytics-for-installing-update.test.ts | 16 +++++++-------- .../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 ++-- ...ecking-for-updates-tray-icon.injectable.ts | 8 ++++---- ...dy-to-be-installed-tray-icon.injectable.ts | 6 +++--- .../check-for-updates-tray-item.injectable.ts | 20 +++++++++---------- ...application-update-tray-item.injectable.ts | 12 +++++------ .../discovered-update-version.injectable.ts | 6 +++--- .../progress-of-update-download.injectable.ts | 6 +++--- .../restart-and-install-update-channel.ts | 0 .../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 | 18 ++++++++--------- ...alling-update-using-topbar-button.test.tsx | 14 ++++++------- .../installing-update-using-tray.test.ts | 6 +++--- .../installing-update.test.ts | 14 ++++++------- .../check-for-platform-updates.injectable.ts | 6 +++--- .../check-for-platform-updates.test.ts | 12 +++++------ ...pdates-starting-from-channel.injectable.ts | 2 +- ...process-checking-for-updates.injectable.ts | 10 +++++----- .../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 ++++---- ...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 ++-- ...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 ++-- .../selection-of-update-stability.test.ts | 20 +++++++++---------- src/main/getDiForUnitTesting.ts | 8 ++++---- .../menu/application-menu-items.injectable.ts | 4 ++-- .../components/+preferences/application.tsx | 6 +++--- .../components/layout/top-bar/top-bar.tsx | 2 +- src/renderer/getDiForUnitTesting.tsx | 2 +- 60 files changed, 179 insertions(+), 179 deletions(-) rename src/{renderer/components => features/application-update/child-features/application-update-using-top-bar/renderer}/update-button/index.ts (100%) rename src/{renderer/components => features/application-update/child-features/application-update-using-top-bar/renderer}/update-button/restart-and-install-update.injectable.ts (71%) rename src/{renderer/components => features/application-update/child-features/application-update-using-top-bar/renderer}/update-button/styles.module.scss (100%) rename src/{renderer/components => features/application-update/child-features/application-update-using-top-bar/renderer}/update-button/update-button.tsx (88%) rename src/{renderer/components => features/application-update/child-features/application-update-using-top-bar/renderer}/update-button/update-warning-level.injectable.ts (82%) rename src/{main/application-update => features/application-update/child-features/application-update-using-tray/main}/tray-icons/checking-for-updates-tray-icon.injectable.ts (66%) rename src/{main/application-update => features/application-update/child-features/application-update-using-tray/main}/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts (69%) rename src/{main/application-update => features/application-update/child-features/application-update-using-tray/main/tray-items}/check-for-updates-tray-item.injectable.ts (66%) rename src/{main/application-update => features/application-update/child-features/application-update-using-tray/main/tray-items}/install-application-update-tray-item.injectable.ts (68%) rename src/{common/application-update => features/application-update/common}/discovered-update-version/discovered-update-version.injectable.ts (72%) rename src/{common/application-update => features/application-update/common}/progress-of-update-download/progress-of-update-download.injectable.ts (71%) rename src/{common/application-update => features/application-update/common}/restart-and-install-update-channel.ts (100%) rename src/{common/application-update => features/application-update/common}/selected-update-channel/default-update-channel.injectable.ts (84%) rename src/{common/application-update => features/application-update/common}/selected-update-channel/selected-update-channel.injectable.ts (100%) rename src/{common/application-update => features/application-update/common}/update-channels.ts (100%) rename src/{common/application-update => features/application-update/common}/update-downloaded-date-time/update-downloaded-date-time.injectable.ts (74%) rename src/{common/application-update => features/application-update/common}/update-is-being-downloaded/update-is-being-downloaded.injectable.ts (67%) rename src/{common/application-update => features/application-update/common}/updates-are-being-discovered/updates-are-being-discovered.injectable.ts (68%) rename src/{main/application-update => features/application-update/main}/check-for-platform-updates/check-for-platform-updates.injectable.ts (86%) rename src/{main/application-update => features/application-update/main}/check-for-platform-updates/check-for-platform-updates.test.ts (88%) rename src/{main/application-update => features/application-update/main}/check-for-updates/check-for-updates-starting-from-channel.injectable.ts (94%) rename src/{main/application-update => features/application-update/main}/check-for-updates/process-checking-for-updates.injectable.ts (80%) rename src/{main/application-update => features/application-update/main}/check-for-updates/update-can-be-downgraded.injectable.ts (75%) rename src/{main/application-update => features/application-update/main}/download-platform-update/download-platform-update.injectable.ts (81%) rename src/{main/application-update => features/application-update/main}/download-platform-update/download-platform-update.test.ts (91%) rename src/{main/application-update => features/application-update/main}/download-update/download-update.injectable.ts (67%) rename src/{main/application-update => features/application-update/main}/emit-current-version-to-analytics.injectable.ts (67%) rename src/{main/application-update => features/application-update/main}/periodical-check-for-updates/periodical-check-for-updates.injectable.ts (83%) rename src/{main/application-update => features/application-update/main}/periodical-check-for-updates/start-checking-for-updates.injectable.ts (86%) rename src/{main/application-update => features/application-update/main}/periodical-check-for-updates/stop-checking-for-updates.injectable.ts (84%) rename src/{main/application-update => features/application-update/main}/publish-is-configured.injectable.ts (80%) rename src/{main/application-update => features/application-update/main}/quit-and-install-update.injectable.ts (72%) rename src/{main/application-update => features/application-update/main}/restart-and-install-update/restart-and-install-update-listener.injectable.ts (67%) rename src/{main/application-update => features/application-update/main}/update-is-ready-to-be-installed.injectable.ts (71%) rename src/{main/application-update => features/application-update/main}/updating-is-enabled.injectable.ts (84%) rename src/{main/application-update => features/application-update/main}/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts (85%) rename src/{main/application-update => features/application-update/main}/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts (85%) rename src/{main/application-update => features/application-update/main}/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts (72%) rename src/{renderer/application-update => features/application-update/renderer}/force-update-modal/force-update-modal-root-frame-component.injectable.ts (83%) rename src/{renderer/application-update => features/application-update/renderer}/force-update-modal/force-update-modal.module.scss (100%) rename src/{renderer/application-update => features/application-update/renderer}/force-update-modal/force-update-modal.tsx (83%) rename src/{renderer/application-update => features/application-update/renderer}/force-update-modal/install-update-countdown.injectable.ts (74%) rename src/{renderer/application-update => features/application-update/renderer}/force-update-modal/seconds-after-install-starts.injectable.ts (100%) rename src/{renderer/application-update => features/application-update/renderer}/force-update-modal/time-after-update-must-be-installed.injectable.ts (100%) rename src/{renderer/application-update => features/application-update/renderer}/force-update-modal/time-since-update-was-downloaded.injectable.ts (78%) diff --git a/src/common/user-store/user-store.injectable.ts b/src/common/user-store/user-store.injectable.ts index ffd2310886..5b59a47df3 100644 --- a/src/common/user-store/user-store.injectable.ts +++ b/src/common/user-store/user-store.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { UserStore } from "./user-store"; -import selectedUpdateChannelInjectable from "../application-update/selected-update-channel/selected-update-channel.injectable"; +import selectedUpdateChannelInjectable from "../../features/application-update/common/selected-update-channel/selected-update-channel.injectable"; const userStoreInjectable = getInjectable({ id: "user-store", diff --git a/src/common/user-store/user-store.ts b/src/common/user-store/user-store.ts index 8a8ff6735c..08d053aa98 100644 --- a/src/common/user-store/user-store.ts +++ b/src/common/user-store/user-store.ts @@ -11,8 +11,8 @@ import { getOrInsertSet, toggle, toJS, object } from "../../renderer/utils"; import { DESCRIPTORS } from "./preferences-helpers"; import type { UserPreferencesModel, StoreType } from "./preferences-helpers"; import logger from "../../main/logger"; -import type { SelectedUpdateChannel } from "../application-update/selected-update-channel/selected-update-channel.injectable"; -import type { ReleaseChannel } from "../application-update/update-channels"; +import type { SelectedUpdateChannel } from "../../features/application-update/common/selected-update-channel/selected-update-channel.injectable"; +import type { ReleaseChannel } from "../../features/application-update/common/update-channels"; export interface UserStoreModel { lastSeenAppVersion: string; diff --git a/src/features/application-update/analytics-for-installing-update.test.ts b/src/features/application-update/analytics-for-installing-update.test.ts index 625022b040..6600248517 100644 --- a/src/features/application-update/analytics-for-installing-update.test.ts +++ b/src/features/application-update/analytics-for-installing-update.test.ts @@ -5,18 +5,18 @@ 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 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 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 periodicalCheckForUpdatesInjectable from "./main/periodical-check-for-updates/periodical-check-for-updates.injectable"; import { advanceFakeTime, useFakeTime } from "../../common/test-utils/use-fake-time"; import emitEventInjectable from "../../common/app-event-bus/emit-event.injectable"; import getBuildVersionInjectable from "../../main/vars/build-version/get-build-version.injectable"; diff --git a/src/renderer/components/update-button/index.ts b/src/features/application-update/child-features/application-update-using-top-bar/renderer/update-button/index.ts similarity index 100% rename from src/renderer/components/update-button/index.ts rename to src/features/application-update/child-features/application-update-using-top-bar/renderer/update-button/index.ts diff --git a/src/renderer/components/update-button/restart-and-install-update.injectable.ts b/src/features/application-update/child-features/application-update-using-top-bar/renderer/update-button/restart-and-install-update.injectable.ts similarity index 71% rename from src/renderer/components/update-button/restart-and-install-update.injectable.ts rename to src/features/application-update/child-features/application-update-using-top-bar/renderer/update-button/restart-and-install-update.injectable.ts index 83fb3d72a3..4f6939b6d4 100644 --- a/src/renderer/components/update-button/restart-and-install-update.injectable.ts +++ b/src/features/application-update/child-features/application-update-using-top-bar/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"; -import messageToChannelInjectable from "../../utils/channel/message-to-channel.injectable"; +import { restartAndInstallUpdateChannel } from "../../../../common/restart-and-install-update-channel"; +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/features/application-update/child-features/application-update-using-top-bar/renderer/update-button/styles.module.scss similarity index 100% rename from src/renderer/components/update-button/styles.module.scss rename to src/features/application-update/child-features/application-update-using-top-bar/renderer/update-button/styles.module.scss diff --git a/src/renderer/components/update-button/update-button.tsx b/src/features/application-update/child-features/application-update-using-top-bar/renderer/update-button/update-button.tsx similarity index 88% rename from src/renderer/components/update-button/update-button.tsx rename to src/features/application-update/child-features/application-update-using-top-bar/renderer/update-button/update-button.tsx index 029b58f3fe..12556b6a84 100644 --- a/src/renderer/components/update-button/update-button.tsx +++ b/src/features/application-update/child-features/application-update-using-top-bar/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/features/application-update/child-features/application-update-using-top-bar/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/features/application-update/child-features/application-update-using-top-bar/renderer/update-button/update-warning-level.injectable.ts index cc963ab27d..b6890a206d 100644 --- a/src/renderer/components/update-button/update-warning-level.injectable.ts +++ b/src/features/application-update/child-features/application-update-using-top-bar/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/main/application-update/tray-icons/checking-for-updates-tray-icon.injectable.ts b/src/features/application-update/child-features/application-update-using-tray/main/tray-icons/checking-for-updates-tray-icon.injectable.ts similarity index 66% rename from src/main/application-update/tray-icons/checking-for-updates-tray-icon.injectable.ts rename to src/features/application-update/child-features/application-update-using-tray/main/tray-icons/checking-for-updates-tray-icon.injectable.ts index 5d22c98bba..c955199c21 100644 --- a/src/main/application-update/tray-icons/checking-for-updates-tray-icon.injectable.ts +++ b/src/features/application-update/child-features/application-update-using-tray/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 "../../tray/menu-icon/get-tray-icon-path.injectable"; -import { trayIconInjectionToken } from "../../tray/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 "../../../../../../main/tray/menu-icon/get-tray-icon-path.injectable"; +import { trayIconInjectionToken } from "../../../../../../main/tray/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/features/application-update/child-features/application-update-using-tray/main/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts similarity index 69% rename from src/main/application-update/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts rename to src/features/application-update/child-features/application-update-using-tray/main/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts index 7f097c0cbb..ebbb8c449a 100644 --- a/src/main/application-update/tray-icons/update-is-ready-to-be-installed-tray-icon.injectable.ts +++ b/src/features/application-update/child-features/application-update-using-tray/main/tray-icons/update-is-ready-to-be-installed-tray-icon.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 getTrayIconPathInjectable from "../../tray/menu-icon/get-tray-icon-path.injectable"; -import { trayIconInjectionToken } from "../../tray/menu-icon/tray-icon-injection-token"; -import updateIsReadyToBeInstalledInjectable from "../update-is-ready-to-be-installed.injectable"; +import getTrayIconPathInjectable from "../../../../../../main/tray/menu-icon/get-tray-icon-path.injectable"; +import { trayIconInjectionToken } from "../../../../../../main/tray/menu-icon/tray-icon-injection-token"; +import updateIsReadyToBeInstalledInjectable from "../../../../main/update-is-ready-to-be-installed.injectable"; const updateIsReadyToBeInstalledTrayIconInjectable = getInjectable({ id: "update-is-ready-to-be-installed-tray-icon", diff --git a/src/main/application-update/check-for-updates-tray-item.injectable.ts b/src/features/application-update/child-features/application-update-using-tray/main/tray-items/check-for-updates-tray-item.injectable.ts similarity index 66% rename from src/main/application-update/check-for-updates-tray-item.injectable.ts rename to src/features/application-update/child-features/application-update-using-tray/main/tray-items/check-for-updates-tray-item.injectable.ts index 82bdbfbbd4..22c9a85741 100644 --- a/src/main/application-update/check-for-updates-tray-item.injectable.ts +++ b/src/features/application-update/child-features/application-update-using-tray/main/tray-items/check-for-updates-tray-item.injectable.ts @@ -4,18 +4,18 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; -import updatingIsEnabledInjectable from "./updating-is-enabled.injectable"; -import { trayMenuItemInjectionToken } from "../tray/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 updatingIsEnabledInjectable from "../../../../main/updating-is-enabled.injectable"; +import { trayMenuItemInjectionToken } from "../../../../../../main/tray/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 processCheckingForUpdatesInjectable from "../../../../main/check-for-updates/process-checking-for-updates.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"; const checkForUpdatesTrayItemInjectable = getInjectable({ id: "check-for-updates-tray-item", diff --git a/src/main/application-update/install-application-update-tray-item.injectable.ts b/src/features/application-update/child-features/application-update-using-tray/main/tray-items/install-application-update-tray-item.injectable.ts similarity index 68% rename from src/main/application-update/install-application-update-tray-item.injectable.ts rename to src/features/application-update/child-features/application-update-using-tray/main/tray-items/install-application-update-tray-item.injectable.ts index ba71d5cfe7..fb8042b74b 100644 --- a/src/main/application-update/install-application-update-tray-item.injectable.ts +++ b/src/features/application-update/child-features/application-update-using-tray/main/tray-items/install-application-update-tray-item.injectable.ts @@ -4,13 +4,13 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import { computed } from "mobx"; -import { trayMenuItemInjectionToken } from "../tray/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 "../../../../../../main/tray/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 quitAndInstallUpdateInjectable from "./quit-and-install-update.injectable"; -import updateIsReadyToBeInstalledInjectable from "./update-is-ready-to-be-installed.injectable"; +import withErrorLoggingInjectable from "../../../../../../common/utils/with-error-logging/with-error-logging.injectable"; +import quitAndInstallUpdateInjectable from "../../../../main/quit-and-install-update.injectable"; +import updateIsReadyToBeInstalledInjectable from "../../../../main/update-is-ready-to-be-installed.injectable"; const installApplicationUpdateTrayItemInjectable = getInjectable({ id: "install-update-tray-item", diff --git a/src/common/application-update/discovered-update-version/discovered-update-version.injectable.ts b/src/features/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/features/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/features/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/features/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/features/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/features/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.ts b/src/features/application-update/common/restart-and-install-update-channel.ts similarity index 100% rename from src/common/application-update/restart-and-install-update-channel.ts rename to src/features/application-update/common/restart-and-install-update-channel.ts diff --git a/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts b/src/features/application-update/common/selected-update-channel/default-update-channel.injectable.ts similarity index 84% rename from src/common/application-update/selected-update-channel/default-update-channel.injectable.ts rename to src/features/application-update/common/selected-update-channel/default-update-channel.injectable.ts index 9c00efa204..c994b8ee62 100644 --- a/src/common/application-update/selected-update-channel/default-update-channel.injectable.ts +++ b/src/features/application-update/common/selected-update-channel/default-update-channel.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { createInitializableState } from "../../initializable-state/create"; -import releaseChannelInjectable from "../../vars/release-channel.injectable"; +import releaseChannelInjectable from "../../../../common/vars/release-channel.injectable"; import { updateChannels } from "../update-channels"; const defaultUpdateChannelInjectable = createInitializableState({ diff --git a/src/common/application-update/selected-update-channel/selected-update-channel.injectable.ts b/src/features/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/features/application-update/common/selected-update-channel/selected-update-channel.injectable.ts diff --git a/src/common/application-update/update-channels.ts b/src/features/application-update/common/update-channels.ts similarity index 100% rename from src/common/application-update/update-channels.ts rename to src/features/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/features/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/features/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/features/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/features/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/features/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/features/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/features/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/features/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/features/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/features/application-update/downgrading-version-update.test.ts b/src/features/application-update/downgrading-version-update.test.ts index 8f56ebd15c..761c99ff4c 100644 --- a/src/features/application-update/downgrading-version-update.test.ts +++ b/src/features/application-update/downgrading-version-update.test.ts @@ -5,15 +5,15 @@ 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 { updateChannels } from "../../common/application-update/update-channels"; +import { updateChannels } from "./common/update-channels"; import getBuildVersionInjectable from "../../main/vars/build-version/get-build-version.injectable"; describe("downgrading version update", () => { diff --git a/src/features/application-update/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts b/src/features/application-update/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts index ba8380e7b5..f7e13d5b91 100644 --- a/src/features/application-update/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts +++ b/src/features/application-update/force-user-to-update-when-too-long-time-since-update-was-downloaded.test.ts @@ -4,21 +4,21 @@ */ 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 forceUpdateModalRootFrameComponentInjectable from "../../renderer/application-update/force-update-modal/force-update-modal-root-frame-component.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"; +import forceUpdateModalRootFrameComponentInjectable from "./renderer/force-update-modal/force-update-modal-root-frame-component.injectable"; const TIME_AFTER_UPDATE_MUST_BE_INSTALLED = 1000; const TIME_AFTER_INSTALL_STARTS = 5 * 1000; diff --git a/src/features/application-update/installing-update-using-topbar-button.test.tsx b/src/features/application-update/installing-update-using-topbar-button.test.tsx index 5e5500498b..935c3b4899 100644 --- a/src/features/application-update/installing-update-using-topbar-button.test.tsx +++ b/src/features/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"; function daysToMilliseconds(days: number) { diff --git a/src/features/application-update/installing-update-using-tray.test.ts b/src/features/application-update/installing-update-using-tray.test.ts index 9bcb140638..b5dbf3b902 100644 --- a/src/features/application-update/installing-update-using-tray.test.ts +++ b/src/features/application-update/installing-update-using-tray.test.ts @@ -6,9 +6,9 @@ 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"; diff --git a/src/features/application-update/installing-update.test.ts b/src/features/application-update/installing-update.test.ts index 973095d72d..0bfb82fdcd 100644 --- a/src/features/application-update/installing-update.test.ts +++ b/src/features/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/features/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/features/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/features/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/features/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/features/application-update/main/check-for-platform-updates/check-for-platform-updates.test.ts index 17e750c52e..6a10fadcdf 100644 --- a/src/main/application-update/check-for-platform-updates/check-for-platform-updates.test.ts +++ b/src/features/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, ReleaseChannel } 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, ReleaseChannel } 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/check-for-updates-starting-from-channel.injectable.ts b/src/features/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/features/application-update/main/check-for-updates/check-for-updates-starting-from-channel.injectable.ts index 0381c883a6..5020039424 100644 --- a/src/main/application-update/check-for-updates/check-for-updates-starting-from-channel.injectable.ts +++ b/src/features/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/features/application-update/main/check-for-updates/process-checking-for-updates.injectable.ts similarity index 80% rename from src/main/application-update/check-for-updates/process-checking-for-updates.injectable.ts rename to src/features/application-update/main/check-for-updates/process-checking-for-updates.injectable.ts index b669c6a2ea..1422af6946 100644 --- a/src/main/application-update/check-for-updates/process-checking-for-updates.injectable.ts +++ b/src/features/application-update/main/check-for-updates/process-checking-for-updates.injectable.ts @@ -3,14 +3,14 @@ * 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 emitEventInjectable from "../../../common/app-event-bus/emit-event.injectable"; -import { getCurrentDateTime } from "../../../common/utils/date/get-current-date-time"; +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/features/application-update/main/check-for-updates/update-can-be-downgraded.injectable.ts similarity index 75% rename from src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts rename to src/features/application-update/main/check-for-updates/update-can-be-downgraded.injectable.ts index b5bdfe2cba..d5f27464be 100644 --- a/src/main/application-update/check-for-updates/update-can-be-downgraded.injectable.ts +++ b/src/features/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 releaseChannelInjectable from "../../../common/vars/release-channel.injectable"; +import selectedUpdateChannelInjectable from "../../common/selected-update-channel/selected-update-channel.injectable"; +import releaseChannelInjectable from "../../../../common/vars/release-channel.injectable"; const updateCanBeDowngradedInjectable = getInjectable({ id: "update-can-be-downgraded", diff --git a/src/main/application-update/download-platform-update/download-platform-update.injectable.ts b/src/features/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/features/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/features/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/features/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/features/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/features/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/features/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/features/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/features/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/features/application-update/main/emit-current-version-to-analytics.injectable.ts similarity index 67% rename from src/main/application-update/emit-current-version-to-analytics.injectable.ts rename to src/features/application-update/main/emit-current-version-to-analytics.injectable.ts index 4da1893cea..ad8d5c41f8 100644 --- a/src/main/application-update/emit-current-version-to-analytics.injectable.ts +++ b/src/features/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 buildVersionInjectable from "../vars/build-version/build-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 buildVersionInjectable from "../../../common/vars/build-version/build-version.injectable"; const emitCurrentVersionToAnalyticsInjectable = getInjectable({ id: "emit-current-version-to-analytics", diff --git a/src/main/application-update/periodical-check-for-updates/periodical-check-for-updates.injectable.ts b/src/features/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/features/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/features/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/features/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/features/application-update/main/periodical-check-for-updates/start-checking-for-updates.injectable.ts index 15088b3173..398e35da26 100644 --- a/src/main/application-update/periodical-check-for-updates/start-checking-for-updates.injectable.ts +++ b/src/features/application-update/main/periodical-check-for-updates/start-checking-for-updates.injectable.ts @@ -5,7 +5,7 @@ import { getInjectable } from "@ogre-tools/injectable"; import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable"; import updatingIsEnabledInjectable from "../updating-is-enabled.injectable"; -import { afterApplicationIsLoadedInjectionToken } from "../../start-main-application/runnable-tokens/after-application-is-loaded-injection-token"; +import { afterApplicationIsLoadedInjectionToken } from "../../../../main/start-main-application/runnable-tokens/after-application-is-loaded-injection-token"; const startCheckingForUpdatesInjectable = getInjectable({ id: "start-checking-for-updates", diff --git a/src/main/application-update/periodical-check-for-updates/stop-checking-for-updates.injectable.ts b/src/features/application-update/main/periodical-check-for-updates/stop-checking-for-updates.injectable.ts similarity index 84% rename from src/main/application-update/periodical-check-for-updates/stop-checking-for-updates.injectable.ts rename to src/features/application-update/main/periodical-check-for-updates/stop-checking-for-updates.injectable.ts index 15e71cc817..3751af53d2 100644 --- a/src/main/application-update/periodical-check-for-updates/stop-checking-for-updates.injectable.ts +++ b/src/features/application-update/main/periodical-check-for-updates/stop-checking-for-updates.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.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 stopCheckingForUpdatesInjectable = getInjectable({ id: "stop-checking-for-updates", diff --git a/src/main/application-update/publish-is-configured.injectable.ts b/src/features/application-update/main/publish-is-configured.injectable.ts similarity index 80% rename from src/main/application-update/publish-is-configured.injectable.ts rename to src/features/application-update/main/publish-is-configured.injectable.ts index 6a3fca2f7f..e321e5c58f 100644 --- a/src/main/application-update/publish-is-configured.injectable.ts +++ b/src/features/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 applicationInformationInjectable from "../../common/vars/application-information.injectable"; +import applicationInformationInjectable from "../../../common/vars/application-information.injectable"; const publishIsConfiguredInjectable = getInjectable({ id: "publish-is-configured", diff --git a/src/main/application-update/quit-and-install-update.injectable.ts b/src/features/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/features/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/features/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/features/application-update/main/restart-and-install-update/restart-and-install-update-listener.injectable.ts similarity index 67% rename from src/main/application-update/restart-and-install-update/restart-and-install-update-listener.injectable.ts rename to src/features/application-update/main/restart-and-install-update/restart-and-install-update-listener.injectable.ts index 87f232d9b1..940856ad3b 100644 --- a/src/main/application-update/restart-and-install-update/restart-and-install-update-listener.injectable.ts +++ b/src/features/application-update/main/restart-and-install-update/restart-and-install-update-listener.injectable.ts @@ -2,8 +2,8 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { restartAndInstallUpdateChannel } from "../../../common/application-update/restart-and-install-update-channel"; -import { getMessageChannelListenerInjectable } from "../../../common/utils/channel/message-channel-listener-injection-token"; +import { restartAndInstallUpdateChannel } from "../../common/restart-and-install-update-channel"; +import { getMessageChannelListenerInjectable } from "../../../../common/utils/channel/message-channel-listener-injection-token"; import quitAndInstallUpdateInjectable from "../quit-and-install-update.injectable"; const restartAndInstallUpdateListenerInjectable = getMessageChannelListenerInjectable({ diff --git a/src/main/application-update/update-is-ready-to-be-installed.injectable.ts b/src/features/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/features/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/features/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/features/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/features/application-update/main/updating-is-enabled.injectable.ts index df5e264219..19b78fb603 100644 --- a/src/main/application-update/updating-is-enabled.injectable.ts +++ b/src/features/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/features/application-update/main/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts similarity index 85% 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/features/application-update/main/watch-if-update-should-happen-on-quit/start-watching-if-update-should-happen-on-quit.injectable.ts index 3206b29a69..2609f8f46f 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/features/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/features/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts similarity index 85% 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/features/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts index b782f76966..f68edacefb 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/features/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/features/application-update/main/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts similarity index 72% 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/features/application-update/main/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts index 9be8fdd18f..bcad45a0ac 100644 --- a/src/main/application-update/watch-if-update-should-happen-on-quit/watch-if-update-should-happen-on-quit.injectable.ts +++ b/src/features/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 { ReleaseChannel, 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 { ReleaseChannel, 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/features/application-update/periodical-checking-of-updates.test.ts b/src/features/application-update/periodical-checking-of-updates.test.ts index e5c7b1c17c..6449217594 100644 --- a/src/features/application-update/periodical-checking-of-updates.test.ts +++ b/src/features/application-update/periodical-checking-of-updates.test.ts @@ -6,9 +6,9 @@ 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 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 publishIsConfiguredInjectable from "./main/publish-is-configured.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/features/application-update/renderer/force-update-modal/force-update-modal-root-frame-component.injectable.ts similarity index 83% rename from src/renderer/application-update/force-update-modal/force-update-modal-root-frame-component.injectable.ts rename to src/features/application-update/renderer/force-update-modal/force-update-modal-root-frame-component.injectable.ts index 9681aa72e0..76c78fa1f4 100644 --- a/src/renderer/application-update/force-update-modal/force-update-modal-root-frame-component.injectable.ts +++ b/src/features/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/features/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/features/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/features/application-update/renderer/force-update-modal/force-update-modal.tsx similarity index 83% rename from src/renderer/application-update/force-update-modal/force-update-modal.tsx rename to src/features/application-update/renderer/force-update-modal/force-update-modal.tsx index 22c322be82..617555e465 100644 --- a/src/renderer/application-update/force-update-modal/force-update-modal.tsx +++ b/src/features/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 "../../child-features/application-update-using-top-bar/renderer/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/features/application-update/renderer/force-update-modal/install-update-countdown.injectable.ts similarity index 74% rename from src/renderer/application-update/force-update-modal/install-update-countdown.injectable.ts rename to src/features/application-update/renderer/force-update-modal/install-update-countdown.injectable.ts index eb1ee53371..730a4b0c13 100644 --- a/src/renderer/application-update/force-update-modal/install-update-countdown.injectable.ts +++ b/src/features/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 "../../child-features/application-update-using-top-bar/renderer/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/features/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/features/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/features/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/features/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/features/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/features/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/features/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/features/application-update/selection-of-update-stability.test.ts b/src/features/application-update/selection-of-update-stability.test.ts index bfa6f0680d..bccfed0861 100644 --- a/src/features/application-update/selection-of-update-stability.test.ts +++ b/src/features/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, ReleaseChannel } 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, ReleaseChannel } 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 type { DiContainer } from "@ogre-tools/injectable"; import getBuildVersionInjectable from "../../main/vars/build-version/get-build-version.injectable"; diff --git a/src/main/getDiForUnitTesting.ts b/src/main/getDiForUnitTesting.ts index 10185938c8..ca67b65fad 100644 --- a/src/main/getDiForUnitTesting.ts +++ b/src/main/getDiForUnitTesting.ts @@ -59,15 +59,15 @@ import syncThemeFromOperatingSystemInjectable from "./electron-app/features/sync import platformInjectable from "../common/vars/platform.injectable"; import electronQuitAndInstallUpdateInjectable from "./electron-app/features/electron-quit-and-install-update.injectable"; import electronUpdaterIsActiveInjectable from "./electron-app/features/electron-updater-is-active.injectable"; -import publishIsConfiguredInjectable from "./application-update/publish-is-configured.injectable"; -import checkForPlatformUpdatesInjectable from "./application-update/check-for-platform-updates/check-for-platform-updates.injectable"; +import publishIsConfiguredInjectable from "../features/application-update/main/publish-is-configured.injectable"; +import checkForPlatformUpdatesInjectable from "../features/application-update/main/check-for-platform-updates/check-for-platform-updates.injectable"; import baseBundledBinariesDirectoryInjectable from "../common/vars/base-bundled-binaries-dir.injectable"; import setUpdateOnQuitInjectable from "./electron-app/features/set-update-on-quit.injectable"; -import downloadPlatformUpdateInjectable from "./application-update/download-platform-update/download-platform-update.injectable"; +import downloadPlatformUpdateInjectable from "../features/application-update/main/download-platform-update/download-platform-update.injectable"; import startCatalogSyncInjectable from "./catalog-sync-to-renderer/start-catalog-sync.injectable"; import startKubeConfigSyncInjectable from "./start-main-application/runnables/kube-config-sync/start-kube-config-sync.injectable"; import getRandomIdInjectable from "../common/utils/get-random-id.injectable"; -import periodicalCheckForUpdatesInjectable from "./application-update/periodical-check-for-updates/periodical-check-for-updates.injectable"; +import periodicalCheckForUpdatesInjectable from "../features/application-update/main/periodical-check-for-updates/periodical-check-for-updates.injectable"; import execFileInjectable from "../common/fs/exec-file.injectable"; import normalizedPlatformArchitectureInjectable from "../common/vars/normalized-platform-architecture.injectable"; import getHelmChartVersionsInjectable from "./helm/helm-service/get-helm-chart-versions.injectable"; diff --git a/src/main/menu/application-menu-items.injectable.ts b/src/main/menu/application-menu-items.injectable.ts index bf1197ac1f..52f680b589 100644 --- a/src/main/menu/application-menu-items.injectable.ts +++ b/src/main/menu/application-menu-items.injectable.ts @@ -9,7 +9,7 @@ import type { MenuItemConstructorOptions } from "electron"; import { webContents } from "electron"; import loggerInjectable from "../../common/logger.injectable"; import electronMenuItemsInjectable from "./electron-menu-items.injectable"; -import updatingIsEnabledInjectable from "../application-update/updating-is-enabled.injectable"; +import updatingIsEnabledInjectable from "../../features/application-update/main/updating-is-enabled.injectable"; import navigateToPreferencesInjectable from "../../common/front-end-routing/routes/preferences/navigate-to-preferences.injectable"; import navigateToExtensionsInjectable from "../../common/front-end-routing/routes/extensions/navigate-to-extensions.injectable"; import navigateToCatalogInjectable from "../../common/front-end-routing/routes/catalog/navigate-to-catalog.injectable"; @@ -21,7 +21,7 @@ import { computed } from "mobx"; import showAboutInjectable from "./show-about.injectable"; import reloadCurrentApplicationWindowInjectable from "../start-main-application/lens-window/reload-current-application-window.injectable"; import showApplicationWindowInjectable from "../start-main-application/lens-window/show-application-window.injectable"; -import processCheckingForUpdatesInjectable from "../application-update/check-for-updates/process-checking-for-updates.injectable"; +import processCheckingForUpdatesInjectable from "../../features/application-update/main/check-for-updates/process-checking-for-updates.injectable"; import openLinkInBrowserInjectable from "../../common/utils/open-link-in-browser.injectable"; import appNameInjectable from "../../common/vars/app-name.injectable"; import productNameInjectable from "../../common/vars/product-name.injectable"; diff --git a/src/renderer/components/+preferences/application.tsx b/src/renderer/components/+preferences/application.tsx index d3c0fd4414..ee460fd4d7 100644 --- a/src/renderer/components/+preferences/application.tsx +++ b/src/renderer/components/+preferences/application.tsx @@ -24,11 +24,11 @@ import { Preferences } from "./preferences"; import userStoreInjectable from "../../../common/user-store/user-store.injectable"; import themeStoreInjectable from "../../themes/store.injectable"; import { defaultThemeId } from "../../../common/vars"; -import { updateChannels } from "../../../common/application-update/update-channels"; +import { updateChannels } from "../../../features/application-update/common/update-channels"; import { map, toPairs } from "lodash/fp"; import { pipeline } from "@ogre-tools/fp"; -import type { SelectedUpdateChannel } from "../../../common/application-update/selected-update-channel/selected-update-channel.injectable"; -import selectedUpdateChannelInjectable from "../../../common/application-update/selected-update-channel/selected-update-channel.injectable"; +import type { SelectedUpdateChannel } from "../../../features/application-update/common/selected-update-channel/selected-update-channel.injectable"; +import selectedUpdateChannelInjectable from "../../../features/application-update/common/selected-update-channel/selected-update-channel.injectable"; interface Dependencies { appPreferenceItems: IComputedValue; diff --git a/src/renderer/components/layout/top-bar/top-bar.tsx b/src/renderer/components/layout/top-bar/top-bar.tsx index 5c5a037ccd..0af1cf83a7 100644 --- a/src/renderer/components/layout/top-bar/top-bar.tsx +++ b/src/renderer/components/layout/top-bar/top-bar.tsx @@ -15,7 +15,7 @@ import type { TopBarRegistration } from "./top-bar-registration"; import isLinuxInjectable from "../../../../common/vars/is-linux.injectable"; import isWindowsInjectable from "../../../../common/vars/is-windows.injectable"; import routeIsActiveInjectable from "../../../routes/route-is-active.injectable"; -import { UpdateButton } from "../../update-button"; +import { UpdateButton } from "../../../../features/application-update/child-features/application-update-using-top-bar/renderer/update-button"; import topBarPrevEnabledInjectable from "./prev-enabled.injectable"; import topBarNextEnabledInjectable from "./next-enabled.injectable"; import openAppContextMenuInjectable from "./open-app-context-menu.injectable"; diff --git a/src/renderer/getDiForUnitTesting.tsx b/src/renderer/getDiForUnitTesting.tsx index 70e579adb9..5d19662778 100644 --- a/src/renderer/getDiForUnitTesting.tsx +++ b/src/renderer/getDiForUnitTesting.tsx @@ -55,7 +55,7 @@ import portForwardDialogClusterFrameChildComponentInjectable from "./port-forwar import setupSystemCaInjectable from "./frames/root-frame/setup-system-ca.injectable"; import extensionShouldBeEnabledForClusterFrameInjectable from "./extension-loader/extension-should-be-enabled-for-cluster-frame.injectable"; import { asyncComputed } from "@ogre-tools/injectable-react"; -import forceUpdateModalRootFrameComponentInjectable from "./application-update/force-update-modal/force-update-modal-root-frame-component.injectable"; +import forceUpdateModalRootFrameComponentInjectable from "../features/application-update/renderer/force-update-modal/force-update-modal-root-frame-component.injectable"; import legacyOnChannelListenInjectable from "./ipc/legacy-channel-listen.injectable"; import getEntitySettingCommandsInjectable from "./components/command-palette/registered-commands/get-entity-setting-commands.injectable"; import storageSaveDelayInjectable from "./utils/create-storage/storage-save-delay.injectable";