backend-common: migrate to use exports
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -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<T = unknown>(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)
|
||||
```
|
||||
@@ -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<void>;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export interface Context {
|
||||
readonly abortSignal: AbortSignal;
|
||||
readonly deadline: Date | undefined;
|
||||
value<T = unknown>(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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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';
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user