diff --git a/packages/technical-features/application/agnostic/README.md b/packages/technical-features/application/agnostic/README.md index 451e211c85..d7fd9493ac 100644 --- a/packages/technical-features/application/agnostic/README.md +++ b/packages/technical-features/application/agnostic/README.md @@ -2,17 +2,38 @@ This package contains stuff related to creating Lens-applications. -In the beginning it will contain just the injection tokens used to configure the application. +# Usage -## Install ```bash -$ npm install @k8slens/application +$ npm install @k8slens/application-for-electron-main +``` + +```typescript +import { applicationFeature, startApplicationInjectionToken } from "@k8slens/application"; +import { registerFeature } from "@k8slens/feature-core"; +import { createContainer } from "@ogre-tools/injectable"; + +const di = createContainer("some-container"); + +registerFeature(di, applicationFeature); + +const startApplication = di.inject(startApplicationInjectionToken); + +startApplication(); ``` -## Usage +## Features -As of now, this package doesn't do anything alone. It just provides you way to register implementation for contract. +#### Start application +`startApplicationInjectionToken` -Future ambition is that all stuff related to how applications are built will be relocated here. +Starts the application and calls timeslots in specified order. Check for timeslots for more info. +## Extendability + +#### Timeslots + +1. `beforeApplicationIsLoadingInjectionToken` +2. `onLoadOfApplicationInjectionToken` +3. `afterApplicationIsLoadedInjectionToken` diff --git a/packages/technical-features/application/electron-main/README.md b/packages/technical-features/application/electron-main/README.md index 684647cbf7..6b4f590464 100644 --- a/packages/technical-features/application/electron-main/README.md +++ b/packages/technical-features/application/electron-main/README.md @@ -1,3 +1,35 @@ # @k8slens/application-for-electron-main -TBD +This Feature extends `@k8slens/application` with Electron specifics. + +# Usage +```bash +$ npm install @k8slens/application-for-electron-main +``` + +```typescript +import { applicationFeature, startApplicationInjectionToken } from "@k8slens/application"; +import { applicationFeatureForElectronMain } from "@k8slens/application-for-electron-main"; +import { registerFeature } from "@k8slens/feature-core"; +import { createContainer } from "@ogre-tools/injectable"; + +const di = createContainer("some-container"); + +registerFeature(di, applicationFeature, applicationFeatureForElectronMain); + +const startApplication = di.inject(startApplicationInjectionToken); + +startApplication(); +``` + +# Extendability + +### Timeslots + +#### `beforeAnythingInjectionToken` + +Runnables registered here will be called before anything else. **Special requirement** here is that everything here needs to be synchronous. + +#### `beforeElectronIsReadyInjectionToken` + +Runnables registered here will be called right after runnables in `beforeAnythingInjectionToken` but still before we are sure that Electron application is ready (`electron.app.whenReady()`). **Special requirement** here is that everything here needs to be synchronous.