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

Use default export to fix issue with package lying with types (#6081)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-08-22 13:42:06 -07:00 committed by GitHub
parent df1cc8b788
commit 03d2389f01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 9 deletions

View File

@ -14,7 +14,7 @@ import { DeploymentApi, Ingress, IngressApi, Pod, PodApi } from "../endpoints";
import { getDiForUnitTesting } from "../../../renderer/getDiForUnitTesting"; import { getDiForUnitTesting } from "../../../renderer/getDiForUnitTesting";
import apiManagerInjectable from "../api-manager/manager.injectable"; import apiManagerInjectable from "../api-manager/manager.injectable";
import autoRegistrationInjectable from "../api-manager/auto-registration.injectable"; import autoRegistrationInjectable from "../api-manager/auto-registration.injectable";
import { AbortController } from "abort-controller"; import AbortController from "abort-controller";
jest.mock("../api-manager"); jest.mock("../api-manager");

View File

@ -20,7 +20,7 @@ import logger from "../logger";
import assert from "assert"; import assert from "assert";
import type { PartialDeep } from "type-fest"; import type { PartialDeep } from "type-fest";
import { entries } from "../utils/objects"; import { entries } from "../utils/objects";
import { AbortController } from "abort-controller"; import AbortController from "abort-controller";
export type OnLoadFailure = (error: unknown) => void; export type OnLoadFailure = (error: unknown) => void;

View File

@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { AbortController } from "abort-controller"; import AbortController from "abort-controller";
/** /**
* This is like an `AbortController` but will also abort if the parent aborts, * This is like an `AbortController` but will also abort if the parent aborts,

View File

@ -9,11 +9,7 @@ import { once } from "lodash";
import type { ClusterFrameContext } from "../cluster-frame-context/cluster-frame-context"; import type { ClusterFrameContext } from "../cluster-frame-context/cluster-frame-context";
import logger from "../../common/logger"; import logger from "../../common/logger";
import type { KubeObjectStoreLoadAllParams, KubeObjectStoreSubscribeParams } from "../../common/k8s-api/kube-object.store"; import type { KubeObjectStoreLoadAllParams, KubeObjectStoreSubscribeParams } from "../../common/k8s-api/kube-object.store";
import type { RequestInit } from "node-fetch"; import AbortController from "abort-controller";
import { AbortController } from "abort-controller";
// TODO: upgrade node-fetch once we are starting to use ES modules
type LegacyAbortSignal = NonNullable<RequestInit["signal"]>;
// Kubernetes watch-api client // Kubernetes watch-api client
// API: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams // API: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams
@ -107,7 +103,7 @@ export class KubeWatchApi {
const loadThenSubscribe = async (namespaces: string[] | undefined) => { const loadThenSubscribe = async (namespaces: string[] | undefined) => {
try { try {
await store.loadAll({ namespaces, reqInit: { signal: childController.signal as LegacyAbortSignal }, onLoadFailure }); await store.loadAll({ namespaces, reqInit: { signal: childController.signal }, onLoadFailure });
unsubscribe.push(store.subscribe({ onLoadFailure, abortController: childController })); unsubscribe.push(store.subscribe({ onLoadFailure, abortController: childController }));
} catch (error) { } catch (error) {
if (!(error instanceof DOMException)) { if (!(error instanceof DOMException)) {