mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
register applicationInformationInjectable in main & renderer
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
22662dd716
commit
f2cecbbcae
@ -7,7 +7,7 @@ import { getInjectionToken } from "@ogre-tools/injectable";
|
|||||||
import type packageJson from "../../../package.json";
|
import type packageJson from "../../../package.json";
|
||||||
|
|
||||||
export type ApplicationInformation = Pick<typeof packageJson, "version" | "config" | "productName" | "copyright" | "description" | "name"> & {
|
export type ApplicationInformation = Pick<typeof packageJson, "version" | "config" | "productName" | "copyright" | "description" | "name"> & {
|
||||||
build: { publish?: unknown[] };
|
build: Partial<typeof packageJson["build"]> & { publish?: unknown[] };
|
||||||
};
|
};
|
||||||
|
|
||||||
const applicationInformationToken = getInjectionToken<ApplicationInformation>({
|
const applicationInformationToken = getInjectionToken<ApplicationInformation>({
|
||||||
|
|||||||
@ -30,7 +30,7 @@ import type { GetDirnameOfPath } from "../../common/path/get-dirname.injectable"
|
|||||||
import type { GetRelativePath } from "../../common/path/get-relative-path.injectable";
|
import type { GetRelativePath } from "../../common/path/get-relative-path.injectable";
|
||||||
import type { RemovePath } from "../../common/fs/remove-path.injectable";
|
import type { RemovePath } from "../../common/fs/remove-path.injectable";
|
||||||
import type TypedEventEmitter from "typed-emitter";
|
import type TypedEventEmitter from "typed-emitter";
|
||||||
import type { ApplicationInformation } from "../../common/vars/application-information-injectable";
|
import type { ApplicationInformation } from "../../common/vars/application-information-token.injectable";
|
||||||
|
|
||||||
interface Dependencies {
|
interface Dependencies {
|
||||||
readonly extensionLoader: ExtensionLoader;
|
readonly extensionLoader: ExtensionLoader;
|
||||||
|
|||||||
@ -3,10 +3,17 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { createContainer } from "@ogre-tools/injectable";
|
import { createContainer } from "@ogre-tools/injectable";
|
||||||
|
import { runInAction } from "mobx";
|
||||||
|
import applicationInformationInjectable from "../common/vars/application-information-injectable";
|
||||||
import { registerInjectables } from "./register-injectables";
|
import { registerInjectables } from "./register-injectables";
|
||||||
|
|
||||||
export const getDi = () => {
|
export const getDi = () => {
|
||||||
const di = createContainer("main");
|
const di = createContainer("main");
|
||||||
|
|
||||||
return registerInjectables(di);
|
runInAction(() => {
|
||||||
|
registerInjectables(di);
|
||||||
|
di.register(applicationInformationInjectable);
|
||||||
|
});
|
||||||
|
|
||||||
|
return di;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4,10 +4,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { createContainer } from "@ogre-tools/injectable";
|
import { createContainer } from "@ogre-tools/injectable";
|
||||||
|
import { runInAction } from "mobx";
|
||||||
|
import applicationInformationInjectable from "../common/vars/application-information-injectable";
|
||||||
import { registerInjectables } from "./register-injectables";
|
import { registerInjectables } from "./register-injectables";
|
||||||
|
|
||||||
export const getDi = () => {
|
export const getDi = () => {
|
||||||
const di = createContainer("renderer");
|
const di = createContainer("renderer");
|
||||||
|
|
||||||
return registerInjectables(di);
|
runInAction(() => {
|
||||||
|
registerInjectables(di);
|
||||||
|
di.register(applicationInformationInjectable);
|
||||||
|
});
|
||||||
|
|
||||||
|
return di;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user