mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore: Switch buildVersion to use new Initializable
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
72a01cdc17
commit
1b96a94c14
26 files changed
+105
-152
No files matched your search
@@ -3,27 +3,13 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import { SemVer } from "semver";
|
||||
import type { InitializableState } from "../initializable-state/create";
|
||||
import { buildVersionInitializable } from "../../features/vars/build-version/common/token";
|
||||
import { createInitializableState } from "../initializable-state/create";
|
||||
import type { RequestChannel } from "@k8slens/messaging";
|
||||
|
||||
export const buildVersionInjectionToken = getInjectionToken<InitializableState<string>>({
|
||||
id: "build-version-token",
|
||||
});
|
||||
|
||||
export const buildVersionChannel: RequestChannel<void, string> = {
|
||||
id: "build-version",
|
||||
};
|
||||
|
||||
const buildSemanticVersionInjectable = createInitializableState({
|
||||
id: "build-semantic-version",
|
||||
init: (di) => {
|
||||
const buildVersion = di.inject(buildVersionInjectionToken);
|
||||
|
||||
return new SemVer(buildVersion.get());
|
||||
},
|
||||
init: (di) => new SemVer(di.inject(buildVersionInitializable.stateToken)),
|
||||
});
|
||||
|
||||
export default buildSemanticVersionInjectable;
|
||||
|
||||
Reference in new issue
Block a user