From cae21dc41271773f82c212faa8891b5951f6ac6f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 16 Jan 2023 00:34:03 +0100 Subject: [PATCH] catalog-backend-module-github: migrate to use exports Signed-off-by: Patrik Oldsberg --- .../alpha-api-report.md | 14 ++++++++++++ .../api-report.md | 4 ---- .../package.json | 22 ++++++++++++++----- .../src/alpha.ts | 17 ++++++++++++++ .../src/index.ts | 1 - 5 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 plugins/catalog-backend-module-github/alpha-api-report.md create mode 100644 plugins/catalog-backend-module-github/src/alpha.ts diff --git a/plugins/catalog-backend-module-github/alpha-api-report.md b/plugins/catalog-backend-module-github/alpha-api-report.md new file mode 100644 index 0000000000..8522344433 --- /dev/null +++ b/plugins/catalog-backend-module-github/alpha-api-report.md @@ -0,0 +1,14 @@ +## API Report File for "@backstage/plugin-catalog-backend-module-github" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; + +// Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/plugin-catalog-backend-module-github" does not have an export "GithubEntityProvider" +// +// @alpha +export const githubEntityProviderCatalogModule: () => BackendFeature; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/catalog-backend-module-github/api-report.md b/plugins/catalog-backend-module-github/api-report.md index a66ec712c7..e2b73d267b 100644 --- a/plugins/catalog-backend-module-github/api-report.md +++ b/plugins/catalog-backend-module-github/api-report.md @@ -4,7 +4,6 @@ ```ts import { AnalyzeOptions } from '@backstage/plugin-catalog-backend'; -import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogProcessor } from '@backstage/plugin-catalog-backend'; import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend'; import { Config } from '@backstage/config'; @@ -100,9 +99,6 @@ export class GithubEntityProvider implements EntityProvider, EventSubscriber { supportsEventTopics(): string[]; } -// @alpha -export const githubEntityProviderCatalogModule: () => BackendFeature; - // @public (undocumented) export class GithubLocationAnalyzer implements ScmLocationAnalyzer { constructor(options: GithubLocationAnalyzerOptions); diff --git a/plugins/catalog-backend-module-github/package.json b/plugins/catalog-backend-module-github/package.json index 5d8c5f3659..6ef4fea0c7 100644 --- a/plugins/catalog-backend-module-github/package.json +++ b/plugins/catalog-backend-module-github/package.json @@ -6,10 +6,21 @@ "types": "src/index.ts", "license": "Apache-2.0", "publishConfig": { - "access": "public", - "main": "dist/index.cjs.js", - "types": "dist/index.d.ts", - "alphaTypes": "dist/index.alpha.d.ts" + "access": "public" + }, + "exports": { + ".": "./src/index.ts", + "./alpha": "./src/alpha.ts" + }, + "typesVersions": { + "*": { + "*": [ + "src/index.ts" + ], + "alpha": [ + "src/alpha.ts" + ] + } }, "backstage": { "role": "backend-plugin-module" @@ -24,7 +35,7 @@ "backstage" ], "scripts": { - "build": "backstage-cli package build --experimental-type-build", + "build": "backstage-cli package build", "lint": "backstage-cli package lint", "test": "backstage-cli package test", "prepack": "backstage-cli package prepack", @@ -64,7 +75,6 @@ }, "files": [ "dist", - "alpha", "config.d.ts" ], "configSchema": "config.d.ts" diff --git a/plugins/catalog-backend-module-github/src/alpha.ts b/plugins/catalog-backend-module-github/src/alpha.ts new file mode 100644 index 0000000000..1b83eead82 --- /dev/null +++ b/plugins/catalog-backend-module-github/src/alpha.ts @@ -0,0 +1,17 @@ +/* + * 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 { githubEntityProviderCatalogModule } from './service/GithubEntityProviderCatalogModule'; diff --git a/plugins/catalog-backend-module-github/src/index.ts b/plugins/catalog-backend-module-github/src/index.ts index b005780758..17c769419f 100644 --- a/plugins/catalog-backend-module-github/src/index.ts +++ b/plugins/catalog-backend-module-github/src/index.ts @@ -28,7 +28,6 @@ export { GithubOrgReaderProcessor } from './processors/GithubOrgReaderProcessor' export { GithubEntityProvider } from './providers/GithubEntityProvider'; export { GithubOrgEntityProvider } from './providers/GithubOrgEntityProvider'; export type { GithubOrgEntityProviderOptions } from './providers/GithubOrgEntityProvider'; -export { githubEntityProviderCatalogModule } from './service/GithubEntityProviderCatalogModule'; export { type GithubMultiOrgConfig, type GithubTeam,