mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Bump injectable to 5.1.2 (#5010)
This commit is contained in:
parent
8c8bab540c
commit
6b28f9e9c3
@ -200,8 +200,8 @@
|
|||||||
"@hapi/call": "^8.0.1",
|
"@hapi/call": "^8.0.1",
|
||||||
"@hapi/subtext": "^7.0.3",
|
"@hapi/subtext": "^7.0.3",
|
||||||
"@kubernetes/client-node": "^0.16.1",
|
"@kubernetes/client-node": "^0.16.1",
|
||||||
"@ogre-tools/injectable": "5.0.1",
|
"@ogre-tools/injectable": "5.1.2",
|
||||||
"@ogre-tools/injectable-react": "5.0.1",
|
"@ogre-tools/injectable-react": "5.1.2",
|
||||||
"@sentry/electron": "^2.5.4",
|
"@sentry/electron": "^2.5.4",
|
||||||
"@sentry/integrations": "^6.15.0",
|
"@sentry/integrations": "^6.15.0",
|
||||||
"@types/circular-dependency-plugin": "5.0.5",
|
"@types/circular-dependency-plugin": "5.0.5",
|
||||||
|
|||||||
@ -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 { baseBinariesDir } from "../../vars";
|
import { baseBinariesDir } from "../../vars";
|
||||||
|
|
||||||
const directoryForBundledBinariesInjectable = getInjectable({
|
const directoryForBundledBinariesInjectable = getInjectable({
|
||||||
id: "directory-for-bundled-binaries",
|
id: "directory-for-bundled-binaries",
|
||||||
instantiate: () => baseBinariesDir.get(),
|
instantiate: () => baseBinariesDir.get(),
|
||||||
lifecycle: lifecycleEnum.singleton,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default directoryForBundledBinariesInjectable;
|
export default directoryForBundledBinariesInjectable;
|
||||||
|
|||||||
@ -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 { contextDir } from "../vars";
|
import { contextDir } from "../vars";
|
||||||
|
|
||||||
const contextDirInjectable = getInjectable({
|
const contextDirInjectable = getInjectable({
|
||||||
id: "context-dir",
|
id: "context-dir",
|
||||||
instantiate: () => contextDir,
|
instantiate: () => contextDir,
|
||||||
lifecycle: lifecycleEnum.singleton,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default contextDirInjectable;
|
export default contextDirInjectable;
|
||||||
|
|||||||
@ -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 { isDevelopment } from "../vars";
|
import { isDevelopment } from "../vars";
|
||||||
|
|
||||||
const isDevelopmentInjectable = getInjectable({
|
const isDevelopmentInjectable = getInjectable({
|
||||||
id: "is-development",
|
id: "is-development",
|
||||||
instantiate: () => isDevelopment,
|
instantiate: () => isDevelopment,
|
||||||
lifecycle: lifecycleEnum.singleton,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default isDevelopmentInjectable;
|
export default isDevelopmentInjectable;
|
||||||
|
|||||||
@ -2,29 +2,19 @@
|
|||||||
* 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 type { Injectable, TentativeTuple } from "@ogre-tools/injectable";
|
|
||||||
|
|
||||||
import { getLegacyGlobalDiForExtensionApi } from "./legacy-global-di-for-extension-api";
|
import { getLegacyGlobalDiForExtensionApi } from "./legacy-global-di-for-extension-api";
|
||||||
|
import type { Inject } from "@ogre-tools/injectable";
|
||||||
|
|
||||||
type FactoryType = <
|
export const asLegacyGlobalFunctionForExtensionApi = ((
|
||||||
TInjectable extends Injectable<unknown, TInstance, TInstantiationParameter>,
|
injectableKey,
|
||||||
TInstantiationParameter,
|
instantiationParameter,
|
||||||
TInstance extends (...args: unknown[]) => any,
|
) =>
|
||||||
TFunction extends (...args: unknown[]) => any = Awaited<
|
(...args: any[]) => {
|
||||||
ReturnType<TInjectable["instantiate"]>
|
|
||||||
>,
|
|
||||||
>(
|
|
||||||
injectableKey: TInjectable,
|
|
||||||
...instantiationParameter: TentativeTuple<TInstantiationParameter>
|
|
||||||
) => (...args: Parameters<TFunction>) => ReturnType<TFunction>;
|
|
||||||
|
|
||||||
export const asLegacyGlobalFunctionForExtensionApi: FactoryType =
|
|
||||||
(injectableKey, ...instantiationParameter) =>
|
|
||||||
(...args) => {
|
|
||||||
const injected = getLegacyGlobalDiForExtensionApi().inject(
|
const injected = getLegacyGlobalDiForExtensionApi().inject(
|
||||||
injectableKey,
|
injectableKey,
|
||||||
...instantiationParameter,
|
instantiationParameter,
|
||||||
);
|
) as unknown as (...args: any[]) => any;
|
||||||
|
|
||||||
return injected(...args);
|
return injected(...args);
|
||||||
};
|
}) as Inject<false>;
|
||||||
|
|||||||
@ -0,0 +1,80 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import {
|
||||||
|
createContainer,
|
||||||
|
DiContainer,
|
||||||
|
getInjectable,
|
||||||
|
Injectable,
|
||||||
|
} from "@ogre-tools/injectable";
|
||||||
|
import { setLegacyGlobalDiForExtensionApi } from "./legacy-global-di-for-extension-api";
|
||||||
|
import { asLegacyGlobalObjectForExtensionApiWithModifications } from "./as-legacy-global-object-for-extension-api-with-modifications";
|
||||||
|
|
||||||
|
describe("asLegacyGlobalObjectForExtensionApiWithModifications", () => {
|
||||||
|
describe("given legacy global object", () => {
|
||||||
|
let di: DiContainer;
|
||||||
|
let someInjectable: Injectable<{ someProperty: string }, unknown, void>;
|
||||||
|
let actual: { someProperty: string } & {
|
||||||
|
someModificationProperty: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
di = createContainer();
|
||||||
|
|
||||||
|
jest.spyOn(di, "inject");
|
||||||
|
|
||||||
|
setLegacyGlobalDiForExtensionApi(di);
|
||||||
|
|
||||||
|
someInjectable = getInjectable({
|
||||||
|
id: "some-injectable",
|
||||||
|
instantiate: () => ({
|
||||||
|
someProperty: "some-property-value",
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
di.register(someInjectable);
|
||||||
|
|
||||||
|
actual = asLegacyGlobalObjectForExtensionApiWithModifications(
|
||||||
|
someInjectable,
|
||||||
|
{ someModificationProperty: "some-modification-value" },
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("when not accessed, does not inject yet", () => {
|
||||||
|
expect(di.inject).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("when a property of global is accessed, ", () => {
|
||||||
|
let actualPropertyValue: string;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
actualPropertyValue = actual.someProperty;
|
||||||
|
});
|
||||||
|
|
||||||
|
it("injects the injectable for global", () => {
|
||||||
|
expect(di.inject).toHaveBeenCalledWith(someInjectable, undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("global has property of injectable", () => {
|
||||||
|
expect(actualPropertyValue).toBe("some-property-value");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("when a property of modification is accessed, ", () => {
|
||||||
|
let actualModificationValue: string;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
actualModificationValue = actual.someModificationProperty;
|
||||||
|
});
|
||||||
|
|
||||||
|
it("injects the injectable for global", () => {
|
||||||
|
expect(di.inject).toHaveBeenCalledWith(someInjectable, undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("global has property of modification", () => {
|
||||||
|
expect(actualModificationValue).toBe("some-modification-value");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -2,44 +2,18 @@
|
|||||||
* 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 type { Injectable, TentativeTuple } from "@ogre-tools/injectable";
|
import { asLegacyGlobalForExtensionApi } from "./as-legacy-global-object-for-extension-api";
|
||||||
import { getLegacyGlobalDiForExtensionApi } from "./legacy-global-di-for-extension-api";
|
import type { Injectable } from "@ogre-tools/injectable";
|
||||||
|
|
||||||
type MapInjectables<T> = {
|
|
||||||
[Key in keyof T]: T[Key] extends () => infer Res ? Res : never;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const asLegacyGlobalObjectForExtensionApiWithModifications = <
|
export const asLegacyGlobalObjectForExtensionApiWithModifications = <
|
||||||
TInjectable extends Injectable<unknown, unknown, TInstantiationParameter>,
|
InjectableInstance extends InjectionTokenInstance,
|
||||||
TInstantiationParameter,
|
InjectionTokenInstance,
|
||||||
OtherFields extends Record<string, () => any>,
|
ModificationObject extends object,
|
||||||
>(
|
>(
|
||||||
injectableKey: TInjectable,
|
injectable: Injectable<InjectableInstance, InjectionTokenInstance, void>,
|
||||||
otherFields: OtherFields,
|
modificationObject: ModificationObject,
|
||||||
...instantiationParameter: TentativeTuple<TInstantiationParameter>
|
|
||||||
) =>
|
) =>
|
||||||
new Proxy(
|
Object.assign(
|
||||||
{},
|
asLegacyGlobalForExtensionApi(injectable),
|
||||||
{
|
modificationObject,
|
||||||
get(target, propertyName) {
|
|
||||||
if (propertyName === "$$typeof") {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const instance: any = getLegacyGlobalDiForExtensionApi().inject(
|
|
||||||
injectableKey,
|
|
||||||
...instantiationParameter,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const propertyValue = instance[propertyName] ?? otherFields[propertyName as any]();
|
|
||||||
|
|
||||||
if (typeof propertyValue === "function") {
|
|
||||||
return function (...args: any[]) {
|
|
||||||
return propertyValue.apply(instance, args);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return propertyValue;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
) as ReturnType<TInjectable["instantiate"]> & MapInjectables<OtherFields>;
|
|
||||||
|
|||||||
@ -2,30 +2,37 @@
|
|||||||
* 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 type { Injectable, TentativeTuple } from "@ogre-tools/injectable";
|
import type { Inject } from "@ogre-tools/injectable";
|
||||||
import { getLegacyGlobalDiForExtensionApi } from "./legacy-global-di-for-extension-api";
|
import { getLegacyGlobalDiForExtensionApi } from "./legacy-global-di-for-extension-api";
|
||||||
|
|
||||||
export const asLegacyGlobalObjectForExtensionApi = <
|
export const asLegacyGlobalForExtensionApi = ((
|
||||||
TInjectable extends Injectable<unknown, unknown, TInstantiationParameter>,
|
injectable,
|
||||||
TInstantiationParameter,
|
instantiationParameter,
|
||||||
>(
|
) =>
|
||||||
injectableKey: TInjectable,
|
|
||||||
...instantiationParameter: TentativeTuple<TInstantiationParameter>
|
|
||||||
) =>
|
|
||||||
new Proxy(
|
new Proxy(
|
||||||
{},
|
{},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
apply(target: any, thisArg, argArray) {
|
||||||
|
const fn = getLegacyGlobalDiForExtensionApi().inject(
|
||||||
|
injectable,
|
||||||
|
instantiationParameter,
|
||||||
|
) as unknown as (...args: any[]) => any;
|
||||||
|
|
||||||
|
return fn(...argArray);
|
||||||
|
},
|
||||||
|
|
||||||
get(target, propertyName) {
|
get(target, propertyName) {
|
||||||
if (propertyName === "$$typeof") {
|
if (propertyName === "$$typeof") {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const instance: any = getLegacyGlobalDiForExtensionApi().inject(
|
const instance: any = getLegacyGlobalDiForExtensionApi().inject(
|
||||||
injectableKey,
|
injectable,
|
||||||
...instantiationParameter,
|
instantiationParameter,
|
||||||
);
|
);
|
||||||
|
|
||||||
const propertyValue = instance[propertyName];
|
const propertyValue = instance[propertyName] ?? target[propertyName];
|
||||||
|
|
||||||
if (typeof propertyValue === "function") {
|
if (typeof propertyValue === "function") {
|
||||||
return function (...args: any[]) {
|
return function (...args: any[]) {
|
||||||
@ -36,4 +43,4 @@ export const asLegacyGlobalObjectForExtensionApi = <
|
|||||||
return propertyValue;
|
return propertyValue;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
) as ReturnType<TInjectable["instantiate"]>;
|
)) as Inject<false>;
|
||||||
|
|||||||
@ -5,16 +5,16 @@
|
|||||||
import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api";
|
import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api";
|
||||||
import createTerminalTabInjectable from "../../renderer/components/dock/terminal/create-terminal-tab.injectable";
|
import createTerminalTabInjectable from "../../renderer/components/dock/terminal/create-terminal-tab.injectable";
|
||||||
import terminalStoreInjectable from "../../renderer/components/dock/terminal/store.injectable";
|
import terminalStoreInjectable from "../../renderer/components/dock/terminal/store.injectable";
|
||||||
import { asLegacyGlobalObjectForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
||||||
import logTabStoreInjectable from "../../renderer/components/dock/logs/tab-store.injectable";
|
import logTabStoreInjectable from "../../renderer/components/dock/logs/tab-store.injectable";
|
||||||
|
|
||||||
import commandOverlayInjectable from "../../renderer/components/command-palette/command-overlay.injectable";
|
import commandOverlayInjectable from "../../renderer/components/command-palette/command-overlay.injectable";
|
||||||
import { asLegacyGlobalObjectForExtensionApiWithModifications } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api-with-modifications";
|
|
||||||
import createPodLogsTabInjectable from "../../renderer/components/dock/logs/create-pod-logs-tab.injectable";
|
import createPodLogsTabInjectable from "../../renderer/components/dock/logs/create-pod-logs-tab.injectable";
|
||||||
import createWorkloadLogsTabInjectable from "../../renderer/components/dock/logs/create-workload-logs-tab.injectable";
|
import createWorkloadLogsTabInjectable from "../../renderer/components/dock/logs/create-workload-logs-tab.injectable";
|
||||||
import sendCommandInjectable from "../../renderer/components/dock/terminal/send-command.injectable";
|
import sendCommandInjectable from "../../renderer/components/dock/terminal/send-command.injectable";
|
||||||
import { podsStore } from "../../renderer/components/+workloads-pods/pods.store";
|
import { podsStore } from "../../renderer/components/+workloads-pods/pods.store";
|
||||||
import renameTabInjectable from "../../renderer/components/dock/dock/rename-tab.injectable";
|
import renameTabInjectable from "../../renderer/components/dock/dock/rename-tab.injectable";
|
||||||
|
import { asLegacyGlobalObjectForExtensionApiWithModifications } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api-with-modifications";
|
||||||
|
|
||||||
// layouts
|
// layouts
|
||||||
export * from "../../renderer/components/layout/main-layout";
|
export * from "../../renderer/components/layout/main-layout";
|
||||||
@ -33,7 +33,9 @@ export * from "../../renderer/components/switch";
|
|||||||
export * from "../../renderer/components/input/input";
|
export * from "../../renderer/components/input/input";
|
||||||
|
|
||||||
// command-overlay
|
// command-overlay
|
||||||
export const CommandOverlay = asLegacyGlobalObjectForExtensionApi(commandOverlayInjectable);
|
export const CommandOverlay = asLegacyGlobalForExtensionApi(
|
||||||
|
commandOverlayInjectable,
|
||||||
|
);
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
CategoryColumnRegistration,
|
CategoryColumnRegistration,
|
||||||
@ -74,30 +76,52 @@ export * from "../../renderer/components/+events/kube-event-details";
|
|||||||
// specific exports
|
// specific exports
|
||||||
export * from "../../renderer/components/status-brick";
|
export * from "../../renderer/components/status-brick";
|
||||||
|
|
||||||
export const createTerminalTab = asLegacyGlobalFunctionForExtensionApi(createTerminalTabInjectable);
|
export const createTerminalTab = asLegacyGlobalFunctionForExtensionApi(
|
||||||
export const terminalStore = asLegacyGlobalObjectForExtensionApiWithModifications(terminalStoreInjectable, {
|
createTerminalTabInjectable,
|
||||||
sendCommand: () => asLegacyGlobalFunctionForExtensionApi(sendCommandInjectable),
|
);
|
||||||
});
|
|
||||||
export const logTabStore = asLegacyGlobalObjectForExtensionApiWithModifications(logTabStoreInjectable, {
|
export const terminalStore =
|
||||||
createPodTab: () => asLegacyGlobalFunctionForExtensionApi(createPodLogsTabInjectable),
|
asLegacyGlobalObjectForExtensionApiWithModifications(
|
||||||
createWorkloadTab: () => asLegacyGlobalFunctionForExtensionApi(createWorkloadLogsTabInjectable),
|
terminalStoreInjectable,
|
||||||
renameTab: () => (tabId: string): void => {
|
{
|
||||||
const renameTab = asLegacyGlobalFunctionForExtensionApi(renameTabInjectable);
|
sendCommand: asLegacyGlobalFunctionForExtensionApi(sendCommandInjectable),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
export const logTabStore = asLegacyGlobalObjectForExtensionApiWithModifications(
|
||||||
|
logTabStoreInjectable,
|
||||||
|
{
|
||||||
|
createPodTab: asLegacyGlobalFunctionForExtensionApi(
|
||||||
|
createPodLogsTabInjectable,
|
||||||
|
),
|
||||||
|
|
||||||
|
createWorkloadTab: asLegacyGlobalFunctionForExtensionApi(
|
||||||
|
createWorkloadLogsTabInjectable,
|
||||||
|
),
|
||||||
|
|
||||||
|
renameTab: (tabId: string): void => {
|
||||||
|
const renameTab =
|
||||||
|
asLegacyGlobalFunctionForExtensionApi(renameTabInjectable);
|
||||||
|
|
||||||
const tabData = logTabStore.getData(tabId);
|
const tabData = logTabStore.getData(tabId);
|
||||||
const pod = podsStore.getById(tabData.selectedPodId);
|
const pod = podsStore.getById(tabData.selectedPodId);
|
||||||
|
|
||||||
renameTab(tabId, `Pod ${pod.getName()}`);
|
renameTab(tabId, `Pod ${pod.getName()}`);
|
||||||
},
|
},
|
||||||
tabs: () => undefined,
|
|
||||||
});
|
tabs: undefined,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
export class TerminalStore {
|
export class TerminalStore {
|
||||||
static getInstance() {
|
static getInstance() {
|
||||||
return terminalStore;
|
return terminalStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
static createInstance() {
|
static createInstance() {
|
||||||
return terminalStore;
|
return terminalStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
static resetInstance() {
|
static resetInstance() {
|
||||||
console.warn("TerminalStore.resetInstance() does nothing");
|
console.warn("TerminalStore.resetInstance() does nothing");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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 mainExtensionsInjectable from "../../../extensions/main-extensions.injectable";
|
import mainExtensionsInjectable from "../../../extensions/main-extensions.injectable";
|
||||||
import { terminalShellEnvModify } from "./terminal-shell-env-modifiers";
|
import { terminalShellEnvModify } from "./terminal-shell-env-modifiers";
|
||||||
|
|
||||||
@ -14,8 +14,6 @@ const terminalShellEnvModifyInjectable = getInjectable({
|
|||||||
terminalShellEnvModify({
|
terminalShellEnvModify({
|
||||||
extensions: di.inject(mainExtensionsInjectable),
|
extensions: di.inject(mainExtensionsInjectable),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
lifecycle: lifecycleEnum.singleton,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default terminalShellEnvModifyInjectable;
|
export default terminalShellEnvModifyInjectable;
|
||||||
|
|||||||
@ -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 rendererExtensionsInjectable from "../../../extensions/renderer-extensions.injectable";
|
import rendererExtensionsInjectable from "../../../extensions/renderer-extensions.injectable";
|
||||||
import { OverviewStatuses } from "./overview-statuses";
|
import { OverviewStatuses } from "./overview-statuses";
|
||||||
@ -31,8 +31,6 @@ const detailComponentsInjectable = getInjectable({
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
lifecycle: lifecycleEnum.singleton,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const coreRegistrations = [
|
const coreRegistrations = [
|
||||||
|
|||||||
@ -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 rendererExtensionsInjectable from "../../../extensions/renderer-extensions.injectable";
|
import rendererExtensionsInjectable from "../../../extensions/renderer-extensions.injectable";
|
||||||
|
|
||||||
@ -16,8 +16,6 @@ const statusRegistrationsInjectable = getInjectable({
|
|||||||
extensions.get().flatMap((extension) => extension.kubeObjectStatusTexts),
|
extensions.get().flatMap((extension) => extension.kubeObjectStatusTexts),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
lifecycle: lifecycleEnum.singleton,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default statusRegistrationsInjectable;
|
export default statusRegistrationsInjectable;
|
||||||
|
|||||||
@ -3,9 +3,12 @@
|
|||||||
* 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 React from "react";
|
import React from "react";
|
||||||
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 { StatusBarItemProps, StatusBarRegistration } from "./status-bar-registration";
|
import type {
|
||||||
|
StatusBarItemProps,
|
||||||
|
StatusBarRegistration,
|
||||||
|
} from "./status-bar-registration";
|
||||||
import statusBarItemsInjectable from "./status-bar-items.injectable";
|
import statusBarItemsInjectable from "./status-bar-items.injectable";
|
||||||
|
|
||||||
export interface RegisteredStatusBarItems {
|
export interface RegisteredStatusBarItems {
|
||||||
@ -69,7 +72,6 @@ const registeredStatusBarItemsInjectable = getInjectable({
|
|||||||
registrations: di.inject(statusBarItemsInjectable),
|
registrations: di.inject(statusBarItemsInjectable),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
lifecycle: lifecycleEnum.singleton,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default registeredStatusBarItemsInjectable;
|
export default registeredStatusBarItemsInjectable;
|
||||||
|
|||||||
@ -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 rendererExtensionsInjectable from "../../../extensions/renderer-extensions.injectable";
|
import rendererExtensionsInjectable from "../../../extensions/renderer-extensions.injectable";
|
||||||
|
|
||||||
@ -12,12 +12,10 @@ const statusBarItemsInjectable = getInjectable({
|
|||||||
instantiate: (di) => {
|
instantiate: (di) => {
|
||||||
const extensions = di.inject(rendererExtensionsInjectable);
|
const extensions = di.inject(rendererExtensionsInjectable);
|
||||||
|
|
||||||
return computed(() => (
|
return computed(() =>
|
||||||
extensions.get()
|
extensions.get().flatMap((ext) => ext.statusBarItems),
|
||||||
.flatMap(ext => ext.statusBarItems)
|
);
|
||||||
));
|
|
||||||
},
|
},
|
||||||
lifecycle: lifecycleEnum.singleton,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default statusBarItemsInjectable;
|
export default statusBarItemsInjectable;
|
||||||
|
|||||||
30
yarn.lock
30
yarn.lock
@ -956,28 +956,28 @@
|
|||||||
"@nodelib/fs.scandir" "2.1.3"
|
"@nodelib/fs.scandir" "2.1.3"
|
||||||
fastq "^1.6.0"
|
fastq "^1.6.0"
|
||||||
|
|
||||||
"@ogre-tools/fp@^5.0.1":
|
"@ogre-tools/fp@^5.1.2":
|
||||||
version "5.0.1"
|
version "5.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/@ogre-tools/fp/-/fp-5.0.1.tgz#e9953a59b36a747f8248e2e738200b1584e2b40f"
|
resolved "https://registry.yarnpkg.com/@ogre-tools/fp/-/fp-5.1.2.tgz#8648bcd2e942211b8e94882afbfdf00ae2d07310"
|
||||||
integrity sha512-SmEvCVwBwjzgJ9/BporJ21oLq7cPurl0ECY3WFD1GhwVI8D4R6kZeZkWGKOOp/hG2WRcu9c13HM6JpkL+VUTVQ==
|
integrity sha512-xWXg51KKoRX5p1czSkhUnWoRvzzM83V9bThWGjZKg5opZMUPmZI/GZ3uSALq0484lDr1rQCK1DaEDy4VDB7tWg==
|
||||||
dependencies:
|
dependencies:
|
||||||
lodash "^4.17.21"
|
lodash "^4.17.21"
|
||||||
|
|
||||||
"@ogre-tools/injectable-react@5.0.1":
|
"@ogre-tools/injectable-react@5.1.2":
|
||||||
version "5.0.1"
|
version "5.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/@ogre-tools/injectable-react/-/injectable-react-5.0.1.tgz#fbab22b5779e30aef0007b0507e889434563f74b"
|
resolved "https://registry.yarnpkg.com/@ogre-tools/injectable-react/-/injectable-react-5.1.2.tgz#95cf37881b026a18f3625fbfe896e987cb108f36"
|
||||||
integrity sha512-34cSDwdU5DWiHNVfENJjF0k+baS0EBafYB+GjEmap5Au3QBSbej6P+h9b5QDRsFhzRxmEnIapsaQh00bpwHh2A==
|
integrity sha512-D/B4Tyh5KuEnPP73QTZpbErDtCHGDbYPp6KvOU4t+TnNUCX0fw2ImPSa09YmjtyLh3hr4DZVyf/QpamY6HEjMw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@ogre-tools/fp" "^5.0.1"
|
"@ogre-tools/fp" "^5.1.2"
|
||||||
"@ogre-tools/injectable" "^5.0.1"
|
"@ogre-tools/injectable" "^5.1.2"
|
||||||
lodash "^4.17.21"
|
lodash "^4.17.21"
|
||||||
|
|
||||||
"@ogre-tools/injectable@5.0.1", "@ogre-tools/injectable@^5.0.1":
|
"@ogre-tools/injectable@5.1.2", "@ogre-tools/injectable@^5.1.2":
|
||||||
version "5.0.1"
|
version "5.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/@ogre-tools/injectable/-/injectable-5.0.1.tgz#5947877e928f381e89f64516a9beb69489fecd42"
|
resolved "https://registry.yarnpkg.com/@ogre-tools/injectable/-/injectable-5.1.2.tgz#7fa0673c447e493ea8bc0c6821cfe6e6a79ce8fe"
|
||||||
integrity sha512-pNvHrMseHk4vwDDba92tVfNR6AXk7IblKwIP1nY2Ccs7WCY2GSiC3zBWlYmfTBW/whjJS/6Q4+L6XhfP8zYKyw==
|
integrity sha512-dP4T/vHy6HlfAJPzXtzGRlgwMDx7SqnAJKvDuhDPpsMWqEGPxouVMMJIi7aF2lvZtnDj9xJK/VfAk7oXPcMXAA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@ogre-tools/fp" "^5.0.1"
|
"@ogre-tools/fp" "^5.1.2"
|
||||||
lodash "^4.17.21"
|
lodash "^4.17.21"
|
||||||
|
|
||||||
"@panva/asn1.js@^1.0.0":
|
"@panva/asn1.js@^1.0.0":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user