mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Upgrade all injectable libraries to v11 (#6338)
- Includes local fixes that are required by the new code Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
ce476b4610
commit
989a24f1f8
5 files changed
+42
-51
No files matched your search
@@ -241,6 +241,6 @@ export class LensProxy {
|
||||
}
|
||||
|
||||
res.setHeader("Content-Security-Policy", this.dependencies.contentSecurityPolicy);
|
||||
this.dependencies.router.route(cluster, req, res);
|
||||
await this.dependencies.router.route(cluster, req, res);
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { Injectable } from "@ogre-tools/injectable";
|
||||
import { getInjectable, getInjectionToken, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import type { Injectable, InjectionToken } from "@ogre-tools/injectable";
|
||||
import { getInjectable, getInjectionToken } from "@ogre-tools/injectable";
|
||||
import { Router } from "./router";
|
||||
import parseRequestInjectable from "./parse-request.injectable";
|
||||
import type { Route } from "./route";
|
||||
@@ -12,17 +12,13 @@ export const routeInjectionToken = getInjectionToken<Route<unknown, string>>({
|
||||
id: "route-injection-token",
|
||||
});
|
||||
|
||||
export function getRouteInjectable<
|
||||
T,
|
||||
Path extends string,
|
||||
>(
|
||||
export function getRouteInjectable<T, Path extends string>(
|
||||
opts: Omit<Injectable<Route<T, Path>, Route<T, Path>, void>, "lifecycle" | "injectionToken">,
|
||||
): Injectable<Route<T, Path>, Route<T, Path>, void> {
|
||||
return {
|
||||
) {
|
||||
return getInjectable({
|
||||
...opts,
|
||||
injectionToken: routeInjectionToken as never,
|
||||
lifecycle: lifecycleEnum.singleton as never,
|
||||
};
|
||||
injectionToken: routeInjectionToken as unknown as InjectionToken<Route<T, Path>, void>,
|
||||
});
|
||||
}
|
||||
|
||||
const routerInjectable = getInjectable({
|
||||
|
||||
@@ -12,6 +12,7 @@ import isWindowsInjectable from "../../../common/vars/is-windows.injectable";
|
||||
import showErrorPopupInjectable from "../../electron-app/features/show-error-popup.injectable";
|
||||
import { beforeApplicationIsLoadingInjectionToken } from "../runnable-tokens/before-application-is-loading-injection-token";
|
||||
import buildVersionInjectable from "../../vars/build-version/build-version.injectable";
|
||||
import initializeBuildVersionInjectable from "../../vars/build-version/init.injectable";
|
||||
|
||||
const setupLensProxyInjectable = getInjectable({
|
||||
id: "setup-lens-proxy",
|
||||
@@ -69,6 +70,7 @@ const setupLensProxyInjectable = getInjectable({
|
||||
return exitApp();
|
||||
}
|
||||
},
|
||||
runAfter: di.inject(initializeBuildVersionInjectable),
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user