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.
* 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";
const appEventBusInjectable = getInjectable({
id: "app-event-bus",
instantiate: () => appEventBus,
lifecycle: lifecycleEnum.singleton,
});
export default appEventBusInjectable;

View File

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

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const directoryForDownloadsInjectable = getInjectable({
id: "directory-for-downloads",
instantiate: (di) => di.inject(appPathsInjectionToken).downloads,
lifecycle: lifecycleEnum.singleton,
});
export default directoryForDownloadsInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const directoryForExesInjectable = getInjectable({
id: "directory-for-exes",
instantiate: (di) => di.inject(appPathsInjectionToken).exe,
lifecycle: lifecycleEnum.singleton,
});
export default directoryForExesInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 path from "path";
@ -11,8 +11,6 @@ const directoryForKubeConfigsInjectable = getInjectable({
instantiate: (di) =>
path.resolve(di.inject(directoryForUserDataInjectable), "kubeconfigs"),
lifecycle: lifecycleEnum.singleton,
});
export default directoryForKubeConfigsInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const directoryForTempInjectable = getInjectable({
id: "directory-for-temp",
instantiate: (di) => di.inject(appPathsInjectionToken).temp,
lifecycle: lifecycleEnum.singleton,
});
export default directoryForTempInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const directoryForUserDataInjectable = getInjectable({
id: "directory-for-user-data",
instantiate: (di) => di.inject(appPathsInjectionToken).userData,
lifecycle: lifecycleEnum.singleton,
});
export default directoryForUserDataInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 directoryForKubeConfigsInjectable from "../directory-for-kube-configs/directory-for-kube-configs.injectable";
@ -17,8 +17,6 @@ const getCustomKubeConfigDirectoryInjectable = getInjectable({
directoryName,
);
},
lifecycle: lifecycleEnum.singleton,
});
export default getCustomKubeConfigDirectoryInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 hostedClusterInjectable from "./hosted-cluster.injectable";
@ -17,7 +17,6 @@ const allowedResourcesInjectable = getInjectable({
equals: (cur, prev) => comparer.structural(cur, prev),
});
},
lifecycle: lifecycleEnum.singleton,
});
export default allowedResourcesInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 { createClusterInjectionToken } from "../cluster/create-cluster-injection-token";
@ -13,8 +13,6 @@ const clusterStoreInjectable = getInjectable({
ClusterStore.createInstance({
createCluster: di.inject(createClusterInjectionToken),
}),
lifecycle: lifecycleEnum.singleton,
});
export default clusterStoreInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 clusterStoreInjectable from "./cluster-store.injectable";
@ -14,8 +14,6 @@ const hostedClusterInjectable = getInjectable({
return di.inject(clusterStoreInjectable).getById(hostedClusterId);
},
lifecycle: lifecycleEnum.singleton,
});
export default hostedClusterInjectable;

View File

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

View File

