mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Persist apiVersion when editing resources in monaco - Use a new custom k8slens prefixed label - Means that users aren't surprised when they use lens to update a resource to a new apiVersionWithGroup - Doesn't touch the versions in the stores Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix lint Signed-off-by: Sebastian Malton <sebastian@malton.name> * fix: Fix lint issues Signed-off-by: Sebastian Malton <sebastian@malton.name> * chore: make lint not bail on failure Signed-off-by: Sebastian Malton <sebastian@malton.name> * chore: Run lint:fix on all files Signed-off-by: Sebastian Malton <sebastian@malton.name> --------- Signed-off-by: Sebastian Malton <sebastian@malton.name> |
||
|---|---|---|
| .. | ||
| src | ||
| .eslintrc.js | ||
| .prettierrc | ||
| index.ts | ||
| jest.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| webpack.config.js | ||
@k8slens/feature-core
Feature is set of injectables that are registered and deregistered simultaneously.
Install
$ npm install @k8slens/feature-core
Usage
import { createContainer } from "@ogre-tools/injectable"
import { getFeature, registerFeature, deregisterFeature } from "@k8slens/feature-core"
// Notice that this Feature is usually exported from another NPM package.
const someFeature = getFeature({
id: "some-feature",
register: (di) => {
di.register(someInjectable, someOtherInjectable);
},
// Feature dependencies are automatically registered and
// deregistered when necessary.
dependencies: [someOtherFeature]
});
const di = createContainer("some-container");
registerFeature(di, someFeature);
// Or perhaps you want to deregister?
deregisterFeature(di, someFeature);
Need to know
NPM packages exporting a Feature
- Prefer
peerDependenciessince they are installed from the application and are not allowed to be in the built bundle. - Prefer exporting
injectionTokeninstead ofinjectablefor not allowing other features to access technical details like theinjectable