mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove webpack.*.ts importing values from src/ (#4992)
This commit is contained in:
1 parent
d5528eb9fe
commit
e977890677
21 files changed
+149
-168
No files matched your search
+2
-2
@@ -11,7 +11,7 @@ import httpProxy from "http-proxy";
|
||||
import * as LensExtensionsCommonApi from "../extensions/common-api";
|
||||
import * as LensExtensionsMainApi from "../extensions/main-api";
|
||||
import { app, autoUpdater, dialog, powerMonitor } from "electron";
|
||||
import { appName, isIntegrationTesting, isMac, isWindows, productName } from "../common/vars";
|
||||
import { appName, isIntegrationTesting, isMac, isWindows, productName, staticFilesDirectory } from "../common/vars";
|
||||
import { LensProxy } from "./lens-proxy";
|
||||
import { WindowManager } from "./window-manager";
|
||||
import { ClusterManager } from "./cluster-manager";
|
||||
@@ -198,7 +198,7 @@ async function main(di: DiContainer) {
|
||||
|
||||
powerMonitor.on("shutdown", () => app.exit());
|
||||
|
||||
registerFileProtocol("static", __static);
|
||||
registerFileProtocol("static", staticFilesDirectory);
|
||||
|
||||
PrometheusProviderRegistry.createInstance();
|
||||
initializers.initPrometheusProviderRegistry();
|
||||
|
||||
@@ -11,9 +11,6 @@ import type { Cluster } from "../../common/cluster/cluster";
|
||||
import type { LensApiResultContentType } from "./router-content-types";
|
||||
import { contentTypes } from "./router-content-types";
|
||||
|
||||
// TODO: Import causes side effect, sets value for __static
|
||||
import "../../common/vars";
|
||||
|
||||
export interface RouterRequestOpts {
|
||||
req: http.IncomingMessage;
|
||||
res: http.ServerResponse;
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { SupportedFileExtension } from "../router/router-content-types";
|
||||
import { contentTypes } from "../router/router-content-types";
|
||||
import logger from "../logger";
|
||||
import { routeInjectionToken } from "../router/router.injectable";
|
||||
import { appName, publicPath, webpackDevServerPort } from "../../common/vars";
|
||||
import { appName, publicPath, staticFilesDirectory } from "../../common/vars";
|
||||
import path from "path";
|
||||
import isDevelopmentInjectable from "../../common/vars/is-development.injectable";
|
||||
import httpProxy from "http-proxy";
|
||||
@@ -17,6 +17,7 @@ import type { GetAbsolutePath } from "../../common/path/get-absolute-path.inject
|
||||
import getAbsolutePathInjectable from "../../common/path/get-absolute-path.injectable";
|
||||
import type { JoinPaths } from "../../common/path/join-paths.injectable";
|
||||
import joinPathsInjectable from "../../common/path/join-paths.injectable";
|
||||
import { webpackDevServerPort } from "../../../webpack/vars";
|
||||
|
||||
interface ProductionDependencies {
|
||||
readFileBuffer: (path: string) => Promise<Buffer>;
|
||||
@@ -27,7 +28,7 @@ interface ProductionDependencies {
|
||||
const handleStaticFileInProduction =
|
||||
({ readFileBuffer, getAbsolutePath, joinPaths }: ProductionDependencies) =>
|
||||
async ({ params }: LensApiRequest) => {
|
||||
const staticPath = getAbsolutePath(__static);
|
||||
const staticPath = getAbsolutePath(staticFilesDirectory);
|
||||
let filePath = params.path;
|
||||
|
||||
for (let retryCount = 0; retryCount < 5; retryCount += 1) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { showAbout } from "../menu/menu";
|
||||
import { checkForUpdates, isAutoUpdateEnabled } from "../app-updater";
|
||||
import type { WindowManager } from "../window-manager";
|
||||
import logger from "../logger";
|
||||
import { isDevelopment, isWindows, productName } from "../../common/vars";
|
||||
import { isDevelopment, isWindows, productName, staticFilesDirectory } from "../../common/vars";
|
||||
import { exitApp } from "../exit-app";
|
||||
import { toJS } from "../../common/utils";
|
||||
import type { TrayMenuRegistration } from "./tray-menu-registration";
|
||||
@@ -25,7 +25,7 @@ export let tray: Tray;
|
||||
|
||||
export function getTrayIcon(): string {
|
||||
return path.resolve(
|
||||
__static,
|
||||
staticFilesDirectory,
|
||||
isDevelopment ? "../build/tray" : "icons", // copied within electron-builder extras
|
||||
"trayIconTemplate.png",
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user