@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
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[]>;
@ -20,7 +20,6 @@ export function listNamespaces(config: KubeConfig): ListNamespaces {
const listNamespacesInjectable = getInjectable({
id: "list-namespaces",
instantiate: () => listNamespaces,
lifecycle: lifecycleEnum.singleton,
});
export default listNamespacesInjectable;

View File

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

View File

@ -2,14 +2,13 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const fsInjectable = getInjectable({
id: "fs",
instantiate: () => fse,
causesSideEffects: true,
lifecycle: lifecycleEnum.singleton,
});
export default fsInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const readDirInjectable = getInjectable({
id: "read-dir",
instantiate: (di) => di.inject(fsInjectable).readdir,
lifecycle: lifecycleEnum.singleton,
});
export default readDirInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const readFileInjectable = getInjectable({
id: "read-file",
instantiate: (di) => di.inject(fsInjectable).readFile,
lifecycle: lifecycleEnum.singleton,
});
export default readFileInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const readJsonFileInjectable = getInjectable({
id: "read-json-file",
instantiate: (di) => di.inject(fsInjectable).readJson,
lifecycle: lifecycleEnum.singleton,
});
export default readJsonFileInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 path from "path";
import type { JsonValue } from "type-fest";
@ -33,8 +33,6 @@ const writeJsonFileInjectable = getInjectable({
ensureDir,
});
},
lifecycle: lifecycleEnum.singleton,
});
export default writeJsonFileInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const hotbarManagerInjectable = getInjectable({
id: "hotbar-manager",
instantiate: () => HotbarStore.getInstance(),
lifecycle: lifecycleEnum.singleton,
});
export default hotbarManagerInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const userStoreInjectable = getInjectable({
id: "user-store",
instantiate: () => UserStore.createInstance(),
lifecycle: lifecycleEnum.singleton,
});
export default userStoreInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 type { KubeResource } from "../rbac";
@ -17,8 +17,6 @@ const isAllowedResourceInjectable = getInjectable({
return (resource: KubeResource) => allowedResources.get().has(resource);
},
lifecycle: lifecycleEnum.singleton,
});
export default isAllowedResourceInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const isLinuxInjectable = getInjectable({
id: "is-linux",
instantiate: () => isLinux,
lifecycle: lifecycleEnum.singleton,
});
export default isLinuxInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const isWindowsInjectable = getInjectable({
id: "is-windows",
instantiate: () => isWindows,
lifecycle: lifecycleEnum.singleton,
});
export default isWindowsInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const getEnabledExtensionsInjectable = getInjectable({
@ -10,8 +10,6 @@ const getEnabledExtensionsInjectable = getInjectable({
instantiate: (di) => () =>
di.inject(extensionsStoreInjectable).enabledExtensions,
lifecycle: lifecycleEnum.singleton,
});
export default getEnabledExtensionsInjectable;

View File

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

View File

@ -2,14 +2,13 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 { isCompatibleBundledExtension } from "./is-compatible-bundled-extension";
const isCompatibleBundledExtensionInjectable = getInjectable({
id: "is-compatible-bundled-extension",
instantiate: () => isCompatibleBundledExtension({ appSemVer }),
lifecycle: lifecycleEnum.singleton,
});
export default isCompatibleBundledExtensionInjectable;

View File

@ -2,14 +2,13 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 { isCompatibleExtension } from "./is-compatible-extension";
const isCompatibleExtensionInjectable = getInjectable({
id: "is-compatible-extension",
instantiate: () => isCompatibleExtension({ appSemVer }),
lifecycle: lifecycleEnum.singleton,
});
export default isCompatibleExtensionInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const extensionInstallationStateStoreInjectable = getInjectable({
id: "extension-installation-state-store",
instantiate: () => new ExtensionInstallationStateStore(),
lifecycle: lifecycleEnum.singleton,
});
export default extensionInstallationStateStoreInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 extensionPackageRootDirectoryInjectable from "./extension-package-root-directory/extension-package-root-directory.injectable";
@ -15,8 +15,6 @@ const extensionInstallerInjectable = getInjectable({
extensionPackageRootDirectoryInjectable,
),
}),
lifecycle: lifecycleEnum.singleton,
});
export default extensionInstallerInjectable;

