diff --git a/plugins/search-react/package.json b/plugins/search-react/package.json index 31e12db763..da4092fcbd 100644 --- a/plugins/search-react/package.json +++ b/plugins/search-react/package.json @@ -9,13 +9,13 @@ }, "exports": { ".": "./src/index.ts", - "./alpha": "./src/alpha.ts", + "./alpha": "./src/alpha.tsx", "./package.json": "./package.json" }, "typesVersions": { "*": { "alpha": [ - "src/alpha.ts" + "src/alpha.tsx" ], "package.json": [ "package.json" diff --git a/plugins/search-react/src/wiring/createSearchResultListItemExtension.test.tsx b/plugins/search-react/src/alpha.test.tsx similarity index 97% rename from plugins/search-react/src/wiring/createSearchResultListItemExtension.test.tsx rename to plugins/search-react/src/alpha.test.tsx index ca0e7e0672..b61a400832 100644 --- a/plugins/search-react/src/wiring/createSearchResultListItemExtension.test.tsx +++ b/plugins/search-react/src/alpha.test.tsx @@ -31,8 +31,8 @@ import { MockConfigApi } from '@backstage/test-utils'; import { BaseSearchResultListItemProps, createSearchResultListItemExtension, - searchResultItemExtensionData, -} from './createSearchResultListItemExtension'; + searchResultItemExtensionData as searchResultListItemExtensionData, +} from './alpha'; // TODO: Remove this mock when we have a permanent solution for nav items extensions // The `GraphiQLIcon` used in "packages/frontend-app-api/src/extensions/CoreNav.tsx" file @@ -89,7 +89,7 @@ describe('createSearchResultListItemExtension', () => { defaultPath: '/', inputs: { items: createExtensionInput({ - item: searchResultItemExtensionData, + item: searchResultListItemExtensionData, }), }, loader: async ({ inputs }) => { diff --git a/plugins/search-react/src/alpha.ts b/plugins/search-react/src/alpha.ts deleted file mode 100644 index e006e249eb..0000000000 --- a/plugins/search-react/src/alpha.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2023 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export * from './wiring'; diff --git a/plugins/search-react/src/wiring/createSearchResultListItemExtension.tsx b/plugins/search-react/src/alpha.tsx similarity index 97% rename from plugins/search-react/src/wiring/createSearchResultListItemExtension.tsx rename to plugins/search-react/src/alpha.tsx index b276c5e60a..4b5bb79669 100644 --- a/plugins/search-react/src/wiring/createSearchResultListItemExtension.tsx +++ b/plugins/search-react/src/alpha.tsx @@ -28,7 +28,13 @@ import { import { Progress } from '@backstage/core-components'; import { SearchDocument, SearchResult } from '@backstage/plugin-search-common'; -import { SearchResultListItemExtension } from '../extensions'; +import { SearchResultListItemExtension } from './extensions'; + +/** @alpha */ +export type BaseSearchResultListItemProps = T & { + rank?: number; + result?: SearchDocument; +} & Omit; /** @alpha */ export type SearchResultItemExtensionComponent = < @@ -77,12 +83,6 @@ export type SearchResultItemExtensionOptions< predicate?: SearchResultItemExtensionPredicate; }; -/** @alpha */ -export type BaseSearchResultListItemProps = T & { - rank?: number; - result?: SearchDocument; -} & Omit; - /** @alpha */ export function createSearchResultListItemExtension< TConfig extends { noTrack?: boolean }, @@ -92,7 +92,7 @@ export function createSearchResultListItemExtension< ? options.configSchema : (createSchemaFromZod(z => z.object({ - noTrack: z.boolean().default(true), + noTrack: z.boolean().default(false), }), ) as PortableSchema); return createExtension({ diff --git a/plugins/search-react/src/wiring/index.ts b/plugins/search-react/src/wiring/index.ts deleted file mode 100644 index 7cf5b0d6f5..0000000000 --- a/plugins/search-react/src/wiring/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2023 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export * from './createSearchResultListItemExtension';