just some 🧹 api cleaning

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-18 13:30:02 +02:00
parent e195112c5c
commit c8bb0ff8ce
18 changed files with 118 additions and 158 deletions
+21 -54
View File
@@ -58,21 +58,13 @@ export const ApiExplorerIndexPage: (
props: DefaultApiExplorerPageProps,
) => JSX.Element;
// Warning: (ae-missing-release-tag) "ApiExplorerPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ApiExplorerPage: (
props: DefaultApiExplorerPageProps,
) => JSX.Element;
// Warning: (ae-missing-release-tag) "ApiTypeTitle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ApiTypeTitle: ({
apiEntity,
}: {
apiEntity: ApiEntity;
}) => JSX.Element;
export const ApiTypeTitle: (props: { apiEntity: ApiEntity }) => JSX.Element;
// Warning: (ae-missing-release-tag) "AsyncApiDefinitionWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -88,17 +80,15 @@ export type AsyncApiDefinitionWidgetProps = {
definition: string;
};
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "ConsumedApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ConsumedApisCard: ({ variant }: Props) => JSX.Element;
export const ConsumedApisCard: (props: {
variant?: InfoCardVariants;
}) => JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "ConsumingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ConsumingComponentsCard: ({ variant }: Props_4) => JSX.Element;
export const ConsumingComponentsCard: (props: {
variant?: InfoCardVariants;
}) => JSX.Element;
// @public
export const DefaultApiExplorerPage: ({
@@ -119,53 +109,31 @@ export type DefaultApiExplorerPageProps = {
// @public (undocumented)
export function defaultDefinitionWidgets(): ApiDefinitionWidget[];
// Warning: (ae-missing-release-tag) "EntityApiDefinitionCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityApiDefinitionCard: () => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityConsumedApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityConsumedApisCard: ({
variant,
}: {
export const EntityConsumedApisCard: (props: {
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityConsumingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityConsumingComponentsCard: ({
variant,
}: {
export const EntityConsumingComponentsCard: (props: {
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityHasApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityHasApisCard: ({
variant,
}: {
export const EntityHasApisCard: (props: {
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityProvidedApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityProvidedApisCard: ({
variant,
}: {
export const EntityProvidedApisCard: (props: {
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityProvidingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityProvidingComponentsCard: ({
variant,
}: {
export const EntityProvidingComponentsCard: (props: {
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
@@ -183,11 +151,10 @@ export type GraphQlDefinitionWidgetProps = {
definition: string;
};
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "HasApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const HasApisCard: ({ variant }: Props_2) => JSX.Element;
export const HasApisCard: (props: {
variant?: InfoCardVariants;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "OpenApiDefinitionWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -218,15 +185,15 @@ export type PlainApiDefinitionWidgetProps = {
language: string;
};
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "ProvidedApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ProvidedApisCard: ({ variant }: Props_3) => JSX.Element;
export const ProvidedApisCard: (props: {
variant?: InfoCardVariants;
}) => JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "ProvidingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const ProvidingComponentsCard: ({ variant }: Props_5) => JSX.Element;
export const ProvidingComponentsCard: (props: {
variant?: InfoCardVariants;
}) => JSX.Element;
```
@@ -19,7 +19,11 @@ import React from 'react';
import { apiDocsConfigRef } from '../../config';
import { useApi } from '@backstage/core-plugin-api';
export const ApiTypeTitle = ({ apiEntity }: { apiEntity: ApiEntity }) => {
/**
* @public
*/
export const ApiTypeTitle = (props: { apiEntity: ApiEntity }) => {
const { apiEntity } = props;
const config = useApi(apiDocsConfigRef);
const definition = config.getApiDefinitionWidget(apiEntity);
const type = definition ? definition.title : apiEntity.spec.type;
@@ -32,11 +32,11 @@ import {
WarningPanel,
} from '@backstage/core-components';
type Props = {
variant?: InfoCardVariants;
};
export const ConsumedApisCard = ({ variant = 'gridItem' }: Props) => {
/**
* @public
*/
export const ConsumedApisCard = (props: { variant?: InfoCardVariants }) => {
const { variant = 'gridItem' } = props;
const { entity } = useEntity();
const { entities, loading, error } = useRelatedEntities(entity, {
type: RELATION_CONSUMES_API,
@@ -33,10 +33,6 @@ import {
WarningPanel,
} from '@backstage/core-components';
type Props = {
variant?: InfoCardVariants;
};
const columns: TableColumn<ApiEntity>[] = [
EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),
EntityTable.columns.createOwnerColumn(),
@@ -45,7 +41,11 @@ const columns: TableColumn<ApiEntity>[] = [
EntityTable.columns.createMetadataDescriptionColumn(),
];
export const HasApisCard = ({ variant = 'gridItem' }: Props) => {
/**
* @public
*/
export const HasApisCard = (props: { variant?: InfoCardVariants }) => {
const { variant = 'gridItem' } = props;
const { entity } = useEntity();
const { entities, loading, error } = useRelatedEntities(entity, {
type: RELATION_HAS_PART,
@@ -32,11 +32,11 @@ import {
WarningPanel,
} from '@backstage/core-components';
type Props = {
variant?: InfoCardVariants;
};
export const ProvidedApisCard = ({ variant = 'gridItem' }: Props) => {
/**
* @public
*/
export const ProvidedApisCard = (props: { variant?: InfoCardVariants }) => {
const { variant = 'gridItem' } = props;
const { entity } = useEntity();
const { entities, loading, error } = useRelatedEntities(entity, {
type: RELATION_PROVIDES_API,
@@ -34,11 +34,13 @@ import {
WarningPanel,
} from '@backstage/core-components';
type Props = {
/**
* @public
*/
export const ConsumingComponentsCard = (props: {
variant?: InfoCardVariants;
};
export const ConsumingComponentsCard = ({ variant = 'gridItem' }: Props) => {
}) => {
const { variant = 'gridItem' } = props;
const { entity } = useEntity();
const { entities, loading, error } = useRelatedEntities(entity, {
type: RELATION_API_CONSUMED_BY,
@@ -34,11 +34,10 @@ import {
WarningPanel,
} from '@backstage/core-components';
type Props = {
export const ProvidingComponentsCard = (props: {
variant?: InfoCardVariants;
};
export const ProvidingComponentsCard = ({ variant = 'gridItem' }: Props) => {
}) => {
const { variant = 'gridItem' } = props;
const { entity } = useEntity();
const { entities, loading, error } = useRelatedEntities(entity, {
type: RELATION_API_PROVIDED_BY,
+7
View File
@@ -49,6 +49,7 @@ export const apiDocsPlugin = createPlugin({
},
});
/** @public */
export const ApiExplorerPage = apiDocsPlugin.provide(
createRoutableExtension({
name: 'ApiExplorerPage',
@@ -58,6 +59,7 @@ export const ApiExplorerPage = apiDocsPlugin.provide(
}),
);
/** @public */
export const EntityApiDefinitionCard = apiDocsPlugin.provide(
createComponentExtension({
name: 'EntityApiDefinitionCard',
@@ -68,6 +70,7 @@ export const EntityApiDefinitionCard = apiDocsPlugin.provide(
}),
);
/** @public */
export const EntityConsumedApisCard = apiDocsPlugin.provide(
createComponentExtension({
name: 'EntityConsumedApisCard',
@@ -78,6 +81,7 @@ export const EntityConsumedApisCard = apiDocsPlugin.provide(
}),
);
/** @public */
export const EntityConsumingComponentsCard = apiDocsPlugin.provide(
createComponentExtension({
name: 'EntityConsumingComponentsCard',
@@ -90,6 +94,7 @@ export const EntityConsumingComponentsCard = apiDocsPlugin.provide(
}),
);
/** @public */
export const EntityProvidedApisCard = apiDocsPlugin.provide(
createComponentExtension({
name: 'EntityProvidedApisCard',
@@ -100,6 +105,7 @@ export const EntityProvidedApisCard = apiDocsPlugin.provide(
}),
);
/** @public */
export const EntityProvidingComponentsCard = apiDocsPlugin.provide(
createComponentExtension({
name: 'EntityProvidingComponentsCard',
@@ -112,6 +118,7 @@ export const EntityProvidingComponentsCard = apiDocsPlugin.provide(
}),
);
/** @public */
export const EntityHasApisCard = apiDocsPlugin.provide(
createComponentExtension({
name: 'EntityHasApisCard',