mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add bundled extension versions to 'About Lens' (#7163)
- Only during non-stable versions Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
78b6753e94
commit
79e5c9c431
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { bundledExtensionInjectionToken } from "../../../../../../common/library";
|
||||
import buildSemanticVersionInjectable from "../../../../../../common/vars/build-semantic-version.injectable";
|
||||
|
||||
const aboutBundledExtensionsInjectable = getInjectable({
|
||||
id: "about-bundled-extensions",
|
||||
instantiate: (di) => {
|
||||
const buildSemanticVersion = di.inject(buildSemanticVersionInjectable);
|
||||
const bundledExtensions = di.injectMany(bundledExtensionInjectionToken);
|
||||
|
||||
if (buildSemanticVersion.get().prerelease[0] === "latest") {
|
||||
return [];
|
||||
}
|
||||
|
||||
return bundledExtensions.map(ext => `${ext.manifest.name}: ${ext.manifest.version}`);
|
||||
},
|
||||
});
|
||||
|
||||
export default aboutBundledExtensionsInjectable;
|
||||
@ -10,6 +10,7 @@ import productNameInjectable from "../../../../../../common/vars/product-name.in
|
||||
import buildVersionInjectable from "../../../../../../main/vars/build-version/build-version.injectable";
|
||||
import extensionApiVersionInjectable from "../../../../../../common/vars/extension-api-version.injectable";
|
||||
import applicationCopyrightInjectable from "../../../../../../common/vars/application-copyright.injectable";
|
||||
import aboutBundledExtensionsInjectable from "./about-bundled-extensions.injectable";
|
||||
|
||||
const showAboutInjectable = getInjectable({
|
||||
id: "show-about",
|
||||
@ -22,6 +23,7 @@ const showAboutInjectable = getInjectable({
|
||||
const appName = di.inject(appNameInjectable);
|
||||
const productName = di.inject(productNameInjectable);
|
||||
const applicationCopyright = di.inject(applicationCopyrightInjectable);
|
||||
const aboutBundledExtensions = di.inject(aboutBundledExtensionsInjectable);
|
||||
|
||||
return () => {
|
||||
const appInfo = [
|
||||
@ -30,6 +32,7 @@ const showAboutInjectable = getInjectable({
|
||||
`Electron: ${process.versions.electron}`,
|
||||
`Chrome: ${process.versions.chrome}`,
|
||||
`Node: ${process.versions.node}`,
|
||||
...aboutBundledExtensions,
|
||||
applicationCopyright,
|
||||
];
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user