backend-plugin-api: moved loggerToWinstonLogger to backend-common

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-01-03 15:43:07 +01:00
parent 19843ff915
commit 8e06f3cf00
32 changed files with 68 additions and 53 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-common': patch
---
Added `loggerToWinstonLogger`, which was moved from `@backstage/backend-plugin-api`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-plugin-api': minor
---
Moved `loggerToWinstonLogger` to `@backstage/backend-common`.
+19
View File
@@ -0,0 +1,19 @@
---
'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch
'@backstage/plugin-catalog-backend-module-bitbucket-server': patch
'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch
'@backstage/plugin-catalog-backend-module-msgraph': patch
'@backstage/plugin-catalog-backend-module-gerrit': patch
'@backstage/plugin-catalog-backend-module-github': patch
'@backstage/plugin-catalog-backend-module-gitlab': patch
'@backstage/plugin-events-backend-module-aws-sqs': patch
'@backstage/plugin-catalog-backend-module-azure': patch
'@backstage/plugin-catalog-backend-module-aws': patch
'@backstage/plugin-scaffolder-backend': patch
'@backstage/backend-app-api': patch
'@backstage/plugin-catalog-backend': patch
'@backstage/plugin-events-backend': patch
'@backstage/plugin-app-backend': patch
---
Switched imports of `loggerToWinstonLogger` to `@backstage/backend-common`.
@@ -14,11 +14,13 @@
* limitations under the License.
*/
import { loadBackendConfig } from '@backstage/backend-common';
import {
loadBackendConfig,
loggerToWinstonLogger,
} from '@backstage/backend-common';
import {
coreServices,
createServiceFactory,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
/** @public */
@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { loggerToWinstonLogger } from '@backstage/backend-common';
import {
createServiceFactory,
coreServices,
loggerToWinstonLogger,
LifecycleServiceShutdownHook,
RootLifecycleService,
} from '@backstage/backend-plugin-api';
@@ -17,9 +17,11 @@
import {
coreServices,
createServiceFactory,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { ServerTokenManager } from '@backstage/backend-common';
import {
loggerToWinstonLogger,
ServerTokenManager,
} from '@backstage/backend-common';
/** @public */
export const tokenManagerFactory = createServiceFactory({
@@ -14,11 +14,10 @@
* limitations under the License.
*/
import { UrlReaders } from '@backstage/backend-common';
import { loggerToWinstonLogger, UrlReaders } from '@backstage/backend-common';
import {
coreServices,
createServiceFactory,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
/** @public */
+8
View File
@@ -29,6 +29,7 @@ import { Knex } from 'knex';
import { KubeConfig } from '@kubernetes/client-node';
import { LoadConfigOptionsRemote } from '@backstage/config-loader';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { MergeResult } from 'isomorphic-git';
import { DiscoveryService as PluginEndpointDiscovery } from '@backstage/backend-plugin-api';
import { PushResult } from 'isomorphic-git';
@@ -46,6 +47,7 @@ import { SearchOptions } from '@backstage/backend-plugin-api';
import { SearchResponse } from '@backstage/backend-plugin-api';
import { SearchResponseFile } from '@backstage/backend-plugin-api';
import { Server } from 'http';
import { TransportStreamOptions } from 'winston-transport';
import { UrlReaderService as UrlReader } from '@backstage/backend-plugin-api';
import { V1PodTemplateSpec } from '@kubernetes/client-node';
import * as winston from 'winston';
@@ -515,6 +517,12 @@ export function loadBackendConfig(options: {
argv: string[];
}): Promise<Config>;
// @public (undocumented)
export function loggerToWinstonLogger(
logger: LoggerService,
opts?: TransportStreamOptions,
): Logger;
// @public
export function notFoundHandler(): RequestHandler;
+1
View File
@@ -83,6 +83,7 @@
"tar": "^6.1.12",
"uuid": "^8.3.2",
"winston": "^3.2.1",
"winston-transport": "^4.5.0",
"yauzl": "^2.10.0",
"yn": "^4.0.0"
},
@@ -22,3 +22,4 @@ export {
redactWinstonLogLine,
} from './rootLogger';
export * from './voidLogger';
export { loggerToWinstonLogger } from './loggerToWinstonLogger';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { LoggerService } from '../definitions';
import { LoggerService } from '@backstage/backend-plugin-api';
import { Logger as WinstonLogger, createLogger } from 'winston';
import Transport, { TransportStreamOptions } from 'winston-transport';
@@ -7,14 +7,12 @@
import { Config } from '@backstage/config';
import { Handler } from 'express';
import { Logger } from 'winston';
import { PermissionEvaluator } from '@backstage/plugin-permission-common';
import { PluginCacheManager } from '@backstage/backend-common';
import { PluginDatabaseManager } from '@backstage/backend-common';
import { PluginTaskScheduler } from '@backstage/backend-tasks';
import { Readable } from 'stream';
import { TokenManager } from '@backstage/backend-common';
import { TransportStreamOptions } from 'winston-transport';
// @public (undocumented)
export interface BackendFeature {
@@ -201,12 +199,6 @@ export interface LoggerService {
warn(message: string, meta?: Error | LogMeta): void;
}
// @public (undocumented)
export function loggerToWinstonLogger(
logger: LoggerService,
opts?: TransportStreamOptions,
): Logger;
// @public (undocumented)
export type LogMeta = {
[name: string]: unknown;
+1 -3
View File
@@ -38,9 +38,7 @@
"@backstage/config": "workspace:^",
"@backstage/plugin-permission-common": "workspace:^",
"@types/express": "^4.17.6",
"express": "^4.17.1",
"winston": "^3.2.1",
"winston-transport": "^4.5.0"
"express": "^4.17.1"
},
"devDependencies": {
"@backstage/cli": "workspace:^"
@@ -1,17 +0,0 @@
/*
* 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 { loggerToWinstonLogger } from './loggerToWinstonLogger';
@@ -15,5 +15,4 @@
*/
export * from './definitions';
export * from './helpers';
export * from './system';
+1 -1
View File
@@ -18,9 +18,9 @@ import express from 'express';
import {
coreServices,
createBackendPlugin,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { createRouter } from './router';
import { loggerToWinstonLogger } from '@backstage/backend-common';
/** @alpha */
export type AppPluginOptions = {
@@ -14,10 +14,10 @@
* limitations under the License.
*/
import { loggerToWinstonLogger } from '@backstage/backend-common';
import {
coreServices,
createBackendModule,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node';
import { AwsS3EntityProvider } from '../providers';
@@ -14,9 +14,9 @@
* limitations under the License.
*/
import { loggerToWinstonLogger } from '@backstage/backend-common';
import {
createBackendModule,
loggerToWinstonLogger,
coreServices,
} from '@backstage/backend-plugin-api';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node';
@@ -14,10 +14,10 @@
* limitations under the License.
*/
import { loggerToWinstonLogger } from '@backstage/backend-common';
import {
coreServices,
createBackendModule,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import {
catalogProcessingExtensionPoint,
@@ -14,10 +14,10 @@
* limitations under the License.
*/
import { loggerToWinstonLogger } from '@backstage/backend-common';
import {
coreServices,
createBackendModule,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node';
import { BitbucketServerEntityProvider } from '../providers';
@@ -14,10 +14,10 @@
* limitations under the License.
*/
import { loggerToWinstonLogger } from '@backstage/backend-common';
import {
coreServices,
createBackendModule,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node';
import { GerritEntityProvider } from '../providers/GerritEntityProvider';
@@ -16,9 +16,9 @@
import {
createBackendModule,
loggerToWinstonLogger,
coreServices,
} from '@backstage/backend-plugin-api';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node';
import { GithubEntityProvider } from '../providers/GithubEntityProvider';
@@ -16,9 +16,9 @@
import {
createBackendModule,
loggerToWinstonLogger,
coreServices,
} from '@backstage/backend-plugin-api';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node';
import { GitlabDiscoveryEntityProvider } from '../providers';
@@ -18,8 +18,8 @@ import {
ConfigService,
LoggerService,
SchedulerService,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import { stringifyError } from '@backstage/errors';
import {
EntityProvider,
@@ -34,6 +34,7 @@
},
"dependencies": {
"@azure/identity": "^2.1.0",
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/backend-tasks": "workspace:^",
"@backstage/catalog-model": "workspace:^",
@@ -17,8 +17,8 @@
import {
coreServices,
createBackendModule,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node';
import {
GroupTransformer,
@@ -16,7 +16,6 @@
import {
createBackendPlugin,
coreServices,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { CatalogBuilder } from './CatalogBuilder';
import {
@@ -25,6 +24,7 @@ import {
catalogProcessingExtensionPoint,
EntityProvider,
} from '@backstage/plugin-catalog-node';
import { loggerToWinstonLogger } from '@backstage/backend-common';
class CatalogExtensionPointImpl implements CatalogProcessingExtensionPoint {
#processors = new Array<CatalogProcessor>();
@@ -24,6 +24,7 @@
},
"dependencies": {
"@aws-sdk/client-sqs": "^3.208.0",
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/backend-tasks": "workspace:^",
"@backstage/config": "workspace:^",
@@ -17,8 +17,8 @@
import {
coreServices,
createBackendModule,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import { eventsExtensionPoint } from '@backstage/plugin-events-node';
import { AwsSqsConsumingEventPublisher } from '../publisher/AwsSqsConsumingEventPublisher';
@@ -17,8 +17,8 @@
import {
createBackendPlugin,
coreServices,
loggerToWinstonLogger,
} from '@backstage/backend-plugin-api';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import {
EventBroker,
EventPublisher,
@@ -16,9 +16,9 @@
import {
createBackendPlugin,
coreServices,
loggerToWinstonLogger,
createExtensionPoint,
} from '@backstage/backend-plugin-api';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import { ScmIntegrations } from '@backstage/integration';
import { catalogServiceRef } from '@backstage/plugin-catalog-node';
import { TemplateFilter, TemplateGlobal } from './lib';
+1 -2
View File
@@ -3466,6 +3466,7 @@ __metadata:
tar: ^6.1.12
uuid: ^8.3.2
winston: ^3.2.1
winston-transport: ^4.5.0
yauzl: ^2.10.0
yn: ^4.0.0
peerDependencies:
@@ -3497,8 +3498,6 @@ __metadata:
"@backstage/plugin-permission-common": "workspace:^"
"@types/express": ^4.17.6
express: ^4.17.1
winston: ^3.2.1
winston-transport: ^4.5.0
languageName: unknown
linkType: soft