Merge pull request #30670 from backstage/export
Export `FormField` type from Scaffolder
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder': patch
|
||||
'@backstage/plugin-scaffolder-react': patch
|
||||
---
|
||||
|
||||
Export `FormField` type from `/alpha` in `-react` package, and internal refactor.
|
||||
@@ -17,12 +17,10 @@
|
||||
import { OpaqueType } from '@internal/opaque';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { FormFieldExtensionData } from '@backstage/plugin-scaffolder-react/alpha';
|
||||
|
||||
/** @alpha */
|
||||
export interface FormField {
|
||||
readonly $$type: '@backstage/scaffolder/FormField';
|
||||
}
|
||||
import {
|
||||
FormFieldExtensionData,
|
||||
FormField,
|
||||
} from '@backstage/plugin-scaffolder-react/alpha';
|
||||
|
||||
/** @alpha */
|
||||
export const OpaqueFormField = OpaqueType.create<{
|
||||
|
||||
@@ -13,5 +13,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export { OpaqueFormField, type FormField } from './InternalFormField';
|
||||
export { OpaqueFormField } from './InternalFormField';
|
||||
export { OpaqueFormDecorator } from './InternalFormDecorator';
|
||||
|
||||
@@ -20,7 +20,6 @@ import { FieldExtensionComponentProps } from '@backstage/plugin-scaffolder-react
|
||||
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldSchema } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldValidation } from '@rjsf/utils';
|
||||
import { FormField } from '@internal/scaffolder';
|
||||
import { FormProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { IconComponent } from '@backstage/core-plugin-api';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
@@ -157,6 +156,12 @@ export const FormDecoratorBlueprint: ExtensionBlueprint<{
|
||||
};
|
||||
}>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export interface FormField {
|
||||
// (undocumented)
|
||||
readonly $$type: '@backstage/scaffolder/FormField';
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export const FormFieldBlueprint: ExtensionBlueprint<{
|
||||
kind: 'scaffolder-form-field';
|
||||
|
||||
@@ -19,9 +19,9 @@ import {
|
||||
createExtensionInput,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { formFieldsApiRef } from './ref';
|
||||
import { ScaffolderFormFieldsApi } from './types';
|
||||
import { FormField, ScaffolderFormFieldsApi } from './types';
|
||||
import { FormFieldBlueprint } from '../blueprints';
|
||||
import { FormField, OpaqueFormField } from '@internal/scaffolder';
|
||||
import { OpaqueFormField } from '@internal/scaffolder';
|
||||
|
||||
class DefaultScaffolderFormFieldsApi implements ScaffolderFormFieldsApi {
|
||||
constructor(
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
export { formFieldsApi } from './FormFieldsApi';
|
||||
export { formFieldsApiRef } from './ref';
|
||||
export type { ScaffolderFormFieldsApi } from './types';
|
||||
export type { ScaffolderFormFieldsApi, FormField } from './types';
|
||||
|
||||
@@ -23,3 +23,8 @@ import { FormFieldExtensionData } from '../blueprints';
|
||||
export interface ScaffolderFormFieldsApi {
|
||||
getFormFields(): Promise<FormFieldExtensionData[]>;
|
||||
}
|
||||
|
||||
/** @alpha */
|
||||
export interface FormField {
|
||||
readonly $$type: '@backstage/scaffolder/FormField';
|
||||
}
|
||||
|
||||
@@ -19,8 +19,9 @@ import {
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { OpaqueFormField, FormField } from '@internal/scaffolder';
|
||||
import { OpaqueFormField } from '@internal/scaffolder';
|
||||
import { FormFieldExtensionData } from './types';
|
||||
import { FormField } from '../api';
|
||||
|
||||
const formFieldExtensionDataRef = createExtensionDataRef<
|
||||
() => Promise<FormField>
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionInput } from '@backstage/frontend-plugin-api';
|
||||
import { ExternalRouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import { FormField } from '@internal/scaffolder';
|
||||
import { FormField } from '@backstage/plugin-scaffolder-react/alpha';
|
||||
import { formFieldsApiRef } from '@backstage/plugin-scaffolder-react/alpha';
|
||||
import type { FormProps as FormProps_2 } from '@rjsf/core';
|
||||
import { FormProps as FormProps_3 } from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
@@ -62,9 +62,10 @@ import {
|
||||
import { RequirePermission } from '@backstage/plugin-permission-react';
|
||||
import { templateManagementPermission } from '@backstage/plugin-scaffolder-common/alpha';
|
||||
import { useApp } from '@backstage/core-plugin-api';
|
||||
import { FormField, OpaqueFormField } from '@internal/scaffolder';
|
||||
import { OpaqueFormField } from '@internal/scaffolder';
|
||||
import { useAsync, useMountEffect } from '@react-hookz/web';
|
||||
import { TemplatingExtensionsPage } from '../TemplatingExtensionsPage';
|
||||
import { FormField } from '@backstage/plugin-scaffolder-react/alpha';
|
||||
|
||||
/**
|
||||
* The Props for the Scaffolder Router
|
||||
|
||||
Reference in New Issue
Block a user