From d871c5627acc58e5b2bd7f9b7c4465eb40665bc0 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Mon, 13 May 2024 17:34:32 +0200 Subject: [PATCH] refactor: apply review suggestions Signed-off-by: Camila Belo --- packages/backend-common/src/deprecated.ts | 28 ----------------- packages/backend-common/src/index.ts | 6 +--- packages/backend-common/src/testUtils.ts | 32 +++++++++++++++++--- packages/backend-plugin-api/src/testUtils.ts | 2 -- 4 files changed, 28 insertions(+), 40 deletions(-) diff --git a/packages/backend-common/src/deprecated.ts b/packages/backend-common/src/deprecated.ts index cee15aadb6..4589303e4b 100644 --- a/packages/backend-common/src/deprecated.ts +++ b/packages/backend-common/src/deprecated.ts @@ -20,34 +20,6 @@ import { isChildPath as _isChildPath, } from '@backstage/backend-plugin-api'; -import { - overridePackagePathResolution as _overridePackagePathResolution, - OverridePackagePathResolutionOptions as _OverridePackagePathResolutionOptions, - PackagePathResolutionOverride as _PackagePathResolutionOverride, -} from '@backstage/backend-plugin-api/testUtils'; - -/** - * @public - * @deprecated This function is deprecated and will be removed in future release, see https://github.com/backstage/backstage/issues/24493. - * Please use the `overridePackagePathResolution` function from the `@backstage/backend-plugin-api/testUtils` package instead. - */ -export const overridePackagePathResolution = _overridePackagePathResolution; - -/** - * @public - * @deprecated This type is deprecated and will be removed in a future release, see https://github.com/backstage/backstage/issues/24493. - * Please use the `OverridePackagePathResolutionOptions` type from the `@backstage/backend-plugin-api/testUtils` package instead. - */ -export type OverridePackagePathResolutionOptions = - _OverridePackagePathResolutionOptions; - -/** - * @public - * @deprecated This type is deprecated and will be removed in a future release, see https://github.com/backstage/backstage/issues/24493. - * Please use the `PackagePathResolutionOverride` type from the `@backstage/backend-plugin-api/testUtils` package instead. - */ -export type PackagePathResolutionOverride = _PackagePathResolutionOverride; - /** * @public * @deprecated This type is deprecated and will be removed in a future release, see https://github.com/backstage/backstage/issues/24493. diff --git a/packages/backend-common/src/index.ts b/packages/backend-common/src/index.ts index 1d01410408..0c435ad9de 100644 --- a/packages/backend-common/src/index.ts +++ b/packages/backend-common/src/index.ts @@ -25,11 +25,7 @@ export type { LegacyCreateRouter } from './legacy'; export * from './auth'; export * from './cache'; export { loadBackendConfig } from './config'; -export { - resolvePackagePath, - resolveSafeChildPath, - isChildPath, -} from './deprecated'; +export * from './deprecated'; export * from './database'; export * from './discovery'; export * from './hot'; diff --git a/packages/backend-common/src/testUtils.ts b/packages/backend-common/src/testUtils.ts index bae633428f..397d97f20e 100644 --- a/packages/backend-common/src/testUtils.ts +++ b/packages/backend-common/src/testUtils.ts @@ -14,8 +14,30 @@ * limitations under the License. */ -export { - overridePackagePathResolution, - type OverridePackagePathResolutionOptions, - type PackagePathResolutionOverride, -} from './deprecated'; +import { + overridePackagePathResolution as _overridePackagePathResolution, + OverridePackagePathResolutionOptions as _OverridePackagePathResolutionOptions, + PackagePathResolutionOverride as _PackagePathResolutionOverride, +} from '@backstage/backend-plugin-api/testUtils'; + +/** + * @public + * @deprecated This function is deprecated and will be removed in future release, see https://github.com/backstage/backstage/issues/24493. + * Please use the `overridePackagePathResolution` function from the `@backstage/backend-plugin-api/testUtils` package instead. + */ +export const overridePackagePathResolution = _overridePackagePathResolution; + +/** + * @public + * @deprecated This type is deprecated and will be removed in a future release, see https://github.com/backstage/backstage/issues/24493. + * Please use the `OverridePackagePathResolutionOptions` type from the `@backstage/backend-plugin-api/testUtils` package instead. + */ +export type OverridePackagePathResolutionOptions = + _OverridePackagePathResolutionOptions; + +/** + * @public + * @deprecated This type is deprecated and will be removed in a future release, see https://github.com/backstage/backstage/issues/24493. + * Please use the `PackagePathResolutionOverride` type from the `@backstage/backend-plugin-api/testUtils` package instead. + */ +export type PackagePathResolutionOverride = _PackagePathResolutionOverride; diff --git a/packages/backend-plugin-api/src/testUtils.ts b/packages/backend-plugin-api/src/testUtils.ts index ba09145bf0..9616ab1701 100644 --- a/packages/backend-plugin-api/src/testUtils.ts +++ b/packages/backend-plugin-api/src/testUtils.ts @@ -14,8 +14,6 @@ * limitations under the License. */ -// TODO: Remove this relative import when extrating the path utilities to this package -// eslint-disable-next-line @backstage/no-relative-monorepo-imports import { packagePathMocks } from './paths'; import { posix as posixPath, resolve as resolvePath } from 'path';