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

Fix code style

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2023-03-17 08:06:03 +02:00
parent 5391c1fdab
commit a69b03fac7
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
34 changed files with 47 additions and 43 deletions

View File

@ -5,5 +5,5 @@
import type { AppPaths } from "./app-path-injection-token"; import type { AppPaths } from "./app-path-injection-token";
import { getRequestChannel } from "@k8slens/messaging"; import { getRequestChannel } from "@k8slens/messaging";
export const appPathsChannel = getRequestChannel<void, AppPaths>('app-paths') export const appPathsChannel = getRequestChannel<void, AppPaths>("app-paths");

View File

@ -19,7 +19,7 @@ export const kubectlApplyAllChannel = getRequestChannel<
Result<string, string> Result<string, string>
>("kubectl-apply-all"); >("kubectl-apply-all");
export type KubectlApplyAll = (req: KubectlApplyAllArgs) => AsyncResult<string, string> export type KubectlApplyAll = (req: KubectlApplyAllArgs) => AsyncResult<string, string>;
export const kubectlApplyAllInjectionToken = getInjectionToken<KubectlApplyAll>({ export const kubectlApplyAllInjectionToken = getInjectionToken<KubectlApplyAll>({
id: "kubectl-apply-all", id: "kubectl-apply-all",

View File

@ -5,5 +5,5 @@
import { getRequestChannel } from "@k8slens/messaging"; import { getRequestChannel } from "@k8slens/messaging";
export const resolveSystemProxyChannel = getRequestChannel<string, string>( export const resolveSystemProxyChannel = getRequestChannel<string, string>(
"resolve-system-proxy-channel" "resolve-system-proxy-channel",
); );

View File

@ -8,7 +8,7 @@ import { casChannel } from "../common/channel";
import certificateAuthoritiesChannelListenerInjectable from "./channel-handler.injectable"; import certificateAuthoritiesChannelListenerInjectable from "./channel-handler.injectable";
export default getGlobalOverride(certificateAuthoritiesChannelListenerInjectable, () => ({ export default getGlobalOverride(certificateAuthoritiesChannelListenerInjectable, () => ({
id: 'certificate-authorities-channel-listener', id: "certificate-authorities-channel-listener",
channel: casChannel, channel: casChannel,
handler: () => [], handler: () => [],
})); }));

View File

@ -8,7 +8,7 @@ import { globalAgent } from "https";
import { isString } from "@k8slens/utilities"; import { isString } from "@k8slens/utilities";
const certificateAuthoritiesChannelListenerInjectable = getRequestChannelListenerInjectable({ const certificateAuthoritiesChannelListenerInjectable = getRequestChannelListenerInjectable({
id: 'certificate-authorities-channel-listener', id: "certificate-authorities-channel-listener",
channel: casChannel, channel: casChannel,
getHandler: () => () => { getHandler: () => () => {
if (Array.isArray(globalAgent.options.ca)) { if (Array.isArray(globalAgent.options.ca)) {

View File

@ -7,7 +7,7 @@ import { activateClusterChannel } from "../common/channels";
import requestClusterActivationInjectable from "./request-activation.injectable"; import requestClusterActivationInjectable from "./request-activation.injectable";
const activateClusterRequestChannelListenerInjectable = getRequestChannelListenerInjectable({ const activateClusterRequestChannelListenerInjectable = getRequestChannelListenerInjectable({
id: 'activate-cluster-request-channel-listener', id: "activate-cluster-request-channel-listener",
channel: activateClusterChannel, channel: activateClusterChannel,
getHandler: (di) => di.inject(requestClusterActivationInjectable), getHandler: (di) => di.inject(requestClusterActivationInjectable),
}); });

View File

@ -7,7 +7,7 @@ import { deactivateClusterChannel } from "../common/channels";
import requestClusterDeactivationInjectable from "./request-deactivation.injectable"; import requestClusterDeactivationInjectable from "./request-deactivation.injectable";
const clusterDeactivationRequestChannelListenerInjectable = getRequestChannelListenerInjectable({ const clusterDeactivationRequestChannelListenerInjectable = getRequestChannelListenerInjectable({
id: 'cluster-deactivation-request-channel-listener', id: "cluster-deactivation-request-channel-listener",
channel: deactivateClusterChannel, channel: deactivateClusterChannel,
getHandler: (di) => di.inject(requestClusterDeactivationInjectable), getHandler: (di) => di.inject(requestClusterDeactivationInjectable),
}); });

View File

@ -6,5 +6,5 @@ import type { ClusterId } from "../../../../common/cluster-types";
import { getRequestChannel } from "@k8slens/messaging"; import { getRequestChannel } from "@k8slens/messaging";
export const clearClusterAsDeletingChannel = getRequestChannel<ClusterId, void>( export const clearClusterAsDeletingChannel = getRequestChannel<ClusterId, void>(
"clear-cluster-as-deleting" "clear-cluster-as-deleting",
); );

View File

@ -3,10 +3,11 @@
* 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 type { ClusterId } from "../../../../common/cluster-types"; import type { ClusterId } from "../../../../common/cluster-types";
import { getRequestChannel, RequestChannel } from "@k8slens/messaging"; import type { RequestChannel } from "@k8slens/messaging";
import { getRequestChannel } from "@k8slens/messaging";
export type DeleteClusterChannel = RequestChannel<ClusterId, void>; export type DeleteClusterChannel = RequestChannel<ClusterId, void>;
export const deleteClusterChannel = getRequestChannel<ClusterId, void>( export const deleteClusterChannel = getRequestChannel<ClusterId, void>(
"delete-cluster" "delete-cluster",
); );

View File

@ -6,5 +6,5 @@ import type { ClusterId } from "../../../../common/cluster-types";
import { getRequestChannel } from "@k8slens/messaging"; import { getRequestChannel } from "@k8slens/messaging";
export const setClusterAsDeletingChannel = getRequestChannel<ClusterId, void>( export const setClusterAsDeletingChannel = getRequestChannel<ClusterId, void>(
"set-cluster-as-deleting" "set-cluster-as-deleting",
); );

View File

@ -7,7 +7,7 @@ import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import { clearClusterAsDeletingChannel } from "../common/clear-as-deleting-channel"; import { clearClusterAsDeletingChannel } from "../common/clear-as-deleting-channel";
const clearClusterAsDeletingChannelListenerInjectable = getRequestChannelListenerInjectable({ const clearClusterAsDeletingChannelListenerInjectable = getRequestChannelListenerInjectable({
id: 'clear-cluster-as-deleting-channel-listener', id: "clear-cluster-as-deleting-channel-listener",
channel: clearClusterAsDeletingChannel, channel: clearClusterAsDeletingChannel,
getHandler: (di) => { getHandler: (di) => {
const clustersThatAreBeingDeleted = di.inject(clustersThatAreBeingDeletedInjectable); const clustersThatAreBeingDeleted = di.inject(clustersThatAreBeingDeletedInjectable);

View File

@ -14,7 +14,7 @@ import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import { deleteClusterChannel } from "../common/delete-channel"; import { deleteClusterChannel } from "../common/delete-channel";
const deleteClusterChannelListenerInjectable = getRequestChannelListenerInjectable({ const deleteClusterChannelListenerInjectable = getRequestChannelListenerInjectable({
id: 'delete-cluster-channel-listener', id: "delete-cluster-channel-listener",
channel: deleteClusterChannel, channel: deleteClusterChannel,
getHandler: (di) => { getHandler: (di) => {
const emitAppEvent = di.inject(emitAppEventInjectable); const emitAppEvent = di.inject(emitAppEventInjectable);

View File

@ -7,7 +7,7 @@ import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import { setClusterAsDeletingChannel } from "../common/set-as-deleting-channel"; import { setClusterAsDeletingChannel } from "../common/set-as-deleting-channel";
const setClusterAsDeletingChannelHandlerInjectable = getRequestChannelListenerInjectable({ const setClusterAsDeletingChannelHandlerInjectable = getRequestChannelListenerInjectable({
id: 'set-cluster-as-deleting-channel-handler', id: "set-cluster-as-deleting-channel-handler",
channel: setClusterAsDeletingChannel, channel: setClusterAsDeletingChannel,
getHandler: (di) => { getHandler: (di) => {
const clustersThatAreBeingDeleted = di.inject(clustersThatAreBeingDeletedInjectable); const clustersThatAreBeingDeleted = di.inject(clustersThatAreBeingDeletedInjectable);

View File

@ -4,8 +4,7 @@
*/ */
import type { ClusterId, ClusterState } from "../../../../common/cluster-types"; import type { ClusterId, ClusterState } from "../../../../common/cluster-types";
import type { MessageChannel } from "@k8slens/messaging"; import type { MessageChannel, RequestChannel } from "@k8slens/messaging";
import type { RequestChannel } from "@k8slens/messaging";
export interface ClusterStateSync { export interface ClusterStateSync {
clusterId: ClusterId; clusterId: ClusterId;

View File

@ -4,7 +4,8 @@
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { sendMessageToChannelInjectionToken } from "@k8slens/messaging"; import { sendMessageToChannelInjectionToken } from "@k8slens/messaging";
import { ClusterStateSync, clusterStateSyncChannel } from "../common/channels"; import type { ClusterStateSync } from "../common/channels";
import { clusterStateSyncChannel } from "../common/channels";
const emitClusterStateUpdateInjectable = getInjectable({ const emitClusterStateUpdateInjectable = getInjectable({
id: "emit-cluster-state-update", id: "emit-cluster-state-update",

View File

@ -7,7 +7,7 @@ import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import { initialClusterStatesChannel } from "../common/channels"; import { initialClusterStatesChannel } from "../common/channels";
const handleInitialClusterStateSyncInjectable = getRequestChannelListenerInjectable({ const handleInitialClusterStateSyncInjectable = getRequestChannelListenerInjectable({
id: 'handle-initial-cluster-state-sync', id: "handle-initial-cluster-state-sync",
channel: initialClusterStatesChannel, channel: initialClusterStatesChannel,
getHandler: (di) => { getHandler: (di) => {
const clusterStore = di.inject(clusterStoreInjectable); const clusterStore = di.inject(clusterStoreInjectable);

View File

@ -8,7 +8,7 @@ import { reloadPageChannel } from "../common/channel";
import reloadPageChannelListenerInjectable from "./register-listener.injectable"; import reloadPageChannelListenerInjectable from "./register-listener.injectable";
export default getGlobalOverride(reloadPageChannelListenerInjectable, () => ({ export default getGlobalOverride(reloadPageChannelListenerInjectable, () => ({
id: 'reload-page-channel-listener', id: "reload-page-channel-listener",
channel: reloadPageChannel, channel: reloadPageChannel,
handler: () => {}, handler: () => {},
})); }));

View File

@ -8,7 +8,7 @@ import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import { openPathPickingDialogChannel } from "../common/channel"; import { openPathPickingDialogChannel } from "../common/channel";
const openPathPickingDialogListener = getRequestChannelListenerInjectable({ const openPathPickingDialogListener = getRequestChannelListenerInjectable({
id: 'open-path-picking-dialog', id: "open-path-picking-dialog",
channel: openPathPickingDialogChannel, channel: openPathPickingDialogChannel,
getHandler: (di) => di.inject(askUserForFilePathsInjectable), getHandler: (di) => di.inject(askUserForFilePathsInjectable),
}); });

View File

@ -3,8 +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 type { MessageChannel } from "@k8slens/messaging"; import type { MessageChannel, RequestChannel } from "@k8slens/messaging";
import type { RequestChannel } from "@k8slens/messaging";
export type SystemThemeType = "dark" | "light"; export type SystemThemeType = "dark" | "light";

View File

@ -4,7 +4,8 @@
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { sendMessageToChannelInjectionToken } from "@k8slens/messaging"; import { sendMessageToChannelInjectionToken } from "@k8slens/messaging";
import { SystemThemeType, systemThemeTypeUpdateChannel } from "../common/channels"; import type { SystemThemeType } from "../common/channels";
import { systemThemeTypeUpdateChannel } from "../common/channels";
const emitSystemThemeTypeUpdateInjectable = getInjectable({ const emitSystemThemeTypeUpdateInjectable = getInjectable({
id: "emit-system-theme-type-update", id: "emit-system-theme-type-update",

View File

@ -8,7 +8,7 @@ import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import { initialSystemThemeTypeChannel } from "../common/channels"; import { initialSystemThemeTypeChannel } from "../common/channels";
const initialSystemThemeTypeHandler = getRequestChannelListenerInjectable({ const initialSystemThemeTypeHandler = getRequestChannelListenerInjectable({
id: 'initial-system-theme-type-listener', id: "initial-system-theme-type-listener",
channel: initialSystemThemeTypeChannel, channel: initialSystemThemeTypeChannel,
getHandler: (di) => { getHandler: (di) => {
const operatingSystemTheme = di.inject(operatingSystemThemeInjectable); const operatingSystemTheme = di.inject(operatingSystemThemeInjectable);

View File

@ -7,7 +7,7 @@ import appPathsInjectable from "../../common/app-paths/app-paths.injectable";
import { getRequestChannelListenerInjectable } from "@k8slens/messaging"; import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
const appPathsRequestChannelListenerInjectable = getRequestChannelListenerInjectable({ const appPathsRequestChannelListenerInjectable = getRequestChannelListenerInjectable({
id: 'app-paths-request-channel-listener', id: "app-paths-request-channel-listener",
channel: appPathsChannel, channel: appPathsChannel,
getHandler: (di) => { getHandler: (di) => {
const appPaths = di.inject(appPathsInjectable); const appPaths = di.inject(appPathsInjectable);

View File

@ -7,7 +7,7 @@ import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import buildVersionInjectable from "../vars/build-version/build-version.injectable"; import buildVersionInjectable from "../vars/build-version/build-version.injectable";
const buildVersionChannelListenerInjectable = getRequestChannelListenerInjectable({ const buildVersionChannelListenerInjectable = getRequestChannelListenerInjectable({
id: 'build-version-channel-listener', id: "build-version-channel-listener",
channel: buildVersionChannel, channel: buildVersionChannel,
getHandler: (di) => { getHandler: (di) => {
const buildVersion = di.inject(buildVersionInjectable); const buildVersion = di.inject(buildVersionInjectable);

View File

@ -7,7 +7,7 @@ import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import getActiveHelmRepositoriesInjectable from "./get-active-helm-repositories.injectable"; import getActiveHelmRepositoriesInjectable from "./get-active-helm-repositories.injectable";
const getActiveHelmRepositoriesChannelListenerInjectable = getRequestChannelListenerInjectable({ const getActiveHelmRepositoriesChannelListenerInjectable = getRequestChannelListenerInjectable({
id: 'get-active-helm-repositories-channel-listener', id: "get-active-helm-repositories-channel-listener",
channel: getActiveHelmRepositoriesChannel, channel: getActiveHelmRepositoriesChannel,
getHandler: (di) => di.inject(getActiveHelmRepositoriesInjectable), getHandler: (di) => di.inject(getActiveHelmRepositoriesInjectable),
}); });

View File

@ -7,7 +7,7 @@ import { removeHelmRepositoryChannel } from "../../../../common/helm/remove-helm
import { getRequestChannelListenerInjectable } from "@k8slens/messaging"; import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
const removeHelmRepositoryChannelListenerInjectable = getRequestChannelListenerInjectable({ const removeHelmRepositoryChannelListenerInjectable = getRequestChannelListenerInjectable({
id: 'remove-helm-repository-channel-listener', id: "remove-helm-repository-channel-listener",
channel: removeHelmRepositoryChannel, channel: removeHelmRepositoryChannel,
getHandler: (di) => di.inject(removeHelmRepositoryInjectable), getHandler: (di) => di.inject(removeHelmRepositoryInjectable),
}); });

View File

@ -9,7 +9,7 @@ import resourceApplierInjectable from "../resource-applier/create-resource-appli
import { getRequestChannelListenerInjectable } from "@k8slens/messaging"; import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
const kubectlApplyAllChannelHandlerInjectable = getRequestChannelListenerInjectable({ const kubectlApplyAllChannelHandlerInjectable = getRequestChannelListenerInjectable({
id: 'kubectl-apply-all-channel-handler-listener', id: "kubectl-apply-all-channel-handler-listener",
channel: kubectlApplyAllChannel, channel: kubectlApplyAllChannel,
getHandler: (di) => { getHandler: (di) => {
const getClusterById = di.inject(getClusterByIdInjectable); const getClusterById = di.inject(getClusterByIdInjectable);

View File

@ -9,7 +9,7 @@ import resourceApplierInjectable from "../resource-applier/create-resource-appli
import { getRequestChannelListenerInjectable } from "@k8slens/messaging"; import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
const kubectlDeleteAllChannelHandlerInjectable = getRequestChannelListenerInjectable({ const kubectlDeleteAllChannelHandlerInjectable = getRequestChannelListenerInjectable({
id: 'kubectl-delete-all-channel-handler-listener', id: "kubectl-delete-all-channel-handler-listener",
channel: kubectlDeleteAllChannel, channel: kubectlDeleteAllChannel,
getHandler: (di) => { getHandler: (di) => {
const emitAppEvent = di.inject(emitAppEventInjectable); const emitAppEvent = di.inject(emitAppEventInjectable);

View File

@ -7,7 +7,7 @@ import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import lensProxyCertificateInjectable from "../../common/certificate/lens-proxy-certificate.injectable"; import lensProxyCertificateInjectable from "../../common/certificate/lens-proxy-certificate.injectable";
const lensProxyCertificateRequestHandlerInjectable = getRequestChannelListenerInjectable({ const lensProxyCertificateRequestHandlerInjectable = getRequestChannelListenerInjectable({
id: 'lens-proxy-certificate-request-handler-listener', id: "lens-proxy-certificate-request-handler-listener",
channel: lensProxyCertificateChannel, channel: lensProxyCertificateChannel,
getHandler: (di) => { getHandler: (di) => {
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable).get(); const lensProxyCertificate = di.inject(lensProxyCertificateInjectable).get();

View File

@ -7,7 +7,7 @@ import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
import resolveSystemProxyInjectable from "./resolve-system-proxy.injectable"; import resolveSystemProxyInjectable from "./resolve-system-proxy.injectable";
const resolveSystemProxyChannelResponderInjectable = getRequestChannelListenerInjectable({ const resolveSystemProxyChannelResponderInjectable = getRequestChannelListenerInjectable({
id: 'resolve-system-proxy-channel-responder-listener', id: "resolve-system-proxy-channel-responder-listener",
channel: resolveSystemProxyChannel, channel: resolveSystemProxyChannel,
getHandler: (di) => di.inject(resolveSystemProxyInjectable), getHandler: (di) => di.inject(resolveSystemProxyInjectable),
}); });

View File

@ -7,7 +7,7 @@ import { syncBoxInjectionToken } from "../../../common/utils/sync-box/sync-box-i
import { getRequestChannelListenerInjectable } from "@k8slens/messaging"; import { getRequestChannelListenerInjectable } from "@k8slens/messaging";
const syncBoxInitialValueChannelListenerInjectable = getRequestChannelListenerInjectable({ const syncBoxInitialValueChannelListenerInjectable = getRequestChannelListenerInjectable({
id: 'sync-box-initial-value-channel-listener', id: "sync-box-initial-value-channel-listener",
channel: syncBoxInitialValueChannel, channel: syncBoxInitialValueChannel,
getHandler: (di) => { getHandler: (di) => {
const syncBoxes = di.injectMany(syncBoxInjectionToken); const syncBoxes = di.injectMany(syncBoxInjectionToken);

View File

@ -20,7 +20,7 @@ const navigationChannelListenerInjectable = getInjectable({
const navigateToUrl = di.inject(navigateToUrlInjectionToken); const navigateToUrl = di.inject(navigateToUrlInjectionToken);
return { return {
id: 'navigation-channel-listener', id: "navigation-channel-listener",
channel: currentlyInClusterFrame channel: currentlyInClusterFrame
? clusterFrameNavigationChannel ? clusterFrameNavigationChannel
: appNavigationChannel, : appNavigationChannel,
@ -35,7 +35,7 @@ const navigationChannelListenerInjectable = getInjectable({
}; };
}, },
injectionToken: messageChannelListenerInjectionToken injectionToken: messageChannelListenerInjectionToken,
}); });
export default navigationChannelListenerInjectable; export default navigationChannelListenerInjectable;

View File

@ -1 +1,2 @@
module.exports = require("@k8slens/jest").monorepoPackageConfig(__dirname).configForNode; module.exports =
require("@k8slens/jest").monorepoPackageConfig(__dirname).configForNode;

View File

@ -4,8 +4,7 @@ import * as timeSlots from "./time-slots";
export type StartApplication = () => Promise<void>; export type StartApplication = () => Promise<void>;
export const startApplicationInjectionToken = export const startApplicationInjectionToken = getInjectionToken<StartApplication>({
getInjectionToken<StartApplication>({
id: "start-application-injection-token", id: "start-application-injection-token",
}); });
@ -13,8 +12,10 @@ const startApplicationInjectable = getInjectable({
id: "start-application", id: "start-application",
instantiate: (di): StartApplication => { instantiate: (di): StartApplication => {
const runManyAsync = runManyFor(di) const runManyAsync = runManyFor(di);
const beforeApplicationIsLoading = runManyAsync(timeSlots.beforeApplicationIsLoadingInjectionToken); const beforeApplicationIsLoading = runManyAsync(
timeSlots.beforeApplicationIsLoadingInjectionToken,
);
const onLoadOfApplication = runManyAsync(timeSlots.onLoadOfApplicationInjectionToken); const onLoadOfApplication = runManyAsync(timeSlots.onLoadOfApplicationInjectionToken);
const afterApplicationIsLoaded = runManyAsync(timeSlots.afterApplicationIsLoadedInjectionToken); const afterApplicationIsLoaded = runManyAsync(timeSlots.afterApplicationIsLoadedInjectionToken);

View File

@ -1 +1,2 @@
module.exports = require("@k8slens/jest").monorepoPackageConfig(__dirname).configForNode; module.exports =
require("@k8slens/jest").monorepoPackageConfig(__dirname).configForNode;