Monaco editor refactoring (#4225)

* monaco editor refactoring

Signed-off-by: Roman <ixrock@gmail.com>

* clean up / responding to comments

Signed-off-by: Roman <ixrock@gmail.com>

* move custom monaco themes to own folder

Signed-off-by: Roman <ixrock@gmail.com>

* fix lint

Signed-off-by: Roman <ixrock@gmail.com>

* removed unused rules from webpack's config (renderer)

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman authored and GitHub committed 2021-11-03 17:19:17 +02:00
1 parent 0ae4dfbeab
commit 368e2d9a00
44 files changed
+817 -520

No files matched your search

+3 -9
View File
@@ -28,7 +28,6 @@ import * as ReactRouter from "react-router";
import * as ReactRouterDom from "react-router-dom";
import * as LensExtensionsCommonApi from "../extensions/common-api";
import * as LensExtensionsRendererApi from "../extensions/renderer-api";
import { monaco } from "react-monaco-editor";
import { render } from "react-dom";
import { delay } from "../common/utils";
import { isMac, isDevelopment } from "../common/vars";
@@ -48,14 +47,15 @@ import { FilesystemProvisionerStore } from "../main/extension-filesystem";
import { ThemeStore } from "./theme.store";
import { SentryInit } from "../common/sentry";
import { TerminalStore } from "./components/dock/terminal.store";
import cloudsMidnight from "./monaco-themes/Clouds Midnight.json";
import { AppPaths } from "../common/app-paths";
import { registerCustomThemes } from "./components/monaco-editor";
if (process.isMainFrame) {
SentryInit();
}
configurePackages();
configurePackages(); // global packages
registerCustomThemes(); // monaco editor themes
/**
* If this is a development build, wait a second to attach
@@ -106,12 +106,6 @@ export async function bootstrap(comp: () => Promise<AppComponent>) {
ExtensionsStore.createInstance();
FilesystemProvisionerStore.createInstance();
// define Monaco Editor themes
const { base, ...params } = cloudsMidnight;
const baseTheme = base as monaco.editor.BuiltinTheme;
monaco.editor.defineTheme("clouds-midnight", { base: baseTheme, ...params });
// ThemeStore depends on: UserStore
ThemeStore.createInstance();