2022-01-27 01:37:54 +00:00
|
|
|
import {Awaitable, UniversalPath} from '../util'
|
2021-07-03 02:45:15 +00:00
|
|
|
import {ExtolloAwareNodeModule} from './types'
|
2022-01-27 01:37:54 +00:00
|
|
|
import {BaseEvent} from './bus'
|
2021-07-03 02:45:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* An event indicating that an NPM package has been discovered
|
|
|
|
* by the framework.
|
|
|
|
*
|
|
|
|
* Application services can listen for this event to register
|
|
|
|
* various discovery logic (e.g. automatically boot units
|
|
|
|
*/
|
2022-01-27 01:37:54 +00:00
|
|
|
export class PackageDiscovered extends BaseEvent {
|
2021-07-03 02:45:15 +00:00
|
|
|
constructor(
|
|
|
|
public packageConfig: ExtolloAwareNodeModule,
|
|
|
|
public packageJson: UniversalPath,
|
|
|
|
) {
|
|
|
|
super()
|
|
|
|
}
|
|
|
|
|
2022-01-27 01:37:54 +00:00
|
|
|
eventName = '@extollo/lib.PackageDiscovered'
|
2021-07-03 02:45:15 +00:00
|
|
|
|
2022-01-27 01:37:54 +00:00
|
|
|
shouldBroadcast(): Awaitable<boolean> {
|
|
|
|
return false
|
2021-07-03 02:45:15 +00:00
|
|
|
}
|
|
|
|
}
|