mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Move another utility function under directory
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
e3ac29cc43
commit
82e268eff3
@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { AppPaths } from "./app-path-injection-token";
|
||||
import type { RequestChannel } from "../channel/request-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../channel/message-channel-injection-token";
|
||||
import type { RequestChannel } from "../utils/channel/request-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../utils/channel/message-channel-injection-token";
|
||||
|
||||
export type AppPathsChannel = RequestChannel<void, AppPaths>;
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { MessageChannel } from "../channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../channel/message-channel-injection-token";
|
||||
import type { MessageChannel } from "../utils/channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../utils/channel/message-channel-injection-token";
|
||||
|
||||
export type ApplicationUpdateStatusEventId =
|
||||
| "checking-for-updates"
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { MessageChannel } from "../channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../channel/message-channel-injection-token";
|
||||
import type { MessageChannel } from "../utils/channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../utils/channel/message-channel-injection-token";
|
||||
|
||||
export type AskBooleanAnswerChannel = MessageChannel<{ id: string; value: boolean }>;
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { MessageChannel } from "../channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../channel/message-channel-injection-token";
|
||||
import type { MessageChannel } from "../utils/channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../utils/channel/message-channel-injection-token";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
||||
export type AskBooleanQuestionParameters = { id: string; title: string; question: string };
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { IpcRendererNavigationEvents } from "../../renderer/navigation/events";
|
||||
import type { MessageChannel } from "../channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../channel/message-channel-injection-token";
|
||||
import type { MessageChannel } from "../utils/channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../utils/channel/message-channel-injection-token";
|
||||
|
||||
export type AppNavigationChannel = MessageChannel<string>;
|
||||
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { IpcRendererNavigationEvents } from "../../renderer/navigation/events";
|
||||
import type { MessageChannel } from "../channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../channel/message-channel-injection-token";
|
||||
import type { MessageChannel } from "../utils/channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../utils/channel/message-channel-injection-token";
|
||||
|
||||
export type ClusterFrameNavigationChannel = MessageChannel<string>;
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { MessageChannel } from "../channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../channel/message-channel-injection-token";
|
||||
import type { MessageChannel } from "../utils/channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../utils/channel/message-channel-injection-token";
|
||||
|
||||
export type RootFrameRenderedChannel = MessageChannel;
|
||||
|
||||
|
||||
@ -4,13 +4,13 @@
|
||||
*/
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { LensWindow } from "../../main/start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import { lensWindowInjectionToken } from "../../main/start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import type { LensWindow } from "../../../main/start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import { lensWindowInjectionToken } from "../../../main/start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import type { MessageToChannel } from "./message-to-channel-injection-token";
|
||||
import { messageToChannelInjectionToken } from "./message-to-channel-injection-token";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import createLensWindowInjectable from "../../main/start-main-application/lens-window/application-window/create-lens-window.injectable";
|
||||
import closeAllWindowsInjectable from "../../main/start-main-application/lens-window/hide-all-windows/close-all-windows.injectable";
|
||||
import { getApplicationBuilder } from "../../../renderer/components/test-utils/get-application-builder";
|
||||
import createLensWindowInjectable from "../../../main/start-main-application/lens-window/application-window/create-lens-window.injectable";
|
||||
import closeAllWindowsInjectable from "../../../main/start-main-application/lens-window/hide-all-windows/close-all-windows.injectable";
|
||||
import { messageChannelListenerInjectionToken } from "./message-channel-listener-injection-token";
|
||||
import type { MessageChannel } from "./message-channel-injection-token";
|
||||
import type { RequestFromChannel } from "./request-from-channel-injection-token";
|
||||
@ -19,7 +19,7 @@ import type { RequestChannel } from "./request-channel-injection-token";
|
||||
import { requestChannelListenerInjectionToken } from "./request-channel-listener-injection-token";
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import { getPromiseStatus } from "../test-utils/get-promise-status";
|
||||
import { getPromiseStatus } from "../../test-utils/get-promise-status";
|
||||
|
||||
type TestMessageChannel = MessageChannel<string>;
|
||||
type TestRequestChannel = RequestChannel<string, string>;
|
||||
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { getStartableStoppable } from "../utils/get-startable-stoppable";
|
||||
import { disposer } from "../utils";
|
||||
import { getStartableStoppable } from "../get-startable-stoppable";
|
||||
import { disposer } from "../index";
|
||||
import { messageChannelListenerInjectionToken } from "./message-channel-listener-injection-token";
|
||||
import { requestChannelListenerInjectionToken } from "./request-channel-listener-injection-token";
|
||||
import { enlistMessageChannelListenerInjectionToken } from "./enlist-message-channel-listener-injection-token";
|
||||
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import syncBoxChannelInjectable from "./sync-box-channel.injectable";
|
||||
import { messageToChannelInjectionToken } from "../../channel/message-to-channel-injection-token";
|
||||
import { messageToChannelInjectionToken } from "../channel/message-to-channel-injection-token";
|
||||
import syncBoxStateInjectable from "./sync-box-state.injectable";
|
||||
import type { SyncBox } from "./sync-box-injection-token";
|
||||
|
||||
|
||||
@ -6,8 +6,8 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { SyncBoxChannel } from "./sync-box-channel.injectable";
|
||||
import syncBoxChannelInjectable from "./sync-box-channel.injectable";
|
||||
import syncBoxStateInjectable from "./sync-box-state.injectable";
|
||||
import type { MessageChannelListener } from "../../channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../channel/message-channel-listener-injection-token";
|
||||
import type { MessageChannelListener } from "../channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../channel/message-channel-listener-injection-token";
|
||||
|
||||
const syncBoxChannelListenerInjectable = getInjectable({
|
||||
id: "sync-box-channel-listener",
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { MessageChannel } from "../../channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../../channel/message-channel-injection-token";
|
||||
import type { MessageChannel } from "../channel/message-channel-injection-token";
|
||||
import { messageChannelInjectionToken } from "../channel/message-channel-injection-token";
|
||||
|
||||
export type SyncBoxChannel = MessageChannel<{ id: string; value: any }>;
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { RequestChannel } from "../../channel/request-channel-injection-token";
|
||||
import { requestChannelInjectionToken } from "../../channel/request-channel-injection-token";
|
||||
import type { RequestChannel } from "../channel/request-channel-injection-token";
|
||||
import { requestChannelInjectionToken } from "../channel/request-channel-injection-token";
|
||||
|
||||
export type SyncBoxInitialValueChannel = RequestChannel<
|
||||
void,
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { RequestChannelListener } from "../../common/channel/request-channel-listener-injection-token";
|
||||
import { requestChannelListenerInjectionToken } from "../../common/channel/request-channel-listener-injection-token";
|
||||
import type { RequestChannelListener } from "../../common/utils/channel/request-channel-listener-injection-token";
|
||||
import { requestChannelListenerInjectionToken } from "../../common/utils/channel/request-channel-listener-injection-token";
|
||||
import type { AppPathsChannel } from "../../common/app-paths/app-paths-channel.injectable";
|
||||
import appPathsChannelInjectable from "../../common/app-paths/app-paths-channel.injectable";
|
||||
import appPathsInjectable from "../../common/app-paths/app-paths.injectable";
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { ApplicationUpdateStatusChannelMessage } from "../../../common/application-update/application-update-status-channel.injectable";
|
||||
import { messageToChannelInjectionToken } from "../../../common/channel/message-to-channel-injection-token";
|
||||
import { messageToChannelInjectionToken } from "../../../common/utils/channel/message-to-channel-injection-token";
|
||||
import applicationUpdateStatusChannelInjectable from "../../../common/application-update/application-update-status-channel.injectable";
|
||||
|
||||
const broadcastChangeInUpdatingStatusInjectable = getInjectable({
|
||||
|
||||
@ -6,8 +6,8 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { AskBooleanAnswerChannel } from "../../common/ask-boolean/ask-boolean-answer-channel.injectable";
|
||||
import askBooleanAnswerChannelInjectable from "../../common/ask-boolean/ask-boolean-answer-channel.injectable";
|
||||
import askBooleanPromiseInjectable from "./ask-boolean-promise.injectable";
|
||||
import type { MessageChannelListener } from "../../common/channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../common/channel/message-channel-listener-injection-token";
|
||||
import type { MessageChannelListener } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
|
||||
|
||||
const askBooleanAnswerChannelListenerInjectable = getInjectable({
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { messageToChannelInjectionToken } from "../../common/channel/message-to-channel-injection-token";
|
||||
import { messageToChannelInjectionToken } from "../../common/utils/channel/message-to-channel-injection-token";
|
||||
import askBooleanQuestionChannelInjectable from "../../common/ask-boolean/ask-boolean-question-channel.injectable";
|
||||
import askBooleanPromiseInjectable from "./ask-boolean-promise.injectable";
|
||||
import getRandomIdInjectable from "../../common/utils/get-random-id.injectable";
|
||||
|
||||
@ -64,7 +64,7 @@ import type { ClusterFrameInfo } from "../common/cluster-frames";
|
||||
import { observable } from "mobx";
|
||||
import waitForElectronToBeReadyInjectable from "./electron-app/features/wait-for-electron-to-be-ready.injectable";
|
||||
import setupListenerForCurrentClusterFrameInjectable from "./start-main-application/lens-window/current-cluster-frame/setup-listener-for-current-cluster-frame.injectable";
|
||||
import ipcMainInjectable from "./channel/ipc-main/ipc-main.injectable";
|
||||
import ipcMainInjectable from "./utils/channel/ipc-main/ipc-main.injectable";
|
||||
import createElectronWindowForInjectable from "./start-main-application/lens-window/application-window/create-electron-window-for.injectable";
|
||||
import setupRunnablesAfterWindowIsOpenedInjectable from "./electron-app/runnables/setup-runnables-after-window-is-opened.injectable";
|
||||
import sendToChannelInElectronBrowserWindowInjectable from "./start-main-application/lens-window/application-window/send-to-channel-in-electron-browser-window.injectable";
|
||||
|
||||
@ -11,7 +11,7 @@ import appNameInjectable from "../../../app-paths/app-name/app-name.injectable";
|
||||
import appEventBusInjectable from "../../../../common/app-event-bus/app-event-bus.injectable";
|
||||
import { delay } from "../../../../common/utils";
|
||||
import { bundledExtensionsLoaded } from "../../../../common/ipc/extension-handling";
|
||||
import ipcMainInjectable from "../../../channel/ipc-main/ipc-main.injectable";
|
||||
import ipcMainInjectable from "../../../utils/channel/ipc-main/ipc-main.injectable";
|
||||
|
||||
const applicationWindowInjectable = getInjectable({
|
||||
id: "application-window",
|
||||
|
||||
@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import rootFrameRenderedChannelInjectable from "../../../../common/root-frame-rendered-channel/root-frame-rendered-channel.injectable";
|
||||
import { runManyFor } from "../../../../common/runnable/run-many-for";
|
||||
import { afterRootFrameIsReadyInjectionToken } from "../../runnable-tokens/after-root-frame-is-ready-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../../../common/channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../../../common/utils/channel/message-channel-listener-injection-token";
|
||||
|
||||
const rootFrameRenderedChannelListenerInjectable = getInjectable({
|
||||
id: "root-frame-rendered-channel-listener",
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { IpcMainEvent } from "electron";
|
||||
import ipcMainInjectable from "../ipc-main/ipc-main.injectable";
|
||||
import { enlistMessageChannelListenerInjectionToken } from "../../../common/channel/enlist-message-channel-listener-injection-token";
|
||||
import { enlistMessageChannelListenerInjectionToken } from "../../../../common/utils/channel/enlist-message-channel-listener-injection-token";
|
||||
import { pipeline } from "@ogre-tools/fp";
|
||||
import { tentativeParseJson } from "../../../common/utils/tentative-parse-json";
|
||||
import { tentativeParseJson } from "../../../../common/utils/tentative-parse-json";
|
||||
|
||||
const enlistMessageChannelListenerInjectable = getInjectable({
|
||||
id: "enlist-message-channel-listener-for-main",
|
||||
@ -2,10 +2,10 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
import { getDiForUnitTesting } from "../../../getDiForUnitTesting";
|
||||
import ipcMainInjectable from "../ipc-main/ipc-main.injectable";
|
||||
import type { EnlistMessageChannelListener } from "../../../common/channel/enlist-message-channel-listener-injection-token";
|
||||
import { enlistMessageChannelListenerInjectionToken } from "../../../common/channel/enlist-message-channel-listener-injection-token";
|
||||
import type { EnlistMessageChannelListener } from "../../../../common/utils/channel/enlist-message-channel-listener-injection-token";
|
||||
import { enlistMessageChannelListenerInjectionToken } from "../../../../common/utils/channel/enlist-message-channel-listener-injection-token";
|
||||
import type { IpcMain, IpcMainEvent } from "electron";
|
||||
|
||||
describe("enlist message channel listener in main", () => {
|
||||
@ -5,10 +5,10 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { IpcMainInvokeEvent } from "electron";
|
||||
import ipcMainInjectable from "../ipc-main/ipc-main.injectable";
|
||||
import { enlistRequestChannelListenerInjectionToken } from "../../../common/channel/enlist-request-channel-listener-injection-token";
|
||||
import { enlistRequestChannelListenerInjectionToken } from "../../../../common/utils/channel/enlist-request-channel-listener-injection-token";
|
||||
import { pipeline } from "@ogre-tools/fp";
|
||||
import { tentativeParseJson } from "../../../common/utils/tentative-parse-json";
|
||||
import { tentativeStringifyJson } from "../../../common/utils/tentative-stringify-json";
|
||||
import { tentativeParseJson } from "../../../../common/utils/tentative-parse-json";
|
||||
import { tentativeStringifyJson } from "../../../../common/utils/tentative-stringify-json";
|
||||
|
||||
const enlistRequestChannelListenerInjectable = getInjectable({
|
||||
id: "enlist-request-channel-listener-for-main",
|
||||
@ -2,12 +2,12 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
import { getDiForUnitTesting } from "../../../getDiForUnitTesting";
|
||||
import ipcMainInjectable from "../ipc-main/ipc-main.injectable";
|
||||
import type { IpcMain, IpcMainInvokeEvent } from "electron";
|
||||
import type { EnlistRequestChannelListener } from "../../../common/channel/enlist-request-channel-listener-injection-token";
|
||||
import { enlistRequestChannelListenerInjectionToken } from "../../../common/channel/enlist-request-channel-listener-injection-token";
|
||||
import { getPromiseStatus } from "../../../common/test-utils/get-promise-status";
|
||||
import type { EnlistRequestChannelListener } from "../../../../common/utils/channel/enlist-request-channel-listener-injection-token";
|
||||
import { enlistRequestChannelListenerInjectionToken } from "../../../../common/utils/channel/enlist-request-channel-listener-injection-token";
|
||||
import { getPromiseStatus } from "../../../../common/test-utils/get-promise-status";
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
* 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 listeningOfChannelsInjectable from "../../../common/channel/listening-of-channels.injectable";
|
||||
import { onLoadOfApplicationInjectionToken } from "../../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
||||
import listeningOfChannelsInjectable from "../../../../common/utils/channel/listening-of-channels.injectable";
|
||||
|
||||
const startListeningOfChannelsInjectable = getInjectable({
|
||||
id: "start-listening-of-channels-main",
|
||||
@ -2,13 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { lensWindowInjectionToken } from "../start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import { lensWindowInjectionToken } from "../../start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import { pipeline } from "@ogre-tools/fp";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { filter } from "lodash/fp";
|
||||
import { messageToChannelInjectionToken } from "../../common/channel/message-to-channel-injection-token";
|
||||
import type { MessageChannel } from "../../common/channel/message-channel-injection-token";
|
||||
import { tentativeStringifyJson } from "../../common/utils/tentative-stringify-json";
|
||||
import { messageToChannelInjectionToken } from "../../../common/utils/channel/message-to-channel-injection-token";
|
||||
import type { MessageChannel } from "../../../common/utils/channel/message-channel-injection-token";
|
||||
import { tentativeStringifyJson } from "../../../common/utils/tentative-stringify-json";
|
||||
|
||||
const messageToChannelInjectable = getInjectable({
|
||||
id: "message-to-channel",
|
||||
@ -3,17 +3,17 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { MessageToChannel } from "../../common/channel/message-to-channel-injection-token";
|
||||
import { messageToChannelInjectionToken } from "../../common/channel/message-to-channel-injection-token";
|
||||
import closeAllWindowsInjectable from "../start-main-application/lens-window/hide-all-windows/close-all-windows.injectable";
|
||||
import type { MessageChannel } from "../../common/channel/message-channel-injection-token";
|
||||
import { getDiForUnitTesting } from "../getDiForUnitTesting";
|
||||
import createLensWindowInjectable from "../start-main-application/lens-window/application-window/create-lens-window.injectable";
|
||||
import type { LensWindow } from "../start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import { lensWindowInjectionToken } from "../start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import type { MessageToChannel } from "../../../common/utils/channel/message-to-channel-injection-token";
|
||||
import { messageToChannelInjectionToken } from "../../../common/utils/channel/message-to-channel-injection-token";
|
||||
import closeAllWindowsInjectable from "../../start-main-application/lens-window/hide-all-windows/close-all-windows.injectable";
|
||||
import type { MessageChannel } from "../../../common/utils/channel/message-channel-injection-token";
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
import createLensWindowInjectable from "../../start-main-application/lens-window/application-window/create-lens-window.injectable";
|
||||
import type { LensWindow } from "../../start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import { lensWindowInjectionToken } from "../../start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import sendToChannelInElectronBrowserWindowInjectable from "../start-main-application/lens-window/application-window/send-to-channel-in-electron-browser-window.injectable";
|
||||
import sendToChannelInElectronBrowserWindowInjectable from "../../start-main-application/lens-window/application-window/send-to-channel-in-electron-browser-window.injectable";
|
||||
|
||||
describe("message to channel from main", () => {
|
||||
let messageToChannel: MessageToChannel;
|
||||
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import syncBoxInitialValueChannelInjectable from "../../../common/utils/sync-box/sync-box-initial-value-channel.injectable";
|
||||
import { syncBoxInjectionToken } from "../../../common/utils/sync-box/sync-box-injection-token";
|
||||
import { requestChannelListenerInjectionToken } from "../../../common/channel/request-channel-listener-injection-token";
|
||||
import { requestChannelListenerInjectionToken } from "../../../common/utils/channel/request-channel-listener-injection-token";
|
||||
|
||||
const syncBoxInitialValueChannelListenerInjectable = getInjectable({
|
||||
id: "sync-box-initial-value-channel-listener",
|
||||
|
||||
@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import appPathsStateInjectable from "../../common/app-paths/app-paths-state.injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../before-frame-starts/before-frame-starts-injection-token";
|
||||
import appPathsChannelInjectable from "../../common/app-paths/app-paths-channel.injectable";
|
||||
import { requestFromChannelInjectionToken } from "../../common/channel/request-from-channel-injection-token";
|
||||
import { requestFromChannelInjectionToken } from "../../common/utils/channel/request-from-channel-injection-token";
|
||||
|
||||
const setupAppPathsInjectable = getInjectable({
|
||||
id: "setup-app-paths",
|
||||
|
||||
@ -6,8 +6,8 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { ApplicationUpdateStatusChannel, ApplicationUpdateStatusEventId } from "../../common/application-update/application-update-status-channel.injectable";
|
||||
import applicationUpdateStatusChannelInjectable from "../../common/application-update/application-update-status-channel.injectable";
|
||||
import showInfoNotificationInjectable from "../components/notifications/show-info-notification.injectable";
|
||||
import type { MessageChannelListener } from "../../common/channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../common/channel/message-channel-listener-injection-token";
|
||||
import type { MessageChannelListener } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
|
||||
const applicationUpdateStatusListenerInjectable = getInjectable({
|
||||
id: "application-update-status-listener",
|
||||
|
||||
@ -8,11 +8,11 @@ import askBooleanQuestionChannelInjectable from "../../common/ask-boolean/ask-bo
|
||||
import showInfoNotificationInjectable from "../components/notifications/show-info-notification.injectable";
|
||||
import { Button } from "../components/button";
|
||||
import React from "react";
|
||||
import { messageToChannelInjectionToken } from "../../common/channel/message-to-channel-injection-token";
|
||||
import { messageToChannelInjectionToken } from "../../common/utils/channel/message-to-channel-injection-token";
|
||||
import askBooleanAnswerChannelInjectable from "../../common/ask-boolean/ask-boolean-answer-channel.injectable";
|
||||
import notificationsStoreInjectable from "../components/notifications/notifications-store.injectable";
|
||||
import type { MessageChannelListener } from "../../common/channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../common/channel/message-channel-listener-injection-token";
|
||||
import type { MessageChannelListener } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
|
||||
const askBooleanQuestionChannelListenerInjectable = getInjectable({
|
||||
id: "ask-boolean-question-channel-listener",
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { messageToChannelInjectionToken } from "../../../common/channel/message-to-channel-injection-token";
|
||||
import { messageToChannelInjectionToken } from "../../../common/utils/channel/message-to-channel-injection-token";
|
||||
import rootFrameIsRenderedChannelInjectable from "../../../common/root-frame-rendered-channel/root-frame-rendered-channel.injectable";
|
||||
|
||||
const broadcastThatRootFrameIsRenderedInjectable = getInjectable({
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { initRootFrame } from "./init-root-frame";
|
||||
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
|
||||
import ipcRendererInjectable from "../../../channel/ipc-renderer.injectable";
|
||||
import ipcRendererInjectable from "../../../utils/channel/ipc-renderer.injectable";
|
||||
import bindProtocolAddRouteHandlersInjectable from "../../../protocol-handler/bind-protocol-add-route-handlers/bind-protocol-add-route-handlers.injectable";
|
||||
import lensProtocolRouterRendererInjectable from "../../../protocol-handler/lens-protocol-router-renderer/lens-protocol-router-renderer.injectable";
|
||||
import catalogEntityRegistryInjectable from "../../../api/catalog/entity/registry.injectable";
|
||||
|
||||
@ -7,7 +7,7 @@ import glob from "glob";
|
||||
import { memoize, noop } from "lodash/fp";
|
||||
import { createContainer } from "@ogre-tools/injectable";
|
||||
import { Environments, setLegacyGlobalDiForExtensionApi } from "../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api";
|
||||
import requestFromChannelInjectable from "./channel/request-from-channel.injectable";
|
||||
import requestFromChannelInjectable from "./utils/channel/request-from-channel.injectable";
|
||||
import loggerInjectable from "../common/logger.injectable";
|
||||
import { overrideFsWithFakes } from "../test-utils/override-fs-with-fakes";
|
||||
import { createMemoryHistory } from "history";
|
||||
@ -36,7 +36,7 @@ import { ApiManager } from "../common/k8s-api/api-manager";
|
||||
import lensResourcesDirInjectable from "../common/vars/lens-resources-dir.injectable";
|
||||
import broadcastMessageInjectable from "../common/ipc/broadcast-message.injectable";
|
||||
import apiManagerInjectable from "../common/k8s-api/api-manager/manager.injectable";
|
||||
import ipcRendererInjectable from "./channel/ipc-renderer.injectable";
|
||||
import ipcRendererInjectable from "./utils/channel/ipc-renderer.injectable";
|
||||
import type { IpcRenderer } from "electron";
|
||||
import setupOnApiErrorListenersInjectable from "./api/setup-on-api-errors.injectable";
|
||||
import { observable } from "mobx";
|
||||
|
||||
@ -8,7 +8,7 @@ import appNavigationChannelInjectable from "../../common/front-end-routing/app-n
|
||||
import clusterFrameNavigationChannelInjectable from "../../common/front-end-routing/cluster-frame-navigation-channel.injectable";
|
||||
import focusWindowInjectable from "./focus-window.injectable";
|
||||
import { navigateToUrlInjectionToken } from "../../common/front-end-routing/navigate-to-url-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../common/channel/message-channel-listener-injection-token";
|
||||
import { messageChannelListenerInjectionToken } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
|
||||
const navigationChannelListenerInjectable = getInjectable({
|
||||
id: "navigation-channel-listener",
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import userStoreInjectable from "../../common/user-store/user-store.injectable";
|
||||
import ipcRendererInjectable from "../channel/ipc-renderer.injectable";
|
||||
import ipcRendererInjectable from "../utils/channel/ipc-renderer.injectable";
|
||||
import { ThemeStore } from "./store";
|
||||
|
||||
const themeStoreInjectable = getInjectable({
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
import ipcRendererInjectable from "../ipc-renderer.injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { IpcRendererEvent } from "electron";
|
||||
import { enlistMessageChannelListenerInjectionToken } from "../../../common/channel/enlist-message-channel-listener-injection-token";
|
||||
import { tentativeParseJson } from "../../../common/utils/tentative-parse-json";
|
||||
import { enlistMessageChannelListenerInjectionToken } from "../../../../common/utils/channel/enlist-message-channel-listener-injection-token";
|
||||
import { tentativeParseJson } from "../../../../common/utils/tentative-parse-json";
|
||||
import { pipeline } from "@ogre-tools/fp";
|
||||
|
||||
const enlistMessageChannelListenerInjectable = getInjectable({
|
||||
@ -2,9 +2,9 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
import type { EnlistMessageChannelListener } from "../../../common/channel/enlist-message-channel-listener-injection-token";
|
||||
import { enlistMessageChannelListenerInjectionToken } from "../../../common/channel/enlist-message-channel-listener-injection-token";
|
||||
import { getDiForUnitTesting } from "../../../getDiForUnitTesting";
|
||||
import type { EnlistMessageChannelListener } from "../../../../common/utils/channel/enlist-message-channel-listener-injection-token";
|
||||
import { enlistMessageChannelListenerInjectionToken } from "../../../../common/utils/channel/enlist-message-channel-listener-injection-token";
|
||||
import type { IpcRendererEvent, IpcRenderer } from "electron";
|
||||
import ipcRendererInjectable from "../ipc-renderer.injectable";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { enlistRequestChannelListenerInjectionToken } from "../../../common/channel/enlist-request-channel-listener-injection-token";
|
||||
import { enlistRequestChannelListenerInjectionToken } from "../../../../common/utils/channel/enlist-request-channel-listener-injection-token";
|
||||
|
||||
const enlistRequestChannelListenerInjectable = getInjectable({
|
||||
id: "enlist-request-channel-listener-for-renderer",
|
||||
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../../before-frame-starts/before-frame-starts-injection-token";
|
||||
import listeningOfChannelsInjectable from "../../../common/channel/listening-of-channels.injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../../../before-frame-starts/before-frame-starts-injection-token";
|
||||
import listeningOfChannelsInjectable from "../../../../common/utils/channel/listening-of-channels.injectable";
|
||||
|
||||
const startListeningOfChannelsInjectable = getInjectable({
|
||||
id: "start-listening-of-channels-renderer",
|
||||
@ -3,9 +3,9 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { messageToChannelInjectionToken } from "../../common/channel/message-to-channel-injection-token";
|
||||
import { messageToChannelInjectionToken } from "../../../common/utils/channel/message-to-channel-injection-token";
|
||||
import sendToMainInjectable from "./send-to-main.injectable";
|
||||
import type { MessageChannel } from "../../common/channel/message-channel-injection-token";
|
||||
import type { MessageChannel } from "../../../common/utils/channel/message-channel-injection-token";
|
||||
|
||||
const messageToChannelInjectable = getInjectable({
|
||||
id: "message-to-channel",
|
||||
@ -3,10 +3,10 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { MessageToChannel } from "../../common/channel/message-to-channel-injection-token";
|
||||
import type { MessageChannel } from "../../common/channel/message-channel-injection-token";
|
||||
import { getDiForUnitTesting } from "../getDiForUnitTesting";
|
||||
import { messageToChannelInjectionToken } from "../../common/channel/message-to-channel-injection-token";
|
||||
import type { MessageToChannel } from "../../../common/utils/channel/message-to-channel-injection-token";
|
||||
import type { MessageChannel } from "../../../common/utils/channel/message-channel-injection-token";
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
import { messageToChannelInjectionToken } from "../../../common/utils/channel/message-to-channel-injection-token";
|
||||
import ipcRendererInjectable from "./ipc-renderer.injectable";
|
||||
import type { IpcRenderer } from "electron";
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import ipcRendererInjectable from "./ipc-renderer.injectable";
|
||||
import { requestFromChannelInjectionToken } from "../../common/channel/request-from-channel-injection-token";
|
||||
import { requestFromChannelInjectionToken } from "../../../common/utils/channel/request-from-channel-injection-token";
|
||||
import { pipeline } from "@ogre-tools/fp";
|
||||
import { tentativeStringifyJson } from "../../common/utils/tentative-stringify-json";
|
||||
import { tentativeParseJson } from "../../common/utils/tentative-parse-json";
|
||||
import { tentativeStringifyJson } from "../../../common/utils/tentative-stringify-json";
|
||||
import { tentativeParseJson } from "../../../common/utils/tentative-parse-json";
|
||||
|
||||
const requestFromChannelInjectable = getInjectable({
|
||||
id: "request-from-channel",
|
||||
@ -3,16 +3,16 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { MessageChannel } from "../../common/channel/message-channel-injection-token";
|
||||
import { getDiForUnitTesting } from "../getDiForUnitTesting";
|
||||
import type { MessageChannel } from "../../../common/utils/channel/message-channel-injection-token";
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
import ipcRendererInjectable from "./ipc-renderer.injectable";
|
||||
import type { IpcRenderer } from "electron";
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import type { RequestFromChannel } from "../../common/channel/request-from-channel-injection-token";
|
||||
import { requestFromChannelInjectionToken } from "../../common/channel/request-from-channel-injection-token";
|
||||
import type { RequestFromChannel } from "../../../common/utils/channel/request-from-channel-injection-token";
|
||||
import { requestFromChannelInjectionToken } from "../../../common/utils/channel/request-from-channel-injection-token";
|
||||
import requestFromChannelInjectable from "./request-from-channel.injectable";
|
||||
import { getPromiseStatus } from "../../common/test-utils/get-promise-status";
|
||||
import { getPromiseStatus } from "../../../common/test-utils/get-promise-status";
|
||||
|
||||
describe("request from channel in renderer", () => {
|
||||
let requestFromChannel: RequestFromChannel;
|
||||
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { JsonValue } from "type-fest";
|
||||
import ipcRendererInjectable from "./ipc-renderer.injectable";
|
||||
import { tentativeStringifyJson } from "../../common/utils/tentative-stringify-json";
|
||||
import { tentativeStringifyJson } from "../../../common/utils/tentative-stringify-json";
|
||||
|
||||
const sendToMainInjectable = getInjectable({
|
||||
id: "send-to-main",
|
||||
@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../../before-frame-starts/before-frame-starts-injection-token";
|
||||
import syncBoxInitialValueChannelInjectable from "../../../common/utils/sync-box/sync-box-initial-value-channel.injectable";
|
||||
import syncBoxStateInjectable from "../../../common/utils/sync-box/sync-box-state.injectable";
|
||||
import { requestFromChannelInjectionToken } from "../../../common/channel/request-from-channel-injection-token";
|
||||
import { requestFromChannelInjectionToken } from "../../../common/utils/channel/request-from-channel-injection-token";
|
||||
|
||||
const provideInitialValuesForSyncBoxesInjectable = getInjectable({
|
||||
id: "provide-initial-values-for-sync-boxes",
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { MessageChannelListener } from "../../common/channel/message-channel-listener-injection-token";
|
||||
import type { MessageChannel } from "../../common/channel/message-channel-injection-token";
|
||||
import type { MessageChannelListener } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
import type { MessageChannel } from "../../common/utils/channel/message-channel-injection-token";
|
||||
import sendToChannelInElectronBrowserWindowInjectable from "../../main/start-main-application/lens-window/application-window/send-to-channel-in-electron-browser-window.injectable";
|
||||
import type { SendToViewArgs } from "../../main/start-main-application/lens-window/application-window/lens-window-injection-token";
|
||||
import enlistMessageChannelListenerInjectableInRenderer from "../../renderer/channel/channel-listeners/enlist-message-channel-listener.injectable";
|
||||
import enlistMessageChannelListenerInjectableInRenderer from "../../renderer/utils/channel/channel-listeners/enlist-message-channel-listener.injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import assert from "assert";
|
||||
import { tentativeParseJson } from "../../common/utils/tentative-parse-json";
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
*/
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import assert from "assert";
|
||||
import type { MessageChannel } from "../../common/channel/message-channel-injection-token";
|
||||
import type { MessageChannelListener } from "../../common/channel/message-channel-listener-injection-token";
|
||||
import enlistMessageChannelListenerInjectableInMain from "../../main/channel/channel-listeners/enlist-message-channel-listener.injectable";
|
||||
import sendToMainInjectable from "../../renderer/channel/send-to-main.injectable";
|
||||
import type { MessageChannel } from "../../common/utils/channel/message-channel-injection-token";
|
||||
import type { MessageChannelListener } from "../../common/utils/channel/message-channel-listener-injection-token";
|
||||
import enlistMessageChannelListenerInjectableInMain from "../../main/utils/channel/channel-listeners/enlist-message-channel-listener.injectable";
|
||||
import sendToMainInjectable from "../../renderer/utils/channel/send-to-main.injectable";
|
||||
|
||||
export const overrideMessagingFromWindowToMain = (mainDi: DiContainer) => {
|
||||
const messageChannelListenerFakesForMain = new Map<
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import type { RequestChannel } from "../../common/channel/request-channel-injection-token";
|
||||
import type { RequestChannelListener } from "../../common/channel/request-channel-listener-injection-token";
|
||||
import enlistRequestChannelListenerInjectableInMain from "../../main/channel/channel-listeners/enlist-request-channel-listener.injectable";
|
||||
import requestFromChannelInjectable from "../../renderer/channel/request-from-channel.injectable";
|
||||
import type { RequestChannel } from "../../common/utils/channel/request-channel-injection-token";
|
||||
import type { RequestChannelListener } from "../../common/utils/channel/request-channel-listener-injection-token";
|
||||
import enlistRequestChannelListenerInjectableInMain from "../../main/utils/channel/channel-listeners/enlist-request-channel-listener.injectable";
|
||||
import requestFromChannelInjectable from "../../renderer/utils/channel/request-from-channel.injectable";
|
||||
|
||||
export const overrideRequestingFromWindowToMain = (mainDi: DiContainer) => {
|
||||
const requestChannelListenerFakesForMain = new Map<
|
||||
|
||||
Loading…
Reference in New Issue
Block a user