From b52f576f48e27fe9042a71caad6e272089b1e1da Mon Sep 17 00:00:00 2001 From: ivgo Date: Mon, 23 Oct 2023 14:23:07 +0200 Subject: [PATCH] Make sure types are exported Signed-off-by: ivgo --- .changeset/old-coats-doubt.md | 8 +++++ plugins/kubernetes-react/api-report.md | 35 +++++++++++++++++++ plugins/kubernetes-react/src/index.ts | 2 ++ plugins/kubernetes-react/src/types/types.ts | 6 ++++ .../utils/clusterLinks/formatClusterLink.ts | 8 +++-- .../utils/clusterLinks/formatters/index.ts | 3 ++ .../src/utils/clusterLinks/index.ts | 5 ++- 7 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 .changeset/old-coats-doubt.md diff --git a/.changeset/old-coats-doubt.md b/.changeset/old-coats-doubt.md new file mode 100644 index 0000000000000..2b98acbd874f9 --- /dev/null +++ b/.changeset/old-coats-doubt.md @@ -0,0 +1,8 @@ +--- +'@backstage/plugin-kubernetes-react': patch +--- + +Make sure types exported by other `kubernetes` plugins in the past are exported again after the creation +of the react package. + +Some types have been moved to this new package but the export was missing, so they were not available anymore for developers. diff --git a/plugins/kubernetes-react/api-report.md b/plugins/kubernetes-react/api-report.md index bb8e4923f6fdf..ca1df34b40c89 100644 --- a/plugins/kubernetes-react/api-report.md +++ b/plugins/kubernetes-react/api-report.md @@ -22,6 +22,7 @@ import { IContainerStatus } from 'kubernetes-models/v1'; import { IdentityApi } from '@backstage/core-plugin-api'; import { IIoK8sApimachineryPkgApisMetaV1ObjectMeta } from '@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta'; import { IObjectMeta } from '@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta'; +import type { JsonObject } from '@backstage/types'; import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; import { OAuthApi } from '@backstage/core-plugin-api'; import { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common'; @@ -59,6 +60,26 @@ export const Cluster: ({ // @public (undocumented) export const ClusterContext: React_2.Context; +// @public (undocumented) +export type ClusterLinksFormatter = ( + options: ClusterLinksFormatterOptions, +) => URL; + +// @public (undocumented) +export interface ClusterLinksFormatterOptions { + // (undocumented) + dashboardParameters?: JsonObject; + // (undocumented) + dashboardUrl?: URL; + // (undocumented) + kind: string; + // (undocumented) + object: any; +} + +// @public (undocumented) +export const clusterLinksFormatters: Record; + // @public export type ClusterProps = { clusterObjects: ClusterObjects; @@ -207,6 +228,20 @@ export interface FixDialogProps { pod: Pod_2; } +// @public (undocumented) +export function formatClusterLink( + options: FormatClusterLinkOptions, +): string | undefined; + +// @public (undocumented) +export type FormatClusterLinkOptions = { + dashboardUrl?: string; + dashboardApp?: string; + dashboardParameters?: JsonObject; + object: any; + kind: string; +}; + // @public (undocumented) export class GoogleKubernetesAuthProvider implements KubernetesAuthProvider { constructor(authProvider: OAuthApi); diff --git a/plugins/kubernetes-react/src/index.ts b/plugins/kubernetes-react/src/index.ts index e5c84eab793a0..4fb86140914b6 100644 --- a/plugins/kubernetes-react/src/index.ts +++ b/plugins/kubernetes-react/src/index.ts @@ -27,3 +27,5 @@ export * from './hooks'; export * from './api'; export * from './kubernetes-auth-provider'; export * from './components'; +export * from './utils'; +export * from './types'; diff --git a/plugins/kubernetes-react/src/types/types.ts b/plugins/kubernetes-react/src/types/types.ts index 7efd1ef3ff6dc..ad8df040acdcc 100644 --- a/plugins/kubernetes-react/src/types/types.ts +++ b/plugins/kubernetes-react/src/types/types.ts @@ -16,6 +16,9 @@ import type { JsonObject } from '@backstage/types'; +/** + * @public + */ export interface ClusterLinksFormatterOptions { dashboardUrl?: URL; dashboardParameters?: JsonObject; @@ -23,6 +26,9 @@ export interface ClusterLinksFormatterOptions { kind: string; } +/** + * @public + */ export type ClusterLinksFormatter = ( options: ClusterLinksFormatterOptions, ) => URL; diff --git a/plugins/kubernetes-react/src/utils/clusterLinks/formatClusterLink.ts b/plugins/kubernetes-react/src/utils/clusterLinks/formatClusterLink.ts index ae3bdb950faa5..8f7e43a121973 100644 --- a/plugins/kubernetes-react/src/utils/clusterLinks/formatClusterLink.ts +++ b/plugins/kubernetes-react/src/utils/clusterLinks/formatClusterLink.ts @@ -17,7 +17,9 @@ import type { JsonObject } from '@backstage/types'; import { defaultFormatterName, clusterLinksFormatters } from './formatters'; -// @Deprecated use import { FormatClusterLinkOptions } from '@backstage/kubernetes-react' +/** + * @public + */ export type FormatClusterLinkOptions = { dashboardUrl?: string; dashboardApp?: string; @@ -26,7 +28,9 @@ export type FormatClusterLinkOptions = { kind: string; }; -// @Deprecated use import { formatClusterLink } from '@backstage/kubernetes-react' +/** + * @public + */ export function formatClusterLink(options: FormatClusterLinkOptions) { if (!options.dashboardUrl && !options.dashboardParameters) { return undefined; diff --git a/plugins/kubernetes-react/src/utils/clusterLinks/formatters/index.ts b/plugins/kubernetes-react/src/utils/clusterLinks/formatters/index.ts index a2dea97555ab7..b75e45cc7f23a 100644 --- a/plugins/kubernetes-react/src/utils/clusterLinks/formatters/index.ts +++ b/plugins/kubernetes-react/src/utils/clusterLinks/formatters/index.ts @@ -21,6 +21,9 @@ import { aksFormatter } from './aks'; import { eksFormatter } from './eks'; import { gkeFormatter } from './gke'; +/** + * @public + */ export const clusterLinksFormatters: Record = { standard: standardFormatter, rancher: rancherFormatter, diff --git a/plugins/kubernetes-react/src/utils/clusterLinks/index.ts b/plugins/kubernetes-react/src/utils/clusterLinks/index.ts index 0a2a32cdbfd46..90a30e8277927 100644 --- a/plugins/kubernetes-react/src/utils/clusterLinks/index.ts +++ b/plugins/kubernetes-react/src/utils/clusterLinks/index.ts @@ -14,5 +14,8 @@ * limitations under the License. */ -export { formatClusterLink } from './formatClusterLink'; +export { + formatClusterLink, + type FormatClusterLinkOptions, +} from './formatClusterLink'; export { clusterLinksFormatters } from './formatters';