chore: don't export the components that back the field extensions

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-02-28 16:19:05 +01:00
parent 96bc687026
commit 2c5d38e337
11 changed files with 40 additions and 76 deletions
+20 -42
View File
@@ -28,6 +28,7 @@ import { ScmIntegrationRegistry } from '@backstage/integration';
import { TaskSpec } from '@backstage/plugin-scaffolder-common';
import { TemplateEntityV1beta2 } from '@backstage/plugin-scaffolder-common';
// Warning: (ae-forgotten-export) The symbol "FieldExtensionComponent" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "createScaffolderFieldExtension" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
@@ -36,7 +37,7 @@ export function createScaffolderFieldExtension<
TInputProps = unknown,
>(
options: FieldExtensionOptions<TReturnValue, TInputProps>,
): Extension<() => null>;
): Extension<FieldExtensionComponent<TInputProps>>;
// @public
export type CustomFieldValidator<TFieldReturnValue> = (
@@ -50,19 +51,16 @@ export type CustomFieldValidator<TFieldReturnValue> = (
// 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: () => 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<string, EntityPickerUiOptions>,
) => JSX.Element;
export const EntityNamePickerFieldExtension: FieldExtensionComponent<
FieldExtensionComponentProps<string, {}>
>;
// 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: () => null;
export const EntityPickerFieldExtension: FieldExtensionComponent<
FieldExtensionComponentProps<string, EntityPickerUiOptions>
>;
// Warning: (ae-missing-release-tag) "EntityPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -76,15 +74,10 @@ 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 EntityTagsPicker: (
props: FieldExtensionComponentProps<string[], EntityTagsPickerUiOptions>,
) => JSX.Element;
// @public
export const EntityTagsPickerFieldExtension: () => null;
export const EntityTagsPickerFieldExtension: FieldExtensionComponent<
FieldExtensionComponentProps<string[], EntityTagsPickerUiOptions>
>;
// Warning: (ae-missing-release-tag) "EntityTagsPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -153,17 +146,12 @@ export type LogEvent = {
taskId: string;
};
// 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<string, OwnedEntityPickerUiOptions>,
) => 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: () => null;
export const OwnedEntityPickerFieldExtension: FieldExtensionComponent<
FieldExtensionComponentProps<string, OwnedEntityPickerUiOptions>
>;
// Warning: (ae-missing-release-tag) "OwnedEntityPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -175,17 +163,12 @@ 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<string, OwnerPickerUiOptions>,
) => 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: () => null;
export const OwnerPickerFieldExtension: FieldExtensionComponent<
FieldExtensionComponentProps<string, OwnerPickerUiOptions>
>;
// Warning: (ae-missing-release-tag) "OwnerPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -206,17 +189,12 @@ export const repoPickerValidation: (
},
) => 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<string, RepoUrlPickerUiOptions>,
) => 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: () => null;
export const RepoUrlPickerFieldExtension: FieldExtensionComponent<
FieldExtensionComponentProps<string, RepoUrlPickerUiOptions>
>;
// Warning: (ae-missing-release-tag) "RepoUrlPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -13,5 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { EntityNamePicker } from './EntityNamePicker';
export { entityNamePickerValidation } from './validation';
@@ -13,5 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { EntityPicker } from './EntityPicker';
export type { EntityPickerUiOptions } from './EntityPicker';
@@ -13,5 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { EntityTagsPicker } from './EntityTagsPicker';
export type { EntityTagsPickerUiOptions } from './EntityTagsPicker';
@@ -13,5 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { OwnedEntityPicker } from './OwnedEntityPicker';
export type { OwnedEntityPickerUiOptions } from './OwnedEntityPicker';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { EntityPicker } from '../EntityPicker';
import { EntityPicker } from '../EntityPicker/EntityPicker';
import { FieldExtensionComponentProps } from '../../../extensions';
export interface OwnerPickerUiOptions {
@@ -13,5 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { OwnerPicker } from './OwnerPicker';
export type { OwnerPickerUiOptions } from './OwnerPicker';
@@ -13,6 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { RepoUrlPicker } from './RepoUrlPicker';
export type { RepoUrlPickerUiOptions } from './RepoUrlPicker';
export { repoPickerValidation } from './validation';
+8 -12
View File
@@ -13,19 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { EntityPicker } from '../components/fields/EntityPicker';
import {
EntityNamePicker,
entityNamePickerValidation,
} from '../components/fields/EntityNamePicker';
import { EntityTagsPicker } from '../components/fields/EntityTagsPicker';
import { OwnerPicker } from '../components/fields/OwnerPicker';
import {
repoPickerValidation,
RepoUrlPicker,
} from '../components/fields/RepoUrlPicker';
import { EntityPicker } from '../components/fields/EntityPicker/EntityPicker';
import { EntityNamePicker } from '../components/fields/EntityNamePicker/EntityNamePicker';
import { entityNamePickerValidation } from '../components/fields/EntityNamePicker/validation';
import { EntityTagsPicker } from '../components/fields/EntityTagsPicker/EntityTagsPicker';
import { OwnerPicker } from '../components/fields/OwnerPicker/OwnerPicker';
import { RepoUrlPicker } from '../components/fields/RepoUrlPicker/RepoUrlPicker';
import { repoPickerValidation } from '../components/fields/RepoUrlPicker/validation';
import { FieldExtensionOptions } from './types';
import { OwnedEntityPicker } from '../components/fields/OwnedEntityPicker';
import { OwnedEntityPicker } from '../components/fields/OwnedEntityPicker/OwnedEntityPicker';
export const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS: FieldExtensionOptions<any>[] =
[
+3 -3
View File
@@ -25,14 +25,14 @@ import { Extension, attachComponentData } from '@backstage/core-plugin-api';
export const FIELD_EXTENSION_WRAPPER_KEY = 'scaffolder.extensions.wrapper.v1';
export const FIELD_EXTENSION_KEY = 'scaffolder.extensions.field.v1';
export type FieldExtensionComponent<_TInputProps> = () => null;
export function createScaffolderFieldExtension<
TReturnValue = unknown,
TInputProps = unknown,
>(
options: FieldExtensionOptions<TReturnValue, TInputProps>,
// TODO: need know how to embed these types nicely so the api report looks nice.
// then we can remove the export of the components
): Extension<() => null> {
): Extension<FieldExtensionComponent<TInputProps>> {
return {
expose() {
const FieldExtensionDataHolder: any = () => null;
+8 -12
View File
@@ -16,16 +16,12 @@
import { scmIntegrationsApiRef } from '@backstage/integration-react';
import { scaffolderApiRef, ScaffolderClient } from './api';
import { EntityPicker } from './components/fields/EntityPicker';
import {
entityNamePickerValidation,
EntityNamePicker,
} from './components/fields/EntityNamePicker';
import { OwnerPicker } from './components/fields/OwnerPicker';
import {
repoPickerValidation,
RepoUrlPicker,
} from './components/fields/RepoUrlPicker';
import { EntityPicker } from './components/fields/EntityPicker/EntityPicker';
import { entityNamePickerValidation } from './components/fields/EntityNamePicker';
import { EntityNamePicker } from './components/fields/EntityNamePicker/EntityNamePicker';
import { OwnerPicker } from './components/fields/OwnerPicker/OwnerPicker';
import { repoPickerValidation } from './components/fields/RepoUrlPicker';
import { RepoUrlPicker } from './components/fields/RepoUrlPicker/RepoUrlPicker';
import { createScaffolderFieldExtension } from './extensions';
import { registerComponentRouteRef, rootRouteRef } from './routes';
import {
@@ -35,8 +31,8 @@ import {
discoveryApiRef,
fetchApiRef,
} from '@backstage/core-plugin-api';
import { OwnedEntityPicker } from './components/fields/OwnedEntityPicker';
import { EntityTagsPicker } from './components/fields/EntityTagsPicker';
import { OwnedEntityPicker } from './components/fields/OwnedEntityPicker/OwnedEntityPicker';
import { EntityTagsPicker } from './components/fields/EntityTagsPicker/EntityTagsPicker';
export const scaffolderPlugin = createPlugin({
id: 'scaffolder',