From 209b13774c9ca90c0e6cd7a4f70bb34c7309975b Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 24 Feb 2022 11:10:15 +0100 Subject: [PATCH] chore: fallback to just exporting the components as before for now, and work out how to embed the types later Signed-off-by: blam --- plugins/scaffolder/api-report.md | 84 ++++++++++++------- .../EntityNamePicker/EntityNamePicker.tsx | 3 + .../fields/EntityPicker/EntityPicker.tsx | 3 + .../EntityTagsPicker/EntityTagsPicker.tsx | 1 - .../OwnedEntityPicker/OwnedEntityPicker.tsx | 3 + .../fields/OwnerPicker/OwnerPicker.tsx | 3 + .../fields/RepoUrlPicker/RepoUrlPicker.tsx | 3 + .../scaffolder/src/components/fields/index.ts | 10 +-- plugins/scaffolder/src/extensions/index.tsx | 3 +- 9 files changed, 75 insertions(+), 38 deletions(-) diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index b38684c84e..fb3fd830f7 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -37,7 +37,7 @@ export function createScaffolderFieldExtension< TInputProps = unknown, >( options: FieldExtensionOptions, -): Extension null)>; +): Extension<() => null>; // @public export type CustomFieldValidator = ( @@ -51,20 +51,19 @@ export type CustomFieldValidator = ( // Warning: (ae-missing-release-tag) "EntityNamePickerFieldExtension" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const EntityNamePickerFieldExtension: FieldExtensionComponentProps< - string, - {} -> & - (() => null); +export const EntityNamePickerFieldExtension: () => null; + +// Warning: (ae-missing-release-tag) "EntityPicker" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const EntityPicker: ( + props: FieldExtensionComponentProps, +) => JSX.Element; // Warning: (ae-missing-release-tag) "EntityPickerFieldExtension" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const EntityPickerFieldExtension: FieldExtensionComponentProps< - string, - EntityPickerUiOptions -> & - (() => null); +export const EntityPickerFieldExtension: () => null; // Warning: (ae-missing-release-tag) "EntityPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -78,12 +77,15 @@ export interface EntityPickerUiOptions { defaultKind?: string; } +// Warning: (ae-missing-release-tag) "EntityTagsPicker" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// // @public -export const EntityTagsPickerFieldExtension: FieldExtensionComponentProps< - string[], - EntityTagsPickerUiOptions -> & - (() => null); +export const EntityTagsPicker: ( + props: FieldExtensionComponentProps, +) => JSX.Element; + +// @public +export const EntityTagsPickerFieldExtension: () => null; // Warning: (ae-missing-release-tag) "EntityTagsPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -120,14 +122,17 @@ export type FieldExtensionOptions< validation?: CustomFieldValidator; }; +// Warning: (ae-missing-release-tag) "OwnedEntityPicker" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const OwnedEntityPicker: ( + props: FieldExtensionComponentProps, +) => JSX.Element; + // Warning: (ae-missing-release-tag) "OwnedEntityPickerFieldExtension" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const OwnedEntityPickerFieldExtension: FieldExtensionComponentProps< - string, - OwnedEntityPickerUiOptions -> & - (() => null); +export const OwnedEntityPickerFieldExtension: () => null; // Warning: (ae-missing-release-tag) "OwnedEntityPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -139,14 +144,17 @@ export interface OwnedEntityPickerUiOptions { defaultKind?: string; } +// Warning: (ae-missing-release-tag) "OwnerPicker" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const OwnerPicker: ( + props: FieldExtensionComponentProps, +) => JSX.Element; + // Warning: (ae-missing-release-tag) "OwnerPickerFieldExtension" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const OwnerPickerFieldExtension: FieldExtensionComponentProps< - string, - OwnerPickerUiOptions -> & - (() => null); +export const OwnerPickerFieldExtension: () => null; // Warning: (ae-missing-release-tag) "OwnerPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -156,14 +164,28 @@ export interface OwnerPickerUiOptions { allowedKinds?: string[]; } +// Warning: (ae-missing-release-tag) "repoPickerValidation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const repoPickerValidation: ( + value: string, + validation: FieldValidation, + context: { + apiHolder: ApiHolder; + }, +) => void; + +// Warning: (ae-missing-release-tag) "RepoUrlPicker" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const RepoUrlPicker: ( + props: FieldExtensionComponentProps, +) => JSX.Element; + // Warning: (ae-missing-release-tag) "RepoUrlPickerFieldExtension" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const RepoUrlPickerFieldExtension: FieldExtensionComponentProps< - string, - RepoUrlPickerUiOptions -> & - (() => null); +export const RepoUrlPickerFieldExtension: () => null; // Warning: (ae-missing-release-tag) "RepoUrlPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/plugins/scaffolder/src/components/fields/EntityNamePicker/EntityNamePicker.tsx b/plugins/scaffolder/src/components/fields/EntityNamePicker/EntityNamePicker.tsx index 2b8817aa4b..802135a863 100644 --- a/plugins/scaffolder/src/components/fields/EntityNamePicker/EntityNamePicker.tsx +++ b/plugins/scaffolder/src/components/fields/EntityNamePicker/EntityNamePicker.tsx @@ -17,6 +17,9 @@ import React from 'react'; import { FieldExtensionComponentProps } from '../../../extensions'; import { TextField } from '@material-ui/core'; +/** + * EntityName Picker + */ export const EntityNamePicker = ( props: FieldExtensionComponentProps, ) => { diff --git a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx index e991d6d097..31c44bfe97 100644 --- a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx +++ b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx @@ -31,6 +31,9 @@ export interface EntityPickerUiOptions { allowArbitraryValues?: boolean; } +/** + * Entity Picker + */ export const EntityPicker = ( props: FieldExtensionComponentProps, ) => { diff --git a/plugins/scaffolder/src/components/fields/EntityTagsPicker/EntityTagsPicker.tsx b/plugins/scaffolder/src/components/fields/EntityTagsPicker/EntityTagsPicker.tsx index 2d0acecbaf..41369a58eb 100644 --- a/plugins/scaffolder/src/components/fields/EntityTagsPicker/EntityTagsPicker.tsx +++ b/plugins/scaffolder/src/components/fields/EntityTagsPicker/EntityTagsPicker.tsx @@ -29,7 +29,6 @@ export interface EntityTagsPickerUiOptions { } /** * EntityTagsPicker - * @public */ export const EntityTagsPicker = ( props: FieldExtensionComponentProps, diff --git a/plugins/scaffolder/src/components/fields/OwnedEntityPicker/OwnedEntityPicker.tsx b/plugins/scaffolder/src/components/fields/OwnedEntityPicker/OwnedEntityPicker.tsx index 71083b596e..80f63efaf9 100644 --- a/plugins/scaffolder/src/components/fields/OwnedEntityPicker/OwnedEntityPicker.tsx +++ b/plugins/scaffolder/src/components/fields/OwnedEntityPicker/OwnedEntityPicker.tsx @@ -29,6 +29,9 @@ export interface OwnedEntityPickerUiOptions { defaultKind?: string; } +/** + * Owned Entity Picker + */ export const OwnedEntityPicker = ( props: FieldExtensionComponentProps, ) => { diff --git a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx index cde1eba132..9012ed149e 100644 --- a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx +++ b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx @@ -21,6 +21,9 @@ export interface OwnerPickerUiOptions { allowedKinds?: string[]; } +/** + * Owner Picker + */ export const OwnerPicker = ( props: FieldExtensionComponentProps, ) => { diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index 1ccaed4e86..fe7c4b18a4 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -44,6 +44,9 @@ export interface RepoUrlPickerUiOptions { }; } +/** + * Repo Url Picker + */ export const RepoUrlPicker = ( props: FieldExtensionComponentProps, ) => { diff --git a/plugins/scaffolder/src/components/fields/index.ts b/plugins/scaffolder/src/components/fields/index.ts index 0d4de41493..6358934025 100644 --- a/plugins/scaffolder/src/components/fields/index.ts +++ b/plugins/scaffolder/src/components/fields/index.ts @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export type { EntityPickerUiOptions } from './EntityPicker'; -export type { OwnerPickerUiOptions } from './OwnerPicker'; -export type { RepoUrlPickerUiOptions } from './RepoUrlPicker'; -export type { OwnedEntityPickerUiOptions } from './OwnedEntityPicker'; -export type { EntityTagsPickerUiOptions } from './EntityTagsPicker'; +export * from './EntityPicker'; +export * from './OwnerPicker'; +export * from './RepoUrlPicker'; +export * from './OwnedEntityPicker'; +export * from './EntityTagsPicker'; diff --git a/plugins/scaffolder/src/extensions/index.tsx b/plugins/scaffolder/src/extensions/index.tsx index 55be17cb77..fd816681ea 100644 --- a/plugins/scaffolder/src/extensions/index.tsx +++ b/plugins/scaffolder/src/extensions/index.tsx @@ -31,7 +31,8 @@ export function createScaffolderFieldExtension< >( options: FieldExtensionOptions, // TODO: need know how to embed these types nicely so the api report looks nice. -): Extension null)> { + // then we can remove the export of the components +): Extension<() => null> { return { expose() { const FieldExtensionDataHolder: any = () => null;