-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding package exporting injection tokens for cluster settings #7395
Changes from 8 commits
9d4dbce
6ed1188
df327dc
2709119
66c4930
62abe4f
09c8abc
9396912
2635550
1db728c
1758963
fce6695
8df97aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/swcrc", | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript" | ||
}, | ||
"target": "es2022" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Description | ||
|
||
The package exports tokens needed for external configuration of Cluster Settings page. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "@k8slens/cluster-settings", | ||
"version": "6.5.0-alpha.1", | ||
"description": "Injection token exporter for cluster settings configuration", | ||
"license": "MIT", | ||
"private": false, | ||
"mode": "production", | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org/" | ||
}, | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"clean": "rimraf dist/", | ||
"generate-types": "tsc --d --declarationDir ./dist --declarationMap --emitDeclarationOnly", | ||
"build": "npm run generate-types && swc ./src/index.ts -d ./dist" | ||
}, | ||
"devDependencies": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure. It works well without specify typescript here. Probably it uses some globally installed typescript somehow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, try to remove global ‘typescript’ package and check again. |
||
"@ogre-tools/injectable": "^15.1.2", | ||
"@swc/cli": "^0.1.61", | ||
"@swc/core": "^1.3.37", | ||
"@types/node": "^16.18.11", | ||
"@types/semver": "^7.3.13", | ||
"rimraf": "^4.1.2" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { getInjectionToken } from "@ogre-tools/injectable"; | ||
|
||
type ClusterPreferences = { | ||
clusterName?: string; | ||
icon?: string | null; | ||
} | ||
|
||
export interface ClusterIconMenuItem { | ||
id: string; | ||
title: string; | ||
disabled?: (preferences: ClusterPreferences) => boolean; | ||
onClick: (preferences: ClusterPreferences) => void; | ||
} | ||
|
||
export interface ClusterIconSettingComponentProps { | ||
preferences: ClusterPreferences; | ||
} | ||
|
||
export interface ClusterIconSettingsComponent { | ||
id: string; | ||
Component: React.ComponentType<ClusterIconSettingComponentProps>; | ||
} | ||
|
||
export const clusterIconSettingsMenuInjectionToken = getInjectionToken<ClusterIconMenuItem>({ | ||
id: "cluster-icon-settings-menu-injection-token", | ||
}); | ||
|
||
export const clusterIconSettingsComponentInjectionToken = getInjectionToken<ClusterIconSettingsComponent>({ | ||
id: "cluster-icon-settings-component-injection-token", | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "dist/", | ||
"paths": { | ||
"*": [ | ||
"node_modules/*", | ||
"types/*" | ||
] | ||
}, | ||
}, | ||
"include": [ | ||
"src/**/*", | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
] | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this should probably be
1.0.0-alpha.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following same versioning as other internal packages. Keeping
6.5.0-alpha.1
for now until clarification. Will change it if needed in follow up PR.