@equinor/fusion-framework-app
Advanced tools
Comparing version 4.0.11 to 4.0.12
@@ -6,2 +6,6 @@ # Change Log | ||
## [4.0.12](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-app@4.0.11...@equinor/fusion-framework-app@4.0.12) (2022-12-12) | ||
**Note:** Version bump only for package @equinor/fusion-framework-app | ||
## [4.0.11](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-app@4.0.10...@equinor/fusion-framework-app@4.0.11) (2022-12-08) | ||
@@ -8,0 +12,0 @@ |
@@ -16,5 +16,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
const modules = yield configurator.initialize(args.fusion.modules); | ||
const modules = (yield configurator.initialize(args.fusion.modules)); | ||
modules.event.dispatchEvent('onAppModulesLoaded', { | ||
detail: { modules, env: args.env }, | ||
detail: { appKey: args.env.manifest.appKey, modules }, | ||
}); | ||
@@ -21,0 +21,0 @@ return modules; |
import { Fusion } from '@equinor/fusion-framework'; | ||
import type { AnyModule } from '@equinor/fusion-framework-module'; | ||
import { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framework-module-event'; | ||
import type { AppModulesInstance, AppModuleInitiator, AppEnv } from './types'; | ||
export declare const configureModules: <TModules extends AnyModule[], TRef extends Fusion<unknown> = Fusion<unknown>, TEnv = AppEnv<unknown, unknown>>(cb?: AppModuleInitiator<TModules, TRef, TEnv> | undefined) => (args: { | ||
export declare const configureModules: <TModules extends AnyModule[], TRef extends Fusion<unknown> = Fusion<unknown>, TEnv extends AppEnv<unknown, unknown> = AppEnv<unknown, unknown>>(cb?: AppModuleInitiator<TModules, TRef, TEnv> | undefined) => (args: { | ||
fusion: TRef; | ||
@@ -10,9 +9,1 @@ env: TEnv; | ||
export default configureModules; | ||
declare module '@equinor/fusion-framework-module-event' { | ||
interface FrameworkEventMap { | ||
onAppModulesLoaded: FrameworkEvent<FrameworkEventInit<{ | ||
modules: AppModulesInstance; | ||
env: AppEnv; | ||
}>>; | ||
} | ||
} |
import type { AppConfig, AppManifest, Fusion, FusionModulesInstance } from '@equinor/fusion-framework'; | ||
import type { AnyModule, CombinedModules, IModulesConfigurator } from '@equinor/fusion-framework-module'; | ||
import type { ModulesInstance } from '@equinor/fusion-framework-module'; | ||
import { ContextModule } from '@equinor/fusion-framework-module-context'; | ||
import type { EventModule } from '@equinor/fusion-framework-module-event'; | ||
import { configureHttp, configureHttpClient, HttpModule } from '@equinor/fusion-framework-module-http'; | ||
import type { MsalModule, configureMsal } from '@equinor/fusion-framework-module-msal'; | ||
export { AppManifest, AppConfig } from '@equinor/fusion-framework'; | ||
import type { AnyModule, IModulesConfigurator } from '@equinor/fusion-framework-module'; | ||
import { AppModules, AppModulesInstance } from '@equinor/fusion-framework-module-app'; | ||
import { configureHttp, configureHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import type { configureMsal } from '@equinor/fusion-framework-module-msal'; | ||
export type { AppModules, AppManifest, AppConfig, AppModulesInstance, } from '@equinor/fusion-framework-module-app'; | ||
export interface IAppConfigurator<TModules extends Array<AnyModule> | unknown = unknown, TRef extends FusionModulesInstance = FusionModulesInstance> extends IModulesConfigurator<AppModules<TModules>, TRef> { | ||
@@ -17,13 +15,6 @@ configureHttp(...args: Parameters<typeof configureHttp>): void; | ||
basename?: string; | ||
manifest?: AppManifest; | ||
manifest: AppManifest; | ||
config?: AppConfig<TConfig>; | ||
props?: TProps; | ||
}; | ||
export type AppModules<TModules extends Array<AnyModule> | unknown = unknown> = CombinedModules<TModules, [ | ||
ContextModule, | ||
EventModule, | ||
HttpModule, | ||
MsalModule | ||
]>; | ||
export type AppModulesInstance<TModules extends Array<AnyModule> | unknown = unknown> = ModulesInstance<AppModules<TModules>>; | ||
export type AppModuleInitiator<TModules extends Array<AnyModule> | unknown = unknown, TRef extends Fusion = Fusion, TEnv = AppEnv> = (configurator: IAppConfigurator<TModules, TRef['modules']>, args: { | ||
@@ -30,0 +21,0 @@ fusion: TRef; |
{ | ||
"name": "@equinor/fusion-framework-app", | ||
"version": "4.0.11", | ||
"version": "4.0.12", | ||
"description": "", | ||
@@ -26,7 +26,7 @@ "main": "dist/esm/index.js", | ||
"dependencies": { | ||
"@equinor/fusion-framework": "^5.0.11", | ||
"@equinor/fusion-framework": "^5.0.12", | ||
"@equinor/fusion-framework-module": "^1.2.10", | ||
"@equinor/fusion-framework-module-app-config": "^2.0.6", | ||
"@equinor/fusion-framework-module-app-config": "^2.0.7", | ||
"@equinor/fusion-framework-module-event": "^1.2.0", | ||
"@equinor/fusion-framework-module-http": "^2.2.0", | ||
"@equinor/fusion-framework-module-http": "^2.2.1", | ||
"@equinor/fusion-framework-module-msal": "^1.0.21" | ||
@@ -37,3 +37,3 @@ }, | ||
}, | ||
"gitHead": "7c03916da17e754a65ec93ea06f8e1bb3e2412ab" | ||
"gitHead": "acfc1533fae1e5a95f8463cc2d6e3a2ad94c252e" | ||
} |
import { Fusion } from '@equinor/fusion-framework'; | ||
import type { AnyModule } from '@equinor/fusion-framework-module'; | ||
import { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framework-module-event'; | ||
@@ -9,3 +8,7 @@ import { AppConfigurator } from './configurator'; | ||
export const configureModules = | ||
<TModules extends Array<AnyModule> | never, TRef extends Fusion = Fusion, TEnv = AppEnv>( | ||
< | ||
TModules extends Array<AnyModule> | never, | ||
TRef extends Fusion = Fusion, | ||
TEnv extends AppEnv = AppEnv | ||
>( | ||
cb?: AppModuleInitiator<TModules, TRef, TEnv> | ||
@@ -18,20 +21,11 @@ ): ((args: { fusion: TRef; env: TEnv }) => Promise<AppModulesInstance<TModules>>) => | ||
} | ||
const modules = await configurator.initialize(args.fusion.modules); | ||
const modules = (await configurator.initialize( | ||
args.fusion.modules | ||
)) as AppModulesInstance<TModules>; | ||
modules.event.dispatchEvent('onAppModulesLoaded', { | ||
detail: { modules, env: args.env }, | ||
detail: { appKey: args.env.manifest.appKey, modules }, | ||
}); | ||
return modules as unknown as AppModulesInstance<TModules>; | ||
return modules; | ||
}; | ||
export default configureModules; | ||
declare module '@equinor/fusion-framework-module-event' { | ||
interface FrameworkEventMap { | ||
onAppModulesLoaded: FrameworkEvent< | ||
FrameworkEventInit<{ | ||
modules: AppModulesInstance; | ||
env: AppEnv; | ||
}> | ||
>; | ||
} | ||
} |
@@ -7,20 +7,17 @@ import type { | ||
} from '@equinor/fusion-framework'; | ||
import type { | ||
AnyModule, | ||
CombinedModules, | ||
IModulesConfigurator, | ||
} from '@equinor/fusion-framework-module'; | ||
import type { ModulesInstance } from '@equinor/fusion-framework-module'; | ||
import { ContextModule } from '@equinor/fusion-framework-module-context'; | ||
import type { EventModule } from '@equinor/fusion-framework-module-event'; | ||
import { | ||
configureHttp, | ||
configureHttpClient, | ||
HttpModule, | ||
} from '@equinor/fusion-framework-module-http'; | ||
import type { MsalModule, configureMsal } from '@equinor/fusion-framework-module-msal'; | ||
import type { AnyModule, IModulesConfigurator } from '@equinor/fusion-framework-module'; | ||
export { AppManifest, AppConfig } from '@equinor/fusion-framework'; | ||
import { AppModules, AppModulesInstance } from '@equinor/fusion-framework-module-app'; | ||
import { configureHttp, configureHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import type { configureMsal } from '@equinor/fusion-framework-module-msal'; | ||
export type { | ||
AppModules, | ||
AppManifest, | ||
AppConfig, | ||
AppModulesInstance, | ||
} from '@equinor/fusion-framework-module-app'; | ||
export interface IAppConfigurator< | ||
@@ -41,3 +38,3 @@ TModules extends Array<AnyModule> | unknown = unknown, | ||
basename?: string; | ||
manifest?: AppManifest; | ||
manifest: AppManifest; | ||
config?: AppConfig<TConfig>; | ||
@@ -47,10 +44,2 @@ props?: TProps; | ||
export type AppModules<TModules extends Array<AnyModule> | unknown = unknown> = CombinedModules< | ||
TModules, | ||
[ContextModule, EventModule, HttpModule, MsalModule] | ||
>; | ||
export type AppModulesInstance<TModules extends Array<AnyModule> | unknown = unknown> = | ||
ModulesInstance<AppModules<TModules>>; | ||
export type AppModuleInitiator< | ||
@@ -57,0 +46,0 @@ TModules extends Array<AnyModule> | unknown = unknown, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149081
280