mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Cleanup getDi and registering injectables (#7251)
* Cleanup getDi and registering injectables Signed-off-by: Sebastian Malton <sebastian@malton.name> * Create more explicit application - Make testing use more production code Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix uses of getEnvironmentSpecificLegacyGlobalDiForExtensionApi Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix unit tests Signed-off-by: Sebastian Malton <sebastian@malton.name> --------- Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
b5f0960ee1
commit
c67230f322
19 files changed
+110
-133
No files matched your search
@@ -1,18 +1,15 @@
|
||||
import { createContainer } from "@ogre-tools/injectable";
|
||||
import { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration";
|
||||
import { runInAction } from "mobx";
|
||||
import { createApp, mainExtensionApi as Main, commonExtensionApi as Common } from "@k8slens/core/main";
|
||||
import { createApplication, mainExtensionApi as Main, commonExtensionApi as Common } from "@k8slens/core/main";
|
||||
|
||||
const di = createContainer("main");
|
||||
const app = createApp({
|
||||
di,
|
||||
const app = createApplication({
|
||||
mode: process.env.NODE_ENV || "development"
|
||||
});
|
||||
|
||||
runInAction(() => {
|
||||
try {
|
||||
autoRegister({
|
||||
di,
|
||||
di: app.di,
|
||||
targetModule: module,
|
||||
getRequireContexts: () => [
|
||||
require.context("./", true, CONTEXT_MATCHER_FOR_NON_FEATURES),
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
import "@k8slens/core/styles";
|
||||
import { createContainer } from "@ogre-tools/injectable";
|
||||
import { runInAction } from "mobx";
|
||||
import { createApp, rendererExtensionApi as Renderer, commonExtensionApi as Common } from "@k8slens/core/renderer";
|
||||
import { createApplication, rendererExtensionApi as Renderer, commonExtensionApi as Common } from "@k8slens/core/renderer";
|
||||
import { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration";
|
||||
|
||||
const di = createContainer("renderer");
|
||||
const app = createApp({
|
||||
di,
|
||||
const app = createApplication({
|
||||
mode: process.env.NODE_ENV || "development"
|
||||
});
|
||||
|
||||
runInAction(() => {
|
||||
autoRegister({
|
||||
di,
|
||||
di: app.di,
|
||||
targetModule: module,
|
||||
getRequireContexts: () => [
|
||||
require.context("./", true, CONTEXT_MATCHER_FOR_NON_FEATURES),
|
||||
|
||||
Reference in new issue
Block a user