mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Ban circular dependencies (#3547)
This commit is contained in:
1 parent
b227a86711
commit
4f75acf2b4
35 files changed
+209
-59
No files matched your search
@@ -42,9 +42,9 @@ import { Console } from "console";
|
||||
import { SemVer } from "semver";
|
||||
import electron from "electron";
|
||||
import { stdout, stderr } from "process";
|
||||
import { ThemeStore } from "../../renderer/theme.store";
|
||||
import type { ClusterStoreModel } from "../cluster-store";
|
||||
import { AppPaths } from "../app-paths";
|
||||
import { defaultTheme } from "../vars";
|
||||
|
||||
console = new Console(stdout, stderr);
|
||||
AppPaths.init();
|
||||
@@ -75,7 +75,7 @@ describe("user store tests", () => {
|
||||
us.httpsProxy = "abcd://defg";
|
||||
|
||||
expect(us.httpsProxy).toBe("abcd://defg");
|
||||
expect(us.colorTheme).toBe(ThemeStore.defaultTheme);
|
||||
expect(us.colorTheme).toBe(defaultTheme);
|
||||
|
||||
us.colorTheme = "light";
|
||||
expect(us.colorTheme).toBe("light");
|
||||
@@ -86,7 +86,7 @@ describe("user store tests", () => {
|
||||
|
||||
us.colorTheme = "some other theme";
|
||||
us.resetTheme();
|
||||
expect(us.colorTheme).toBe(ThemeStore.defaultTheme);
|
||||
expect(us.colorTheme).toBe(defaultTheme);
|
||||
});
|
||||
|
||||
it("correctly calculates if the last seen version is an old release", () => {
|
||||
|
||||
@@ -23,7 +23,8 @@ import { app, ipcMain, ipcRenderer } from "electron";
|
||||
import { observable, when } from "mobx";
|
||||
import path from "path";
|
||||
import logger from "./logger";
|
||||
import { fromEntries, toJS } from "./utils";
|
||||
import { fromEntries } from "./utils/objects";
|
||||
import { toJS } from "./utils/toJS";
|
||||
import { isWindows } from "./vars";
|
||||
|
||||
export type PathName = Parameters<typeof app["getPath"]>[0];
|
||||
|
||||
@@ -20,11 +20,10 @@
|
||||
*/
|
||||
|
||||
import { catalogCategoryRegistry } from "../catalog/catalog-category-registry";
|
||||
import { CatalogEntity, CatalogEntityActionContext, CatalogEntityContextMenuContext, CatalogEntityMetadata, CatalogEntityStatus } from "../catalog";
|
||||
import { CatalogEntity, CatalogEntityActionContext, CatalogEntityContextMenuContext, CatalogEntityMetadata, CatalogEntityStatus, CatalogCategory, CatalogCategorySpec } from "../catalog";
|
||||
import { clusterActivateHandler, clusterDisconnectHandler } from "../cluster-ipc";
|
||||
import { ClusterStore } from "../cluster-store";
|
||||
import { broadcastMessage, requestMain } from "../ipc";
|
||||
import { CatalogCategory, CatalogCategorySpec } from "../catalog";
|
||||
import { app } from "electron";
|
||||
import type { CatalogEntitySpec } from "../catalog/catalog-entity";
|
||||
import { IpcRendererNavigationEvents } from "../../renderer/navigation/events";
|
||||
|
||||
@@ -30,7 +30,15 @@ import { ClusterFrameInfo, clusterFrameMap } from "../cluster-frames";
|
||||
import type { Disposer } from "../utils";
|
||||
import type remote from "@electron/remote";
|
||||
|
||||
const electronRemote = ipcMain ? null : require("@electron/remote");
|
||||
const electronRemote = (() => {
|
||||
if (ipcRenderer) {
|
||||
try {
|
||||
return require("@electron/remote");
|
||||
} catch {}
|
||||
}
|
||||
|
||||
return null;
|
||||
})();
|
||||
|
||||
const subFramesChannel = "ipc:get-sub-frames";
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@ import type { IKubeWatchEvent } from "./kube-watch-api";
|
||||
import { KubeJsonApi, KubeJsonApiData } from "./kube-json-api";
|
||||
import { noop } from "../utils";
|
||||
import type { RequestInit } from "node-fetch";
|
||||
|
||||
// BUG: https://github.com/mysticatea/abort-controller/pull/22
|
||||
// eslint-disable-next-line import/no-named-as-default
|
||||
import AbortController from "abort-controller";
|
||||
import { Agent, AgentOptions } from "https";
|
||||
import type { Patch } from "rfc6902";
|
||||
|
||||
@@ -30,6 +30,9 @@ import { ensureObjectSelfLink, IKubeApiQueryParams, KubeApi } from "./kube-api";
|
||||
import { parseKubeApi } from "./kube-api-parse";
|
||||
import type { KubeJsonApiData } from "./kube-json-api";
|
||||
import type { RequestInit } from "node-fetch";
|
||||
|
||||
// BUG: https://github.com/mysticatea/abort-controller/pull/22
|
||||
// eslint-disable-next-line import/no-named-as-default
|
||||
import AbortController from "abort-controller";
|
||||
import type { Patch } from "rfc6902";
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
import moment from "moment-timezone";
|
||||
import path from "path";
|
||||
import os from "os";
|
||||
import { ThemeStore } from "../../renderer/theme.store";
|
||||
import { getAppVersion, ObservableToggleSet } from "../utils";
|
||||
import type { editor } from "monaco-editor";
|
||||
import merge from "lodash/merge";
|
||||
import { SemVer } from "semver";
|
||||
import { defaultTheme } from "../vars";
|
||||
|
||||
export interface KubeconfigSyncEntry extends KubeconfigSyncValue {
|
||||
filePath: string;
|
||||
@@ -72,10 +72,10 @@ const shell: PreferenceDescription<string | undefined> = {
|
||||
|
||||
const colorTheme: PreferenceDescription<string> = {
|
||||
fromStore(val) {
|
||||
return val || ThemeStore.defaultTheme;
|
||||
return val || defaultTheme;
|
||||
},
|
||||
toStore(val) {
|
||||
if (!val || val === ThemeStore.defaultTheme) {
|
||||
if (!val || val === defaultTheme) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { array } from "../utils";
|
||||
import * as array from "../utils/array";
|
||||
|
||||
/**
|
||||
* A strict N-tuple of type T
|
||||
|
||||
@@ -41,6 +41,7 @@ export const isIntegrationTesting = process.argv.includes(integrationTestingArg)
|
||||
export const productName = packageInfo.productName;
|
||||
export const appName = `${packageInfo.productName}${isDevelopment ? "Dev" : ""}`;
|
||||
export const publicPath = "/build/" as string;
|
||||
export const defaultTheme = "lens-dark" as string;
|
||||
|
||||
// Webpack build paths
|
||||
export const contextDir = process.cwd();
|
||||
|
||||
Reference in new issue
Block a user