mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fixup type errors due to new Runnable requirements
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
ecf3eff8d4
commit
d12f59a6a4
@ -121,7 +121,7 @@ describe("KubeApi", () => {
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when resource request fufills with a resource", () => {
|
describe("when resource request fulfills with a resource", () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await fetchMock.resolveSpecific(
|
await fetchMock.resolveSpecific(
|
||||||
["https://127.0.0.1:12345/api-kube/apis/networking.k8s.io/v1"],
|
["https://127.0.0.1:12345/api-kube/apis/networking.k8s.io/v1"],
|
||||||
@ -283,7 +283,7 @@ describe("KubeApi", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when resource request fufills with no resource", () => {
|
describe("when resource request fulfills with no resource", () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await fetchMock.resolveSpecific(
|
await fetchMock.resolveSpecific(
|
||||||
["https://127.0.0.1:12345/api-kube/apis/networking.k8s.io/v1"],
|
["https://127.0.0.1:12345/api-kube/apis/networking.k8s.io/v1"],
|
||||||
@ -307,7 +307,7 @@ describe("KubeApi", () => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
describe("when resource request fufills with a resource", () => {
|
describe("when resource request fulfills with a resource", () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await fetchMock.resolveSpecific(
|
await fetchMock.resolveSpecific(
|
||||||
["https://127.0.0.1:12345/api-kube/apis/networking.k8s.io/v1beta1"],
|
["https://127.0.0.1:12345/api-kube/apis/networking.k8s.io/v1beta1"],
|
||||||
@ -509,7 +509,7 @@ describe("KubeApi", () => {
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when resource request fufills with a resource", () => {
|
describe("when resource request fulfills with a resource", () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await fetchMock.resolveSpecific(
|
await fetchMock.resolveSpecific(
|
||||||
["https://127.0.0.1:12345/api-kube/apis/extensions"],
|
["https://127.0.0.1:12345/api-kube/apis/extensions"],
|
||||||
|
|||||||
@ -4,23 +4,18 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import applicationMenuReactivityInjectable from "./application-menu-reactivity.injectable";
|
import applicationMenuReactivityInjectable from "./application-menu-reactivity.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../../main/start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../../main/start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const startApplicationMenuInjectable = getInjectable({
|
const startApplicationMenuInjectable = getInjectable({
|
||||||
id: "start-application-menu",
|
id: "start-application-menu",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
const applicationMenu = di.inject(
|
|
||||||
applicationMenuReactivityInjectable,
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
id: "start-application-menu",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
|
const applicationMenu = di.inject(applicationMenuReactivityInjectable);
|
||||||
|
|
||||||
applicationMenu.start();
|
applicationMenu.start();
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,19 +4,20 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import applicationMenuReactivityInjectable from "./application-menu-reactivity.injectable";
|
import applicationMenuReactivityInjectable from "./application-menu-reactivity.injectable";
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../../../main/start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
|
import { beforeQuitOfBackEndInjectionToken } from "../../../main/start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const stopApplicationMenuInjectable = getInjectable({
|
const stopApplicationMenuInjectable = getInjectable({
|
||||||
id: "stop-application-menu",
|
id: "stop-application-menu",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const applicationMenu = di.inject(applicationMenuReactivityInjectable);
|
const applicationMenu = di.inject(applicationMenuReactivityInjectable);
|
||||||
|
|
||||||
return {
|
applicationMenu.stop();
|
||||||
id: "stop-application-menu",
|
|
||||||
run: () => void applicationMenu.stop(),
|
return undefined;
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,24 +5,21 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable";
|
import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable";
|
||||||
import updatingIsEnabledInjectable from "../../../main/updating-is-enabled/updating-is-enabled.injectable";
|
import updatingIsEnabledInjectable from "../../../main/updating-is-enabled/updating-is-enabled.injectable";
|
||||||
import { afterApplicationIsLoadedInjectionToken } from "../../../../../main/start-main-application/runnable-tokens/after-application-is-loaded-injection-token";
|
import { afterApplicationIsLoadedInjectionToken } from "../../../../../main/start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const startCheckingForUpdatesInjectable = getInjectable({
|
const startCheckingForUpdatesInjectable = getInjectable({
|
||||||
id: "start-checking-for-updates",
|
id: "start-checking-for-updates",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const periodicalCheckForUpdates = di.inject(periodicalCheckForUpdatesInjectable);
|
const periodicalCheckForUpdates = di.inject(periodicalCheckForUpdatesInjectable);
|
||||||
const updatingIsEnabled = di.inject(updatingIsEnabledInjectable);
|
const updatingIsEnabled = di.inject(updatingIsEnabledInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "start-checking-for-updates",
|
|
||||||
run: () => {
|
|
||||||
if (updatingIsEnabled && !periodicalCheckForUpdates.started) {
|
if (updatingIsEnabled && !periodicalCheckForUpdates.started) {
|
||||||
periodicalCheckForUpdates.start();
|
periodicalCheckForUpdates.start();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: afterApplicationIsLoadedInjectionToken,
|
injectionToken: afterApplicationIsLoadedInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,25 +4,22 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable";
|
import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable";
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../../../../../main/start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
|
import { beforeQuitOfBackEndInjectionToken } from "../../../../../main/start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const stopCheckingForUpdatesInjectable = getInjectable({
|
const stopCheckingForUpdatesInjectable = getInjectable({
|
||||||
id: "stop-checking-for-updates",
|
id: "stop-checking-for-updates",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const periodicalCheckForUpdates = di.inject(periodicalCheckForUpdatesInjectable);
|
const periodicalCheckForUpdates = di.inject(periodicalCheckForUpdatesInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "stop-checking-for-updates",
|
|
||||||
run: () => {
|
|
||||||
if (periodicalCheckForUpdates.started) {
|
if (periodicalCheckForUpdates.started) {
|
||||||
periodicalCheckForUpdates.stop();
|
periodicalCheckForUpdates.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { afterApplicationIsLoadedInjectionToken } from "../../../main/start-main-application/runnable-tokens/after-application-is-loaded-injection-token";
|
import { afterApplicationIsLoadedInjectionToken } from "../../../main/start-main-application/runnable-tokens/phases";
|
||||||
import emitAppEventInjectable from "../../../common/app-event-bus/emit-event.injectable";
|
import emitAppEventInjectable from "../../../common/app-event-bus/emit-event.injectable";
|
||||||
import { getCurrentDateTime } from "../../../common/utils/date/get-current-date-time";
|
import { getCurrentDateTime } from "../../../common/utils/date/get-current-date-time";
|
||||||
import buildVersionInjectable from "../../../main/vars/build-version/build-version.injectable";
|
import buildVersionInjectable from "../../../main/vars/build-version/build-version.injectable";
|
||||||
@ -11,13 +11,11 @@ import buildVersionInjectable from "../../../main/vars/build-version/build-versi
|
|||||||
const emitCurrentVersionToAnalyticsInjectable = getInjectable({
|
const emitCurrentVersionToAnalyticsInjectable = getInjectable({
|
||||||
id: "emit-current-version-to-analytics",
|
id: "emit-current-version-to-analytics",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const emitAppEvent = di.inject(emitAppEventInjectable);
|
const emitAppEvent = di.inject(emitAppEventInjectable);
|
||||||
const buildVersion = di.inject(buildVersionInjectable);
|
const buildVersion = di.inject(buildVersionInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "emit-current-version-to-analytics",
|
|
||||||
run: () => {
|
|
||||||
emitAppEvent({
|
emitAppEvent({
|
||||||
name: "app",
|
name: "app",
|
||||||
action: "current-version",
|
action: "current-version",
|
||||||
@ -28,8 +26,7 @@ const emitCurrentVersionToAnalyticsInjectable = getInjectable({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: afterApplicationIsLoadedInjectionToken,
|
injectionToken: afterApplicationIsLoadedInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,22 +3,19 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../../../main/start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../../../main/start-main-application/runnable-tokens/phases";
|
||||||
import watchIfUpdateShouldHappenOnQuitInjectable from "./watch-if-update-should-happen-on-quit.injectable";
|
import watchIfUpdateShouldHappenOnQuitInjectable from "./watch-if-update-should-happen-on-quit.injectable";
|
||||||
|
|
||||||
const startWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({
|
const startWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({
|
||||||
id: "start-watching-if-update-should-happen-on-quit",
|
id: "start-watching-if-update-should-happen-on-quit",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const watchIfUpdateShouldHappenOnQuit = di.inject(watchIfUpdateShouldHappenOnQuitInjectable);
|
const watchIfUpdateShouldHappenOnQuit = di.inject(watchIfUpdateShouldHappenOnQuitInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "start-watching-if-update-should-happen-on-quit",
|
|
||||||
run: () => {
|
|
||||||
watchIfUpdateShouldHappenOnQuit.start();
|
watchIfUpdateShouldHappenOnQuit.start();
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,19 +4,20 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import watchIfUpdateShouldHappenOnQuitInjectable from "./watch-if-update-should-happen-on-quit.injectable";
|
import watchIfUpdateShouldHappenOnQuitInjectable from "./watch-if-update-should-happen-on-quit.injectable";
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../../../../main/start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
|
import { beforeQuitOfBackEndInjectionToken } from "../../../../main/start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const stopWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({
|
const stopWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({
|
||||||
id: "stop-watching-if-update-should-happen-on-quit",
|
id: "stop-watching-if-update-should-happen-on-quit",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const watchIfUpdateShouldHappenOnQuit = di.inject(watchIfUpdateShouldHappenOnQuitInjectable);
|
const watchIfUpdateShouldHappenOnQuit = di.inject(watchIfUpdateShouldHappenOnQuitInjectable);
|
||||||
|
|
||||||
return {
|
watchIfUpdateShouldHappenOnQuit.stop();
|
||||||
id: "stop-watching-if-update-should-happen-on-quit",
|
|
||||||
run: () => void watchIfUpdateShouldHappenOnQuit.stop(),
|
return undefined;
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -7,14 +7,13 @@ import { isEqual } from "lodash";
|
|||||||
import { autorun } from "mobx";
|
import { autorun } from "mobx";
|
||||||
import clusterStoreInjectable from "../../../../common/cluster-store/cluster-store.injectable";
|
import clusterStoreInjectable from "../../../../common/cluster-store/cluster-store.injectable";
|
||||||
import type { ClusterId, ClusterState } from "../../../../common/cluster-types";
|
import type { ClusterId, ClusterState } from "../../../../common/cluster-types";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "../../../../main/start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
import { beforeApplicationIsLoadingInjectionToken } from "../../../../main/start-main-application/runnable-tokens/phases";
|
||||||
import initClusterStoreInjectable from "../../store/main/init.injectable";
|
import initClusterStoreInjectable from "../../store/main/init.injectable";
|
||||||
import emitClusterStateUpdateInjectable from "./emit-update.injectable";
|
import emitClusterStateUpdateInjectable from "./emit-update.injectable";
|
||||||
|
|
||||||
const setupClusterStateBroadcastingInjectable = getInjectable({
|
const setupClusterStateBroadcastingInjectable = getInjectable({
|
||||||
id: "setup-cluster-state-broadcasting",
|
id: "setup-cluster-state-broadcasting",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-cluster-state-broadcasting",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const emitClusterStateUpdate = di.inject(emitClusterStateUpdateInjectable);
|
const emitClusterStateUpdate = di.inject(emitClusterStateUpdateInjectable);
|
||||||
const clusterStore = di.inject(clusterStoreInjectable);
|
const clusterStore = di.inject(clusterStoreInjectable);
|
||||||
@ -36,7 +35,7 @@ const setupClusterStateBroadcastingInjectable = getInjectable({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
runAfter: di.inject(initClusterStoreInjectable),
|
runAfter: initClusterStoreInjectable,
|
||||||
}),
|
}),
|
||||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -11,17 +11,16 @@ import requestInitialClusterStatesInjectable from "./request-initial.injectable"
|
|||||||
const setupClusterStateSyncInjectable = getInjectable({
|
const setupClusterStateSyncInjectable = getInjectable({
|
||||||
id: "setup-cluster-state-sync",
|
id: "setup-cluster-state-sync",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-cluster-state-sync",
|
|
||||||
run: async () => {
|
run: async () => {
|
||||||
const requestInitialClusterStates = di.inject(requestInitialClusterStatesInjectable);
|
const requestInitialClusterStates = di.inject(requestInitialClusterStatesInjectable);
|
||||||
const getClusterById = di.inject(getClusterByIdInjectable);
|
const getClusterById = di.inject(getClusterByIdInjectable);
|
||||||
const initalStates = await requestInitialClusterStates();
|
const initialStates = await requestInitialClusterStates();
|
||||||
|
|
||||||
for (const { clusterId, state } of initalStates) {
|
for (const { clusterId, state } of initialStates) {
|
||||||
getClusterById(clusterId)?.setState(state);
|
getClusterById(clusterId)?.setState(state);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
runAfter: di.inject(initClusterStoreInjectable),
|
runAfter: initClusterStoreInjectable,
|
||||||
}),
|
}),
|
||||||
injectionToken: beforeFrameStartsSecondInjectionToken,
|
injectionToken: beforeFrameStartsSecondInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,22 +4,19 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import clusterStoreInjectable from "../../../../common/cluster-store/cluster-store.injectable";
|
import clusterStoreInjectable from "../../../../common/cluster-store/cluster-store.injectable";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "../../../../main/start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
import { beforeApplicationIsLoadingInjectionToken } from "../../../../main/start-main-application/runnable-tokens/phases";
|
||||||
import initUserStoreInjectable from "../../../../main/stores/init-user-store.injectable";
|
import initUserStoreInjectable from "../../../../main/stores/init-user-store.injectable";
|
||||||
|
|
||||||
const initClusterStoreInjectable = getInjectable({
|
const initClusterStoreInjectable = getInjectable({
|
||||||
id: "init-cluster-store",
|
id: "init-cluster-store",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const clusterStore = di.inject(clusterStoreInjectable);
|
const clusterStore = di.inject(clusterStoreInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "init-cluster-store",
|
|
||||||
run: () => {
|
|
||||||
clusterStore.load();
|
clusterStore.load();
|
||||||
},
|
},
|
||||||
runAfter: di.inject(initUserStoreInjectable),
|
runAfter: initUserStoreInjectable,
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -10,13 +10,12 @@ import initUserStoreInjectable from "../../../../renderer/stores/init-user-store
|
|||||||
const initClusterStoreInjectable = getInjectable({
|
const initClusterStoreInjectable = getInjectable({
|
||||||
id: "init-cluster-store",
|
id: "init-cluster-store",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "init-cluster-store",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const clusterStore = di.inject(clusterStoreInjectable);
|
const clusterStore = di.inject(clusterStoreInjectable);
|
||||||
|
|
||||||
clusterStore.load();
|
clusterStore.load();
|
||||||
},
|
},
|
||||||
runAfter: di.inject(initUserStoreInjectable),
|
runAfter: initUserStoreInjectable,
|
||||||
}),
|
}),
|
||||||
injectionToken: beforeFrameStartsSecondInjectionToken,
|
injectionToken: beforeFrameStartsSecondInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,12 +4,11 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import fileSystemProvisionerStoreInjectable from "../../../extensions/extension-loader/file-system-provisioner-store/file-system-provisioner-store.injectable";
|
import fileSystemProvisionerStoreInjectable from "../../../extensions/extension-loader/file-system-provisioner-store/file-system-provisioner-store.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../../main/start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../../main/start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const initFileSystemProvisionerStoreInjectable = getInjectable({
|
const initFileSystemProvisionerStoreInjectable = getInjectable({
|
||||||
id: "init-file-system-provisioner-store",
|
id: "init-file-system-provisioner-store",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "init-file-system-provisioner-store",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const store = di.inject(fileSystemProvisionerStoreInjectable);
|
const store = di.inject(fileSystemProvisionerStoreInjectable);
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import { beforeFrameStartsSecondInjectionToken } from "../../../renderer/before-
|
|||||||
const initFileSystemProvisionerStoreInjectable = getInjectable({
|
const initFileSystemProvisionerStoreInjectable = getInjectable({
|
||||||
id: "init-file-system-provisioner-store",
|
id: "init-file-system-provisioner-store",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "init-file-system-provisioner-store",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const store = di.inject(fileSystemProvisionerStoreInjectable);
|
const store = di.inject(fileSystemProvisionerStoreInjectable);
|
||||||
|
|
||||||
|
|||||||
@ -4,22 +4,19 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import hotbarStoreInjectable from "../../../../common/hotbars/store.injectable";
|
import hotbarStoreInjectable from "../../../../common/hotbars/store.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../../../main/start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../../../main/start-main-application/runnable-tokens/phases";
|
||||||
import setupSyncingOfGeneralCatalogEntitiesInjectable from "../../../../main/start-main-application/runnables/setup-syncing-of-general-catalog-entities.injectable";
|
import setupSyncingOfGeneralCatalogEntitiesInjectable from "../../../../main/start-main-application/runnables/setup-syncing-of-general-catalog-entities.injectable";
|
||||||
|
|
||||||
const initHotbarStoreInjectable = getInjectable({
|
const initHotbarStoreInjectable = getInjectable({
|
||||||
id: "init-hotbar-store",
|
id: "init-hotbar-store",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const hotbarStore = di.inject(hotbarStoreInjectable);
|
const hotbarStore = di.inject(hotbarStoreInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "init-hotbar-store",
|
|
||||||
run: () => {
|
|
||||||
hotbarStore.load();
|
hotbarStore.load();
|
||||||
},
|
},
|
||||||
runAfter: di.inject(setupSyncingOfGeneralCatalogEntitiesInjectable),
|
runAfter: setupSyncingOfGeneralCatalogEntitiesInjectable,
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -10,13 +10,12 @@ import initClusterStoreInjectable from "../../../cluster/store/renderer/init.inj
|
|||||||
const initHotbarStoreInjectable = getInjectable({
|
const initHotbarStoreInjectable = getInjectable({
|
||||||
id: "init-hotbar-store",
|
id: "init-hotbar-store",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "init-hotbar-store",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const hotbarStore = di.inject(hotbarStoreInjectable);
|
const hotbarStore = di.inject(hotbarStoreInjectable);
|
||||||
|
|
||||||
hotbarStore.load();
|
hotbarStore.load();
|
||||||
},
|
},
|
||||||
runAfter: di.inject(initClusterStoreInjectable),
|
runAfter: initClusterStoreInjectable,
|
||||||
}),
|
}),
|
||||||
injectionToken: beforeFrameStartsSecondInjectionToken,
|
injectionToken: beforeFrameStartsSecondInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import loggerInjectable from "../../../common/logger.injectable";
|
import loggerInjectable from "../../../common/logger.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../../main/start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../../main/start-main-application/runnable-tokens/phases";
|
||||||
import { unionPATHs } from "../../../common/utils/union-env-path";
|
import { unionPATHs } from "../../../common/utils/union-env-path";
|
||||||
import isSnapPackageInjectable from "../../../common/vars/is-snap-package.injectable";
|
import isSnapPackageInjectable from "../../../common/vars/is-snap-package.injectable";
|
||||||
import electronAppInjectable from "../../../main/electron-app/electron-app.injectable";
|
import electronAppInjectable from "../../../main/electron-app/electron-app.injectable";
|
||||||
@ -15,7 +15,8 @@ import emitShellSyncFailedInjectable from "./emit-failure.injectable";
|
|||||||
const setupShellInjectable = getInjectable({
|
const setupShellInjectable = getInjectable({
|
||||||
id: "setup-shell",
|
id: "setup-shell",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const logger = di.inject(loggerInjectable);
|
const logger = di.inject(loggerInjectable);
|
||||||
const isSnapPackage = di.inject(isSnapPackageInjectable);
|
const isSnapPackage = di.inject(isSnapPackageInjectable);
|
||||||
const electronApp = di.inject(electronAppInjectable);
|
const electronApp = di.inject(electronAppInjectable);
|
||||||
@ -23,9 +24,6 @@ const setupShellInjectable = getInjectable({
|
|||||||
const computeShellEnvironment = di.inject(computeShellEnvironmentInjectable);
|
const computeShellEnvironment = di.inject(computeShellEnvironmentInjectable);
|
||||||
const emitShellSyncFailed = di.inject(emitShellSyncFailedInjectable);
|
const emitShellSyncFailed = di.inject(emitShellSyncFailedInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-shell",
|
|
||||||
run: async (): Promise<void> => {
|
|
||||||
logger.info("🐚 Syncing shell environment");
|
logger.info("🐚 Syncing shell environment");
|
||||||
|
|
||||||
const result = await computeShellEnvironment(resolvedUserShellSetting.get());
|
const result = await computeShellEnvironment(resolvedUserShellSetting.get());
|
||||||
@ -40,7 +38,9 @@ const setupShellInjectable = getInjectable({
|
|||||||
const env = result.response;
|
const env = result.response;
|
||||||
|
|
||||||
if (!env) {
|
if (!env) {
|
||||||
return void logger.debug("[SHELL-SYNC]: nothing to do, env not special in shells");
|
logger.debug("[SHELL-SYNC]: nothing to do, env not special in shells");
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!env.LANG) {
|
if (!env.LANG) {
|
||||||
@ -64,8 +64,7 @@ const setupShellInjectable = getInjectable({
|
|||||||
logger.info(`[SHELL-SYNC]: Synced shell env`);
|
logger.info(`[SHELL-SYNC]: Synced shell env`);
|
||||||
logger.debug(`[SHELL-SYNC]: updated env`, process.env);
|
logger.debug(`[SHELL-SYNC]: updated env`, process.env);
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import loadTerminalFontInjectable from "./load-font.injectable";
|
|||||||
const preloadTerminalFontsInjectable = getInjectable({
|
const preloadTerminalFontsInjectable = getInjectable({
|
||||||
id: "preload-terminal-fonts",
|
id: "preload-terminal-fonts",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "preload-terminal-fonts",
|
|
||||||
run: async () => {
|
run: async () => {
|
||||||
const terminalFonts = di.inject(terminalFontsInjectable);
|
const terminalFonts = di.inject(terminalFontsInjectable);
|
||||||
const loadTerminalFont = di.inject(loadTerminalFontInjectable);
|
const loadTerminalFont = di.inject(loadTerminalFontInjectable);
|
||||||
|
|||||||
@ -4,19 +4,17 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { reaction } from "mobx";
|
import { reaction } from "mobx";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../../../main/start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../../../main/start-main-application/runnable-tokens/phases";
|
||||||
import operatingSystemThemeInjectable from "../../../../main/theme/operating-system-theme.injectable";
|
import operatingSystemThemeInjectable from "../../../../main/theme/operating-system-theme.injectable";
|
||||||
import emitSystemThemeTypeUpdateInjectable from "./emit-update.injectable";
|
import emitSystemThemeTypeUpdateInjectable from "./emit-update.injectable";
|
||||||
|
|
||||||
const setupSystemThemeTypeUpdaterEmitterInjectable = getInjectable({
|
const setupSystemThemeTypeUpdaterEmitterInjectable = getInjectable({
|
||||||
id: "setup-system-theme-type-updater-emitter",
|
id: "setup-system-theme-type-updater-emitter",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const operatingSystemTheme = di.inject(operatingSystemThemeInjectable);
|
const operatingSystemTheme = di.inject(operatingSystemThemeInjectable);
|
||||||
const emitSystemThemeTypeUpdate = di.inject(emitSystemThemeTypeUpdateInjectable);
|
const emitSystemThemeTypeUpdate = di.inject(emitSystemThemeTypeUpdateInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-system-theme-type-updater-emitter",
|
|
||||||
run: () => {
|
|
||||||
reaction(
|
reaction(
|
||||||
() => operatingSystemTheme.get(),
|
() => operatingSystemTheme.get(),
|
||||||
emitSystemThemeTypeUpdate,
|
emitSystemThemeTypeUpdate,
|
||||||
@ -25,8 +23,7 @@ const setupSystemThemeTypeUpdaterEmitterInjectable = getInjectable({
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -11,14 +11,13 @@ import requestInitialSystemThemeTypeInjectable from "./request-initial.injectabl
|
|||||||
const initializeSystemThemeTypeInjectable = getInjectable({
|
const initializeSystemThemeTypeInjectable = getInjectable({
|
||||||
id: "initialize-system-theme-type",
|
id: "initialize-system-theme-type",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "initialize-system-theme-type",
|
|
||||||
run: async () => {
|
run: async () => {
|
||||||
const systemThemeConfiguration = di.inject(systemThemeConfigurationInjectable);
|
const systemThemeConfiguration = di.inject(systemThemeConfigurationInjectable);
|
||||||
const requestInitialSystemThemeType = di.inject(requestInitialSystemThemeTypeInjectable);
|
const requestInitialSystemThemeType = di.inject(requestInitialSystemThemeTypeInjectable);
|
||||||
|
|
||||||
systemThemeConfiguration.set(await requestInitialSystemThemeType());
|
systemThemeConfiguration.set(await requestInitialSystemThemeType());
|
||||||
},
|
},
|
||||||
runAfter: di.inject(initUserStoreInjectable),
|
runAfter: initUserStoreInjectable,
|
||||||
}),
|
}),
|
||||||
injectionToken: beforeFrameStartsSecondInjectionToken,
|
injectionToken: beforeFrameStartsSecondInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -18,7 +18,8 @@ import { appPathsRunnablePhaseInjectionToken } from "../start-main-application/r
|
|||||||
const setupAppPathsInjectable = getInjectable({
|
const setupAppPathsInjectable = getInjectable({
|
||||||
id: "setup-app-paths",
|
id: "setup-app-paths",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const setElectronAppPath = di.inject(setElectronAppPathInjectable);
|
const setElectronAppPath = di.inject(setElectronAppPathInjectable);
|
||||||
const appName = di.inject(appNameInjectable);
|
const appName = di.inject(appNameInjectable);
|
||||||
const getElectronAppPath = di.inject(getElectronAppPathInjectable);
|
const getElectronAppPath = di.inject(getElectronAppPathInjectable);
|
||||||
@ -26,9 +27,6 @@ const setupAppPathsInjectable = getInjectable({
|
|||||||
const directoryForIntegrationTesting = di.inject(directoryForIntegrationTestingInjectable);
|
const directoryForIntegrationTesting = di.inject(directoryForIntegrationTestingInjectable);
|
||||||
const joinPaths = di.inject(joinPathsInjectable);
|
const joinPaths = di.inject(joinPathsInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-app-paths",
|
|
||||||
run: () => {
|
|
||||||
if (directoryForIntegrationTesting) {
|
if (directoryForIntegrationTesting) {
|
||||||
setElectronAppPath("appData", directoryForIntegrationTesting);
|
setElectronAppPath("appData", directoryForIntegrationTesting);
|
||||||
}
|
}
|
||||||
@ -48,8 +46,7 @@ const setupAppPathsInjectable = getInjectable({
|
|||||||
// NOTE: this is the worse of two evils. This makes sure that `RunnableSync` always is sync
|
// NOTE: this is the worse of two evils. This makes sure that `RunnableSync` always is sync
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: appPathsRunnablePhaseInjectionToken,
|
injectionToken: appPathsRunnablePhaseInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,24 +3,21 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { afterRootFrameIsReadyInjectionToken } from "../start-main-application/runnable-tokens/after-root-frame-is-ready-injection-token";
|
import { afterRootFrameIsReadyInjectionToken } from "../start-main-application/runnable-tokens/phases";
|
||||||
import catalogSyncToRendererInjectable from "./catalog-sync-to-renderer.injectable";
|
import catalogSyncToRendererInjectable from "./catalog-sync-to-renderer.injectable";
|
||||||
|
|
||||||
const startCatalogSyncInjectable = getInjectable({
|
const startCatalogSyncInjectable = getInjectable({
|
||||||
id: "start-catalog-sync",
|
id: "start-catalog-sync",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const catalogSyncToRenderer = di.inject(catalogSyncToRendererInjectable);
|
const catalogSyncToRenderer = di.inject(catalogSyncToRendererInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "start-catalog-sync",
|
|
||||||
run: () => {
|
|
||||||
if (!catalogSyncToRenderer.started) {
|
if (!catalogSyncToRenderer.started) {
|
||||||
catalogSyncToRenderer.start();
|
catalogSyncToRenderer.start();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: afterRootFrameIsReadyInjectionToken,
|
injectionToken: afterRootFrameIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,25 +4,22 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import catalogSyncToRendererInjectable from "./catalog-sync-to-renderer.injectable";
|
import catalogSyncToRendererInjectable from "./catalog-sync-to-renderer.injectable";
|
||||||
import { beforeQuitOfFrontEndInjectionToken } from "../start-main-application/runnable-tokens/before-quit-of-front-end-injection-token";
|
import { beforeQuitOfFrontEndInjectionToken } from "../start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const stopCatalogSyncInjectable = getInjectable({
|
const stopCatalogSyncInjectable = getInjectable({
|
||||||
id: "stop-catalog-sync",
|
id: "stop-catalog-sync",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const catalogSyncToRenderer = di.inject(catalogSyncToRendererInjectable);
|
const catalogSyncToRenderer = di.inject(catalogSyncToRendererInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "stop-catalog-sync",
|
|
||||||
run: () => {
|
|
||||||
if (catalogSyncToRenderer.started) {
|
if (catalogSyncToRenderer.started) {
|
||||||
catalogSyncToRenderer.stop();
|
catalogSyncToRenderer.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,21 +3,18 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../start-main-application/runnable-tokens/phases";
|
||||||
import clusterManagerInjectable from "./manager.injectable";
|
import clusterManagerInjectable from "./manager.injectable";
|
||||||
|
|
||||||
const initializeClusterManagerInjectable = getInjectable({
|
const initializeClusterManagerInjectable = getInjectable({
|
||||||
id: "initialize-cluster-manager",
|
id: "initialize-cluster-manager",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const clusterManager = di.inject(clusterManagerInjectable);
|
const clusterManager = di.inject(clusterManagerInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "initialize-cluster-manager",
|
|
||||||
run: () => {
|
|
||||||
clusterManager.init();
|
clusterManager.init();
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
causesSideEffects: true,
|
causesSideEffects: true,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,20 +3,21 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
|
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import lensProtocolRouterMainInjectable from "../../protocol-handler/lens-protocol-router-main/lens-protocol-router-main.injectable";
|
import lensProtocolRouterMainInjectable from "../../protocol-handler/lens-protocol-router-main/lens-protocol-router-main.injectable";
|
||||||
|
|
||||||
const cleanUpDeepLinkingInjectable = getInjectable({
|
const cleanUpDeepLinkingInjectable = getInjectable({
|
||||||
id: "clean-up-deep-linking",
|
id: "clean-up-deep-linking",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const lensProtocolRouterMain = di.inject(lensProtocolRouterMainInjectable);
|
const lensProtocolRouterMain = di.inject(lensProtocolRouterMainInjectable);
|
||||||
|
|
||||||
return {
|
lensProtocolRouterMain.cleanup();
|
||||||
id: "clean-up-deep-linking",
|
|
||||||
run: () => void lensProtocolRouterMain.cleanup(),
|
return undefined;
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeQuitOfFrontEndInjectionToken } from "../../../start-main-application/runnable-tokens/before-quit-of-front-end-injection-token";
|
import { beforeQuitOfFrontEndInjectionToken } from "../../../start-main-application/runnable-tokens/phases";
|
||||||
import electronAppInjectable from "../../electron-app.injectable";
|
import electronAppInjectable from "../../electron-app.injectable";
|
||||||
import { isEmpty } from "lodash/fp";
|
import { isEmpty } from "lodash/fp";
|
||||||
import getVisibleWindowsInjectable from "../../../start-main-application/lens-window/get-visible-windows.injectable";
|
import getVisibleWindowsInjectable from "../../../start-main-application/lens-window/get-visible-windows.injectable";
|
||||||
@ -11,13 +11,10 @@ import getVisibleWindowsInjectable from "../../../start-main-application/lens-wi
|
|||||||
const hideDockForLastClosedWindowInjectable = getInjectable({
|
const hideDockForLastClosedWindowInjectable = getInjectable({
|
||||||
id: "hide-dock-when-there-are-no-windows",
|
id: "hide-dock-when-there-are-no-windows",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const app = di.inject(electronAppInjectable);
|
const app = di.inject(electronAppInjectable);
|
||||||
const getVisibleWindows = di.inject(getVisibleWindowsInjectable);
|
const getVisibleWindows = di.inject(getVisibleWindowsInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "hide-dock-when-there-are-no-windows",
|
|
||||||
run: () => {
|
|
||||||
const visibleWindows = getVisibleWindows();
|
const visibleWindows = getVisibleWindows();
|
||||||
|
|
||||||
if (isEmpty(visibleWindows)) {
|
if (isEmpty(visibleWindows)) {
|
||||||
@ -26,8 +23,7 @@ const hideDockForLastClosedWindowInjectable = getInjectable({
|
|||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,21 +4,18 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import electronAppInjectable from "../../electron-app.injectable";
|
import electronAppInjectable from "../../electron-app.injectable";
|
||||||
import { afterWindowIsOpenedInjectionToken } from "../../../start-main-application/runnable-tokens/after-window-is-opened-injection-token";
|
import { afterWindowIsOpenedInjectionToken } from "../../../start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const showDockForFirstOpenedWindowInjectable = getInjectable({
|
const showDockForFirstOpenedWindowInjectable = getInjectable({
|
||||||
id: "show-dock-for-first-opened-window",
|
id: "show-dock-for-first-opened-window",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const app = di.inject(electronAppInjectable);
|
const app = di.inject(electronAppInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "show-dock-for-first-opened-window",
|
|
||||||
run: () => {
|
|
||||||
app.dock?.show();
|
app.dock?.show();
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: afterWindowIsOpenedInjectionToken,
|
injectionToken: afterWindowIsOpenedInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,28 +3,25 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../../start-main-application/runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import requestSingleInstanceLockInjectable from "../features/request-single-instance-lock.injectable";
|
import requestSingleInstanceLockInjectable from "../features/request-single-instance-lock.injectable";
|
||||||
import exitAppInjectable from "../features/exit-app.injectable";
|
import exitAppInjectable from "../features/exit-app.injectable";
|
||||||
|
|
||||||
const enforceSingleApplicationInstanceInjectable = getInjectable({
|
const enforceSingleApplicationInstanceInjectable = getInjectable({
|
||||||
id: "enforce-single-application-instance",
|
id: "enforce-single-application-instance",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const requestSingleInstanceLock = di.inject(requestSingleInstanceLockInjectable);
|
const requestSingleInstanceLock = di.inject(requestSingleInstanceLockInjectable);
|
||||||
const exitApp = di.inject(exitAppInjectable);
|
const exitApp = di.inject(exitAppInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "enforce-single-application-instance",
|
|
||||||
run: () => {
|
|
||||||
if (!requestSingleInstanceLock()) {
|
if (!requestSingleInstanceLock()) {
|
||||||
exitApp();
|
exitApp();
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,25 +4,22 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import appNameInjectable from "../../../common/vars/app-name.injectable";
|
import appNameInjectable from "../../../common/vars/app-name.injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../../start-main-application/runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import electronAppInjectable from "../electron-app.injectable";
|
import electronAppInjectable from "../electron-app.injectable";
|
||||||
|
|
||||||
const setupApplicationNameInjectable = getInjectable({
|
const setupApplicationNameInjectable = getInjectable({
|
||||||
id: "setup-application-name",
|
id: "setup-application-name",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const app = di.inject(electronAppInjectable);
|
const app = di.inject(electronAppInjectable);
|
||||||
const appName = di.inject(appNameInjectable);
|
const appName = di.inject(appNameInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-application-name",
|
|
||||||
run: () => {
|
|
||||||
app.setName(appName);
|
app.setName(appName);
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -7,27 +7,21 @@ import electronAppInjectable from "../electron-app.injectable";
|
|||||||
import openDeepLinkInjectable from "../../protocol-handler/lens-protocol-router-main/open-deep-link-for-url/open-deep-link.injectable";
|
import openDeepLinkInjectable from "../../protocol-handler/lens-protocol-router-main/open-deep-link-for-url/open-deep-link.injectable";
|
||||||
import loggerInjectable from "../../../common/logger.injectable";
|
import loggerInjectable from "../../../common/logger.injectable";
|
||||||
import commandLineArgumentsInjectable from "../../utils/command-line-arguments.injectable";
|
import commandLineArgumentsInjectable from "../../utils/command-line-arguments.injectable";
|
||||||
import { pipeline } from "@ogre-tools/fp";
|
import { startsWith, toLower } from "lodash/fp";
|
||||||
import { find, startsWith, toLower, map } from "lodash/fp";
|
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
|
||||||
import showApplicationWindowInjectable from "../../start-main-application/lens-window/show-application-window.injectable";
|
import showApplicationWindowInjectable from "../../start-main-application/lens-window/show-application-window.injectable";
|
||||||
|
|
||||||
const setupDeepLinkingInjectable = getInjectable({
|
const setupDeepLinkingInjectable = getInjectable({
|
||||||
id: "setup-deep-linking",
|
id: "setup-deep-linking",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const app = di.inject(electronAppInjectable);
|
const app = di.inject(electronAppInjectable);
|
||||||
const logger = di.inject(loggerInjectable);
|
const logger = di.inject(loggerInjectable);
|
||||||
const openDeepLinkForUrl = di.inject(openDeepLinkInjectable);
|
const openDeepLinkForUrl = di.inject(openDeepLinkInjectable);
|
||||||
const showApplicationWindow = di.inject(showApplicationWindowInjectable);
|
const showApplicationWindow = di.inject(showApplicationWindowInjectable);
|
||||||
|
const firstInstanceCommandLineArguments = di.inject(commandLineArgumentsInjectable);
|
||||||
|
|
||||||
const firstInstanceCommandLineArguments = di.inject(
|
|
||||||
commandLineArgumentsInjectable,
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-deep-linking",
|
|
||||||
run: async () => {
|
|
||||||
logger.info(`📟 Setting protocol client for lens://`);
|
logger.info(`📟 Setting protocol client for lens://`);
|
||||||
|
|
||||||
if (app.setAsDefaultProtocolClient("lens")) {
|
if (app.setAsDefaultProtocolClient("lens")) {
|
||||||
@ -50,7 +44,6 @@ const setupDeepLinkingInjectable = getInjectable({
|
|||||||
|
|
||||||
app.on(
|
app.on(
|
||||||
"second-instance",
|
"second-instance",
|
||||||
|
|
||||||
async (_, secondInstanceCommandLineArguments) => {
|
async (_, secondInstanceCommandLineArguments) => {
|
||||||
const url = getDeepLinkUrl(secondInstanceCommandLineArguments);
|
const url = getDeepLinkUrl(secondInstanceCommandLineArguments);
|
||||||
|
|
||||||
@ -62,13 +55,15 @@ const setupDeepLinkingInjectable = getInjectable({
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default setupDeepLinkingInjectable;
|
export default setupDeepLinkingInjectable;
|
||||||
|
|
||||||
const getDeepLinkUrl = (commandLineArguments: string[]) =>
|
const getDeepLinkUrl = (commandLineArguments: string[]) => (
|
||||||
pipeline(commandLineArguments, map(toLower), find(startsWith("lens://")));
|
commandLineArguments
|
||||||
|
.map(toLower)
|
||||||
|
.find(startsWith("lens://"))
|
||||||
|
);
|
||||||
|
|||||||
@ -5,37 +5,38 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import nodeEnvInjectionToken from "../../../common/vars/node-env-injection-token";
|
import nodeEnvInjectionToken from "../../../common/vars/node-env-injection-token";
|
||||||
import loggerInjectable from "../../../common/logger.injectable";
|
import loggerInjectable from "../../../common/logger.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const setupDeveloperToolsInDevelopmentEnvironmentInjectable = getInjectable({
|
const setupDeveloperToolsInDevelopmentEnvironmentInjectable = getInjectable({
|
||||||
id: "setup-developer-tools-in-development-environment",
|
id: "setup-developer-tools-in-development-environment",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const logger = di.inject(loggerInjectable);
|
const logger = di.inject(loggerInjectable);
|
||||||
const nodeEnv = di.inject(nodeEnvInjectionToken);
|
const nodeEnv = di.inject(nodeEnvInjectionToken);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-developer-tools-in-development-environment",
|
|
||||||
run: () => {
|
|
||||||
if (nodeEnv !== "development") {
|
if (nodeEnv !== "development") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("🤓 Installing developer tools");
|
logger.info("🤓 Installing developer tools");
|
||||||
|
|
||||||
import("electron-devtools-installer")
|
void (async () => {
|
||||||
.then(({ default: devToolsInstaller, REACT_DEVELOPER_TOOLS }) =>
|
try {
|
||||||
devToolsInstaller([REACT_DEVELOPER_TOOLS]),
|
const {
|
||||||
)
|
default: devToolsInstaller,
|
||||||
.then((name) =>
|
REACT_DEVELOPER_TOOLS,
|
||||||
logger.info(`[DEVTOOLS-INSTALLER]: installed ${name}`),
|
} = await import("electron-devtools-installer");
|
||||||
)
|
|
||||||
.catch((error) =>
|
const name = await devToolsInstaller([REACT_DEVELOPER_TOOLS]);
|
||||||
logger.error(`[DEVTOOLS-INSTALLER]: failed`, { error }),
|
|
||||||
);
|
logger.info(`[DEVTOOLS-INSTALLER]: installed ${name}`);
|
||||||
},
|
} catch (error) {
|
||||||
};
|
logger.error(`[DEVTOOLS-INSTALLER]: failed`, { error });
|
||||||
|
}
|
||||||
|
})();
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,24 +5,19 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import powerMonitorInjectable from "../features/power-monitor.injectable";
|
import powerMonitorInjectable from "../features/power-monitor.injectable";
|
||||||
import exitAppInjectable from "../features/exit-app.injectable";
|
import exitAppInjectable from "../features/exit-app.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const setupDeviceShutdownInjectable = getInjectable({
|
const setupDeviceShutdownInjectable = getInjectable({
|
||||||
id: "setup-device-shutdown",
|
id: "setup-device-shutdown",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const powerMonitor = di.inject(powerMonitorInjectable);
|
const powerMonitor = di.inject(powerMonitorInjectable);
|
||||||
const exitApp = di.inject(exitAppInjectable);
|
const exitApp = di.inject(exitAppInjectable);
|
||||||
|
|
||||||
return {
|
powerMonitor.on("shutdown", exitApp);
|
||||||
id: "setup-device-shutdown",
|
|
||||||
run: () => {
|
|
||||||
powerMonitor.on("shutdown", async () => {
|
|
||||||
exitApp();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
|||||||
import { setupIpcMainHandlers } from "./setup-ipc-main-handlers";
|
import { setupIpcMainHandlers } from "./setup-ipc-main-handlers";
|
||||||
import loggerInjectable from "../../../../common/logger.injectable";
|
import loggerInjectable from "../../../../common/logger.injectable";
|
||||||
import clusterStoreInjectable from "../../../../common/cluster-store/cluster-store.injectable";
|
import clusterStoreInjectable from "../../../../common/cluster-store/cluster-store.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../../start-main-application/runnable-tokens/phases";
|
||||||
import applicationMenuItemCompositeInjectable from "../../../../features/application-menu/main/application-menu-item-composite.injectable";
|
import applicationMenuItemCompositeInjectable from "../../../../features/application-menu/main/application-menu-item-composite.injectable";
|
||||||
import emitAppEventInjectable from "../../../../common/app-event-bus/emit-event.injectable";
|
import emitAppEventInjectable from "../../../../common/app-event-bus/emit-event.injectable";
|
||||||
import getClusterByIdInjectable from "../../../../common/cluster-store/get-by-id.injectable";
|
import getClusterByIdInjectable from "../../../../common/cluster-store/get-by-id.injectable";
|
||||||
@ -15,7 +15,8 @@ import pushCatalogToRendererInjectable from "../../../catalog-sync-to-renderer/p
|
|||||||
const setupIpcMainHandlersInjectable = getInjectable({
|
const setupIpcMainHandlersInjectable = getInjectable({
|
||||||
id: "setup-ipc-main-handlers",
|
id: "setup-ipc-main-handlers",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const logger = di.inject(loggerInjectable);
|
const logger = di.inject(loggerInjectable);
|
||||||
const applicationMenuItemComposite = di.inject(applicationMenuItemCompositeInjectable);
|
const applicationMenuItemComposite = di.inject(applicationMenuItemCompositeInjectable);
|
||||||
const pushCatalogToRenderer = di.inject(pushCatalogToRendererInjectable);
|
const pushCatalogToRenderer = di.inject(pushCatalogToRendererInjectable);
|
||||||
@ -23,9 +24,6 @@ const setupIpcMainHandlersInjectable = getInjectable({
|
|||||||
const emitAppEvent = di.inject(emitAppEventInjectable);
|
const emitAppEvent = di.inject(emitAppEventInjectable);
|
||||||
const getClusterById = di.inject(getClusterByIdInjectable);
|
const getClusterById = di.inject(getClusterByIdInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-ipc-main-handlers",
|
|
||||||
run: () => {
|
|
||||||
logger.debug("[APP-MAIN] initializing ipc main handlers");
|
logger.debug("[APP-MAIN] initializing ipc main handlers");
|
||||||
|
|
||||||
setupIpcMainHandlers({
|
setupIpcMainHandlers({
|
||||||
@ -36,8 +34,7 @@ const setupIpcMainHandlersInjectable = getInjectable({
|
|||||||
getClusterById,
|
getClusterById,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
causesSideEffects: true,
|
causesSideEffects: true,
|
||||||
|
|||||||
@ -5,30 +5,27 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import electronAppInjectable from "../electron-app.injectable";
|
import electronAppInjectable from "../electron-app.injectable";
|
||||||
import loggerInjectable from "../../../common/logger.injectable";
|
import loggerInjectable from "../../../common/logger.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import showApplicationWindowInjectable from "../../start-main-application/lens-window/show-application-window.injectable";
|
import showApplicationWindowInjectable from "../../start-main-application/lens-window/show-application-window.injectable";
|
||||||
|
|
||||||
const setupMainWindowVisibilityAfterActivationInjectable = getInjectable({
|
const setupMainWindowVisibilityAfterActivationInjectable = getInjectable({
|
||||||
id: "setup-main-window-visibility-after-activation",
|
id: "setup-main-window-visibility-after-activation",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const app = di.inject(electronAppInjectable);
|
const app = di.inject(electronAppInjectable);
|
||||||
const showApplicationWindow = di.inject(showApplicationWindowInjectable);
|
const showApplicationWindow = di.inject(showApplicationWindowInjectable);
|
||||||
const logger = di.inject(loggerInjectable);
|
const logger = di.inject(loggerInjectable);
|
||||||
|
|
||||||
return {
|
app.on("activate", (_, windowIsVisible) => {
|
||||||
id: "setup-main-window-visibility-after-activation",
|
|
||||||
run: () => {
|
|
||||||
app.on("activate", async (_, windowIsVisible) => {
|
|
||||||
logger.info("APP:ACTIVATE", { hasVisibleWindows: windowIsVisible });
|
logger.info("APP:ACTIVATE", { hasVisibleWindows: windowIsVisible });
|
||||||
|
|
||||||
if (!windowIsVisible) {
|
if (!windowIsVisible) {
|
||||||
await showApplicationWindow();
|
void showApplicationWindow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,29 +3,25 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../../start-main-application/runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken, afterWindowIsOpenedInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import electronAppInjectable from "../electron-app.injectable";
|
import electronAppInjectable from "../electron-app.injectable";
|
||||||
import { runManyFor } from "../../../common/runnable/run-many-for";
|
import { runManyFor } from "../../../common/runnable/run-many-for";
|
||||||
import { afterWindowIsOpenedInjectionToken } from "../../start-main-application/runnable-tokens/after-window-is-opened-injection-token";
|
|
||||||
|
|
||||||
const setupRunnablesAfterWindowIsOpenedInjectable = getInjectable({
|
const setupRunnablesAfterWindowIsOpenedInjectable = getInjectable({
|
||||||
id: "setup-runnables-after-window-is-opened",
|
id: "setup-runnables-after-window-is-opened",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const afterWindowIsOpened = runManyFor(di)(afterWindowIsOpenedInjectionToken);
|
const afterWindowIsOpened = runManyFor(di)(afterWindowIsOpenedInjectionToken);
|
||||||
const app = di.inject(electronAppInjectable);
|
const app = di.inject(electronAppInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-runnables-after-window-is-opened",
|
|
||||||
run: () => {
|
|
||||||
app.on("browser-window-created", () => {
|
app.on("browser-window-created", () => {
|
||||||
afterWindowIsOpened();
|
afterWindowIsOpened();
|
||||||
});
|
});
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,9 +3,7 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../../start-main-application/runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken, beforeQuitOfFrontEndInjectionToken, beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import { beforeQuitOfFrontEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-front-end-injection-token";
|
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
|
|
||||||
import electronAppInjectable from "../electron-app.injectable";
|
import electronAppInjectable from "../electron-app.injectable";
|
||||||
import isIntegrationTestingInjectable from "../../../common/vars/is-integration-testing.injectable";
|
import isIntegrationTestingInjectable from "../../../common/vars/is-integration-testing.injectable";
|
||||||
import autoUpdaterInjectable from "../features/auto-updater.injectable";
|
import autoUpdaterInjectable from "../features/auto-updater.injectable";
|
||||||
@ -14,17 +12,14 @@ import { runManySyncFor } from "../../../common/runnable/run-many-sync-for";
|
|||||||
const setupRunnablesBeforeClosingOfApplicationInjectable = getInjectable({
|
const setupRunnablesBeforeClosingOfApplicationInjectable = getInjectable({
|
||||||
id: "setup-closing-of-application",
|
id: "setup-closing-of-application",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const runManySync = runManySyncFor(di);
|
const runManySync = runManySyncFor(di);
|
||||||
const runRunnablesBeforeQuitOfFrontEnd = runManySync(beforeQuitOfFrontEndInjectionToken);
|
const runRunnablesBeforeQuitOfFrontEnd = runManySync(beforeQuitOfFrontEndInjectionToken);
|
||||||
const runRunnablesBeforeQuitOfBackEnd = runManySync(beforeQuitOfBackEndInjectionToken);
|
const runRunnablesBeforeQuitOfBackEnd = runManySync(beforeQuitOfBackEndInjectionToken);
|
||||||
const app = di.inject(electronAppInjectable);
|
const app = di.inject(electronAppInjectable);
|
||||||
const isIntegrationTesting = di.inject(isIntegrationTestingInjectable);
|
const isIntegrationTesting = di.inject(isIntegrationTestingInjectable);
|
||||||
const autoUpdater = di.inject(autoUpdaterInjectable);
|
const autoUpdater = di.inject(autoUpdaterInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-closing-of-application",
|
|
||||||
run: () => {
|
|
||||||
let isAutoUpdating = false;
|
let isAutoUpdating = false;
|
||||||
|
|
||||||
autoUpdater.on("before-quit-for-update", () => {
|
autoUpdater.on("before-quit-for-update", () => {
|
||||||
@ -46,8 +41,7 @@ const setupRunnablesBeforeClosingOfApplicationInjectable = getInjectable({
|
|||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,10 +4,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// @experimental
|
// @experimental
|
||||||
export { afterApplicationIsLoadedInjectionToken } from "./start-main-application/runnable-tokens/after-application-is-loaded-injection-token";
|
export {
|
||||||
export { beforeApplicationIsLoadingInjectionToken } from "./start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
afterApplicationIsLoadedInjectionToken,
|
||||||
export { beforeElectronIsReadyInjectionToken } from "./start-main-application/runnable-tokens/before-electron-is-ready-injection-token";
|
beforeApplicationIsLoadingInjectionToken,
|
||||||
export { onLoadOfApplicationInjectionToken } from "./start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
beforeElectronIsReadyInjectionToken,
|
||||||
|
onLoadOfApplicationInjectionToken,
|
||||||
|
} from "./start-main-application/runnable-tokens/phases";
|
||||||
export { createApplication } from "./create-app";
|
export { createApplication } from "./create-app";
|
||||||
export type { CreateApplication, Application, ApplicationConfig } from "../common/create-app";
|
export type { CreateApplication, Application, ApplicationConfig } from "../common/create-app";
|
||||||
export * as Mobx from "mobx";
|
export * as Mobx from "mobx";
|
||||||
|
|||||||
@ -2,23 +2,16 @@
|
|||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { pipeline } from "@ogre-tools/fp";
|
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { filter } from "lodash/fp";
|
|
||||||
import { applicationWindowInjectionToken } from "./application-window/application-window-injection-token";
|
import { applicationWindowInjectionToken } from "./application-window/application-window-injection-token";
|
||||||
|
|
||||||
const getVisibleWindowsInjectable = getInjectable({
|
const getVisibleWindowsInjectable = getInjectable({
|
||||||
id: "get-visible-windows",
|
id: "get-visible-windows",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => () => (
|
||||||
const getAllLensWindows = () => di.injectMany(applicationWindowInjectionToken);
|
di.injectMany(applicationWindowInjectionToken)
|
||||||
|
.filter(window => window.isVisible)
|
||||||
return () =>
|
),
|
||||||
pipeline(
|
|
||||||
getAllLensWindows(),
|
|
||||||
filter((lensWindow) => !!lensWindow.isVisible),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default getVisibleWindowsInjectable;
|
export default getVisibleWindowsInjectable;
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
|
||||||
import type { Runnable } from "../../../common/runnable/run-many-for";
|
|
||||||
|
|
||||||
export const afterApplicationIsLoadedInjectionToken = getInjectionToken<Runnable>({
|
|
||||||
id: "after-application-is-loaded",
|
|
||||||
});
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
|
||||||
import type { Runnable } from "../../../common/runnable/run-many-for";
|
|
||||||
|
|
||||||
export const afterRootFrameIsReadyInjectionToken = getInjectionToken<Runnable>({
|
|
||||||
id: "after-root-frame-is-ready",
|
|
||||||
});
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
|
||||||
import type { Runnable } from "../../../common/runnable/run-many-for";
|
|
||||||
|
|
||||||
export const afterWindowIsOpenedInjectionToken = getInjectionToken<Runnable>({
|
|
||||||
id: "after-window-is-opened",
|
|
||||||
});
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
|
||||||
import type { Runnable } from "../../../common/runnable/run-many-for";
|
|
||||||
|
|
||||||
export const beforeApplicationIsLoadingInjectionToken = getInjectionToken<Runnable>({
|
|
||||||
id: "before-application-is-loading",
|
|
||||||
});
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
|
||||||
import type { RunnableSync } from "../../../common/runnable/run-many-sync-for";
|
|
||||||
|
|
||||||
export const beforeElectronIsReadyInjectionToken = getInjectionToken<RunnableSync>({
|
|
||||||
id: "before-electron-is-ready",
|
|
||||||
});
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
|
||||||
import type { RunnableSync } from "../../../common/runnable/run-many-sync-for";
|
|
||||||
|
|
||||||
export const beforeQuitOfBackEndInjectionToken = getInjectionToken<RunnableSync>({
|
|
||||||
id: "before-quit-of-back-end",
|
|
||||||
});
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
|
||||||
import type { RunnableSync } from "../../../common/runnable/run-many-sync-for";
|
|
||||||
|
|
||||||
export const beforeQuitOfFrontEndInjectionToken = getInjectionToken<RunnableSync>({
|
|
||||||
id: "before-quit-of-front-end",
|
|
||||||
});
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
|
||||||
import type { Runnable } from "../../../common/runnable/run-many-for";
|
|
||||||
|
|
||||||
export const onLoadOfApplicationInjectionToken = getInjectionToken<Runnable>({
|
|
||||||
id: "on-load-of-application",
|
|
||||||
});
|
|
||||||
@ -4,8 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||||
import type { Runnable } from "../../../common/runnable/run-many-for";
|
import type { Runnable, RunnableSync } from "../../../common/runnable/types";
|
||||||
import type { RunnableSync } from "../../../common/runnable/run-many-sync-for";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These tokens are here so that the importing of their respective dependencies
|
* These tokens are here so that the importing of their respective dependencies
|
||||||
@ -26,3 +25,35 @@ export const showLoadingRunnablePhaseInjectionToken = getInjectionToken<Runnable
|
|||||||
export const showInitialWindowRunnablePhaseInjectionToken = getInjectionToken<Runnable>({
|
export const showInitialWindowRunnablePhaseInjectionToken = getInjectionToken<Runnable>({
|
||||||
id: "show-initial-window-runnable-phase",
|
id: "show-initial-window-runnable-phase",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const onLoadOfApplicationInjectionToken = getInjectionToken<Runnable>({
|
||||||
|
id: "on-load-of-application",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const beforeQuitOfFrontEndInjectionToken = getInjectionToken<RunnableSync>({
|
||||||
|
id: "before-quit-of-front-end",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const beforeQuitOfBackEndInjectionToken = getInjectionToken<RunnableSync>({
|
||||||
|
id: "before-quit-of-back-end",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const beforeElectronIsReadyInjectionToken = getInjectionToken<RunnableSync>({
|
||||||
|
id: "before-electron-is-ready",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const beforeApplicationIsLoadingInjectionToken = getInjectionToken<Runnable>({
|
||||||
|
id: "before-application-is-loading",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const afterWindowIsOpenedInjectionToken = getInjectionToken<Runnable>({
|
||||||
|
id: "after-window-is-opened",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const afterRootFrameIsReadyInjectionToken = getInjectionToken<Runnable>({
|
||||||
|
id: "after-root-frame-is-ready",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const afterApplicationIsLoadedInjectionToken = getInjectionToken<Runnable>({
|
||||||
|
id: "after-application-is-loaded",
|
||||||
|
});
|
||||||
|
|||||||
@ -3,14 +3,13 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../runnable-tokens/before-quit-of-back-end-injection-token";
|
import { beforeQuitOfBackEndInjectionToken } from "../runnable-tokens/phases";
|
||||||
import { ShellSession } from "../../shell-session/shell-session";
|
import { ShellSession } from "../../shell-session/shell-session";
|
||||||
|
|
||||||
const cleanUpShellSessionsInjectable = getInjectable({
|
const cleanUpShellSessionsInjectable = getInjectable({
|
||||||
id: "clean-up-shell-sessions",
|
id: "clean-up-shell-sessions",
|
||||||
|
|
||||||
instantiate: () => ({
|
instantiate: () => ({
|
||||||
id: "clean-up-shell-sessions",
|
|
||||||
run: () => void ShellSession.cleanup(),
|
run: () => void ShellSession.cleanup(),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|||||||
@ -4,23 +4,20 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import emitAppEventInjectable from "../../../common/app-event-bus/emit-event.injectable";
|
import emitAppEventInjectable from "../../../common/app-event-bus/emit-event.injectable";
|
||||||
import { beforeQuitOfFrontEndInjectionToken } from "../runnable-tokens/before-quit-of-front-end-injection-token";
|
import { beforeQuitOfFrontEndInjectionToken } from "../runnable-tokens/phases";
|
||||||
|
|
||||||
const emitCloseToEventBusInjectable = getInjectable({
|
const emitCloseToEventBusInjectable = getInjectable({
|
||||||
id: "emit-close-to-event-bus",
|
id: "emit-close-to-event-bus",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const emitAppEvent = di.inject(emitAppEventInjectable);
|
const emitAppEvent = di.inject(emitAppEventInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "emit-close-to-event-bus",
|
|
||||||
run: () => {
|
|
||||||
emitAppEvent({ name: "app", action: "close" });
|
emitAppEvent({ name: "app", action: "close" });
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,21 +4,18 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import emitAppEventInjectable from "../../../common/app-event-bus/emit-event.injectable";
|
import emitAppEventInjectable from "../../../common/app-event-bus/emit-event.injectable";
|
||||||
import { afterApplicationIsLoadedInjectionToken } from "../runnable-tokens/after-application-is-loaded-injection-token";
|
import { afterApplicationIsLoadedInjectionToken } from "../runnable-tokens/phases";
|
||||||
|
|
||||||
const emitServiceStartToEventBusInjectable = getInjectable({
|
const emitServiceStartToEventBusInjectable = getInjectable({
|
||||||
id: "emit-service-start-to-event-bus",
|
id: "emit-service-start-to-event-bus",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const emitAppEvent = di.inject(emitAppEventInjectable);
|
const emitAppEvent = di.inject(emitAppEventInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "emit-service-start-to-event-bus",
|
|
||||||
run: () => {
|
|
||||||
emitAppEvent({ name: "service", action: "start" });
|
emitAppEvent({ name: "service", action: "start" });
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: afterApplicationIsLoadedInjectionToken,
|
injectionToken: afterApplicationIsLoadedInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,26 +3,23 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { afterRootFrameIsReadyInjectionToken } from "../../runnable-tokens/after-root-frame-is-ready-injection-token";
|
import { afterRootFrameIsReadyInjectionToken } from "../../runnable-tokens/phases";
|
||||||
import lensProtocolRouterMainInjectable from "../../../protocol-handler/lens-protocol-router-main/lens-protocol-router-main.injectable";
|
import lensProtocolRouterMainInjectable from "../../../protocol-handler/lens-protocol-router-main/lens-protocol-router-main.injectable";
|
||||||
import { runInAction } from "mobx";
|
import { runInAction } from "mobx";
|
||||||
|
|
||||||
const flagRendererAsLoadedInjectable = getInjectable({
|
const flagRendererAsLoadedInjectable = getInjectable({
|
||||||
id: "flag-renderer-as-loaded",
|
id: "flag-renderer-as-loaded",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const lensProtocolRouterMain = di.inject(lensProtocolRouterMainInjectable);
|
const lensProtocolRouterMain = di.inject(lensProtocolRouterMainInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "flag-renderer-as-loaded",
|
|
||||||
run: () => {
|
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
// Todo: remove this kludge which enables out-of-place temporal dependency.
|
// Todo: remove this kludge which enables out-of-place temporal dependency.
|
||||||
lensProtocolRouterMain.rendererLoaded = true;
|
lensProtocolRouterMain.rendererLoaded = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: afterRootFrameIsReadyInjectionToken,
|
injectionToken: afterRootFrameIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,17 +5,15 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { runInAction } from "mobx";
|
import { runInAction } from "mobx";
|
||||||
import lensProtocolRouterMainInjectable from "../../../protocol-handler/lens-protocol-router-main/lens-protocol-router-main.injectable";
|
import lensProtocolRouterMainInjectable from "../../../protocol-handler/lens-protocol-router-main/lens-protocol-router-main.injectable";
|
||||||
import { beforeQuitOfFrontEndInjectionToken } from "../../runnable-tokens/before-quit-of-front-end-injection-token";
|
import { beforeQuitOfFrontEndInjectionToken } from "../../runnable-tokens/phases";
|
||||||
|
|
||||||
const flagRendererAsNotLoadedInjectable = getInjectable({
|
const flagRendererAsNotLoadedInjectable = getInjectable({
|
||||||
id: "stop-deep-linking",
|
id: "stop-deep-linking",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const lensProtocolRouterMain = di.inject(lensProtocolRouterMainInjectable);
|
const lensProtocolRouterMain = di.inject(lensProtocolRouterMainInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "stop-deep-linking",
|
|
||||||
run: () => {
|
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
// Todo: remove this kludge which enables out-of-place temporal dependency.
|
// Todo: remove this kludge which enables out-of-place temporal dependency.
|
||||||
lensProtocolRouterMain.rendererLoaded = false;
|
lensProtocolRouterMain.rendererLoaded = false;
|
||||||
@ -23,8 +21,7 @@ const flagRendererAsNotLoadedInjectable = getInjectable({
|
|||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -9,20 +9,18 @@ import loggerInjectable from "../../../common/logger.injectable";
|
|||||||
import extensionDiscoveryInjectable from "../../../extensions/extension-discovery/extension-discovery.injectable";
|
import extensionDiscoveryInjectable from "../../../extensions/extension-discovery/extension-discovery.injectable";
|
||||||
import extensionLoaderInjectable from "../../../extensions/extension-loader/extension-loader.injectable";
|
import extensionLoaderInjectable from "../../../extensions/extension-loader/extension-loader.injectable";
|
||||||
import showErrorPopupInjectable from "../../electron-app/features/show-error-popup.injectable";
|
import showErrorPopupInjectable from "../../electron-app/features/show-error-popup.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../runnable-tokens/phases";
|
||||||
|
|
||||||
const initializeExtensionsInjectable = getInjectable({
|
const initializeExtensionsInjectable = getInjectable({
|
||||||
id: "initialize-extensions",
|
id: "initialize-extensions",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const logger = di.inject(loggerInjectable);
|
const logger = di.inject(loggerInjectable);
|
||||||
const extensionDiscovery = di.inject(extensionDiscoveryInjectable);
|
const extensionDiscovery = di.inject(extensionDiscoveryInjectable);
|
||||||
const extensionLoader = di.inject(extensionLoaderInjectable);
|
const extensionLoader = di.inject(extensionLoaderInjectable);
|
||||||
const showErrorPopup = di.inject(showErrorPopupInjectable);
|
const showErrorPopup = di.inject(showErrorPopupInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "initialize-extensions",
|
|
||||||
run: async () => {
|
|
||||||
logger.info("🧩 Initializing extensions");
|
logger.info("🧩 Initializing extensions");
|
||||||
|
|
||||||
await extensionDiscovery.init();
|
await extensionDiscovery.init();
|
||||||
@ -48,17 +46,14 @@ const initializeExtensionsInjectable = getInjectable({
|
|||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
showErrorPopup(
|
showErrorPopup(
|
||||||
"Lens Error",
|
"Lens Error",
|
||||||
`Could not load extensions${
|
`Could not load extensions${error?.message ? `: ${error.message}` : ""}`,
|
||||||
error?.message ? `: ${error.message}` : ""
|
|
||||||
}`,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
console.error(error);
|
console.error(error);
|
||||||
console.trace();
|
console.trace();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
causesSideEffects: true,
|
causesSideEffects: true,
|
||||||
|
|
||||||
|
|||||||
@ -5,21 +5,18 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable";
|
import kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable";
|
||||||
import catalogEntityRegistryInjectable from "../../../catalog/entity-registry.injectable";
|
import catalogEntityRegistryInjectable from "../../../catalog/entity-registry.injectable";
|
||||||
import { afterApplicationIsLoadedInjectionToken } from "../../runnable-tokens/after-application-is-loaded-injection-token";
|
import { afterApplicationIsLoadedInjectionToken } from "../../runnable-tokens/phases";
|
||||||
|
|
||||||
const addKubeconfigSyncAsEntitySourceInjectable = getInjectable({
|
const addKubeconfigSyncAsEntitySourceInjectable = getInjectable({
|
||||||
id: "add-kubeconfig-sync-as-entity-source",
|
id: "add-kubeconfig-sync-as-entity-source",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const kubeConfigSyncManager = di.inject(kubeconfigSyncManagerInjectable);
|
const kubeConfigSyncManager = di.inject(kubeconfigSyncManagerInjectable);
|
||||||
const entityRegistry = di.inject(catalogEntityRegistryInjectable);
|
const entityRegistry = di.inject(catalogEntityRegistryInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "add-kubeconfig-sync-as-entity-source",
|
|
||||||
run: () => {
|
|
||||||
entityRegistry.addComputedSource("kubeconfig-sync", kubeConfigSyncManager.source);
|
entityRegistry.addComputedSource("kubeconfig-sync", kubeConfigSyncManager.source);
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
injectionToken: afterApplicationIsLoadedInjectionToken,
|
injectionToken: afterApplicationIsLoadedInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { afterApplicationIsLoadedInjectionToken } from "../../runnable-tokens/after-application-is-loaded-injection-token";
|
import { afterApplicationIsLoadedInjectionToken } from "../../runnable-tokens/phases";
|
||||||
import directoryForKubeConfigsInjectable from "../../../../common/app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable";
|
import directoryForKubeConfigsInjectable from "../../../../common/app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable";
|
||||||
import ensureDirInjectable from "../../../../common/fs/ensure-dir.injectable";
|
import ensureDirInjectable from "../../../../common/fs/ensure-dir.injectable";
|
||||||
import kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable";
|
import kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable";
|
||||||
@ -12,21 +12,18 @@ import addKubeconfigSyncAsEntitySourceInjectable from "./add-source.injectable";
|
|||||||
const startKubeConfigSyncInjectable = getInjectable({
|
const startKubeConfigSyncInjectable = getInjectable({
|
||||||
id: "start-kubeconfig-sync",
|
id: "start-kubeconfig-sync",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const directoryForKubeConfigs = di.inject(directoryForKubeConfigsInjectable);
|
const directoryForKubeConfigs = di.inject(directoryForKubeConfigsInjectable);
|
||||||
const kubeConfigSyncManager = di.inject(kubeconfigSyncManagerInjectable);
|
const kubeConfigSyncManager = di.inject(kubeconfigSyncManagerInjectable);
|
||||||
const ensureDir = di.inject(ensureDirInjectable);
|
const ensureDir = di.inject(ensureDirInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "start-kubeconfig-sync",
|
|
||||||
run: async () => {
|
|
||||||
await ensureDir(directoryForKubeConfigs);
|
await ensureDir(directoryForKubeConfigs);
|
||||||
|
|
||||||
kubeConfigSyncManager.startSync();
|
kubeConfigSyncManager.startSync();
|
||||||
},
|
},
|
||||||
runAfter: di.inject(addKubeconfigSyncAsEntitySourceInjectable),
|
runAfter: addKubeconfigSyncAsEntitySourceInjectable,
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: afterApplicationIsLoadedInjectionToken,
|
injectionToken: afterApplicationIsLoadedInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,20 +3,21 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../../runnable-tokens/before-quit-of-back-end-injection-token";
|
import { beforeQuitOfBackEndInjectionToken } from "../../runnable-tokens/phases";
|
||||||
import kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable";
|
import kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable";
|
||||||
|
|
||||||
const stopKubeConfigSyncInjectable = getInjectable({
|
const stopKubeConfigSyncInjectable = getInjectable({
|
||||||
id: "stop-kube-config-sync",
|
id: "stop-kube-config-sync",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const kubeConfigSyncManager = di.inject(kubeconfigSyncManagerInjectable);
|
const kubeConfigSyncManager = di.inject(kubeconfigSyncManagerInjectable);
|
||||||
|
|
||||||
return {
|
kubeConfigSyncManager.stopSync();
|
||||||
id: "stop-kube-config-sync",
|
|
||||||
run: () => void kubeConfigSyncManager.stopSync(),
|
return undefined;
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import { getMessageChannelListenerInjectable } from "../../../../common/utils/channel/message-channel-listener-injection-token";
|
import { getMessageChannelListenerInjectable } from "../../../../common/utils/channel/message-channel-listener-injection-token";
|
||||||
import { rootFrameHasRenderedChannel } from "../../../../common/root-frame/root-frame-rendered-channel";
|
import { rootFrameHasRenderedChannel } from "../../../../common/root-frame/root-frame-rendered-channel";
|
||||||
import { runManyFor } from "../../../../common/runnable/run-many-for";
|
import { runManyFor } from "../../../../common/runnable/run-many-for";
|
||||||
import { afterRootFrameIsReadyInjectionToken } from "../../runnable-tokens/after-root-frame-is-ready-injection-token";
|
import { afterRootFrameIsReadyInjectionToken } from "../../runnable-tokens/phases";
|
||||||
|
|
||||||
const rootFrameRenderedChannelListenerInjectable = getMessageChannelListenerInjectable({
|
const rootFrameRenderedChannelListenerInjectable = getMessageChannelListenerInjectable({
|
||||||
id: "action",
|
id: "action",
|
||||||
|
|||||||
@ -3,21 +3,22 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../../runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken } from "../../runnable-tokens/phases";
|
||||||
import initializeSentryReportingWithInjectable from "../../../../common/error-reporting/initialize-sentry-reporting.injectable";
|
import initializeSentryReportingWithInjectable from "../../../../common/error-reporting/initialize-sentry-reporting.injectable";
|
||||||
import initializeSentryOnMainInjectable from "./initialize-on-main.injectable";
|
import initializeSentryOnMainInjectable from "./initialize-on-main.injectable";
|
||||||
|
|
||||||
const setupSentryInjectable = getInjectable({
|
const setupSentryInjectable = getInjectable({
|
||||||
id: "setup-sentry",
|
id: "setup-sentry",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable);
|
const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable);
|
||||||
const initializeSentryOnMain = di.inject(initializeSentryOnMainInjectable);
|
const initializeSentryOnMain = di.inject(initializeSentryOnMainInjectable);
|
||||||
|
|
||||||
return {
|
initializeSentryReportingWith(initializeSentryOnMain);
|
||||||
id: "setup-sentry",
|
|
||||||
run: () => void initializeSentryReportingWith(initializeSentryOnMain),
|
return undefined;
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -5,26 +5,23 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import disableHardwareAccelerationInjectable from "../../electron-app/features/disable-hardware-acceleration.injectable";
|
import disableHardwareAccelerationInjectable from "../../electron-app/features/disable-hardware-acceleration.injectable";
|
||||||
import hardwareAccelerationShouldBeDisabledInjectable from "../../vars/hardware-acceleration-should-be-disabled.injectable";
|
import hardwareAccelerationShouldBeDisabledInjectable from "../../vars/hardware-acceleration-should-be-disabled.injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/phases";
|
||||||
|
|
||||||
const setupHardwareAccelerationInjectable = getInjectable({
|
const setupHardwareAccelerationInjectable = getInjectable({
|
||||||
id: "setup-hardware-acceleration",
|
id: "setup-hardware-acceleration",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const hardwareAccelerationShouldBeDisabled = di.inject(hardwareAccelerationShouldBeDisabledInjectable);
|
const hardwareAccelerationShouldBeDisabled = di.inject(hardwareAccelerationShouldBeDisabledInjectable);
|
||||||
const disableHardwareAcceleration = di.inject(disableHardwareAccelerationInjectable);
|
const disableHardwareAcceleration = di.inject(disableHardwareAccelerationInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-hardware-acceleration",
|
|
||||||
run: () => {
|
|
||||||
if (hardwareAccelerationShouldBeDisabled) {
|
if (hardwareAccelerationShouldBeDisabled) {
|
||||||
disableHardwareAcceleration();
|
disableHardwareAcceleration();
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,17 +4,15 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import electronAppInjectable from "../../electron-app/electron-app.injectable";
|
import electronAppInjectable from "../../electron-app/electron-app.injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/phases";
|
||||||
|
|
||||||
const setupHostnamesInjectable = getInjectable({
|
const setupHostnamesInjectable = getInjectable({
|
||||||
id: "setup-hostnames",
|
id: "setup-hostnames",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const app = di.inject(electronAppInjectable);
|
const app = di.inject(electronAppInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-hostnames",
|
|
||||||
run: () => {
|
|
||||||
app.commandLine.appendSwitch("host-rules", [
|
app.commandLine.appendSwitch("host-rules", [
|
||||||
"MAP localhost 127.0.0.1",
|
"MAP localhost 127.0.0.1",
|
||||||
"MAP lens.app 127.0.0.1",
|
"MAP lens.app 127.0.0.1",
|
||||||
@ -23,8 +21,7 @@ const setupHostnamesInjectable = getInjectable({
|
|||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,19 +3,18 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import * as Immer from "immer";
|
import { setAutoFreeze, enableMapSet } from "immer";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/phases";
|
||||||
|
|
||||||
const setupImmerInjectable = getInjectable({
|
const setupImmerInjectable = getInjectable({
|
||||||
id: "setup-immer",
|
id: "setup-immer",
|
||||||
|
|
||||||
instantiate: () => ({
|
instantiate: () => ({
|
||||||
id: "setup-immer",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
// Docs: https://immerjs.github.io/immer/
|
// Docs: https://immerjs.github.io/immer/
|
||||||
// Required in `utils/storage-helper.ts`
|
// Required in `utils/storage-helper.ts`
|
||||||
Immer.setAutoFreeze(false); // allow to merge mobx observables
|
setAutoFreeze(false); // allow to merge mobx observables
|
||||||
Immer.enableMapSet(); // allow to merge maps and sets
|
enableMapSet(); // allow to merge maps and sets
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
|
|||||||
@ -5,17 +5,15 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { generate } from "selfsigned";
|
import { generate } from "selfsigned";
|
||||||
import lensProxyCertificateInjectable from "../../../common/certificate/lens-proxy-certificate.injectable";
|
import lensProxyCertificateInjectable from "../../../common/certificate/lens-proxy-certificate.injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/phases";
|
||||||
|
|
||||||
const setupLensProxyCertificateInjectable = getInjectable({
|
const setupLensProxyCertificateInjectable = getInjectable({
|
||||||
id: "setup-lens-proxy-certificate",
|
id: "setup-lens-proxy-certificate",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable);
|
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-lens-proxy-certificate",
|
|
||||||
run: () => {
|
|
||||||
const cert = generate([
|
const cert = generate([
|
||||||
{ name: "commonName", value: "Lens Certificate Authority" },
|
{ name: "commonName", value: "Lens Certificate Authority" },
|
||||||
{ name: "organizationName", value: "Lens" },
|
{ name: "organizationName", value: "Lens" },
|
||||||
@ -44,8 +42,7 @@ const setupLensProxyCertificateInjectable = getInjectable({
|
|||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import loggerInjectable from "../../../common/logger.injectable";
|
|||||||
import lensProxyPortInjectable from "../../lens-proxy/lens-proxy-port.injectable";
|
import lensProxyPortInjectable from "../../lens-proxy/lens-proxy-port.injectable";
|
||||||
import isWindowsInjectable from "../../../common/vars/is-windows.injectable";
|
import isWindowsInjectable from "../../../common/vars/is-windows.injectable";
|
||||||
import showErrorPopupInjectable from "../../electron-app/features/show-error-popup.injectable";
|
import showErrorPopupInjectable from "../../electron-app/features/show-error-popup.injectable";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "../runnable-tokens/before-application-is-loading-injection-token";
|
import { beforeApplicationIsLoadingInjectionToken } from "../runnable-tokens/phases";
|
||||||
import buildVersionInjectable from "../../vars/build-version/build-version.injectable";
|
import buildVersionInjectable from "../../vars/build-version/build-version.injectable";
|
||||||
import initializeBuildVersionInjectable from "../../vars/build-version/init.injectable";
|
import initializeBuildVersionInjectable from "../../vars/build-version/init.injectable";
|
||||||
import lensProxyCertificateInjectable from "../../../common/certificate/lens-proxy-certificate.injectable";
|
import lensProxyCertificateInjectable from "../../../common/certificate/lens-proxy-certificate.injectable";
|
||||||
@ -19,7 +19,8 @@ import { Agent } from "https";
|
|||||||
const setupLensProxyInjectable = getInjectable({
|
const setupLensProxyInjectable = getInjectable({
|
||||||
id: "setup-lens-proxy",
|
id: "setup-lens-proxy",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const lensProxy = di.inject(lensProxyInjectable);
|
const lensProxy = di.inject(lensProxyInjectable);
|
||||||
const exitApp = di.inject(exitAppInjectable);
|
const exitApp = di.inject(exitAppInjectable);
|
||||||
const logger = di.inject(loggerInjectable);
|
const logger = di.inject(loggerInjectable);
|
||||||
@ -30,9 +31,6 @@ const setupLensProxyInjectable = getInjectable({
|
|||||||
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable);
|
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable);
|
||||||
const fetch = di.inject(fetchInjectable);
|
const fetch = di.inject(fetchInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-lens-proxy",
|
|
||||||
run: async () => {
|
|
||||||
try {
|
try {
|
||||||
logger.info("🔌 Starting LensProxy");
|
logger.info("🔌 Starting LensProxy");
|
||||||
await lensProxy.listen(); // lensProxy.port available
|
await lensProxy.listen(); // lensProxy.port available
|
||||||
@ -78,9 +76,8 @@ const setupLensProxyInjectable = getInjectable({
|
|||||||
return exitApp();
|
return exitApp();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
runAfter: di.inject(initializeBuildVersionInjectable),
|
runAfter: initializeBuildVersionInjectable,
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
causesSideEffects: true,
|
causesSideEffects: true,
|
||||||
|
|
||||||
|
|||||||
@ -4,13 +4,12 @@
|
|||||||
*/
|
*/
|
||||||
import * as Mobx from "mobx";
|
import * as Mobx from "mobx";
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/phases";
|
||||||
|
|
||||||
const setupMobxInjectable = getInjectable({
|
const setupMobxInjectable = getInjectable({
|
||||||
id: "setup-mobx",
|
id: "setup-mobx",
|
||||||
|
|
||||||
instantiate: () => ({
|
instantiate: () => ({
|
||||||
id: "setup-mobx",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
// Docs: https://mobx.js.org/configuration.html
|
// Docs: https://mobx.js.org/configuration.html
|
||||||
Mobx.configure({
|
Mobx.configure({
|
||||||
|
|||||||
@ -3,22 +3,18 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/before-electron-is-ready-injection-token";
|
import { beforeElectronIsReadyInjectionToken } from "../runnable-tokens/phases";
|
||||||
import getCommandLineSwitchInjectable from "../../electron-app/features/get-command-line-switch.injectable";
|
import getCommandLineSwitchInjectable from "../../electron-app/features/get-command-line-switch.injectable";
|
||||||
|
|
||||||
const setupProxyEnvInjectable = getInjectable({
|
const setupProxyEnvInjectable = getInjectable({
|
||||||
id: "setup-proxy-env",
|
id: "setup-proxy-env",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
const getCommandLineSwitch = di.inject(getCommandLineSwitchInjectable);
|
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-proxy-env",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
|
const getCommandLineSwitch = di.inject(getCommandLineSwitchInjectable);
|
||||||
const switchValue = getCommandLineSwitch("proxy-server");
|
const switchValue = getCommandLineSwitch("proxy-server");
|
||||||
|
|
||||||
let httpsProxy =
|
let httpsProxy = process.env.HTTPS_PROXY || process.env.HTTP_PROXY || "";
|
||||||
process.env.HTTPS_PROXY || process.env.HTTP_PROXY || "";
|
|
||||||
|
|
||||||
delete process.env.HTTPS_PROXY;
|
delete process.env.HTTPS_PROXY;
|
||||||
delete process.env.HTTP_PROXY;
|
delete process.env.HTTP_PROXY;
|
||||||
@ -37,8 +33,7 @@ const setupProxyEnvInjectable = getInjectable({
|
|||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeElectronIsReadyInjectionToken,
|
injectionToken: beforeElectronIsReadyInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,23 +4,18 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import syncGeneralCatalogEntitiesInjectable from "../../catalog-sources/sync-general-catalog-entities.injectable";
|
import syncGeneralCatalogEntitiesInjectable from "../../catalog-sources/sync-general-catalog-entities.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../runnable-tokens/phases";
|
||||||
|
|
||||||
const setupSyncingOfGeneralCatalogEntitiesInjectable = getInjectable({
|
const setupSyncingOfGeneralCatalogEntitiesInjectable = getInjectable({
|
||||||
id: "setup-syncing-of-general-catalog-entities",
|
id: "setup-syncing-of-general-catalog-entities",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
const syncGeneralCatalogEntities = di.inject(
|
|
||||||
syncGeneralCatalogEntitiesInjectable,
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-syncing-of-general-catalog-entities",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
|
const syncGeneralCatalogEntities = di.inject(syncGeneralCatalogEntitiesInjectable);
|
||||||
|
|
||||||
syncGeneralCatalogEntities();
|
syncGeneralCatalogEntities();
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,22 +3,19 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../runnable-tokens/phases";
|
||||||
import syncWeblinksInjectable from "../../catalog-sources/sync-weblinks.injectable";
|
import syncWeblinksInjectable from "../../catalog-sources/sync-weblinks.injectable";
|
||||||
|
|
||||||
const setupSyncingOfWeblinksInjectable = getInjectable({
|
const setupSyncingOfWeblinksInjectable = getInjectable({
|
||||||
id: "setup-syncing-of-weblinks",
|
id: "setup-syncing-of-weblinks",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const syncWeblinks = di.inject(syncWeblinksInjectable);
|
const syncWeblinks = di.inject(syncWeblinksInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-syncing-of-weblinks",
|
|
||||||
run: () => {
|
|
||||||
syncWeblinks();
|
syncWeblinks();
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,14 +3,17 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "../runnable-tokens/before-application-is-loading-injection-token";
|
import { beforeApplicationIsLoadingInjectionToken } from "../runnable-tokens/phases";
|
||||||
import injectSystemCAsInjectable from "../../../features/certificate-authorities/common/inject-system-cas.injectable";
|
import injectSystemCAsInjectable from "../../../features/certificate-authorities/common/inject-system-cas.injectable";
|
||||||
|
|
||||||
const setupSystemCaInjectable = getInjectable({
|
const setupSystemCaInjectable = getInjectable({
|
||||||
id: "setup-system-ca",
|
id: "setup-system-ca",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-system-ca",
|
run: async () => {
|
||||||
run: di.inject(injectSystemCAsInjectable),
|
const injectSystemCAs = di.inject(injectSystemCAsInjectable);
|
||||||
|
|
||||||
|
await injectSystemCAs();
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -18,7 +18,8 @@ const getDeepLinkUrl = (commandLineArguments: string[]) => (
|
|||||||
|
|
||||||
const showInitialWindowInjectable = getInjectable({
|
const showInitialWindowInjectable = getInjectable({
|
||||||
id: "show-initial-window",
|
id: "show-initial-window",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const shouldStartHidden = di.inject(shouldStartHiddenInjectable);
|
const shouldStartHidden = di.inject(shouldStartHiddenInjectable);
|
||||||
const shouldStartWindow = !shouldStartHidden;
|
const shouldStartWindow = !shouldStartHidden;
|
||||||
const createFirstApplicationWindow = di.inject(createFirstApplicationWindowInjectable);
|
const createFirstApplicationWindow = di.inject(createFirstApplicationWindowInjectable);
|
||||||
@ -26,9 +27,6 @@ const showInitialWindowInjectable = getInjectable({
|
|||||||
const openDeepLink = di.inject(openDeepLinkInjectable);
|
const openDeepLink = di.inject(openDeepLinkInjectable);
|
||||||
const commandLineArguments = di.inject(commandLineArgumentsInjectable);
|
const commandLineArguments = di.inject(commandLineArgumentsInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "show-initial-window",
|
|
||||||
run: async () => {
|
|
||||||
if (shouldStartWindow) {
|
if (shouldStartWindow) {
|
||||||
const deepLinkUrl = getDeepLinkUrl(commandLineArguments);
|
const deepLinkUrl = getDeepLinkUrl(commandLineArguments);
|
||||||
|
|
||||||
@ -43,8 +41,7 @@ const showInitialWindowInjectable = getInjectable({
|
|||||||
splashWindow.close();
|
splashWindow.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
injectionToken: showInitialWindowRunnablePhaseInjectionToken,
|
injectionToken: showInitialWindowRunnablePhaseInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -9,20 +9,18 @@ import { showLoadingRunnablePhaseInjectionToken } from "../runnable-tokens/phase
|
|||||||
|
|
||||||
const showLoadingInjectable = getInjectable({
|
const showLoadingInjectable = getInjectable({
|
||||||
id: "show-loading",
|
id: "show-loading",
|
||||||
instantiate: (di) => {
|
|
||||||
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const shouldStartHidden = di.inject(shouldStartHiddenInjectable);
|
const shouldStartHidden = di.inject(shouldStartHiddenInjectable);
|
||||||
const shouldShowLoadingWindow = !shouldStartHidden;
|
const shouldShowLoadingWindow = !shouldStartHidden;
|
||||||
const splashWindow = di.inject(splashWindowInjectable);
|
const splashWindow = di.inject(splashWindowInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "show-loading",
|
|
||||||
run: async () => {
|
|
||||||
if (shouldShowLoadingWindow) {
|
if (shouldShowLoadingWindow) {
|
||||||
await splashWindow.start();
|
await splashWindow.start();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
injectionToken: showLoadingRunnablePhaseInjectionToken,
|
injectionToken: showLoadingRunnablePhaseInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -4,23 +4,20 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import clusterManagerInjectable from "../../cluster/manager.injectable";
|
import clusterManagerInjectable from "../../cluster/manager.injectable";
|
||||||
import { beforeQuitOfFrontEndInjectionToken } from "../runnable-tokens/before-quit-of-front-end-injection-token";
|
import { beforeQuitOfFrontEndInjectionToken } from "../runnable-tokens/phases";
|
||||||
|
|
||||||
const stopClusterManagerInjectable = getInjectable({
|
const stopClusterManagerInjectable = getInjectable({
|
||||||
id: "stop-cluster-manager",
|
id: "stop-cluster-manager",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const clusterManager = di.inject(clusterManagerInjectable);
|
const clusterManager = di.inject(clusterManagerInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "stop-cluster-manager",
|
|
||||||
run: () => {
|
|
||||||
clusterManager.stop();
|
clusterManager.stop();
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -6,12 +6,8 @@ import { getInjectable } from "@ogre-tools/injectable";
|
|||||||
|
|
||||||
import { runManyFor } from "../../common/runnable/run-many-for";
|
import { runManyFor } from "../../common/runnable/run-many-for";
|
||||||
import { runManySyncFor } from "../../common/runnable/run-many-sync-for";
|
import { runManySyncFor } from "../../common/runnable/run-many-sync-for";
|
||||||
import { beforeElectronIsReadyInjectionToken } from "./runnable-tokens/before-electron-is-ready-injection-token";
|
import * as phases from "./runnable-tokens/phases";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "./runnable-tokens/before-application-is-loading-injection-token";
|
|
||||||
import { onLoadOfApplicationInjectionToken } from "./runnable-tokens/on-load-of-application-injection-token";
|
|
||||||
import { afterApplicationIsLoadedInjectionToken } from "./runnable-tokens/after-application-is-loaded-injection-token";
|
|
||||||
import waitForElectronToBeReadyInjectable from "../electron-app/features/wait-for-electron-to-be-ready.injectable";
|
import waitForElectronToBeReadyInjectable from "../electron-app/features/wait-for-electron-to-be-ready.injectable";
|
||||||
import { appPathsRunnablePhaseInjectionToken, showInitialWindowRunnablePhaseInjectionToken, showLoadingRunnablePhaseInjectionToken } from "./runnable-tokens/phases";
|
|
||||||
|
|
||||||
const startMainApplicationInjectable = getInjectable({
|
const startMainApplicationInjectable = getInjectable({
|
||||||
id: "start-main-application",
|
id: "start-main-application",
|
||||||
@ -21,13 +17,13 @@ const startMainApplicationInjectable = getInjectable({
|
|||||||
const runManySync = runManySyncFor(di);
|
const runManySync = runManySyncFor(di);
|
||||||
const waitForElectronToBeReady = di.inject(waitForElectronToBeReadyInjectable);
|
const waitForElectronToBeReady = di.inject(waitForElectronToBeReadyInjectable);
|
||||||
|
|
||||||
const appPathsRunnablePhase = runManySync(appPathsRunnablePhaseInjectionToken);
|
const appPathsRunnablePhase = runManySync(phases.appPathsRunnablePhaseInjectionToken);
|
||||||
const beforeElectronIsReady = runManySync(beforeElectronIsReadyInjectionToken);
|
const beforeElectronIsReady = runManySync(phases.beforeElectronIsReadyInjectionToken);
|
||||||
const beforeApplicationIsLoading = runMany(beforeApplicationIsLoadingInjectionToken);
|
const beforeApplicationIsLoading = runMany(phases.beforeApplicationIsLoadingInjectionToken);
|
||||||
const showLoadingRunnablePhase = runMany(showLoadingRunnablePhaseInjectionToken);
|
const showLoadingRunnablePhase = runMany(phases.showLoadingRunnablePhaseInjectionToken);
|
||||||
const onLoadOfApplication = runMany(onLoadOfApplicationInjectionToken);
|
const onLoadOfApplication = runMany(phases.onLoadOfApplicationInjectionToken);
|
||||||
const showInitialWindowRunnablePhase = runMany(showInitialWindowRunnablePhaseInjectionToken);
|
const showInitialWindowRunnablePhase = runMany(phases.showInitialWindowRunnablePhaseInjectionToken);
|
||||||
const afterApplicationIsLoaded = runMany(afterApplicationIsLoadedInjectionToken);
|
const afterApplicationIsLoaded = runMany(phases.afterApplicationIsLoadedInjectionToken);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
// Stuff happening before application is ready needs to be synchronous because of
|
// Stuff happening before application is ready needs to be synchronous because of
|
||||||
|
|||||||
@ -5,24 +5,21 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import userStoreFileNameMigrationInjectable from "../../common/user-store/file-name-migration.injectable";
|
import userStoreFileNameMigrationInjectable from "../../common/user-store/file-name-migration.injectable";
|
||||||
import userStoreInjectable from "../../common/user-store/user-store.injectable";
|
import userStoreInjectable from "../../common/user-store/user-store.injectable";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "../start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
import { beforeApplicationIsLoadingInjectionToken } from "../start-main-application/runnable-tokens/phases";
|
||||||
import initDefaultUpdateChannelInjectable from "../vars/default-update-channel/init.injectable";
|
import initDefaultUpdateChannelInjectable from "../vars/default-update-channel/init.injectable";
|
||||||
|
|
||||||
const initUserStoreInjectable = getInjectable({
|
const initUserStoreInjectable = getInjectable({
|
||||||
id: "init-user-store",
|
id: "init-user-store",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const userStore = di.inject(userStoreInjectable);
|
const userStore = di.inject(userStoreInjectable);
|
||||||
const userStoreFileNameMigration = di.inject(userStoreFileNameMigrationInjectable);
|
const userStoreFileNameMigration = di.inject(userStoreFileNameMigrationInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "init-user-store",
|
|
||||||
run: async () => {
|
|
||||||
await userStoreFileNameMigration();
|
await userStoreFileNameMigration();
|
||||||
userStore.load();
|
userStore.load();
|
||||||
},
|
},
|
||||||
runAfter: di.inject(initDefaultUpdateChannelInjectable),
|
runAfter: initDefaultUpdateChannelInjectable,
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -4,21 +4,18 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import syncThemeFromOperatingSystemInjectable from "../../electron-app/features/sync-theme-from-operating-system.injectable";
|
import syncThemeFromOperatingSystemInjectable from "../../electron-app/features/sync-theme-from-operating-system.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const startSyncingThemeFromOperatingSystemInjectable = getInjectable({
|
const startSyncingThemeFromOperatingSystemInjectable = getInjectable({
|
||||||
id: "start-syncing-theme-from-operating-system",
|
id: "start-syncing-theme-from-operating-system",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const syncTheme = di.inject(syncThemeFromOperatingSystemInjectable);
|
const syncTheme = di.inject(syncThemeFromOperatingSystemInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "start-syncing-theme-from-operating-system",
|
|
||||||
run: () => {
|
|
||||||
syncTheme.start();
|
syncTheme.start();
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,19 +4,20 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import syncThemeFromOperatingSystemInjectable from "../../electron-app/features/sync-theme-from-operating-system.injectable";
|
import syncThemeFromOperatingSystemInjectable from "../../electron-app/features/sync-theme-from-operating-system.injectable";
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
|
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const stopSyncingThemeFromOperatingSystemInjectable = getInjectable({
|
const stopSyncingThemeFromOperatingSystemInjectable = getInjectable({
|
||||||
id: "stop-syncing-theme-from-operating-system",
|
id: "stop-syncing-theme-from-operating-system",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const syncTheme = di.inject(syncThemeFromOperatingSystemInjectable);
|
const syncTheme = di.inject(syncThemeFromOperatingSystemInjectable);
|
||||||
|
|
||||||
return {
|
syncTheme.stop();
|
||||||
id: "stop-syncing-theme-from-operating-system",
|
|
||||||
run: () => void syncTheme.stop(),
|
return undefined;
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,22 +3,19 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import electronTrayInjectable from "./electron-tray.injectable";
|
import electronTrayInjectable from "./electron-tray.injectable";
|
||||||
|
|
||||||
const startTrayInjectable = getInjectable({
|
const startTrayInjectable = getInjectable({
|
||||||
id: "start-tray",
|
id: "start-tray",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const electronTray = di.inject(electronTrayInjectable);
|
const electronTray = di.inject(electronTrayInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "start-tray",
|
|
||||||
run: () => {
|
|
||||||
electronTray.start();
|
electronTray.start();
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,21 +4,22 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import electronTrayInjectable from "./electron-tray.injectable";
|
import electronTrayInjectable from "./electron-tray.injectable";
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
|
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import stopReactiveTrayMenuItemsInjectable from "../reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable";
|
import stopReactiveTrayMenuItemsInjectable from "../reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable";
|
||||||
|
|
||||||
const stopTrayInjectable = getInjectable({
|
const stopTrayInjectable = getInjectable({
|
||||||
id: "stop-tray",
|
id: "stop-tray",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const electronTray = di.inject(electronTrayInjectable);
|
const electronTray = di.inject(electronTrayInjectable);
|
||||||
|
|
||||||
return {
|
electronTray.stop();
|
||||||
id: "stop-tray",
|
|
||||||
run: () => void electronTray.stop(),
|
return undefined;
|
||||||
runAfter: di.inject(stopReactiveTrayMenuItemsInjectable),
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
runAfter: stopReactiveTrayMenuItemsInjectable,
|
||||||
|
}),
|
||||||
|
|
||||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,25 +3,22 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import startTrayInjectable from "../electron-tray/start-tray.injectable";
|
import startTrayInjectable from "../electron-tray/start-tray.injectable";
|
||||||
import reactiveTrayMenuIconInjectable from "./reactive.injectable";
|
import reactiveTrayMenuIconInjectable from "./reactive.injectable";
|
||||||
|
|
||||||
const startReactiveTrayMenuIconInjectable = getInjectable({
|
const startReactiveTrayMenuIconInjectable = getInjectable({
|
||||||
id: "start-reactive-tray-menu-icon",
|
id: "start-reactive-tray-menu-icon",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const reactiveTrayMenuIcon = di.inject(reactiveTrayMenuIconInjectable);
|
const reactiveTrayMenuIcon = di.inject(reactiveTrayMenuIconInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "start-reactive-tray-menu-icon",
|
|
||||||
run: () => {
|
|
||||||
reactiveTrayMenuIcon.start();
|
reactiveTrayMenuIcon.start();
|
||||||
},
|
},
|
||||||
|
|
||||||
runAfter: di.inject(startTrayInjectable),
|
runAfter: startTrayInjectable,
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,20 +3,21 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
|
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import reactiveTrayMenuIconInjectable from "./reactive.injectable";
|
import reactiveTrayMenuIconInjectable from "./reactive.injectable";
|
||||||
|
|
||||||
const stopReactiveTrayMenuIconInjectable = getInjectable({
|
const stopReactiveTrayMenuIconInjectable = getInjectable({
|
||||||
id: "stop-reactive-tray-menu-icon",
|
id: "stop-reactive-tray-menu-icon",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const reactiveTrayMenuIcon = di.inject(reactiveTrayMenuIconInjectable);
|
const reactiveTrayMenuIcon = di.inject(reactiveTrayMenuIconInjectable);
|
||||||
|
|
||||||
return {
|
reactiveTrayMenuIcon.stop();
|
||||||
id: "stop-reactive-tray-menu-icon",
|
|
||||||
run: () => void reactiveTrayMenuIcon.stop(),
|
return undefined;
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,24 +4,20 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import reactiveTrayMenuItemsInjectable from "./reactive-tray-menu-items.injectable";
|
import reactiveTrayMenuItemsInjectable from "./reactive-tray-menu-items.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import startTrayInjectable from "../electron-tray/start-tray.injectable";
|
import startTrayInjectable from "../electron-tray/start-tray.injectable";
|
||||||
|
|
||||||
const startReactiveTrayMenuItemsInjectable = getInjectable({
|
const startReactiveTrayMenuItemsInjectable = getInjectable({
|
||||||
id: "start-reactive-tray-menu-items",
|
id: "start-reactive-tray-menu-items",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const reactiveTrayMenuItems = di.inject(reactiveTrayMenuItemsInjectable);
|
const reactiveTrayMenuItems = di.inject(reactiveTrayMenuItemsInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "start-reactive-tray-menu-items",
|
|
||||||
run: () => {
|
|
||||||
reactiveTrayMenuItems.start();
|
reactiveTrayMenuItems.start();
|
||||||
},
|
},
|
||||||
|
runAfter: startTrayInjectable,
|
||||||
runAfter: di.inject(startTrayInjectable),
|
}),
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,19 +4,20 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import reactiveTrayMenuItemsInjectable from "./reactive-tray-menu-items.injectable";
|
import reactiveTrayMenuItemsInjectable from "./reactive-tray-menu-items.injectable";
|
||||||
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
|
import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const stopReactiveTrayMenuItemsInjectable = getInjectable({
|
const stopReactiveTrayMenuItemsInjectable = getInjectable({
|
||||||
id: "stop-reactive-tray-menu-items",
|
id: "stop-reactive-tray-menu-items",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const reactiveTrayMenuItems = di.inject(reactiveTrayMenuItemsInjectable);
|
const reactiveTrayMenuItems = di.inject(reactiveTrayMenuItemsInjectable);
|
||||||
|
|
||||||
return {
|
reactiveTrayMenuItems.stop();
|
||||||
id: "stop-reactive-tray-menu-items",
|
|
||||||
run: () => void reactiveTrayMenuItems.stop(),
|
return undefined;
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
injectionToken: beforeQuitOfBackEndInjectionToken,
|
injectionToken: beforeQuitOfBackEndInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -6,17 +6,15 @@ import { getInjectable } from "@ogre-tools/injectable";
|
|||||||
import { reaction } from "mobx";
|
import { reaction } from "mobx";
|
||||||
import userStoreInjectable from "../../common/user-store/user-store.injectable";
|
import userStoreInjectable from "../../common/user-store/user-store.injectable";
|
||||||
import setLoginItemSettingsInjectable from "../electron-app/features/set-login-item-settings.injectable";
|
import setLoginItemSettingsInjectable from "../electron-app/features/set-login-item-settings.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../start-main-application/runnable-tokens/phases";
|
||||||
|
|
||||||
const setupSyncOpenAtLoginWithOsInjectable = getInjectable({
|
const setupSyncOpenAtLoginWithOsInjectable = getInjectable({
|
||||||
id: "setup-sync-open-at-login-with-os",
|
id: "setup-sync-open-at-login-with-os",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const setLoginItemSettings = di.inject(setLoginItemSettingsInjectable);
|
const setLoginItemSettings = di.inject(setLoginItemSettingsInjectable);
|
||||||
const userStore = di.inject(userStoreInjectable);
|
const userStore = di.inject(userStoreInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "setup-sync-open-at-login-with-os",
|
|
||||||
run: () => {
|
|
||||||
reaction(() => userStore.openAtLogin, openAtLogin => {
|
reaction(() => userStore.openAtLogin, openAtLogin => {
|
||||||
setLoginItemSettings({
|
setLoginItemSettings({
|
||||||
openAtLogin,
|
openAtLogin,
|
||||||
@ -27,8 +25,7 @@ const setupSyncOpenAtLoginWithOsInjectable = getInjectable({
|
|||||||
fireImmediately: true,
|
fireImmediately: true,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -3,25 +3,22 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../../start-main-application/runnable-tokens/phases";
|
||||||
import listeningOnMessageChannelsInjectable from "../../../../common/utils/channel/listening-on-message-channels.injectable";
|
import listeningOnMessageChannelsInjectable from "../../../../common/utils/channel/listening-on-message-channels.injectable";
|
||||||
import listeningOnRequestChannelsInjectable from "./listening-on-request-channels.injectable";
|
import listeningOnRequestChannelsInjectable from "./listening-on-request-channels.injectable";
|
||||||
|
|
||||||
const startListeningOnChannelsInjectable = getInjectable({
|
const startListeningOnChannelsInjectable = getInjectable({
|
||||||
id: "start-listening-on-channels-main",
|
id: "start-listening-on-channels-main",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: () => {
|
||||||
const listeningOnMessageChannels = di.inject(listeningOnMessageChannelsInjectable);
|
const listeningOnMessageChannels = di.inject(listeningOnMessageChannelsInjectable);
|
||||||
const listeningOnRequestChannels = di.inject(listeningOnRequestChannelsInjectable);
|
const listeningOnRequestChannels = di.inject(listeningOnRequestChannelsInjectable);
|
||||||
|
|
||||||
return {
|
|
||||||
id: "start-listening-on-channels-main",
|
|
||||||
run: () => {
|
|
||||||
listeningOnMessageChannels.start();
|
listeningOnMessageChannels.start();
|
||||||
listeningOnRequestChannels.start();
|
listeningOnRequestChannels.start();
|
||||||
},
|
},
|
||||||
};
|
}),
|
||||||
},
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,19 +3,18 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import buildVersionInjectable from "./build-version.injectable";
|
import buildVersionInjectable from "./build-version.injectable";
|
||||||
|
|
||||||
const initializeBuildVersionInjectable = getInjectable({
|
const initializeBuildVersionInjectable = getInjectable({
|
||||||
id: "initialize-build-version",
|
id: "initialize-build-version",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const buildVersion = di.inject(buildVersionInjectable);
|
const buildVersion = di.inject(buildVersionInjectable);
|
||||||
|
|
||||||
return {
|
await buildVersion.init();
|
||||||
id: "initialize-build-version",
|
|
||||||
run: () => buildVersion.init(),
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -3,21 +3,20 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import initReleaseChannelInjectable from "../release-channel/init.injectable";
|
import initReleaseChannelInjectable from "../release-channel/init.injectable";
|
||||||
import defaultUpdateChannelInjectable from "../../../features/application-update/common/selected-update-channel/default-update-channel.injectable";
|
import defaultUpdateChannelInjectable from "../../../features/application-update/common/selected-update-channel/default-update-channel.injectable";
|
||||||
|
|
||||||
const initDefaultUpdateChannelInjectable = getInjectable({
|
const initDefaultUpdateChannelInjectable = getInjectable({
|
||||||
id: "init-default-update-channel",
|
id: "init-default-update-channel",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const defaultUpdateChannel = di.inject(defaultUpdateChannelInjectable);
|
const defaultUpdateChannel = di.inject(defaultUpdateChannelInjectable);
|
||||||
|
|
||||||
return {
|
await defaultUpdateChannel.init();
|
||||||
id: "init-default-update-channel",
|
|
||||||
run: () => defaultUpdateChannel.init(),
|
|
||||||
runAfter: di.inject(initReleaseChannelInjectable),
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
runAfter: initReleaseChannelInjectable,
|
||||||
|
}),
|
||||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -4,20 +4,19 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import releaseChannelInjectable from "../../../common/vars/release-channel.injectable";
|
import releaseChannelInjectable from "../../../common/vars/release-channel.injectable";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import initSemanticBuildVersionInjectable from "../semantic-build-version/init.injectable";
|
import initSemanticBuildVersionInjectable from "../semantic-build-version/init.injectable";
|
||||||
|
|
||||||
const initReleaseChannelInjectable = getInjectable({
|
const initReleaseChannelInjectable = getInjectable({
|
||||||
id: "init-release-channel",
|
id: "init-release-channel",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => ({
|
||||||
|
run: async () => {
|
||||||
const releaseChannel = di.inject(releaseChannelInjectable);
|
const releaseChannel = di.inject(releaseChannelInjectable);
|
||||||
|
|
||||||
return {
|
await releaseChannel.init();
|
||||||
id: "init-release-channel",
|
|
||||||
run: () => releaseChannel.init(),
|
|
||||||
runAfter: di.inject(initSemanticBuildVersionInjectable),
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
runAfter: initSemanticBuildVersionInjectable,
|
||||||
|
}),
|
||||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -4,18 +4,19 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import buildSemanticVersionInjectable from "../../../common/vars/build-semantic-version.injectable";
|
import buildSemanticVersionInjectable from "../../../common/vars/build-semantic-version.injectable";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
import { beforeApplicationIsLoadingInjectionToken } from "../../start-main-application/runnable-tokens/phases";
|
||||||
import initializeBuildVersionInjectable from "../build-version/init.injectable";
|
import initializeBuildVersionInjectable from "../build-version/init.injectable";
|
||||||
|
|
||||||
const initSemanticBuildVersionInjectable = getInjectable({
|
const initSemanticBuildVersionInjectable = getInjectable({
|
||||||
id: "init-semantic-build-version",
|
id: "init-semantic-build-version",
|
||||||
instantiate: (di) => {
|
instantiate: (di) => {
|
||||||
|
return {
|
||||||
|
run: async () => {
|
||||||
const buildSemanticVersion = di.inject(buildSemanticVersionInjectable);
|
const buildSemanticVersion = di.inject(buildSemanticVersionInjectable);
|
||||||
|
|
||||||
return {
|
await buildSemanticVersion.init();
|
||||||
id: "init-semantic-build-version",
|
},
|
||||||
run: () => buildSemanticVersion.init(),
|
runAfter: initializeBuildVersionInjectable,
|
||||||
runAfter: di.inject(initializeBuildVersionInjectable),
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
||||||
|
|||||||
@ -12,7 +12,6 @@ const setupAppPathsInjectable = getInjectable({
|
|||||||
id: "setup-app-paths",
|
id: "setup-app-paths",
|
||||||
|
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-app-paths",
|
|
||||||
run: async () => {
|
run: async () => {
|
||||||
const requestFromChannel = di.inject(requestFromChannelInjectionToken);
|
const requestFromChannel = di.inject(requestFromChannelInjectionToken);
|
||||||
const appPathsState = di.inject(appPathsStateInjectable);
|
const appPathsState = di.inject(appPathsStateInjectable);
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import { beforeFrameStartsFirstInjectionToken } from "../tokens";
|
|||||||
const configureImmerInjectable = getInjectable({
|
const configureImmerInjectable = getInjectable({
|
||||||
id: "configure-immer",
|
id: "configure-immer",
|
||||||
instantiate: () => ({
|
instantiate: () => ({
|
||||||
id: "configure-immer",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
// Docs: https://immerjs.github.io/immer/
|
// Docs: https://immerjs.github.io/immer/
|
||||||
// Required in `utils/storage-helper.ts`
|
// Required in `utils/storage-helper.ts`
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import { beforeFrameStartsFirstInjectionToken } from "../tokens";
|
|||||||
const configureMobxInjectable = getInjectable({
|
const configureMobxInjectable = getInjectable({
|
||||||
id: "configure-mobx",
|
id: "configure-mobx",
|
||||||
instantiate: () => ({
|
instantiate: () => ({
|
||||||
id: "configure-mobx",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
// Docs: https://mobx.js.org/configuration.html
|
// Docs: https://mobx.js.org/configuration.html
|
||||||
configure({
|
configure({
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
|||||||
const loadMonacoThemesInjectable = getInjectable({
|
const loadMonacoThemesInjectable = getInjectable({
|
||||||
id: "load-monaco-themes",
|
id: "load-monaco-themes",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "load-monaco-themes",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const customThemes = di.injectMany(customMonacoThemeInjectionToken);
|
const customThemes = di.injectMany(customMonacoThemeInjectionToken);
|
||||||
const addNewMonacoTheme = di.inject(addNewMonacoThemeInjectable);
|
const addNewMonacoTheme = di.inject(addNewMonacoThemeInjectable);
|
||||||
|
|||||||
@ -19,7 +19,6 @@ import maybeKubeApiInjectable from "../../../common/k8s-api/maybe-kube-api.injec
|
|||||||
const setupAutoRegistrationInjectable = getInjectable({
|
const setupAutoRegistrationInjectable = getInjectable({
|
||||||
id: "setup-auto-registration",
|
id: "setup-auto-registration",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-auto-registration",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const autoRegistrationEmitter = di.inject(autoRegistrationEmitterInjectable);
|
const autoRegistrationEmitter = di.inject(autoRegistrationEmitterInjectable);
|
||||||
const beforeApiManagerInitializationCrds: CustomResourceDefinition[] = [];
|
const beforeApiManagerInitializationCrds: CustomResourceDefinition[] = [];
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import { beforeMainFrameStartsFirstInjectionToken } from "../tokens";
|
|||||||
const setupCurrentClusterBroadcastInjectable = getInjectable({
|
const setupCurrentClusterBroadcastInjectable = getInjectable({
|
||||||
id: "setup-current-cluster-broadcast",
|
id: "setup-current-cluster-broadcast",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-current-cluster-broadcast",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const matchedClusterId = di.inject(matchedClusterIdInjectable);
|
const matchedClusterId = di.inject(matchedClusterIdInjectable);
|
||||||
const sendMessageToChannel = di.inject(sendMessageToChannelInjectionToken);
|
const sendMessageToChannel = di.inject(sendMessageToChannelInjectionToken);
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
|||||||
const setupKubernetesClusterCatalogAddMenuListenerInjectable = getInjectable({
|
const setupKubernetesClusterCatalogAddMenuListenerInjectable = getInjectable({
|
||||||
id: "setup-kubernetes-cluster-catalog-add-menu-listener",
|
id: "setup-kubernetes-cluster-catalog-add-menu-listener",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-kubernetes-cluster-catalog-add-menu-listener",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const navigateToAddCluster = di.inject(navigateToAddClusterInjectable);
|
const navigateToAddCluster = di.inject(navigateToAddClusterInjectable);
|
||||||
const addSyncEntries = di.inject(addSyncEntriesInjectable);
|
const addSyncEntries = di.inject(addSyncEntriesInjectable);
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
|||||||
const setupKubernetesClusterContextMenuOpenInjectable = getInjectable({
|
const setupKubernetesClusterContextMenuOpenInjectable = getInjectable({
|
||||||
id: "setup-kubernetes-cluster-context-menu-open",
|
id: "setup-kubernetes-cluster-context-menu-open",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-kubernetes-cluster-context-menu-open",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const catalogCategoryRegistry = di.inject(catalogCategoryRegistryInjectable);
|
const catalogCategoryRegistry = di.inject(catalogCategoryRegistryInjectable);
|
||||||
const openDeleteClusterDialog = di.inject(openDeleteClusterDialogInjectable);
|
const openDeleteClusterDialog = di.inject(openDeleteClusterDialogInjectable);
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import requestLensProxyCertificateInjectable from "../../certificate/request-len
|
|||||||
const setupLensProxyCertificateInjectable = getInjectable({
|
const setupLensProxyCertificateInjectable = getInjectable({
|
||||||
id: "setup-lens-proxy-certificate",
|
id: "setup-lens-proxy-certificate",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-lens-proxy-certificate",
|
|
||||||
run: async () => {
|
run: async () => {
|
||||||
const requestLensProxyCertificate = di.inject(requestLensProxyCertificateInjectable);
|
const requestLensProxyCertificate = di.inject(requestLensProxyCertificateInjectable);
|
||||||
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable);
|
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable);
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
|||||||
const setupRootMacClassnameInjectable = getInjectable({
|
const setupRootMacClassnameInjectable = getInjectable({
|
||||||
id: "setup-root-mac-classname",
|
id: "setup-root-mac-classname",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-root-mac-classname",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const isMac = di.inject(isMacInjectable);
|
const isMac = di.inject(isMacInjectable);
|
||||||
const rootElem = document.getElementById("app");
|
const rootElem = document.getElementById("app");
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import { init } from "@sentry/electron/renderer";
|
|||||||
const setupSentryInjectable = getInjectable({
|
const setupSentryInjectable = getInjectable({
|
||||||
id: "setup-sentry",
|
id: "setup-sentry",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-sentry",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable);
|
const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable);
|
||||||
|
|
||||||
|
|||||||
@ -9,10 +9,9 @@ import { WeblinkAddCommand } from "../../components/catalog-entities/weblink-add
|
|||||||
import commandOverlayInjectable from "../../components/command-palette/command-overlay.injectable";
|
import commandOverlayInjectable from "../../components/command-palette/command-overlay.injectable";
|
||||||
import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
import { beforeFrameStartsSecondInjectionToken } from "../tokens";
|
||||||
|
|
||||||
const setupWeblickContextMenuOpenInjectable = getInjectable({
|
const setupWeblinkContextMenuOpenInjectable = getInjectable({
|
||||||
id: "setup-weblick-context-menu-open",
|
id: "setup-weblink-context-menu-open",
|
||||||
instantiate: (di) => ({
|
instantiate: (di) => ({
|
||||||
id: "setup-weblick-context-menu-open",
|
|
||||||
run: () => {
|
run: () => {
|
||||||
const catalogCategoryRegistry = di.inject(catalogCategoryRegistryInjectable);
|
const catalogCategoryRegistry = di.inject(catalogCategoryRegistryInjectable);
|
||||||
const commandOverlay = di.inject(commandOverlayInjectable);
|
const commandOverlay = di.inject(commandOverlayInjectable);
|
||||||
@ -31,4 +30,4 @@ const setupWeblickContextMenuOpenInjectable = getInjectable({
|
|||||||
injectionToken: beforeFrameStartsSecondInjectionToken,
|
injectionToken: beforeFrameStartsSecondInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default setupWeblickContextMenuOpenInjectable;
|
export default setupWeblinkContextMenuOpenInjectable;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||||
import type { Runnable } from "../../common/runnable/run-many-for";
|
import type { Runnable } from "../../common/runnable/types";
|
||||||
|
|
||||||
// NOTE: these are run before any other token, mostly to set up things that all other runnables need
|
// NOTE: these are run before any other token, mostly to set up things that all other runnables need
|
||||||
export const beforeFrameStartsFirstInjectionToken = getInjectionToken<Runnable>({
|
export const beforeFrameStartsFirstInjectionToken = getInjectionToken<Runnable>({
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user