mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
use startApp on both sides
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
9cb8ff5f6a
commit
17757fd395
@ -6,11 +6,13 @@
|
||||
// Main process
|
||||
|
||||
import { getDi } from "./getDi";
|
||||
import startMainApplicationInjectable from "./start-main-application/start-main-application.injectable";
|
||||
import { Mobx, LensExtensions, Pty } from "./extension-api";
|
||||
import { startApp } from "./start-app";
|
||||
|
||||
const di = getDi();
|
||||
|
||||
void di.inject(startMainApplicationInjectable);
|
||||
startApp({
|
||||
di,
|
||||
});
|
||||
|
||||
export { Mobx, LensExtensions, Pty };
|
||||
|
||||
@ -3,24 +3,13 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import { registerInjectables } from "./register-injectables";
|
||||
import { afterApplicationIsLoadedInjectionToken } from "./start-main-application/runnable-tokens/after-application-is-loaded-injection-token";
|
||||
import { beforeApplicationIsLoadingInjectionToken } from "./start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
||||
import { beforeElectronIsReadyInjectionToken } from "./start-main-application/runnable-tokens/before-electron-is-ready-injection-token";
|
||||
import { onLoadOfApplicationInjectionToken } from "./start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
||||
import startMainApplicationInjectable from "./start-main-application/start-main-application.injectable";
|
||||
import * as extensionApi from "./extension-api";
|
||||
|
||||
interface AppConfig {
|
||||
di: DiContainer;
|
||||
}
|
||||
|
||||
function startApp(conf: AppConfig) {
|
||||
const { di } = conf;
|
||||
|
||||
return di.inject(startMainApplicationInjectable);
|
||||
}
|
||||
import type { startApp } from "./start-app";
|
||||
|
||||
export {
|
||||
registerInjectables,
|
||||
|
||||
17
src/main/start-app.ts
Normal file
17
src/main/start-app.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import startMainApplicationInjectable from "./start-main-application/start-main-application.injectable";
|
||||
|
||||
interface AppConfig {
|
||||
di: DiContainer;
|
||||
}
|
||||
|
||||
export function startApp(conf: AppConfig) {
|
||||
const { di } = conf;
|
||||
|
||||
return di.inject(startMainApplicationInjectable);
|
||||
}
|
||||
@ -6,16 +6,18 @@
|
||||
import "./components/app.scss";
|
||||
|
||||
import { getDi } from "./getDi";
|
||||
import { bootstrap } from "./bootstrap";
|
||||
import {
|
||||
React, ReactDOM, ReactRouter,
|
||||
ReactRouterDom, Mobx, MobxReact, LensExtensions,
|
||||
} from "./extension-api";
|
||||
import { startApp } from "./start-app";
|
||||
|
||||
const di = getDi();
|
||||
|
||||
// run
|
||||
bootstrap(di);
|
||||
startApp({
|
||||
di,
|
||||
});
|
||||
|
||||
export {
|
||||
React,
|
||||
|
||||
@ -4,20 +4,9 @@
|
||||
*/
|
||||
import "./components/app.scss";
|
||||
|
||||
import { bootstrap } from "./bootstrap";
|
||||
import * as extensionApi from "./extension-api";
|
||||
import { registerInjectables } from "./register-injectables";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
|
||||
interface AppConfig {
|
||||
di: DiContainer;
|
||||
}
|
||||
|
||||
function startApp(conf: AppConfig) {
|
||||
const { di } = conf;
|
||||
|
||||
bootstrap(di);
|
||||
}
|
||||
import type { startApp } from "./start-app";
|
||||
|
||||
export {
|
||||
startApp,
|
||||
|
||||
18
src/renderer/start-app.ts
Normal file
18
src/renderer/start-app.ts
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import "./components/app.scss";
|
||||
|
||||
import { bootstrap } from "./bootstrap";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
|
||||
interface AppConfig {
|
||||
di: DiContainer;
|
||||
}
|
||||
|
||||
export function startApp(conf: AppConfig) {
|
||||
const { di } = conf;
|
||||
|
||||
bootstrap(di);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user