View File

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

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const installExtensionInjectable = getInjectable({
id: "install-extension",
instantiate: (di) => di.inject(extensionInstallerInjectable).installPackage,
lifecycle: lifecycleEnum.singleton,
});
export default installExtensionInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const installExtensionsInjectable = getInjectable({
id: "install-extensions",
instantiate: (di) => di.inject(extensionInstallerInjectable).installPackages,
lifecycle: lifecycleEnum.singleton,
});
export default installExtensionsInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 fileSystemProvisionerStoreInjectable from "./file-system-provisioner-store/file-system-provisioner-store.injectable";
@ -12,8 +12,6 @@ const createExtensionInstanceInjectable = getInjectable({
instantiate: (di) => createExtensionInstance({
fileSystemProvisionerStore: di.inject(fileSystemProvisionerStoreInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default createExtensionInstanceInjectable;

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 directoryForExtensionDataInjectable from "./directory-for-extension-data/directory-for-extension-data.injectable";
@ -15,8 +15,6 @@ const fileSystemProvisionerStoreInjectable = getInjectable({
directoryForExtensionDataInjectable,
),
}),
lifecycle: lifecycleEnum.singleton,
});
export default fileSystemProvisionerStoreInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 updateExtensionsStateInjectable from "./update-extensions-state/update-extensions-state.injectable";
import createExtensionInstanceInjectable
@ -16,8 +16,6 @@ const extensionLoaderInjectable = getInjectable({
updateExtensionsState: di.inject(updateExtensionsStateInjectable),
createExtensionInstance: di.inject(createExtensionInstanceInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default extensionLoaderInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const updateExtensionsStateInjectable = getInjectable({
id: "upadte-extensions-state",
instantiate: (di) => di.inject(extensionsStoreInjectable).mergeState,
lifecycle: lifecycleEnum.singleton,
});
export default updateExtensionsStateInjectable;

View File

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

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const extensionsStoreInjectable = getInjectable({
id: "extensions-store",
instantiate: () => ExtensionsStore.createInstance(),
lifecycle: lifecycleEnum.singleton,
});
export default extensionsStoreInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 extensionLoaderInjectable from "./extension-loader/extension-loader.injectable";
@ -14,8 +14,6 @@ const extensionsInjectable = getInjectable({
return computed(() => extensionLoader.enabledExtensionInstances);
},
lifecycle: lifecycleEnum.singleton,
});
export default extensionsInjectable;

View File

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

View File

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

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const appNameInjectable = getInjectable({
id: "app-name",
instantiate: (di) => di.inject(electronAppInjectable).name,
lifecycle: lifecycleEnum.singleton,
});
export default appNameInjectable;

View File

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

View File

@ -2,12 +2,11 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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({
id: "directory-for-integration-testing",
instantiate: () => process.env.CICD,
lifecycle: lifecycleEnum.singleton,
});
export default directoryForIntegrationTestingInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const electronAppInjectable = getInjectable({
id: "electron-app",
instantiate: () => app,
lifecycle: lifecycleEnum.singleton,
causesSideEffects: true,
});

View File

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

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const ipcMainInjectable = getInjectable({
id: "ipc-main",
instantiate: () => ipcMain,
lifecycle: lifecycleEnum.singleton,
causesSideEffects: true,
});

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 { registerChannel } from "./register-channel";
@ -12,8 +12,6 @@ const registerChannelInjectable = getInjectable({
instantiate: (di) => registerChannel({
ipcMain: di.inject(ipcMainInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default registerChannelInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 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 =>
di.inject(electronAppInjectable).setPath(name, path),
lifecycle: lifecycleEnum.singleton,
});
export default setElectronAppPathInjectable;

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 { ContextHandler } from "./context-handler";
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);
},
lifecycle: lifecycleEnum.singleton,
});
export default createContextHandlerInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 directoryForKubeConfigsInjectable from "../../common/app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable";
import createKubeconfigManagerInjectable from "../kubeconfig-manager/create-kubeconfig-manager.injectable";
@ -29,8 +29,6 @@ const createClusterInjectable = getInjectable({
},
injectionToken: createClusterInjectionToken,
lifecycle: lifecycleEnum.singleton,
});
export default createClusterInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 directoryForLensLocalStorageInjectable
from "../../../common/directory-for-lens-local-storage/directory-for-lens-local-storage.injectable";
@ -15,8 +15,6 @@ const initIpcMainHandlersInjectable = getInjectable({
electronMenuItems: di.inject(electronMenuItemsInjectable),
directoryForLensLocalStorage: di.inject(directoryForLensLocalStorageInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default initIpcMainHandlersInjectable;

View File

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

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 createKubectlInjectable from "./create-kubectl.injectable";
@ -16,8 +16,6 @@ const bundledKubectlInjectable = getInjectable({
return createKubectl(bundledKubectlVersion);
},
lifecycle: lifecycleEnum.singleton,
});
export default bundledKubectlInjectable;

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 path from "path";
@ -11,8 +11,6 @@ const directoryForKubectlBinariesInjectable = getInjectable({
instantiate: (di) =>
path.join(di.inject(directoryForBinariesInjectable), "kubectl"),
lifecycle: lifecycleEnum.singleton,
});
export default directoryForKubectlBinariesInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 mainExtensionsInjectable from "../../extensions/main-extensions.injectable";
const electronMenuItemsInjectable = getInjectable({
id: "electron-menu-items",
lifecycle: lifecycleEnum.singleton,
instantiate: (di) => {
const extensions = di.inject(mainExtensionsInjectable);

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 createShellSessionInjectable from "../../shell-session/create-shell-session.injectable";
import shellRequestAuthenticatorInjectable
@ -15,8 +15,6 @@ const shellApiRequestInjectable = getInjectable({
createShellSession: di.inject(createShellSessionInjectable),
authenticateRequest: di.inject(shellRequestAuthenticatorInjectable).authenticate,
}),
lifecycle: lifecycleEnum.singleton,
});
export default shellApiRequestInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const shellRequestAuthenticatorInjectable = getInjectable({
@ -15,8 +15,6 @@ const shellRequestAuthenticatorInjectable = getInjectable({
return authenticator;
},
lifecycle: lifecycleEnum.singleton,
});
export default shellRequestAuthenticatorInjectable;

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 bundledKubectlInjectable from "../../kubectl/bundled-kubectl.injectable";
@ -19,8 +19,6 @@ const createPortForwardInjectable = getInjectable({
return (pathToKubeConfig: string, args: PortForwardArgs) =>
new PortForward(dependencies, pathToKubeConfig, args);
},
lifecycle: lifecycleEnum.singleton,
});
export default createPortForwardInjectable;

View File

@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
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";
const routePortForwardInjectable = getInjectable({
@ -12,8 +12,6 @@ const routePortForwardInjectable = getInjectable({
instantiate: (di) => routePortForward({
createPortForward: di.inject(createPortForwardInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default routePortForwardInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 WebSocket from "ws";
import localShellSessionInjectable from "./local-shell-session/local-shell-session.injectable";
@ -24,8 +24,6 @@ const createShellSessionInjectable = getInjectable({
!nodeName
? di.inject(localShellSessionInjectable, rest)
: di.inject(nodeShellSessionInjectable, { nodeName, ...rest }),
lifecycle: lifecycleEnum.singleton,
});
export default createShellSessionInjectable;

View File

@ -2,15 +2,13 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 mainExtensionsInjectable from "../../extensions/main-extensions.injectable";
const trayItemsInjectable = getInjectable({
id: "tray-items",
lifecycle: lifecycleEnum.singleton,
instantiate: (di) => {
const extensions = di.inject(mainExtensionsInjectable);

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const catalogEntityRegistryInjectable = getInjectable({
id: "catalog-entity-registry",
instantiate: () => catalogEntityRegistry,
lifecycle: lifecycleEnum.singleton,
});
export default catalogEntityRegistryInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 getValueFromRegisteredChannelInjectable from "./get-value-from-registered-channel/get-value-from-registered-channel.injectable";
@ -22,8 +22,6 @@ const appPathsInjectable = getInjectable({
instantiate: () => syncAppPaths,
injectionToken: appPathsInjectionToken,
lifecycle: lifecycleEnum.singleton,
});
export default appPathsInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 { getValueFromRegisteredChannel } from "./get-value-from-registered-channel";
@ -11,8 +11,6 @@ const getValueFromRegisteredChannelInjectable = getInjectable({
instantiate: (di) =>
getValueFromRegisteredChannel({ ipcRenderer: di.inject(ipcRendererInjectable) }),
lifecycle: lifecycleEnum.singleton,
});
export default getValueFromRegisteredChannelInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
const ipcRendererInjectable = getInjectable({
id: "ipc-renderer",
instantiate: () => ipcRenderer,
lifecycle: lifecycleEnum.singleton,
causesSideEffects: true,
});

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 namespaceStoreInjectable from "../components/+namespaces/namespace-store/namespace-store.injectable";
import hostedClusterInjectable from "../../common/cluster-store/hosted-cluster.injectable";
@ -21,8 +21,6 @@ const clusterFrameContextInjectable = getInjectable({
},
);
},
lifecycle: lifecycleEnum.singleton,
});
export default clusterFrameContextInjectable;

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 createStorageInjectable from "../../../utils/create-storage/create-storage.injectable";
@ -17,8 +17,6 @@ const catalogPreviousActiveTabStorageInjectable = getInjectable({
browseCatalogTab,
);
},
lifecycle: lifecycleEnum.singleton,
});
export default catalogPreviousActiveTabStorageInjectable;

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 {
ClusterOverviewStorageState,
ClusterOverviewStore,
@ -36,8 +36,6 @@ const clusterOverviewStoreInjectable = getInjectable({
return store;
},
lifecycle: lifecycleEnum.singleton,
});
export default clusterOverviewStoreInjectable;

View File

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

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 type { CustomResourceDefinition } from "../../../common/k8s-api/endpoints";
import { getOrInsert } from "../../utils";
@ -30,8 +30,6 @@ const groupedCustomResourceDefinitionsInjectable = getInjectable({
instantiate: (di) => getGroupedCustomResourceDefinitions({
definitions: di.inject(customResourceDefinitionsInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default groupedCustomResourceDefinitionsInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 type { CustomResourceDefinition } from "../../../common/k8s-api/endpoints";
import { crdURL, crdDefinitionsRoute } from "../../../common/routes";
@ -56,8 +56,6 @@ const customResourcesRouteTabsInjectable = getInjectable({
instantiate: (di) => getRouteTabs({
customResourcesDefinitions: di.inject(groupedCustomResourceDefinitionsInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default customResourcesRouteTabsInjectable;

View File

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

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 extensionDiscoveryInjectable from "../../../../../extensions/extension-discovery/extension-discovery.injectable";
@ -13,8 +13,6 @@ const createTempFilesAndValidateInjectable = getInjectable({
createTempFilesAndValidate({
extensionDiscovery: di.inject(extensionDiscoveryInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default createTempFilesAndValidateInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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";
@ -15,8 +15,6 @@ const getExtensionDestFolderInjectable = getInjectable({
getExtensionDestFolder({
extensionDiscovery: di.inject(extensionDiscoveryInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default getExtensionDestFolderInjectable;

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 attemptInstallInjectable from "../attempt-install/attempt-install.injectable";
@ -13,8 +13,6 @@ const attemptInstallsInjectable = getInjectable({
attemptInstalls({
attemptInstall: di.inject(attemptInstallInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default attemptInstallsInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 uninstallExtensionInjectable from "../uninstall-extension/uninstall-extension.injectable";
@ -13,8 +13,6 @@ const confirmUninstallExtensionInjectable = getInjectable({
confirmUninstallExtension({
uninstallExtension: di.inject(uninstallExtensionInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default confirmUninstallExtensionInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 { disableExtension } from "./disable-extension";
@ -13,8 +13,6 @@ const disableExtensionInjectable = getInjectable({
disableExtension({
extensionLoader: di.inject(extensionLoaderInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default disableExtensionInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 { enableExtension } from "./enable-extension";
@ -13,8 +13,6 @@ const enableExtensionInjectable = getInjectable({
enableExtension({
extensionLoader: di.inject(extensionLoaderInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default enableExtensionInjectable;

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 attemptInstallsInjectable from "../attempt-installs/attempt-installs.injectable";
@ -13,8 +13,6 @@ const installOnDropInjectable = getInjectable({
installOnDrop({
attemptInstalls: di.inject(attemptInstallsInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default installOnDropInjectable;

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 { uninstallExtension } from "./uninstall-extension";
import extensionInstallationStateStoreInjectable
@ -19,8 +19,6 @@ const uninstallExtensionInjectable = getInjectable({
extensionDiscovery: di.inject(extensionDiscoveryInjectable),
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
}),
lifecycle: lifecycleEnum.singleton,
});
export default uninstallExtensionInjectable;

View File

@ -2,13 +2,12 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
const userExtensionsInjectable = getInjectable({
id: "user-extensions",
lifecycle: lifecycleEnum.singleton,
instantiate: (di) => {
const extensionLoader = di.inject(extensionLoaderInjectable);

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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 {
createRelease,
IReleaseCreatePayload,
@ -23,8 +23,6 @@ const createReleaseInjectable = getInjectable({
return release;
};
},
lifecycle: lifecycleEnum.singleton,
});
export default createReleaseInjectable;

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