From 5286e5f54b5ba08a84dc65b68a762f214af661bc Mon Sep 17 00:00:00 2001 From: Iku-turso Date: Fri, 25 Nov 2022 10:43:38 +0200 Subject: [PATCH] WIP Kludge "moduleResolution": "node16" Signed-off-by: Iku-turso --- src/common/path/join-paths.injectable.ts | 2 +- .../preference-navigation/preferences-navigation.tsx | 1 + src/features/preferences/renderer/preferences.tsx | 1 + src/main/register-features.ts | 2 ++ src/renderer/bootstrap.tsx | 6 ++++-- src/renderer/components/tree-view/tree-view.tsx | 3 ++- tsconfig.json | 2 +- 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/common/path/join-paths.injectable.ts b/src/common/path/join-paths.injectable.ts index dc63b48307..ee2c6d227f 100644 --- a/src/common/path/join-paths.injectable.ts +++ b/src/common/path/join-paths.injectable.ts @@ -8,7 +8,7 @@ import path from "path"; export type JoinPaths = (...args: string[]) => string; const joinPathsInjectable = getInjectable({ - id: "join-paths", + id: "join-paths-1", instantiate: (): JoinPaths => path.join, // This causes side effect e.g. Windows uses different separator than e.g. linux diff --git a/src/features/preferences/renderer/preference-navigation/preferences-navigation.tsx b/src/features/preferences/renderer/preference-navigation/preferences-navigation.tsx index b1e3ce9aa0..311174b66b 100644 --- a/src/features/preferences/renderer/preference-navigation/preferences-navigation.tsx +++ b/src/features/preferences/renderer/preference-navigation/preferences-navigation.tsx @@ -88,6 +88,7 @@ const toNavigationHierarchy = (composite: Composite) => } default: { + // @ts-ignore throw checkThatAllDiscriminablesAreExhausted(value); } } diff --git a/src/main/register-features.ts b/src/main/register-features.ts index f58f0d20f6..8d7a991ee4 100644 --- a/src/main/register-features.ts +++ b/src/main/register-features.ts @@ -4,6 +4,7 @@ */ import { registerFeature } from "@lensapp/feature-core"; +import appPathsFeature from "@lensapp/app-paths"; import fsFeature from "@lensapp/fs"; import loggingFeature from "@lensapp/logging"; import shellFeature from "@lensapp/shell"; @@ -13,6 +14,7 @@ import type { DiContainer } from "@ogre-tools/injectable"; import { action } from "mobx"; export default action((di: DiContainer) => { + registerFeature(di, appPathsFeature); registerFeature(di, clusterFeature); registerFeature(di, fsFeature); registerFeature(di, loggingFeature); diff --git a/src/renderer/bootstrap.tsx b/src/renderer/bootstrap.tsx index a647309cab..59af5f6e6d 100644 --- a/src/renderer/bootstrap.tsx +++ b/src/renderer/bootstrap.tsx @@ -46,6 +46,8 @@ import assert from "assert"; import startFrameInjectable from "./start-frame/start-frame.injectable"; import initializeSentryReportingWithInjectable from "../common/error-reporting/initialize-sentry-reporting.injectable"; import registerFeatures from "./register-features"; +import { RootFrame } from "./frames/root-frame/root-frame"; +import { ClusterFrame } from "./frames/cluster-frame/cluster-frame"; configurePackages(); // global packages registerCustomThemes(); // monaco editor themes @@ -157,10 +159,10 @@ export async function bootstrap(di: DiContainer) { // TODO: Introduce proper architectural boundaries between root and cluster iframes if (process.isMainFrame) { initializeApp = di.inject(initRootFrameInjectable); - App = (await import("./frames/root-frame/root-frame")).RootFrame; + App = RootFrame; } else { initializeApp = di.inject(initClusterFrameInjectable); - App = (await import("./frames/cluster-frame/cluster-frame")).ClusterFrame; + App = ClusterFrame; } try { diff --git a/src/renderer/components/tree-view/tree-view.tsx b/src/renderer/components/tree-view/tree-view.tsx index 8672f9597f..5d9f1d07e0 100644 --- a/src/renderer/components/tree-view/tree-view.tsx +++ b/src/renderer/components/tree-view/tree-view.tsx @@ -12,7 +12,7 @@ import TreeItem from "@material-ui/lab/TreeItem"; import { cssNames } from "../../utils"; import _ from "lodash"; -import getDeepDash from "deepdash"; +const getDeepDash = require("deepdash"); const deepDash = getDeepDash(_); @@ -33,6 +33,7 @@ function scrollToItem(id: string) { } function getSelectedNode(data: NavigationTree[]) { + // @ts-ignore return deepDash.findDeep(data, (value, key) => key === "selected" && value === true)?.parent; } diff --git a/tsconfig.json b/tsconfig.json index b97369efc7..f2abbdb852 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "DOM", "DOM.Iterable" ], - "moduleResolution": "Node", + "moduleResolution": "node16", "sourceMap": true, "strict": true, "noImplicitAny": true,