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
@@ -0,0 +1,18 @@
|
||||
# @k8slens/application
|
||||
|
||||
This package contains stuff related to creating Lens-applications.
|
||||
|
||||
In the beginning it will contain just the injection tokens used to configure the application.
|
||||
|
||||
## Install
|
||||
```bash
|
||||
$ npm install @k8slens/application
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
As of now, this package doesn't do anything alone. It just provides you way to register implementation for contract.
|
||||
|
||||
Future ambition is that all stuff related to how applications are built will be relocated here.
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export { applicationInformationToken } from "./src/application-information-token";
|
||||
export type { ApplicationInformation } from "./src/application-information-token";
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
module.exports =
|
||||
require("@k8slens/jest").monorepoPackageConfig(__dirname).configForReact;
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "@k8slens/application",
|
||||
"private": false,
|
||||
"version": "6.4.0-beta.13",
|
||||
"description": "Package for creating Lens applications",
|
||||
"type": "commonjs",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/lensapp/monorepo.git"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"author": {
|
||||
"name": "OpenLens Authors",
|
||||
"email": "info@k8slens.dev"
|
||||
},
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/lensapp/lens",
|
||||
"scripts": {
|
||||
"build": "lens-build",
|
||||
"build:remove": "lens-remove-build",
|
||||
"code-style:fix": "lens-fix-code-style",
|
||||
"code-style:verify": "lens-verify-code-style",
|
||||
"test": "lens-test"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@ogre-tools/fp": "^12.0.1",
|
||||
"@ogre-tools/injectable": "^12.0.1",
|
||||
"lodash": "^4.17.15"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
|
||||
export type ApplicationInformation = {
|
||||
name: string;
|
||||
version: string;
|
||||
productName: string;
|
||||
copyright: string;
|
||||
description: string;
|
||||
k8sProxyVersion: string,
|
||||
bundledKubectlVersion: string,
|
||||
bundledHelmVersion: string,
|
||||
sentryDsn: string,
|
||||
contentSecurityPolicy: string,
|
||||
welcomeRoute: string,
|
||||
updatingIsEnabled: boolean;
|
||||
}
|
||||
|
||||
export const applicationInformationToken = getInjectionToken<ApplicationInformation>({
|
||||
id: "application-information-token",
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "@k8slens/typescript/config/base.json"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require("@k8slens/webpack").configForNode;
|
||||
Reference in new issue
Block a user