mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Extract injection token for application information to separate NPM package (#7211)
* Introduce dummy package for application Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Introduce application information token in application Feature Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Switch to using applicationInformationToken from application feature Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> --------- Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
1 parent
4e02bdce6d
commit
688336647d
32 files changed
+201
-112
No files matched your search
@@ -195,6 +195,7 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@k8slens/application": "^6.4.0-beta.13",
|
||||
"@k8slens/core": "^6.4.0-beta.13",
|
||||
"@k8slens/ensure-binaries": "^6.4.0-beta.13",
|
||||
"@k8slens/generate-tray-icons": "^6.4.0-beta.13",
|
||||
|
||||
@@ -1,15 +1,49 @@
|
||||
|
||||
/**
|
||||
* 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 { applicationInformationToken, ApplicationInformation } from "@k8slens/core/common";
|
||||
import packageJson from "../../package.json";
|
||||
import { applicationInformationToken } from "@k8slens/application";
|
||||
|
||||
const applicationInformationInjectable = getInjectable({
|
||||
id: "application-information",
|
||||
injectionToken: applicationInformationToken,
|
||||
instantiate: () => {
|
||||
const { version, config, productName, build, copyright, description, name } = packageJson;
|
||||
|
||||
return { version, config, productName, build, copyright, description, name } as ApplicationInformation;
|
||||
instantiate: () => {
|
||||
const {
|
||||
version,
|
||||
|
||||
config: {
|
||||
bundledHelmVersion,
|
||||
bundledKubectlVersion,
|
||||
contentSecurityPolicy,
|
||||
k8sProxyVersion,
|
||||
sentryDsn,
|
||||
welcomeRoute,
|
||||
},
|
||||
|
||||
productName,
|
||||
build,
|
||||
copyright,
|
||||
description,
|
||||
name,
|
||||
} = packageJson;
|
||||
|
||||
return {
|
||||
version,
|
||||
productName,
|
||||
copyright,
|
||||
description,
|
||||
name,
|
||||
k8sProxyVersion,
|
||||
bundledKubectlVersion,
|
||||
bundledHelmVersion,
|
||||
sentryDsn,
|
||||
contentSecurityPolicy,
|
||||
welcomeRoute,
|
||||
updatingIsEnabled: (build as any)?.publish?.length > 0,
|
||||
};
|
||||
},
|
||||
causesSideEffects: true,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user