From 3eaa4bdfbcc44a3f710023414cf76ced4db71bc2 Mon Sep 17 00:00:00 2001 From: Andrew Thauer Date: Fri, 4 Nov 2022 05:56:56 -0400 Subject: [PATCH] update api report & intial package versions Signed-off-by: Andrew Thauer --- plugins/explore-backend/api-report.md | 31 +++++++++---------- plugins/explore-backend/package.json | 2 +- plugins/explore-backend/src/index.ts | 5 ++- .../src/search/ToolDocumentCollatorFactory.ts | 20 ++++++------ plugins/explore-backend/src/search/index.ts | 4 +++ plugins/explore-backend/src/service/index.ts | 19 ++++++++++++ plugins/explore-backend/src/service/router.ts | 6 ++++ plugins/explore-backend/src/service/types.ts | 4 +-- plugins/explore-common/README.md | 2 +- plugins/explore-common/api-report.md | 6 ---- plugins/explore-common/package.json | 2 +- plugins/explore-common/src/index.ts | 1 - 12 files changed, 62 insertions(+), 40 deletions(-) create mode 100644 plugins/explore-backend/src/service/index.ts diff --git a/plugins/explore-backend/api-report.md b/plugins/explore-backend/api-report.md index 7ab37bb598..89dd256cd9 100644 --- a/plugins/explore-backend/api-report.md +++ b/plugins/explore-backend/api-report.md @@ -16,36 +16,29 @@ import { Logger } from 'winston'; import { PluginEndpointDiscovery } from '@backstage/backend-common'; import { Readable } from 'stream'; -// Warning: (ae-forgotten-export) The symbol "RouterOptions" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "createRouter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export function createRouter(options: RouterOptions): Promise; // @public (undocumented) export interface ExploreToolProvider { - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/plugin-explore-backend" does not have an export "GetExploreToolsRequest" - // Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/plugin-explore-backend" does not have an export "GetExploreToolsResponse" getTools(request: GetExploreToolsRequest): Promise; } -// Warning: (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration -// Warning: (ae-missing-release-tag) "getExampleTools" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// +// @public (undocumented) +export interface RouterOptions { + // (undocumented) + logger: Logger; + // (undocumented) + toolProvider: ExploreToolProvider; +} + // @public -export function getExampleTools( - request: GetExploreToolsRequest, -): Promise; +export interface ToolDocument extends IndexableDocument, ExploreTool {} // @public export class ToolDocumentCollatorFactory implements DocumentCollatorFactory { - // Warning: (ae-forgotten-export) The symbol "ToolDocument" needs to be exported by the entry point index.d.ts - // // (undocumented) execute(): AsyncGenerator; - // Warning: (ae-forgotten-export) The symbol "ToolDocumentCollatorFactoryOptions" needs to be exported by the entry point index.d.ts - // // (undocumented) static fromConfig( _config: Config, @@ -56,4 +49,10 @@ export class ToolDocumentCollatorFactory implements DocumentCollatorFactory { // (undocumented) readonly type: string; } + +// @public +export type ToolDocumentCollatorFactoryOptions = { + discovery: PluginEndpointDiscovery; + logger: Logger; +}; ``` diff --git a/plugins/explore-backend/package.json b/plugins/explore-backend/package.json index 17072e261e..704eb8c7f5 100644 --- a/plugins/explore-backend/package.json +++ b/plugins/explore-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-explore-backend", - "version": "0.1.0", + "version": "0.0.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/explore-backend/src/index.ts b/plugins/explore-backend/src/index.ts index af9347377d..ca0daaa8c4 100644 --- a/plugins/explore-backend/src/index.ts +++ b/plugins/explore-backend/src/index.ts @@ -21,10 +21,9 @@ */ export * from './search'; -export { createRouter } from './service/router'; -export * from './service/types'; +export * from './service'; /** - * @private Example only - do not use in production + * @internal Example only - do not use in production */ export { getExampleTools } from './example/getExampleTools'; diff --git a/plugins/explore-backend/src/search/ToolDocumentCollatorFactory.ts b/plugins/explore-backend/src/search/ToolDocumentCollatorFactory.ts index 895eae43be..dd9872acec 100644 --- a/plugins/explore-backend/src/search/ToolDocumentCollatorFactory.ts +++ b/plugins/explore-backend/src/search/ToolDocumentCollatorFactory.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import { - IndexableDocument, - DocumentCollatorFactory, -} from '@backstage/plugin-search-common'; +import { PluginEndpointDiscovery } from '@backstage/backend-common'; import { Config } from '@backstage/config'; +import { ExploreTool } from '@backstage/plugin-explore-common'; +import { + DocumentCollatorFactory, + IndexableDocument, +} from '@backstage/plugin-search-common'; +import fetch from 'node-fetch'; import { Readable } from 'stream'; import { Logger } from 'winston'; -import { ExploreTool } from '@backstage/plugin-explore-common'; -import fetch from 'node-fetch'; -import { PluginEndpointDiscovery } from '@backstage/backend-common'; /** * Extended IndexableDocument with explore tool specific properties @@ -33,9 +33,11 @@ import { PluginEndpointDiscovery } from '@backstage/backend-common'; export interface ToolDocument extends IndexableDocument, ExploreTool {} /** - * The options for the {@link CatalogClient.ToolDocumentCollatorFactory}. + * The options for the {@link ToolDocumentCollatorFactory}. + * + * @public */ -type ToolDocumentCollatorFactoryOptions = { +export type ToolDocumentCollatorFactoryOptions = { discovery: PluginEndpointDiscovery; logger: Logger; }; diff --git a/plugins/explore-backend/src/search/index.ts b/plugins/explore-backend/src/search/index.ts index 9201518a3d..70e9414652 100644 --- a/plugins/explore-backend/src/search/index.ts +++ b/plugins/explore-backend/src/search/index.ts @@ -15,3 +15,7 @@ */ export { ToolDocumentCollatorFactory } from './ToolDocumentCollatorFactory'; +export type { + ToolDocument, + ToolDocumentCollatorFactoryOptions, +} from './ToolDocumentCollatorFactory'; diff --git a/plugins/explore-backend/src/service/index.ts b/plugins/explore-backend/src/service/index.ts new file mode 100644 index 0000000000..376a2bb98c --- /dev/null +++ b/plugins/explore-backend/src/service/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright 2022 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 { createRouter } from './router'; +export type { RouterOptions } from './router'; +export * from './types'; diff --git a/plugins/explore-backend/src/service/router.ts b/plugins/explore-backend/src/service/router.ts index 22ffcb54c9..22b5afbc87 100644 --- a/plugins/explore-backend/src/service/router.ts +++ b/plugins/explore-backend/src/service/router.ts @@ -21,11 +21,17 @@ import Router from 'express-promise-router'; import { Logger } from 'winston'; import { ExploreToolProvider } from './types'; +/** + * @public + */ export interface RouterOptions { logger: Logger; toolProvider: ExploreToolProvider; } +/** + * @public + */ export async function createRouter( options: RouterOptions, ): Promise { diff --git a/plugins/explore-backend/src/service/types.ts b/plugins/explore-backend/src/service/types.ts index c2bccaa478..3870924a50 100644 --- a/plugins/explore-backend/src/service/types.ts +++ b/plugins/explore-backend/src/service/types.ts @@ -26,8 +26,8 @@ export interface ExploreToolProvider { /** * Gets a list of explore tools filtered by the request options. * - * @param request The request options {@link GetExploreToolsRequest}. - * @returns The response {@link GetExploreToolsResponse}. + * @param request - The request options {@link @backstage/plugin-explore-common#GetExploreToolsRequest}. + * @returns The response {@link @backstage/plugin-explore-common#GetExploreToolsResponse}. */ getTools(request: GetExploreToolsRequest): Promise; } diff --git a/plugins/explore-common/README.md b/plugins/explore-common/README.md index dfd99ae24a..7e8c835660 100644 --- a/plugins/explore-common/README.md +++ b/plugins/explore-common/README.md @@ -1,3 +1,3 @@ # explore-common -Shared types for the `explore*` plugins. +Shared types for the `explore` plugin. diff --git a/plugins/explore-common/api-report.md b/plugins/explore-common/api-report.md index 79cf80186c..c9a552267c 100644 --- a/plugins/explore-common/api-report.md +++ b/plugins/explore-common/api-report.md @@ -28,10 +28,4 @@ export type GetExploreToolsRequest = { export type GetExploreToolsResponse = { tools: ExploreTool[]; }; - -// Warnings were encountered during analysis: -// -// src/index.d.ts:2:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/explore-common/package.json b/plugins/explore-common/package.json index 6365eca8e5..b1af0db63c 100644 --- a/plugins/explore-common/package.json +++ b/plugins/explore-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-explore-common", "description": "Common functionalities for the explore plugin", - "version": "0.1.0", + "version": "0.0.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/explore-common/src/index.ts b/plugins/explore-common/src/index.ts index b5721d9f57..50a9b9f649 100644 --- a/plugins/explore-common/src/index.ts +++ b/plugins/explore-common/src/index.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -/***/ /** * Common functionalities for the explore plugin. *