diff --git a/packages/backend-common/alpha-api-report.md b/packages/backend-common/alpha-api-report.md new file mode 100644 index 0000000000..9d60b68b6b --- /dev/null +++ b/packages/backend-common/alpha-api-report.md @@ -0,0 +1,32 @@ +## API Report File for "@backstage/backend-common" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { Duration } from 'luxon'; + +// @alpha +export interface Context { + readonly abortSignal: AbortSignal; + readonly deadline: Date | undefined; + value(key: string): T | undefined; +} + +// @alpha +export class Contexts { + static root(): Context; + static withAbort( + parentCtx: Context, + source: AbortController | AbortSignal, + ): Context; + static withTimeoutDuration(parentCtx: Context, timeout: Duration): Context; + static withTimeoutMillis(parentCtx: Context, timeout: number): Context; + static withValue( + parentCtx: Context, + key: string, + value: unknown | ((previous: unknown | undefined) => unknown), + ): Context; +} + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index d21ef30a0b..1cde27877b 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -20,7 +20,6 @@ import { Config } from '@backstage/config'; import { ConfigService } from '@backstage/backend-plugin-api'; import cors from 'cors'; import Docker from 'dockerode'; -import { Duration } from 'luxon'; import { ErrorRequestHandler } from 'express'; import express from 'express'; import { GerritIntegration } from '@backstage/integration'; @@ -211,29 +210,6 @@ export interface ContainerRunner { runContainer(opts: RunContainerOptions): Promise; } -// @alpha -export interface Context { - readonly abortSignal: AbortSignal; - readonly deadline: Date | undefined; - value(key: string): T | undefined; -} - -// @alpha -export class Contexts { - static root(): Context; - static withAbort( - parentCtx: Context, - source: AbortController | AbortSignal, - ): Context; - static withTimeoutDuration(parentCtx: Context, timeout: Duration): Context; - static withTimeoutMillis(parentCtx: Context, timeout: number): Context; - static withValue( - parentCtx: Context, - key: string, - value: unknown | ((previous: unknown | undefined) => unknown), - ): Context; -} - // @public export function createDatabaseClient( dbConfig: Config, diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index d356d67fab..e778e6830c 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -5,10 +5,21 @@ "main": "src/index.ts", "types": "src/index.ts", "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": "node-library" @@ -24,7 +35,7 @@ ], "license": "Apache-2.0", "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", diff --git a/packages/backend-common/src/alpha.ts b/packages/backend-common/src/alpha.ts new file mode 100644 index 0000000000..e0a5b2ddc2 --- /dev/null +++ b/packages/backend-common/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 * from './context'; diff --git a/packages/backend-common/src/index.ts b/packages/backend-common/src/index.ts index 46639a1923..afb12115b2 100644 --- a/packages/backend-common/src/index.ts +++ b/packages/backend-common/src/index.ts @@ -24,7 +24,6 @@ export { legacyPlugin, makeLegacyPlugin } from './legacy'; export type { LegacyCreateRouter } from './legacy'; export * from './cache'; export { loadBackendConfig } from './config'; -export * from './context'; export * from './database'; export * from './discovery'; export * from './hot';