mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
24 lines
831 B
TypeScript
24 lines
831 B
TypeScript
/**
|
|
* 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 { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration";
|
|
import { runInAction } from "mobx";
|
|
|
|
export function registerInjectables(di: DiContainer) {
|
|
runInAction(() => {
|
|
autoRegister({
|
|
di,
|
|
targetModule: module,
|
|
getRequireContexts: () => [
|
|
require.context("./", true, CONTEXT_MATCHER_FOR_NON_FEATURES),
|
|
require.context("../common", true, CONTEXT_MATCHER_FOR_NON_FEATURES),
|
|
require.context("../extensions", true, CONTEXT_MATCHER_FOR_NON_FEATURES),
|
|
require.context("../features", true, CONTEXT_MATCHER_FOR_FEATURES),
|
|
],
|
|
});
|
|
});
|
|
}
|