1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Remove explicit singleton as lifecycle for being default

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-02-09 11:03:31 +02:00
parent 063ffef37c
commit eecd4d556e
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
195 changed files with 193 additions and 533 deletions

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { appEventBus } from "./event-bus"; import { appEventBus } from "./event-bus";
const appEventBusInjectable = getInjectable({ const appEventBusInjectable = getInjectable({
id: "app-event-bus", id: "app-event-bus",
instantiate: () => appEventBus, instantiate: () => appEventBus,
lifecycle: lifecycleEnum.singleton,
}); });
export default appEventBusInjectable; export default appEventBusInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import path from "path"; import path from "path";
import directoryForUserDataInjectable from "../directory-for-user-data/directory-for-user-data.injectable"; import directoryForUserDataInjectable from "../directory-for-user-data/directory-for-user-data.injectable";
@ -11,8 +11,6 @@ const directoryForBinariesInjectable = getInjectable({
instantiate: (di) => instantiate: (di) =>
path.join(di.inject(directoryForUserDataInjectable), "binaries"), path.join(di.inject(directoryForUserDataInjectable), "binaries"),
lifecycle: lifecycleEnum.singleton,
}); });
export default directoryForBinariesInjectable; export default directoryForBinariesInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { appPathsInjectionToken } from "../app-path-injection-token"; import { appPathsInjectionToken } from "../app-path-injection-token";
const directoryForDownloadsInjectable = getInjectable({ const directoryForDownloadsInjectable = getInjectable({
id: "directory-for-downloads", id: "directory-for-downloads",
instantiate: (di) => di.inject(appPathsInjectionToken).downloads, instantiate: (di) => di.inject(appPathsInjectionToken).downloads,
lifecycle: lifecycleEnum.singleton,
}); });
export default directoryForDownloadsInjectable; export default directoryForDownloadsInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { appPathsInjectionToken } from "../app-path-injection-token"; import { appPathsInjectionToken } from "../app-path-injection-token";
const directoryForExesInjectable = getInjectable({ const directoryForExesInjectable = getInjectable({
id: "directory-for-exes", id: "directory-for-exes",
instantiate: (di) => di.inject(appPathsInjectionToken).exe, instantiate: (di) => di.inject(appPathsInjectionToken).exe,
lifecycle: lifecycleEnum.singleton,
}); });
export default directoryForExesInjectable; export default directoryForExesInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import directoryForUserDataInjectable from "../directory-for-user-data/directory-for-user-data.injectable"; import directoryForUserDataInjectable from "../directory-for-user-data/directory-for-user-data.injectable";
import path from "path"; import path from "path";
@ -11,8 +11,6 @@ const directoryForKubeConfigsInjectable = getInjectable({
instantiate: (di) => instantiate: (di) =>
path.resolve(di.inject(directoryForUserDataInjectable), "kubeconfigs"), path.resolve(di.inject(directoryForUserDataInjectable), "kubeconfigs"),
lifecycle: lifecycleEnum.singleton,
}); });
export default directoryForKubeConfigsInjectable; export default directoryForKubeConfigsInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { appPathsInjectionToken } from "../app-path-injection-token"; import { appPathsInjectionToken } from "../app-path-injection-token";
const directoryForTempInjectable = getInjectable({ const directoryForTempInjectable = getInjectable({
id: "directory-for-temp", id: "directory-for-temp",
instantiate: (di) => di.inject(appPathsInjectionToken).temp, instantiate: (di) => di.inject(appPathsInjectionToken).temp,
lifecycle: lifecycleEnum.singleton,
}); });
export default directoryForTempInjectable; export default directoryForTempInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { appPathsInjectionToken } from "../app-path-injection-token"; import { appPathsInjectionToken } from "../app-path-injection-token";
const directoryForUserDataInjectable = getInjectable({ const directoryForUserDataInjectable = getInjectable({
id: "directory-for-user-data", id: "directory-for-user-data",
instantiate: (di) => di.inject(appPathsInjectionToken).userData, instantiate: (di) => di.inject(appPathsInjectionToken).userData,
lifecycle: lifecycleEnum.singleton,
}); });
export default directoryForUserDataInjectable; export default directoryForUserDataInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import path from "path"; import path from "path";
import directoryForKubeConfigsInjectable from "../directory-for-kube-configs/directory-for-kube-configs.injectable"; import directoryForKubeConfigsInjectable from "../directory-for-kube-configs/directory-for-kube-configs.injectable";
@ -17,8 +17,6 @@ const getCustomKubeConfigDirectoryInjectable = getInjectable({
directoryName, directoryName,
); );
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default getCustomKubeConfigDirectoryInjectable; export default getCustomKubeConfigDirectoryInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { comparer, computed } from "mobx"; import { comparer, computed } from "mobx";
import hostedClusterInjectable from "./hosted-cluster.injectable"; import hostedClusterInjectable from "./hosted-cluster.injectable";
@ -17,7 +17,6 @@ const allowedResourcesInjectable = getInjectable({
equals: (cur, prev) => comparer.structural(cur, prev), equals: (cur, prev) => comparer.structural(cur, prev),
}); });
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default allowedResourcesInjectable; export default allowedResourcesInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { ClusterStore } from "./cluster-store"; import { ClusterStore } from "./cluster-store";
import { createClusterInjectionToken } from "../cluster/create-cluster-injection-token"; import { createClusterInjectionToken } from "../cluster/create-cluster-injection-token";
@ -13,8 +13,6 @@ const clusterStoreInjectable = getInjectable({
ClusterStore.createInstance({ ClusterStore.createInstance({
createCluster: di.inject(createClusterInjectionToken), createCluster: di.inject(createClusterInjectionToken),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default clusterStoreInjectable; export default clusterStoreInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { getHostedClusterId } from "../utils"; import { getHostedClusterId } from "../utils";
import clusterStoreInjectable from "./cluster-store.injectable"; import clusterStoreInjectable from "./cluster-store.injectable";
@ -14,8 +14,6 @@ const hostedClusterInjectable = getInjectable({
return di.inject(clusterStoreInjectable).getById(hostedClusterId); return di.inject(clusterStoreInjectable).getById(hostedClusterId);
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default hostedClusterInjectable; export default hostedClusterInjectable;

View File

@ -5,7 +5,7 @@
import { AuthorizationV1Api, KubeConfig, V1ResourceAttributes } from "@kubernetes/client-node"; import { AuthorizationV1Api, KubeConfig, V1ResourceAttributes } from "@kubernetes/client-node";
import logger from "../logger"; import logger from "../logger";
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
export type CanI = (resourceAttributes: V1ResourceAttributes) => Promise<boolean>; export type CanI = (resourceAttributes: V1ResourceAttributes) => Promise<boolean>;
@ -40,7 +40,6 @@ export function authorizationReview(proxyConfig: KubeConfig): CanI {
const authorizationReviewInjectable = getInjectable({ const authorizationReviewInjectable = getInjectable({
id: "authorization-review", id: "authorization-review",
instantiate: () => authorizationReview, instantiate: () => authorizationReview,
lifecycle: lifecycleEnum.singleton,
}); });
export default authorizationReviewInjectable; export default authorizationReviewInjectable;

View File

@ -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 { CoreV1Api, KubeConfig } from "@kubernetes/client-node"; import { CoreV1Api, KubeConfig } from "@kubernetes/client-node";
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
export type ListNamespaces = () => Promise<string[]>; export type ListNamespaces = () => Promise<string[]>;
@ -20,7 +20,6 @@ export function listNamespaces(config: KubeConfig): ListNamespaces {
const listNamespacesInjectable = getInjectable({ const listNamespacesInjectable = getInjectable({
id: "list-namespaces", id: "list-namespaces",
instantiate: () => listNamespaces, instantiate: () => listNamespaces,
lifecycle: lifecycleEnum.singleton,
}); });
export default listNamespacesInjectable; export default listNamespacesInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import path from "path"; import path from "path";
import directoryForUserDataInjectable from "../app-paths/directory-for-user-data/directory-for-user-data.injectable"; import directoryForUserDataInjectable from "../app-paths/directory-for-user-data/directory-for-user-data.injectable";
@ -14,8 +14,6 @@ const directoryForLensLocalStorageInjectable = getInjectable({
di.inject(directoryForUserDataInjectable), di.inject(directoryForUserDataInjectable),
"lens-local-storage", "lens-local-storage",
), ),
lifecycle: lifecycleEnum.singleton,
}); });
export default directoryForLensLocalStorageInjectable; export default directoryForLensLocalStorageInjectable;

View File

@ -2,14 +2,13 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import fse from "fs-extra"; import fse from "fs-extra";
const fsInjectable = getInjectable({ const fsInjectable = getInjectable({
id: "fs", id: "fs",
instantiate: () => fse, instantiate: () => fse,
causesSideEffects: true, causesSideEffects: true,
lifecycle: lifecycleEnum.singleton,
}); });
export default fsInjectable; export default fsInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import fsInjectable from "./fs.injectable"; import fsInjectable from "./fs.injectable";
const readDirInjectable = getInjectable({ const readDirInjectable = getInjectable({
id: "read-dir", id: "read-dir",
instantiate: (di) => di.inject(fsInjectable).readdir, instantiate: (di) => di.inject(fsInjectable).readdir,
lifecycle: lifecycleEnum.singleton,
}); });
export default readDirInjectable; export default readDirInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import fsInjectable from "./fs.injectable"; import fsInjectable from "./fs.injectable";
const readFileInjectable = getInjectable({ const readFileInjectable = getInjectable({
id: "read-file", id: "read-file",
instantiate: (di) => di.inject(fsInjectable).readFile, instantiate: (di) => di.inject(fsInjectable).readFile,
lifecycle: lifecycleEnum.singleton,
}); });
export default readFileInjectable; export default readFileInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import fsInjectable from "./fs.injectable"; import fsInjectable from "./fs.injectable";
const readJsonFileInjectable = getInjectable({ const readJsonFileInjectable = getInjectable({
id: "read-json-file", id: "read-json-file",
instantiate: (di) => di.inject(fsInjectable).readJson, instantiate: (di) => di.inject(fsInjectable).readJson,
lifecycle: lifecycleEnum.singleton,
}); });
export default readJsonFileInjectable; export default readJsonFileInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import type { EnsureOptions, WriteOptions } from "fs-extra"; import type { EnsureOptions, WriteOptions } from "fs-extra";
import path from "path"; import path from "path";
import type { JsonValue } from "type-fest"; import type { JsonValue } from "type-fest";
@ -33,8 +33,6 @@ const writeJsonFileInjectable = getInjectable({
ensureDir, ensureDir,
}); });
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default writeJsonFileInjectable; export default writeJsonFileInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { HotbarStore } from "./hotbar-store"; import { HotbarStore } from "./hotbar-store";
const hotbarManagerInjectable = getInjectable({ const hotbarManagerInjectable = getInjectable({
id: "hotbar-manager", id: "hotbar-manager",
instantiate: () => HotbarStore.getInstance(), instantiate: () => HotbarStore.getInstance(),
lifecycle: lifecycleEnum.singleton,
}); });
export default hotbarManagerInjectable; export default hotbarManagerInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { UserStore } from "./user-store"; import { UserStore } from "./user-store";
const userStoreInjectable = getInjectable({ const userStoreInjectable = getInjectable({
id: "user-store", id: "user-store",
instantiate: () => UserStore.createInstance(), instantiate: () => UserStore.createInstance(),
lifecycle: lifecycleEnum.singleton,
}); });
export default userStoreInjectable; export default userStoreInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import allowedResourcesInjectable from "../cluster-store/allowed-resources.injectable"; import allowedResourcesInjectable from "../cluster-store/allowed-resources.injectable";
import type { KubeResource } from "../rbac"; import type { KubeResource } from "../rbac";
@ -17,8 +17,6 @@ const isAllowedResourceInjectable = getInjectable({
return (resource: KubeResource) => allowedResources.get().has(resource); return (resource: KubeResource) => allowedResources.get().has(resource);
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default isAllowedResourceInjectable; export default isAllowedResourceInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { isLinux } from "../vars"; import { isLinux } from "../vars";
const isLinuxInjectable = getInjectable({ const isLinuxInjectable = getInjectable({
id: "is-linux", id: "is-linux",
instantiate: () => isLinux, instantiate: () => isLinux,
lifecycle: lifecycleEnum.singleton,
}); });
export default isLinuxInjectable; export default isLinuxInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { isWindows } from "../vars"; import { isWindows } from "../vars";
const isWindowsInjectable = getInjectable({ const isWindowsInjectable = getInjectable({
id: "is-windows", id: "is-windows",
instantiate: () => isWindows, instantiate: () => isWindows,
lifecycle: lifecycleEnum.singleton,
}); });
export default isWindowsInjectable; export default isWindowsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import extensionsStoreInjectable from "../../extensions-store/extensions-store.injectable"; import extensionsStoreInjectable from "../../extensions-store/extensions-store.injectable";
const getEnabledExtensionsInjectable = getInjectable({ const getEnabledExtensionsInjectable = getInjectable({
@ -10,8 +10,6 @@ const getEnabledExtensionsInjectable = getInjectable({
instantiate: (di) => () => instantiate: (di) => () =>
di.inject(extensionsStoreInjectable).enabledExtensions, di.inject(extensionsStoreInjectable).enabledExtensions,
lifecycle: lifecycleEnum.singleton,
}); });
export default getEnabledExtensionsInjectable; export default getEnabledExtensionsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { ExtensionDiscovery } from "./extension-discovery"; import { ExtensionDiscovery } from "./extension-discovery";
import extensionLoaderInjectable from "../extension-loader/extension-loader.injectable"; import extensionLoaderInjectable from "../extension-loader/extension-loader.injectable";
import isCompatibleExtensionInjectable from "./is-compatible-extension/is-compatible-extension.injectable"; import isCompatibleExtensionInjectable from "./is-compatible-extension/is-compatible-extension.injectable";
@ -38,8 +38,6 @@ const extensionDiscoveryInjectable = getInjectable({
extensionPackageRootDirectoryInjectable, extensionPackageRootDirectoryInjectable,
), ),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default extensionDiscoveryInjectable; export default extensionDiscoveryInjectable;

View File

@ -2,14 +2,13 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { appSemVer } from "../../../common/vars"; import { appSemVer } from "../../../common/vars";
import { isCompatibleBundledExtension } from "./is-compatible-bundled-extension"; import { isCompatibleBundledExtension } from "./is-compatible-bundled-extension";
const isCompatibleBundledExtensionInjectable = getInjectable({ const isCompatibleBundledExtensionInjectable = getInjectable({
id: "is-compatible-bundled-extension", id: "is-compatible-bundled-extension",
instantiate: () => isCompatibleBundledExtension({ appSemVer }), instantiate: () => isCompatibleBundledExtension({ appSemVer }),
lifecycle: lifecycleEnum.singleton,
}); });
export default isCompatibleBundledExtensionInjectable; export default isCompatibleBundledExtensionInjectable;

View File

@ -2,14 +2,13 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { appSemVer } from "../../../common/vars"; import { appSemVer } from "../../../common/vars";
import { isCompatibleExtension } from "./is-compatible-extension"; import { isCompatibleExtension } from "./is-compatible-extension";
const isCompatibleExtensionInjectable = getInjectable({ const isCompatibleExtensionInjectable = getInjectable({
id: "is-compatible-extension", id: "is-compatible-extension",
instantiate: () => isCompatibleExtension({ appSemVer }), instantiate: () => isCompatibleExtension({ appSemVer }),
lifecycle: lifecycleEnum.singleton,
}); });
export default isCompatibleExtensionInjectable; export default isCompatibleExtensionInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { ExtensionInstallationStateStore } from "./extension-installation-state-store"; import { ExtensionInstallationStateStore } from "./extension-installation-state-store";
const extensionInstallationStateStoreInjectable = getInjectable({ const extensionInstallationStateStoreInjectable = getInjectable({
id: "extension-installation-state-store", id: "extension-installation-state-store",
instantiate: () => new ExtensionInstallationStateStore(), instantiate: () => new ExtensionInstallationStateStore(),
lifecycle: lifecycleEnum.singleton,
}); });
export default extensionInstallationStateStoreInjectable; export default extensionInstallationStateStoreInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { ExtensionInstaller } from "./extension-installer"; import { ExtensionInstaller } from "./extension-installer";
import extensionPackageRootDirectoryInjectable from "./extension-package-root-directory/extension-package-root-directory.injectable"; import extensionPackageRootDirectoryInjectable from "./extension-package-root-directory/extension-package-root-directory.injectable";
@ -15,8 +15,6 @@ const extensionInstallerInjectable = getInjectable({
extensionPackageRootDirectoryInjectable, extensionPackageRootDirectoryInjectable,
), ),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default extensionInstallerInjectable; export default extensionInstallerInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import directoryForUserDataInjectable import directoryForUserDataInjectable
from "../../../common/app-paths/directory-for-user-data/directory-for-user-data.injectable"; from "../../../common/app-paths/directory-for-user-data/directory-for-user-data.injectable";
@ -10,8 +10,6 @@ const extensionPackageRootDirectoryInjectable = getInjectable({
id: "extension-package-root-directory", id: "extension-package-root-directory",
instantiate: (di) => di.inject(directoryForUserDataInjectable), instantiate: (di) => di.inject(directoryForUserDataInjectable),
lifecycle: lifecycleEnum.singleton,
}); });
export default extensionPackageRootDirectoryInjectable; export default extensionPackageRootDirectoryInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import extensionInstallerInjectable from "../extension-installer.injectable"; import extensionInstallerInjectable from "../extension-installer.injectable";
const installExtensionInjectable = getInjectable({ const installExtensionInjectable = getInjectable({
id: "install-extension", id: "install-extension",
instantiate: (di) => di.inject(extensionInstallerInjectable).installPackage, instantiate: (di) => di.inject(extensionInstallerInjectable).installPackage,
lifecycle: lifecycleEnum.singleton,
}); });
export default installExtensionInjectable; export default installExtensionInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import extensionInstallerInjectable from "../extension-installer.injectable"; import extensionInstallerInjectable from "../extension-installer.injectable";
const installExtensionsInjectable = getInjectable({ const installExtensionsInjectable = getInjectable({
id: "install-extensions", id: "install-extensions",
instantiate: (di) => di.inject(extensionInstallerInjectable).installPackages, instantiate: (di) => di.inject(extensionInstallerInjectable).installPackages,
lifecycle: lifecycleEnum.singleton,
}); });
export default installExtensionsInjectable; export default installExtensionsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { createExtensionInstance } from "./create-extension-instance"; import { createExtensionInstance } from "./create-extension-instance";
import fileSystemProvisionerStoreInjectable from "./file-system-provisioner-store/file-system-provisioner-store.injectable"; import fileSystemProvisionerStoreInjectable from "./file-system-provisioner-store/file-system-provisioner-store.injectable";
@ -12,8 +12,6 @@ const createExtensionInstanceInjectable = getInjectable({
instantiate: (di) => createExtensionInstance({ instantiate: (di) => createExtensionInstance({
fileSystemProvisionerStore: di.inject(fileSystemProvisionerStoreInjectable), fileSystemProvisionerStore: di.inject(fileSystemProvisionerStoreInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default createExtensionInstanceInjectable; export default createExtensionInstanceInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import path from "path"; import path from "path";
import directoryForUserDataInjectable from "../../../../../common/app-paths/directory-for-user-data/directory-for-user-data.injectable"; import directoryForUserDataInjectable from "../../../../../common/app-paths/directory-for-user-data/directory-for-user-data.injectable";
@ -11,8 +11,6 @@ const directoryForExtensionDataInjectable = getInjectable({
instantiate: (di) => instantiate: (di) =>
path.join(di.inject(directoryForUserDataInjectable), "extension_data"), path.join(di.inject(directoryForUserDataInjectable), "extension_data"),
lifecycle: lifecycleEnum.singleton,
}); });
export default directoryForExtensionDataInjectable; export default directoryForExtensionDataInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { FileSystemProvisionerStore } from "./file-system-provisioner-store"; import { FileSystemProvisionerStore } from "./file-system-provisioner-store";
import directoryForExtensionDataInjectable from "./directory-for-extension-data/directory-for-extension-data.injectable"; import directoryForExtensionDataInjectable from "./directory-for-extension-data/directory-for-extension-data.injectable";
@ -15,8 +15,6 @@ const fileSystemProvisionerStoreInjectable = getInjectable({
directoryForExtensionDataInjectable, directoryForExtensionDataInjectable,
), ),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default fileSystemProvisionerStoreInjectable; export default fileSystemProvisionerStoreInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { ExtensionLoader } from "./extension-loader"; import { ExtensionLoader } from "./extension-loader";
import updateExtensionsStateInjectable from "./update-extensions-state/update-extensions-state.injectable"; import updateExtensionsStateInjectable from "./update-extensions-state/update-extensions-state.injectable";
import createExtensionInstanceInjectable import createExtensionInstanceInjectable
@ -16,8 +16,6 @@ const extensionLoaderInjectable = getInjectable({
updateExtensionsState: di.inject(updateExtensionsStateInjectable), updateExtensionsState: di.inject(updateExtensionsStateInjectable),
createExtensionInstance: di.inject(createExtensionInstanceInjectable), createExtensionInstance: di.inject(createExtensionInstanceInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default extensionLoaderInjectable; export default extensionLoaderInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import extensionsStoreInjectable from "../../extensions-store/extensions-store.injectable"; import extensionsStoreInjectable from "../../extensions-store/extensions-store.injectable";
const updateExtensionsStateInjectable = getInjectable({ const updateExtensionsStateInjectable = getInjectable({
id: "upadte-extensions-state", id: "upadte-extensions-state",
instantiate: (di) => di.inject(extensionsStoreInjectable).mergeState, instantiate: (di) => di.inject(extensionsStoreInjectable).mergeState,
lifecycle: lifecycleEnum.singleton,
}); });
export default updateExtensionsStateInjectable; export default updateExtensionsStateInjectable;

View File

@ -2,14 +2,13 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import directoryForUserDataInjectable import directoryForUserDataInjectable
from "../../common/app-paths/directory-for-user-data/directory-for-user-data.injectable"; from "../../common/app-paths/directory-for-user-data/directory-for-user-data.injectable";
const extensionPackagesRootInjectable = getInjectable({ const extensionPackagesRootInjectable = getInjectable({
id: "extension-packages-root", id: "extension-packages-root",
instantiate: (di) => di.inject(directoryForUserDataInjectable), instantiate: (di) => di.inject(directoryForUserDataInjectable),
lifecycle: lifecycleEnum.singleton,
}); });
export default extensionPackagesRootInjectable; export default extensionPackagesRootInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { ExtensionsStore } from "./extensions-store"; import { ExtensionsStore } from "./extensions-store";
const extensionsStoreInjectable = getInjectable({ const extensionsStoreInjectable = getInjectable({
id: "extensions-store", id: "extensions-store",
instantiate: () => ExtensionsStore.createInstance(), instantiate: () => ExtensionsStore.createInstance(),
lifecycle: lifecycleEnum.singleton,
}); });
export default extensionsStoreInjectable; export default extensionsStoreInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx"; import { computed } from "mobx";
import extensionLoaderInjectable from "./extension-loader/extension-loader.injectable"; import extensionLoaderInjectable from "./extension-loader/extension-loader.injectable";
@ -14,8 +14,6 @@ const extensionsInjectable = getInjectable({
return computed(() => extensionLoader.enabledExtensionInstances); return computed(() => extensionLoader.enabledExtensionInstances);
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default extensionsInjectable; export default extensionsInjectable;

View File

@ -2,14 +2,13 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import type { IComputedValue } from "mobx"; import type { IComputedValue } from "mobx";
import extensionsInjectable from "./extensions.injectable"; import extensionsInjectable from "./extensions.injectable";
import type { LensMainExtension } from "./lens-main-extension"; import type { LensMainExtension } from "./lens-main-extension";
const mainExtensionsInjectable = getInjectable({ const mainExtensionsInjectable = getInjectable({
id: "main-extensions", id: "main-extensions",
lifecycle: lifecycleEnum.singleton,
instantiate: (di) => instantiate: (di) =>
di.inject(extensionsInjectable) as IComputedValue<LensMainExtension[]>, di.inject(extensionsInjectable) as IComputedValue<LensMainExtension[]>,

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import type { IComputedValue } from "mobx"; import type { IComputedValue } from "mobx";
import extensionsInjectable from "./extensions.injectable"; import extensionsInjectable from "./extensions.injectable";
import type { LensRendererExtension } from "./lens-renderer-extension"; import type { LensRendererExtension } from "./lens-renderer-extension";
@ -10,7 +10,6 @@ import type { LensRendererExtension } from "./lens-renderer-extension";
const rendererExtensionsInjectable = getInjectable({ const rendererExtensionsInjectable = getInjectable({
id: "renderer-extensions", id: "renderer-extensions",
instantiate: (di) => di.inject(extensionsInjectable) as IComputedValue<LensRendererExtension[]>, instantiate: (di) => di.inject(extensionsInjectable) as IComputedValue<LensRendererExtension[]>,
lifecycle: lifecycleEnum.singleton,
}); });
export default rendererExtensionsInjectable; export default rendererExtensionsInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import electronAppInjectable from "../get-electron-app-path/electron-app/electron-app.injectable"; import electronAppInjectable from "../get-electron-app-path/electron-app/electron-app.injectable";
const appNameInjectable = getInjectable({ const appNameInjectable = getInjectable({
id: "app-name", id: "app-name",
instantiate: (di) => di.inject(electronAppInjectable).name, instantiate: (di) => di.inject(electronAppInjectable).name,
lifecycle: lifecycleEnum.singleton,
}); });
export default appNameInjectable; export default appNameInjectable;

View File

@ -5,7 +5,6 @@
import { import {
DiContainerForSetup, DiContainerForSetup,
getInjectable, getInjectable,
lifecycleEnum,
} from "@ogre-tools/injectable"; } from "@ogre-tools/injectable";
import { import {
@ -41,7 +40,6 @@ const appPathsInjectable = getInjectable({
getAppPaths({ getAppPath: di.inject(getElectronAppPathInjectable) }), getAppPaths({ getAppPath: di.inject(getElectronAppPathInjectable) }),
injectionToken: appPathsInjectionToken, injectionToken: appPathsInjectionToken,
lifecycle: lifecycleEnum.singleton,
}); });
export default appPathsInjectable; export default appPathsInjectable;

View File

@ -2,12 +2,11 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
const directoryForIntegrationTestingInjectable = getInjectable({ const directoryForIntegrationTestingInjectable = getInjectable({
id: "directory-for-integration-testing", id: "directory-for-integration-testing",
instantiate: () => process.env.CICD, instantiate: () => process.env.CICD,
lifecycle: lifecycleEnum.singleton,
}); });
export default directoryForIntegrationTestingInjectable; export default directoryForIntegrationTestingInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { app } from "electron"; import { app } from "electron";
const electronAppInjectable = getInjectable({ const electronAppInjectable = getInjectable({
id: "electron-app", id: "electron-app",
instantiate: () => app, instantiate: () => app,
lifecycle: lifecycleEnum.singleton,
causesSideEffects: true, causesSideEffects: true,
}); });

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } 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 { getElectronAppPath } from "./get-electron-app-path"; import { getElectronAppPath } from "./get-electron-app-path";
@ -11,8 +11,6 @@ const getElectronAppPathInjectable = getInjectable({
instantiate: (di) => instantiate: (di) =>
getElectronAppPath({ app: di.inject(electronAppInjectable) }), getElectronAppPath({ app: di.inject(electronAppInjectable) }),
lifecycle: lifecycleEnum.singleton,
}); });
export default getElectronAppPathInjectable; export default getElectronAppPathInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { ipcMain } from "electron"; import { ipcMain } from "electron";
const ipcMainInjectable = getInjectable({ const ipcMainInjectable = getInjectable({
id: "ipc-main", id: "ipc-main",
instantiate: () => ipcMain, instantiate: () => ipcMain,
lifecycle: lifecycleEnum.singleton,
causesSideEffects: true, causesSideEffects: true,
}); });

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import ipcMainInjectable from "./ipc-main/ipc-main.injectable"; import ipcMainInjectable from "./ipc-main/ipc-main.injectable";
import { registerChannel } from "./register-channel"; import { registerChannel } from "./register-channel";
@ -12,8 +12,6 @@ const registerChannelInjectable = getInjectable({
instantiate: (di) => registerChannel({ instantiate: (di) => registerChannel({
ipcMain: di.inject(ipcMainInjectable), ipcMain: di.inject(ipcMainInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default registerChannelInjectable; export default registerChannelInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import type { PathName } from "../../../common/app-paths/app-path-names"; import type { PathName } from "../../../common/app-paths/app-path-names";
import electronAppInjectable from "../get-electron-app-path/electron-app/electron-app.injectable"; import electronAppInjectable from "../get-electron-app-path/electron-app/electron-app.injectable";
@ -11,8 +11,6 @@ const setElectronAppPathInjectable = getInjectable({
instantiate: (di) => (name: PathName, path: string) : void => instantiate: (di) => (name: PathName, path: string) : void =>
di.inject(electronAppInjectable).setPath(name, path), di.inject(electronAppInjectable).setPath(name, path),
lifecycle: lifecycleEnum.singleton,
}); });
export default setElectronAppPathInjectable; export default setElectronAppPathInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
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 { KubeconfigSyncManager } from "./kubeconfig-sync-manager"; import { KubeconfigSyncManager } from "./kubeconfig-sync-manager";
import { createClusterInjectionToken } from "../../../common/cluster/create-cluster-injection-token"; import { createClusterInjectionToken } from "../../../common/cluster/create-cluster-injection-token";
@ -14,8 +14,6 @@ const kubeconfigSyncManagerInjectable = getInjectable({
directoryForKubeConfigs: di.inject(directoryForKubeConfigsInjectable), directoryForKubeConfigs: di.inject(directoryForKubeConfigsInjectable),
createCluster: di.inject(createClusterInjectionToken), createCluster: di.inject(createClusterInjectionToken),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default kubeconfigSyncManagerInjectable; export default kubeconfigSyncManagerInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import type { Cluster } from "../../common/cluster/cluster"; import type { Cluster } from "../../common/cluster/cluster";
import { ContextHandler } from "./context-handler"; import { ContextHandler } from "./context-handler";
import createKubeAuthProxyInjectable from "../kube-auth-proxy/create-kube-auth-proxy.injectable"; import createKubeAuthProxyInjectable from "../kube-auth-proxy/create-kube-auth-proxy.injectable";
@ -17,8 +17,6 @@ const createContextHandlerInjectable = getInjectable({
return (cluster: Cluster) => new ContextHandler(dependencies, cluster); return (cluster: Cluster) => new ContextHandler(dependencies, cluster);
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default createContextHandlerInjectable; export default createContextHandlerInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { Cluster, ClusterDependencies } from "../../common/cluster/cluster"; import { Cluster, ClusterDependencies } from "../../common/cluster/cluster";
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 createKubeconfigManagerInjectable from "../kubeconfig-manager/create-kubeconfig-manager.injectable"; import createKubeconfigManagerInjectable from "../kubeconfig-manager/create-kubeconfig-manager.injectable";
@ -29,8 +29,6 @@ const createClusterInjectable = getInjectable({
}, },
injectionToken: createClusterInjectionToken, injectionToken: createClusterInjectionToken,
lifecycle: lifecycleEnum.singleton,
}); });
export default createClusterInjectable; export default createClusterInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import electronMenuItemsInjectable from "../../menu/electron-menu-items.injectable"; import electronMenuItemsInjectable from "../../menu/electron-menu-items.injectable";
import directoryForLensLocalStorageInjectable import directoryForLensLocalStorageInjectable
from "../../../common/directory-for-lens-local-storage/directory-for-lens-local-storage.injectable"; from "../../../common/directory-for-lens-local-storage/directory-for-lens-local-storage.injectable";
@ -15,8 +15,6 @@ const initIpcMainHandlersInjectable = getInjectable({
electronMenuItems: di.inject(electronMenuItemsInjectable), electronMenuItems: di.inject(electronMenuItemsInjectable),
directoryForLensLocalStorage: di.inject(directoryForLensLocalStorageInjectable), directoryForLensLocalStorage: di.inject(directoryForLensLocalStorageInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default initIpcMainHandlersInjectable; export default initIpcMainHandlersInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { KubeAuthProxy } from "./kube-auth-proxy"; import { KubeAuthProxy } from "./kube-auth-proxy";
import type { Cluster } from "../../common/cluster/cluster"; import type { Cluster } from "../../common/cluster/cluster";
import bundledKubectlInjectable from "../kubectl/bundled-kubectl.injectable"; import bundledKubectlInjectable from "../kubectl/bundled-kubectl.injectable";
@ -20,8 +20,6 @@ const createKubeAuthProxyInjectable = getInjectable({
return (cluster: Cluster, environmentVariables: NodeJS.ProcessEnv) => return (cluster: Cluster, environmentVariables: NodeJS.ProcessEnv) =>
new KubeAuthProxy(dependencies, cluster, environmentVariables); new KubeAuthProxy(dependencies, cluster, environmentVariables);
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default createKubeAuthProxyInjectable; export default createKubeAuthProxyInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import type { Cluster } from "../../common/cluster/cluster"; import type { Cluster } from "../../common/cluster/cluster";
import directoryForTempInjectable from "../../common/app-paths/directory-for-temp/directory-for-temp.injectable"; import directoryForTempInjectable from "../../common/app-paths/directory-for-temp/directory-for-temp.injectable";
import { KubeconfigManager } from "./kubeconfig-manager"; import { KubeconfigManager } from "./kubeconfig-manager";
@ -21,8 +21,6 @@ const createKubeconfigManagerInjectable = getInjectable({
return (cluster: Cluster) => new KubeconfigManager(dependencies, cluster); return (cluster: Cluster) => new KubeconfigManager(dependencies, cluster);
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default createKubeconfigManagerInjectable; export default createKubeconfigManagerInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { getBundledKubectlVersion } from "../../common/utils"; import { getBundledKubectlVersion } from "../../common/utils";
import createKubectlInjectable from "./create-kubectl.injectable"; import createKubectlInjectable from "./create-kubectl.injectable";
@ -16,8 +16,6 @@ const bundledKubectlInjectable = getInjectable({
return createKubectl(bundledKubectlVersion); return createKubectl(bundledKubectlVersion);
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default bundledKubectlInjectable; export default bundledKubectlInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { Kubectl } from "./kubectl"; import { Kubectl } from "./kubectl";
import directoryForKubectlBinariesInjectable from "./directory-for-kubectl-binaries/directory-for-kubectl-binaries.injectable"; import directoryForKubectlBinariesInjectable from "./directory-for-kubectl-binaries/directory-for-kubectl-binaries.injectable";
import userStoreInjectable from "../../common/user-store/user-store.injectable"; import userStoreInjectable from "../../common/user-store/user-store.injectable";
@ -22,8 +22,6 @@ const createKubectlInjectable = getInjectable({
return (clusterVersion: string) => return (clusterVersion: string) =>
new Kubectl(dependencies, clusterVersion); new Kubectl(dependencies, clusterVersion);
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default createKubectlInjectable; export default createKubectlInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import directoryForBinariesInjectable from "../../../common/app-paths/directory-for-binaries/directory-for-binaries.injectable"; import directoryForBinariesInjectable from "../../../common/app-paths/directory-for-binaries/directory-for-binaries.injectable";
import path from "path"; import path from "path";
@ -11,8 +11,6 @@ const directoryForKubectlBinariesInjectable = getInjectable({
instantiate: (di) => instantiate: (di) =>
path.join(di.inject(directoryForBinariesInjectable), "kubectl"), path.join(di.inject(directoryForBinariesInjectable), "kubectl"),
lifecycle: lifecycleEnum.singleton,
}); });
export default directoryForKubectlBinariesInjectable; export default directoryForKubectlBinariesInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx"; import { computed } from "mobx";
import mainExtensionsInjectable from "../../extensions/main-extensions.injectable"; import mainExtensionsInjectable from "../../extensions/main-extensions.injectable";
const electronMenuItemsInjectable = getInjectable({ const electronMenuItemsInjectable = getInjectable({
id: "electron-menu-items", id: "electron-menu-items",
lifecycle: lifecycleEnum.singleton,
instantiate: (di) => { instantiate: (di) => {
const extensions = di.inject(mainExtensionsInjectable); const extensions = di.inject(mainExtensionsInjectable);

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import extensionLoaderInjectable from "../../../extensions/extension-loader/extension-loader.injectable"; import extensionLoaderInjectable from "../../../extensions/extension-loader/extension-loader.injectable";
import { LensProtocolRouterMain } from "./lens-protocol-router-main"; import { LensProtocolRouterMain } from "./lens-protocol-router-main";
import extensionsStoreInjectable from "../../../extensions/extensions-store/extensions-store.injectable"; import extensionsStoreInjectable from "../../../extensions/extensions-store/extensions-store.injectable";
@ -15,8 +15,6 @@ const lensProtocolRouterMainInjectable = getInjectable({
extensionLoader: di.inject(extensionLoaderInjectable), extensionLoader: di.inject(extensionLoaderInjectable),
extensionsStore: di.inject(extensionsStoreInjectable), extensionsStore: di.inject(extensionsStoreInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default lensProtocolRouterMainInjectable; export default lensProtocolRouterMainInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { shellApiRequest } from "./shell-api-request"; import { shellApiRequest } from "./shell-api-request";
import createShellSessionInjectable from "../../shell-session/create-shell-session.injectable"; import createShellSessionInjectable from "../../shell-session/create-shell-session.injectable";
import shellRequestAuthenticatorInjectable import shellRequestAuthenticatorInjectable
@ -15,8 +15,6 @@ const shellApiRequestInjectable = getInjectable({
createShellSession: di.inject(createShellSessionInjectable), createShellSession: di.inject(createShellSessionInjectable),
authenticateRequest: di.inject(shellRequestAuthenticatorInjectable).authenticate, authenticateRequest: di.inject(shellRequestAuthenticatorInjectable).authenticate,
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default shellApiRequestInjectable; export default shellApiRequestInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { ShellRequestAuthenticator } from "./shell-request-authenticator"; import { ShellRequestAuthenticator } from "./shell-request-authenticator";
const shellRequestAuthenticatorInjectable = getInjectable({ const shellRequestAuthenticatorInjectable = getInjectable({
@ -15,8 +15,6 @@ const shellRequestAuthenticatorInjectable = getInjectable({
return authenticator; return authenticator;
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default shellRequestAuthenticatorInjectable; export default shellRequestAuthenticatorInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { Router } from "../router"; import { Router } from "../router";
import routePortForwardInjectable import routePortForwardInjectable
from "../routes/port-forward/route-port-forward/route-port-forward.injectable"; from "../routes/port-forward/route-port-forward/route-port-forward.injectable";
@ -13,8 +13,6 @@ const routerInjectable = getInjectable({
instantiate: (di) => new Router({ instantiate: (di) => new Router({
routePortForward: di.inject(routePortForwardInjectable), routePortForward: di.inject(routePortForwardInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default routerInjectable; export default routerInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { PortForward, PortForwardArgs } from "./port-forward"; import { PortForward, PortForwardArgs } from "./port-forward";
import bundledKubectlInjectable from "../../kubectl/bundled-kubectl.injectable"; import bundledKubectlInjectable from "../../kubectl/bundled-kubectl.injectable";
@ -19,8 +19,6 @@ const createPortForwardInjectable = getInjectable({
return (pathToKubeConfig: string, args: PortForwardArgs) => return (pathToKubeConfig: string, args: PortForwardArgs) =>
new PortForward(dependencies, pathToKubeConfig, args); new PortForward(dependencies, pathToKubeConfig, args);
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default createPortForwardInjectable; export default createPortForwardInjectable;

View File

@ -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 { routePortForward } from "./route-port-forward"; import { routePortForward } from "./route-port-forward";
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import createPortForwardInjectable from "../create-port-forward.injectable"; import createPortForwardInjectable from "../create-port-forward.injectable";
const routePortForwardInjectable = getInjectable({ const routePortForwardInjectable = getInjectable({
@ -12,8 +12,6 @@ const routePortForwardInjectable = getInjectable({
instantiate: (di) => routePortForward({ instantiate: (di) => routePortForward({
createPortForward: di.inject(createPortForwardInjectable), createPortForward: di.inject(createPortForwardInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default routePortForwardInjectable; export default routePortForwardInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import type { Cluster } from "../../common/cluster/cluster"; import type { Cluster } from "../../common/cluster/cluster";
import type WebSocket from "ws"; import type WebSocket from "ws";
import localShellSessionInjectable from "./local-shell-session/local-shell-session.injectable"; import localShellSessionInjectable from "./local-shell-session/local-shell-session.injectable";
@ -24,8 +24,6 @@ const createShellSessionInjectable = getInjectable({
!nodeName !nodeName
? di.inject(localShellSessionInjectable, rest) ? di.inject(localShellSessionInjectable, rest)
: di.inject(nodeShellSessionInjectable, { nodeName, ...rest }), : di.inject(nodeShellSessionInjectable, { nodeName, ...rest }),
lifecycle: lifecycleEnum.singleton,
}); });
export default createShellSessionInjectable; export default createShellSessionInjectable;

View File

@ -2,15 +2,13 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx"; import { computed } from "mobx";
import mainExtensionsInjectable from "../../extensions/main-extensions.injectable"; import mainExtensionsInjectable from "../../extensions/main-extensions.injectable";
const trayItemsInjectable = getInjectable({ const trayItemsInjectable = getInjectable({
id: "tray-items", id: "tray-items",
lifecycle: lifecycleEnum.singleton,
instantiate: (di) => { instantiate: (di) => {
const extensions = di.inject(mainExtensionsInjectable); const extensions = di.inject(mainExtensionsInjectable);

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { catalogEntityRegistry } from "../catalog-entity-registry"; import { catalogEntityRegistry } from "../catalog-entity-registry";
const catalogEntityRegistryInjectable = getInjectable({ const catalogEntityRegistryInjectable = getInjectable({
id: "catalog-entity-registry", id: "catalog-entity-registry",
instantiate: () => catalogEntityRegistry, instantiate: () => catalogEntityRegistry,
lifecycle: lifecycleEnum.singleton,
}); });
export default catalogEntityRegistryInjectable; export default catalogEntityRegistryInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { AppPaths, appPathsInjectionToken, appPathsIpcChannel } from "../../common/app-paths/app-path-injection-token"; import { AppPaths, appPathsInjectionToken, appPathsIpcChannel } from "../../common/app-paths/app-path-injection-token";
import getValueFromRegisteredChannelInjectable from "./get-value-from-registered-channel/get-value-from-registered-channel.injectable"; import getValueFromRegisteredChannelInjectable from "./get-value-from-registered-channel/get-value-from-registered-channel.injectable";
@ -22,8 +22,6 @@ const appPathsInjectable = getInjectable({
instantiate: () => syncAppPaths, instantiate: () => syncAppPaths,
injectionToken: appPathsInjectionToken, injectionToken: appPathsInjectionToken,
lifecycle: lifecycleEnum.singleton,
}); });
export default appPathsInjectable; export default appPathsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import ipcRendererInjectable from "./ipc-renderer/ipc-renderer.injectable"; import ipcRendererInjectable from "./ipc-renderer/ipc-renderer.injectable";
import { getValueFromRegisteredChannel } from "./get-value-from-registered-channel"; import { getValueFromRegisteredChannel } from "./get-value-from-registered-channel";
@ -11,8 +11,6 @@ const getValueFromRegisteredChannelInjectable = getInjectable({
instantiate: (di) => instantiate: (di) =>
getValueFromRegisteredChannel({ ipcRenderer: di.inject(ipcRendererInjectable) }), getValueFromRegisteredChannel({ ipcRenderer: di.inject(ipcRendererInjectable) }),
lifecycle: lifecycleEnum.singleton,
}); });
export default getValueFromRegisteredChannelInjectable; export default getValueFromRegisteredChannelInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { ipcRenderer } from "electron"; import { ipcRenderer } from "electron";
const ipcRendererInjectable = getInjectable({ const ipcRendererInjectable = getInjectable({
id: "ipc-renderer", id: "ipc-renderer",
instantiate: () => ipcRenderer, instantiate: () => ipcRenderer,
lifecycle: lifecycleEnum.singleton,
causesSideEffects: true, causesSideEffects: true,
}); });

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { ClusterFrameContext } from "./cluster-frame-context"; import { ClusterFrameContext } from "./cluster-frame-context";
import namespaceStoreInjectable from "../components/+namespaces/namespace-store/namespace-store.injectable"; import namespaceStoreInjectable from "../components/+namespaces/namespace-store/namespace-store.injectable";
import hostedClusterInjectable from "../../common/cluster-store/hosted-cluster.injectable"; import hostedClusterInjectable from "../../common/cluster-store/hosted-cluster.injectable";
@ -21,8 +21,6 @@ const clusterFrameContextInjectable = getInjectable({
}, },
); );
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default clusterFrameContextInjectable; export default clusterFrameContextInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { CatalogEntityStore } from "./catalog-entity.store"; import { CatalogEntityStore } from "./catalog-entity.store";
import catalogEntityRegistryInjectable from "../../../api/catalog-entity-registry/catalog-entity-registry.injectable"; import catalogEntityRegistryInjectable from "../../../api/catalog-entity-registry/catalog-entity-registry.injectable";
@ -12,8 +12,6 @@ const catalogEntityStoreInjectable = getInjectable({
instantiate: (di) => new CatalogEntityStore({ instantiate: (di) => new CatalogEntityStore({
registry: di.inject(catalogEntityRegistryInjectable), registry: di.inject(catalogEntityRegistryInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default catalogEntityStoreInjectable; export default catalogEntityStoreInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { browseCatalogTab } from "../../../../common/routes"; import { browseCatalogTab } from "../../../../common/routes";
import createStorageInjectable from "../../../utils/create-storage/create-storage.injectable"; import createStorageInjectable from "../../../utils/create-storage/create-storage.injectable";
@ -17,8 +17,6 @@ const catalogPreviousActiveTabStorageInjectable = getInjectable({
browseCatalogTab, browseCatalogTab,
); );
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default catalogPreviousActiveTabStorageInjectable; export default catalogPreviousActiveTabStorageInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { computed, IComputedValue } from "mobx"; import { computed, IComputedValue } from "mobx";
import type { LensRendererExtension } from "../../../extensions/lens-renderer-extension"; import type { LensRendererExtension } from "../../../extensions/lens-renderer-extension";
import rendererExtensionsInjectable from "../../../extensions/renderer-extensions.injectable"; import rendererExtensionsInjectable from "../../../extensions/renderer-extensions.injectable";
@ -50,8 +50,6 @@ const categoryColumnsInjectable = getInjectable({
instantiate: (di) => getAdditionCategoryColumns({ instantiate: (di) => getAdditionCategoryColumns({
extensions: di.inject(rendererExtensionsInjectable), extensions: di.inject(rendererExtensionsInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default categoryColumnsInjectable; export default categoryColumnsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { orderBy } from "lodash"; import { orderBy } from "lodash";
import { computed, IComputedValue } from "mobx"; import { computed, IComputedValue } from "mobx";
import type { LensRendererExtension } from "../../../extensions/lens-renderer-extension"; import type { LensRendererExtension } from "../../../extensions/lens-renderer-extension";
@ -54,8 +54,6 @@ const customCategoryViewsInjectable = getInjectable({
instantiate: (di) => getCustomCategoryViews({ instantiate: (di) => getCustomCategoryViews({
extensions: di.inject(rendererExtensionsInjectable), extensions: di.inject(rendererExtensionsInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default customCategoryViewsInjectable; export default customCategoryViewsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { orderBy } from "lodash"; import { orderBy } from "lodash";
import type { IComputedValue } from "mobx"; import type { IComputedValue } from "mobx";
import type { CatalogCategory, CatalogEntity } from "../../../common/catalog"; import type { CatalogCategory, CatalogEntity } from "../../../common/catalog";
@ -90,8 +90,6 @@ const getCategoryColumnsInjectable = getInjectable({
instantiate: (di) => getCategoryColumns({ instantiate: (di) => getCategoryColumns({
extensionColumns: di.inject(categoryColumnsInjectable), extensionColumns: di.inject(categoryColumnsInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default getCategoryColumnsInjectable; export default getCategoryColumnsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { import {
ClusterOverviewStorageState, ClusterOverviewStorageState,
ClusterOverviewStore, ClusterOverviewStore,
@ -36,8 +36,6 @@ const clusterOverviewStoreInjectable = getInjectable({
return store; return store;
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default clusterOverviewStoreInjectable; export default clusterOverviewStoreInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx"; import { computed } from "mobx";
import { HorizontalPodAutoscalers } from "../+config-autoscalers"; import { HorizontalPodAutoscalers } from "../+config-autoscalers";
import { LimitRanges } from "../+config-limit-ranges"; import { LimitRanges } from "../+config-limit-ranges";
@ -86,8 +86,6 @@ const configRoutesInjectable = getInjectable({
instantiate: (di) => getRouteTabs({ instantiate: (di) => getRouteTabs({
isAllowedResource: di.inject(isAllowedResourceInjectable), isAllowedResource: di.inject(isAllowedResourceInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default configRoutesInjectable; export default configRoutesInjectable;

View File

@ -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, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx"; import { computed } from "mobx";
import { crdStore } from "./crd.store"; import { crdStore } from "./crd.store";
@ -11,8 +11,6 @@ const customResourceDefinitionsInjectable = getInjectable({
id: "custom-resource-definitions", id: "custom-resource-definitions",
instantiate: () => computed(() => [...crdStore.items]), instantiate: () => computed(() => [...crdStore.items]),
lifecycle: lifecycleEnum.singleton,
}); });
export default customResourceDefinitionsInjectable; export default customResourceDefinitionsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { computed, IComputedValue } from "mobx"; import { computed, IComputedValue } from "mobx";
import type { CustomResourceDefinition } from "../../../common/k8s-api/endpoints"; import type { CustomResourceDefinition } from "../../../common/k8s-api/endpoints";
import { getOrInsert } from "../../utils"; import { getOrInsert } from "../../utils";
@ -30,8 +30,6 @@ const groupedCustomResourceDefinitionsInjectable = getInjectable({
instantiate: (di) => getGroupedCustomResourceDefinitions({ instantiate: (di) => getGroupedCustomResourceDefinitions({
definitions: di.inject(customResourceDefinitionsInjectable), definitions: di.inject(customResourceDefinitionsInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default groupedCustomResourceDefinitionsInjectable; export default groupedCustomResourceDefinitionsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { computed, IComputedValue } from "mobx"; import { computed, IComputedValue } from "mobx";
import type { CustomResourceDefinition } from "../../../common/k8s-api/endpoints"; import type { CustomResourceDefinition } from "../../../common/k8s-api/endpoints";
import { crdURL, crdDefinitionsRoute } from "../../../common/routes"; import { crdURL, crdDefinitionsRoute } from "../../../common/routes";
@ -56,8 +56,6 @@ const customResourcesRouteTabsInjectable = getInjectable({
instantiate: (di) => getRouteTabs({ instantiate: (di) => getRouteTabs({
customResourcesDefinitions: di.inject(groupedCustomResourceDefinitionsInjectable), customResourcesDefinitions: di.inject(groupedCustomResourceDefinitionsInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default customResourcesRouteTabsInjectable; export default customResourcesRouteTabsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { attemptInstallByInfo } from "./attempt-install-by-info"; import { attemptInstallByInfo } from "./attempt-install-by-info";
import attemptInstallInjectable from "../attempt-install/attempt-install.injectable"; import attemptInstallInjectable from "../attempt-install/attempt-install.injectable";
import getBaseRegistryUrlInjectable from "../get-base-registry-url/get-base-registry-url.injectable"; import getBaseRegistryUrlInjectable from "../get-base-registry-url/get-base-registry-url.injectable";
@ -18,8 +18,6 @@ const attemptInstallByInfoInjectable = getInjectable({
getBaseRegistryUrl: di.inject(getBaseRegistryUrlInjectable), getBaseRegistryUrl: di.inject(getBaseRegistryUrlInjectable),
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable), extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default attemptInstallByInfoInjectable; export default attemptInstallByInfoInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable"; import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
import uninstallExtensionInjectable from "../uninstall-extension/uninstall-extension.injectable"; import uninstallExtensionInjectable from "../uninstall-extension/uninstall-extension.injectable";
import { attemptInstall } from "./attempt-install"; import { attemptInstall } from "./attempt-install";
@ -25,8 +25,6 @@ const attemptInstallInjectable = getInjectable({
getExtensionDestFolder: di.inject(getExtensionDestFolderInjectable), getExtensionDestFolder: di.inject(getExtensionDestFolderInjectable),
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable), extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default attemptInstallInjectable; export default attemptInstallInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { createTempFilesAndValidate } from "./create-temp-files-and-validate"; import { createTempFilesAndValidate } from "./create-temp-files-and-validate";
import extensionDiscoveryInjectable from "../../../../../extensions/extension-discovery/extension-discovery.injectable"; import extensionDiscoveryInjectable from "../../../../../extensions/extension-discovery/extension-discovery.injectable";
@ -13,8 +13,6 @@ const createTempFilesAndValidateInjectable = getInjectable({
createTempFilesAndValidate({ createTempFilesAndValidate({
extensionDiscovery: di.inject(extensionDiscoveryInjectable), extensionDiscovery: di.inject(extensionDiscoveryInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default createTempFilesAndValidateInjectable; export default createTempFilesAndValidateInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import extensionDiscoveryInjectable from "../../../../../extensions/extension-discovery/extension-discovery.injectable"; import extensionDiscoveryInjectable from "../../../../../extensions/extension-discovery/extension-discovery.injectable";
@ -15,8 +15,6 @@ const getExtensionDestFolderInjectable = getInjectable({
getExtensionDestFolder({ getExtensionDestFolder({
extensionDiscovery: di.inject(extensionDiscoveryInjectable), extensionDiscovery: di.inject(extensionDiscoveryInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default getExtensionDestFolderInjectable; export default getExtensionDestFolderInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { unpackExtension } from "./unpack-extension"; import { unpackExtension } from "./unpack-extension";
import extensionLoaderInjectable from "../../../../../extensions/extension-loader/extension-loader.injectable"; import extensionLoaderInjectable from "../../../../../extensions/extension-loader/extension-loader.injectable";
import getExtensionDestFolderInjectable import getExtensionDestFolderInjectable
@ -19,8 +19,6 @@ const unpackExtensionInjectable = getInjectable({
getExtensionDestFolder: di.inject(getExtensionDestFolderInjectable), getExtensionDestFolder: di.inject(getExtensionDestFolderInjectable),
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable), extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default unpackExtensionInjectable; export default unpackExtensionInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { attemptInstalls } from "./attempt-installs"; import { attemptInstalls } from "./attempt-installs";
import attemptInstallInjectable from "../attempt-install/attempt-install.injectable"; import attemptInstallInjectable from "../attempt-install/attempt-install.injectable";
@ -13,8 +13,6 @@ const attemptInstallsInjectable = getInjectable({
attemptInstalls({ attemptInstalls({
attemptInstall: di.inject(attemptInstallInjectable), attemptInstall: di.inject(attemptInstallInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default attemptInstallsInjectable; export default attemptInstallsInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { confirmUninstallExtension } from "./confirm-uninstall-extension"; import { confirmUninstallExtension } from "./confirm-uninstall-extension";
import uninstallExtensionInjectable from "../uninstall-extension/uninstall-extension.injectable"; import uninstallExtensionInjectable from "../uninstall-extension/uninstall-extension.injectable";
@ -13,8 +13,6 @@ const confirmUninstallExtensionInjectable = getInjectable({
confirmUninstallExtension({ confirmUninstallExtension({
uninstallExtension: di.inject(uninstallExtensionInjectable), uninstallExtension: di.inject(uninstallExtensionInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default confirmUninstallExtensionInjectable; export default confirmUninstallExtensionInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable"; import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
import { disableExtension } from "./disable-extension"; import { disableExtension } from "./disable-extension";
@ -13,8 +13,6 @@ const disableExtensionInjectable = getInjectable({
disableExtension({ disableExtension({
extensionLoader: di.inject(extensionLoaderInjectable), extensionLoader: di.inject(extensionLoaderInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default disableExtensionInjectable; export default disableExtensionInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable"; import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
import { enableExtension } from "./enable-extension"; import { enableExtension } from "./enable-extension";
@ -13,8 +13,6 @@ const enableExtensionInjectable = getInjectable({
enableExtension({ enableExtension({
extensionLoader: di.inject(extensionLoaderInjectable), extensionLoader: di.inject(extensionLoaderInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default enableExtensionInjectable; export default enableExtensionInjectable;

View File

@ -5,7 +5,6 @@
import { import {
getInjectable, getInjectable,
lifecycleEnum,
} from "@ogre-tools/injectable"; } from "@ogre-tools/injectable";
import { UserStore } from "../../../../common/user-store"; import { UserStore } from "../../../../common/user-store";
import { getBaseRegistryUrl } from "./get-base-registry-url"; import { getBaseRegistryUrl } from "./get-base-registry-url";
@ -17,8 +16,6 @@ const getBaseRegistryUrlInjectable = getInjectable({
// TODO: use injection // TODO: use injection
getRegistryUrlPreference: () => UserStore.getInstance().extensionRegistryUrl, getRegistryUrlPreference: () => UserStore.getInstance().extensionRegistryUrl,
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default getBaseRegistryUrlInjectable; export default getBaseRegistryUrlInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import attemptInstallInjectable from "../attempt-install/attempt-install.injectable"; import attemptInstallInjectable from "../attempt-install/attempt-install.injectable";
import { installFromInput } from "./install-from-input"; import { installFromInput } from "./install-from-input";
import attemptInstallByInfoInjectable from "../attempt-install-by-info/attempt-install-by-info.injectable"; import attemptInstallByInfoInjectable from "../attempt-install-by-info/attempt-install-by-info.injectable";
@ -18,8 +18,6 @@ const installFromInputInjectable = getInjectable({
attemptInstallByInfo: di.inject(attemptInstallByInfoInjectable), attemptInstallByInfo: di.inject(attemptInstallByInfoInjectable),
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable), extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default installFromInputInjectable; export default installFromInputInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { requestOpenFilePickingDialog } from "../../ipc"; import { requestOpenFilePickingDialog } from "../../ipc";
import { supportedExtensionFormats } from "./supported-extension-formats"; import { supportedExtensionFormats } from "./supported-extension-formats";
import attemptInstallsInjectable from "./attempt-installs/attempt-installs.injectable"; import attemptInstallsInjectable from "./attempt-installs/attempt-installs.injectable";
@ -34,8 +34,6 @@ const installFromSelectFileDialogInjectable = getInjectable({
attemptInstalls: di.inject(attemptInstallsInjectable), attemptInstalls: di.inject(attemptInstallsInjectable),
directoryForDownloads: di.inject(directoryForDownloadsInjectable), directoryForDownloads: di.inject(directoryForDownloadsInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default installFromSelectFileDialogInjectable; export default installFromSelectFileDialogInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { installOnDrop } from "./install-on-drop"; import { installOnDrop } from "./install-on-drop";
import attemptInstallsInjectable from "../attempt-installs/attempt-installs.injectable"; import attemptInstallsInjectable from "../attempt-installs/attempt-installs.injectable";
@ -13,8 +13,6 @@ const installOnDropInjectable = getInjectable({
installOnDrop({ installOnDrop({
attemptInstalls: di.inject(attemptInstallsInjectable), attemptInstalls: di.inject(attemptInstallsInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default installOnDropInjectable; export default installOnDropInjectable;

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable"; import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
import { uninstallExtension } from "./uninstall-extension"; import { uninstallExtension } from "./uninstall-extension";
import extensionInstallationStateStoreInjectable import extensionInstallationStateStoreInjectable
@ -19,8 +19,6 @@ const uninstallExtensionInjectable = getInjectable({
extensionDiscovery: di.inject(extensionDiscoveryInjectable), extensionDiscovery: di.inject(extensionDiscoveryInjectable),
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable), extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
}), }),
lifecycle: lifecycleEnum.singleton,
}); });
export default uninstallExtensionInjectable; export default uninstallExtensionInjectable;

View File

@ -2,13 +2,12 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx"; import { computed } from "mobx";
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable"; import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
const userExtensionsInjectable = getInjectable({ const userExtensionsInjectable = getInjectable({
id: "user-extensions", id: "user-extensions",
lifecycle: lifecycleEnum.singleton,
instantiate: (di) => { instantiate: (di) => {
const extensionLoader = di.inject(extensionLoaderInjectable); const extensionLoader = di.inject(extensionLoaderInjectable);

View File

@ -2,7 +2,7 @@
* 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 { getInjectable, lifecycleEnum } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { import {
createRelease, createRelease,
IReleaseCreatePayload, IReleaseCreatePayload,
@ -23,8 +23,6 @@ const createReleaseInjectable = getInjectable({
return release; return release;
}; };
}, },
lifecycle: lifecycleEnum.singleton,
}); });
export default createReleaseInjectable; export default createReleaseInjectable;

Some files were not shown because too many files have changed in this diff Show More