Just some more circular dep cleanup

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2025-06-25 10:10:49 +02:00
parent 129cf06d8c
commit 3507fcdf89
35 changed files with 102 additions and 85 deletions
+17
View File
@@ -0,0 +1,17 @@
---
'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch
'@backstage/plugin-search-backend-module-elasticsearch': patch
'@backstage/backend-dynamic-feature-service': patch
'@backstage/plugin-catalog-backend-module-puppetdb': patch
'@backstage/plugin-catalog-backend-module-msgraph': patch
'@backstage/plugin-catalog-backend-module-ldap': patch
'@backstage/frontend-app-api': patch
'@backstage/plugin-permission-common': patch
'@backstage/plugin-kubernetes-node': patch
'@backstage/plugin-permission-node': patch
'@backstage/catalog-model': patch
'@backstage/plugin-catalog-react': patch
'@backstage/config': patch
---
Just some more circular dep cleanup
@@ -13,14 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
coreServices,
createServiceFactory,
createServiceRef,
} from '@backstage/backend-plugin-api';
import { createRouter } from './router';
import { dynamicPluginsServiceRef } from '../manager';
import { spec } from '../schema/openapi';
import { dynamicPluginsServiceRef } from '../manager/plugin-manager';
import { spec } from '../schema/openapi/generated';
import { ManifestFileName } from '@module-federation/sdk';
import { RemoteInfo } from '../schema/openapi/generated/models';
import { JsonObject } from '@backstage/types';
@@ -19,8 +19,8 @@ import {
RootConfigService,
} from '@backstage/backend-plugin-api';
import express from 'express';
import { createOpenApiRouter, spec } from '../schema/openapi';
import { DynamicPluginProvider } from '../manager';
import { createOpenApiRouter, spec } from '../schema/openapi/generated';
import { DynamicPluginProvider } from '../manager/types';
import * as fs from 'fs';
import * as path from 'path';
import * as url from 'url';
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { Entity } from '../entity';
import { Entity } from '../entity/Entity';
/**
* Validates entities of a certain kind.
@@ -14,7 +14,8 @@
* limitations under the License.
*/
import { Entity, stringifyEntityRef } from '../entity';
import { Entity } from '../entity/Entity';
import { stringifyEntityRef } from '../entity/ref';
import { ANNOTATION_LOCATION, ANNOTATION_SOURCE_LOCATION } from './annotation';
// See https://github.com/facebook/react/blob/f0cf832e1d0c8544c36aa8b310960885a11a847c/packages/react-dom-bindings/src/shared/sanitizeURL.js
@@ -15,7 +15,7 @@
*/
import { Schema } from 'ajv';
import { Entity } from '../entity';
import { Entity } from '../entity/Entity';
import { compileAjvSchema, throwAjvError } from './ajv';
/**
+1 -2
View File
@@ -3,7 +3,6 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { Config as Config_2 } from '@backstage/config';
import { HumanDuration } from '@backstage/types';
import type { JsonArray as JsonArray_2 } from '@backstage/types';
import { JsonObject as JsonObject_2 } from '@backstage/types';
@@ -85,7 +84,7 @@ export type JsonValue = JsonValue_2;
// @public
export function readDurationFromConfig(
config: Config_2,
config: Config,
options?: {
key?: string;
},
@@ -14,10 +14,10 @@
* limitations under the License.
*/
import { Config } from '@backstage/config';
import { InputError, stringifyError } from '@backstage/errors';
import { HumanDuration } from '@backstage/types';
import ms from 'ms';
import { Config } from './types';
export const propsOfHumanDuration = [
'years',
@@ -25,7 +25,7 @@ import {
} from '../../../frontend-plugin-api/src/wiring/createFrontendModule';
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
import { toInternalExtension } from '../../../frontend-plugin-api/src/wiring/resolveExtensionDefinition';
import { FrontendFeature } from '../wiring';
import { FrontendFeature } from '../wiring/types';
/** @internal */
export function resolveAppNodeSpecs(options: {
@@ -8,8 +8,6 @@ import type { DeferredEntity } from '@backstage/plugin-catalog-node';
import { EventParams } from '@backstage/plugin-events-node';
import { ExtensionPoint } from '@backstage/backend-plugin-api';
import { HumanDuration } from '@backstage/types';
import { IncrementalEntityProvider as IncrementalEntityProvider_2 } from '@backstage/plugin-catalog-backend-module-incremental-ingestion';
import { IncrementalEntityProviderOptions as IncrementalEntityProviderOptions_2 } from '@backstage/plugin-catalog-backend-module-incremental-ingestion';
// @public
const catalogModuleIncrementalIngestionEntityProvider: BackendFeature;
@@ -68,8 +66,8 @@ export interface IncrementalEntityProviderOptions {
// @public
export interface IncrementalIngestionProviderExtensionPoint {
addProvider<TCursor, TContext>(config: {
options: IncrementalEntityProviderOptions_2;
provider: IncrementalEntityProvider_2<TCursor, TContext>;
options: IncrementalEntityProviderOptions;
provider: IncrementalEntityProvider<TCursor, TContext>;
}): void;
}
@@ -20,12 +20,12 @@ import {
createExtensionPoint,
} from '@backstage/backend-plugin-api';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { WrapperProviders } from './WrapperProviders';
import { eventsServiceRef } from '@backstage/plugin-events-node';
import {
IncrementalEntityProvider,
IncrementalEntityProviderOptions,
} from '@backstage/plugin-catalog-backend-module-incremental-ingestion';
import { WrapperProviders } from './WrapperProviders';
import { eventsServiceRef } from '@backstage/plugin-events-node';
} from '../types';
/**
* @public
@@ -12,7 +12,6 @@ import { EntityProvider } from '@backstage/plugin-catalog-node';
import { EntityProviderConnection } from '@backstage/plugin-catalog-node';
import { ExtensionPoint } from '@backstage/backend-plugin-api';
import { GroupEntity } from '@backstage/catalog-model';
import { GroupTransformer as GroupTransformer_2 } from '@backstage/plugin-catalog-backend-module-ldap';
import { JsonValue } from '@backstage/types';
import { LocationSpec } from '@backstage/plugin-catalog-common';
import { LoggerService } from '@backstage/backend-plugin-api';
@@ -22,7 +21,6 @@ import { SchedulerServiceTaskScheduleDefinition } from '@backstage/backend-plugi
import { SearchEntry } from 'ldapjs';
import { SearchOptions } from 'ldapjs';
import { UserEntity } from '@backstage/catalog-model';
import { UserTransformer as UserTransformer_2 } from '@backstage/plugin-catalog-backend-module-ldap';
// @public
export type BindConfig = {
@@ -152,10 +150,10 @@ export type LdapOrgEntityProviderOptions =
// @public
export interface LdapOrgEntityProviderTransformsExtensionPoint {
setGroupTransformer(
transformer: GroupTransformer_2 | Record<string, GroupTransformer_2>,
transformer: GroupTransformer | Record<string, GroupTransformer>,
): void;
setUserTransformer(
transformer: UserTransformer_2 | Record<string, UserTransformer_2>,
transformer: UserTransformer | Record<string, UserTransformer>,
): void;
}
@@ -20,11 +20,8 @@ import {
createExtensionPoint,
} from '@backstage/backend-plugin-api';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import {
GroupTransformer,
UserTransformer,
} from '@backstage/plugin-catalog-backend-module-ldap';
import { LdapOrgEntityProvider } from './processors';
import { GroupTransformer, UserTransformer } from './ldap/types';
/**
* Interface for {@link LdapOrgEntityProviderTransformsExtensionPoint}.
@@ -11,18 +11,14 @@ import { EntityProvider } from '@backstage/plugin-catalog-node';
import { EntityProviderConnection } from '@backstage/plugin-catalog-node';
import { ExtensionPoint } from '@backstage/backend-plugin-api';
import { GroupEntity } from '@backstage/catalog-model';
import { GroupTransformer as GroupTransformer_2 } from '@backstage/plugin-catalog-backend-module-msgraph';
import { LocationSpec } from '@backstage/plugin-catalog-common';
import { LoggerService } from '@backstage/backend-plugin-api';
import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
import { OrganizationTransformer as OrganizationTransformer_2 } from '@backstage/plugin-catalog-backend-module-msgraph';
import { ProviderConfigTransformer as ProviderConfigTransformer_2 } from '@backstage/plugin-catalog-backend-module-msgraph';
import { SchedulerService } from '@backstage/backend-plugin-api';
import { SchedulerServiceTaskRunner } from '@backstage/backend-plugin-api';
import { SchedulerServiceTaskScheduleDefinition } from '@backstage/backend-plugin-api';
import { TokenCredential } from '@azure/identity';
import { UserEntity } from '@backstage/catalog-model';
import { UserTransformer as UserTransformer_2 } from '@backstage/plugin-catalog-backend-module-msgraph';
// @public
const catalogModuleMicrosoftGraphOrgEntityProvider: BackendFeature;
@@ -184,20 +180,20 @@ export const microsoftGraphOrgEntityProviderTransformExtensionPoint: ExtensionPo
// @public
export interface MicrosoftGraphOrgEntityProviderTransformsExtensionPoint {
setGroupTransformer(
transformer: GroupTransformer_2 | Record<string, GroupTransformer_2>,
transformer: GroupTransformer | Record<string, GroupTransformer>,
): void;
setOrganizationTransformer(
transformer:
| OrganizationTransformer_2
| Record<string, OrganizationTransformer_2>,
| OrganizationTransformer
| Record<string, OrganizationTransformer>,
): void;
setProviderConfigTransformer(
transformer:
| ProviderConfigTransformer_2
| Record<string, ProviderConfigTransformer_2>,
| ProviderConfigTransformer
| Record<string, ProviderConfigTransformer>,
): void;
setUserTransformer(
transformer: UserTransformer_2 | Record<string, UserTransformer_2>,
transformer: UserTransformer | Record<string, UserTransformer>,
): void;
}
@@ -25,7 +25,7 @@ import {
OrganizationTransformer,
ProviderConfigTransformer,
UserTransformer,
} from '@backstage/plugin-catalog-backend-module-msgraph';
} from '../microsoftGraph/types';
import { MicrosoftGraphOrgEntityProvider } from '../processors';
/**
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { PuppetDbEntityProviderConfig } from '../providers';
import { PuppetDbEntityProviderConfig } from '../providers/PuppetDbEntityProviderConfig';
import { PuppetNode, ResourceTransformer } from './types';
import { ResourceEntity } from '@backstage/catalog-model';
import { defaultResourceTransformer } from './transformers';
@@ -27,7 +27,7 @@ import {
entityContentGroupDataRef,
defaultEntityContentGroups,
} from './extensionData';
import { EntityPredicate } from '../predicates';
import { EntityPredicate } from '../predicates/types';
import { resolveEntityFilterData } from './resolveEntityFilterData';
import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';
import { Entity } from '@backstage/catalog-model';
@@ -25,7 +25,7 @@ import {
EntityCardType,
} from './extensionData';
import { JSX } from 'react';
import { EntityPredicate } from '../predicates';
import { EntityPredicate } from '../predicates/types';
import { resolveEntityFilterData } from './resolveEntityFilterData';
import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';
import { Entity } from '@backstage/catalog-model';
@@ -24,10 +24,8 @@ import MenuItem from '@material-ui/core/MenuItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
import { useEntityContextMenu } from '../../hooks/useEntityContextMenu';
import {
EntityPredicate,
entityPredicateToFilterFunction,
} from '../predicates';
import { EntityPredicate } from '../predicates/types';
import { entityPredicateToFilterFunction } from '../predicates/entityPredicateToFilterFunction';
import type { Entity } from '@backstage/catalog-model';
import { entityFilterFunctionDataRef } from './extensionData';
import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';
@@ -20,7 +20,7 @@ import {
createExtensionDataRef,
} from '@backstage/frontend-plugin-api';
import { EntityPredicate } from '../predicates';
import { EntityPredicate } from '../predicates/types';
import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';
import {
@@ -18,9 +18,9 @@ import { compatWrapper } from '@backstage/core-compat-api';
import { BackstagePlugin, getComponentData } from '@backstage/core-plugin-api';
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
import { ComponentType } from 'react';
import { EntityCardBlueprint } from '../blueprints';
import { EntityCardBlueprint } from '../blueprints/EntityCardBlueprint';
import kebabCase from 'lodash/kebabCase';
import { EntityPredicate } from '../predicates';
import { EntityPredicate } from '../predicates/types';
import { Entity } from '@backstage/catalog-model';
/** @alpha */
@@ -27,8 +27,8 @@ import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
import kebabCase from 'lodash/kebabCase';
import startCase from 'lodash/startCase';
import { ComponentType } from 'react';
import { EntityContentBlueprint } from '../blueprints';
import { EntityPredicate } from '../predicates';
import { EntityContentBlueprint } from '../blueprints/EntityContentBlueprint';
import { EntityPredicate } from '../predicates/types';
import { Entity } from '@backstage/catalog-model';
/** @alpha */
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { EntityPredicate, EntityPredicateValue } from '.';
import { EntityPredicate, EntityPredicateValue } from './types';
import type { z as zImpl, ZodType } from 'zod';
/** @internal */
+1 -2
View File
@@ -5,7 +5,6 @@
```ts
import { AuthenticationStrategy as AuthenticationStrategy_2 } from '@backstage/plugin-kubernetes-node';
import { BackstageCredentials } from '@backstage/backend-plugin-api';
import { ClusterDetails as ClusterDetails_2 } from '@backstage/plugin-kubernetes-node';
import { CustomResourceMatcher } from '@backstage/plugin-kubernetes-common';
import { Entity } from '@backstage/catalog-model';
import { ExtensionPoint } from '@backstage/backend-plugin-api';
@@ -256,7 +255,7 @@ export class PinnipedHelper {
constructor(logger: LoggerService);
// (undocumented)
tokenCredentialRequest(
clusterDetails: ClusterDetails_2,
clusterDetails: ClusterDetails,
pinnipedParams: PinnipedParameters,
): Promise<PinnipedClientCerts>;
}
@@ -15,9 +15,9 @@
*/
import { LoggerService } from '@backstage/backend-plugin-api';
import { ClusterDetails } from '@backstage/plugin-kubernetes-node';
import * as https from 'https';
import fetch, { RequestInit } from 'node-fetch';
import { ClusterDetails } from '../types/types';
/**
*
@@ -0,0 +1,30 @@
/*
* Copyright 2025 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.
*/
import { EvaluatePermissionRequest, EvaluatePermissionResponse } from './api';
import { AuthorizeRequestOptions } from './permission';
/**
* A client interacting with the permission backend can implement this authorizer interface.
* @public
* @deprecated Use {@link @backstage/plugin-permission-common#PermissionEvaluator} instead
*/
export interface PermissionAuthorizer {
authorize(
requests: EvaluatePermissionRequest[],
options?: AuthorizeRequestOptions,
): Promise<EvaluatePermissionResponse[]>;
}
+1 -1
View File
@@ -48,8 +48,8 @@ export type {
BasicPermission,
PermissionAttributes,
Permission,
PermissionAuthorizer,
PermissionBase,
ResourcePermission,
AuthorizeRequestOptions,
} from './permission';
export type { PermissionAuthorizer } from './deprecated';
@@ -14,8 +14,6 @@
* limitations under the License.
*/
import { EvaluatePermissionRequest, EvaluatePermissionResponse } from './api';
/**
* The attributes related to a given permission; these should be generic and widely applicable to
* all permissions in the system.
@@ -88,18 +86,6 @@ export type ResourcePermission<TResourceType extends string = string> =
}
>;
/**
* A client interacting with the permission backend can implement this authorizer interface.
* @public
* @deprecated Use {@link @backstage/plugin-permission-common#PermissionEvaluator} instead
*/
export interface PermissionAuthorizer {
authorize(
requests: EvaluatePermissionRequest[],
options?: AuthorizeRequestOptions,
): Promise<EvaluatePermissionResponse[]>;
}
/**
* Options for authorization requests.
* @public
+1 -1
View File
@@ -21,5 +21,5 @@
*/
export * from './integration';
export * from './policy';
export * from './types';
export type { PermissionRule, PermissionRuleset } from './types';
export { ServerPermissionClient } from './ServerPermissionClient';
@@ -30,9 +30,8 @@ import {
PermissionCriteria,
PolicyDecision,
} from '@backstage/plugin-permission-common';
import { PermissionRule, PermissionRuleset } from '../types';
import { NoInfer, PermissionRule, PermissionRuleset } from '../types';
import {
NoInfer,
createGetRule,
isAndCriteria,
isNotCriteria,
@@ -18,10 +18,9 @@ import {
PermissionCriteria,
PermissionRuleParams,
} from '@backstage/plugin-permission-common';
import { PermissionRule } from '../types';
import { NoInfer, PermissionRule } from '../types';
import { z } from 'zod';
import { PermissionResourceRef } from './createPermissionResourceRef';
import { NoInfer } from './util';
/**
* @public
@@ -22,14 +22,6 @@ import {
} from '@backstage/plugin-permission-common';
import { PermissionRule } from '../types';
/**
* Prevent use of type parameter from contributing to type inference.
*
* https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-980401795
* @ignore
*/
export type NoInfer<T> = T extends infer S ? S : never;
/**
* Utility function used to parse a PermissionCriteria
* @param criteria - a PermissionCriteria
+9 -1
View File
@@ -19,7 +19,15 @@ import type {
PermissionRuleParams,
} from '@backstage/plugin-permission-common';
import { z } from 'zod';
import { NoInfer } from './integration/util';
/**
* Prevent use of type parameter from contributing to type inference.
*
* https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-980401795
*
* @ignore
*/
export type NoInfer<T> = T extends infer S ? S : never;
/**
* A conditional rule that can be provided in an
@@ -11,7 +11,6 @@ import { BulkHelper } from '@elastic/elasticsearch/lib/Helpers';
import { BulkStats } from '@elastic/elasticsearch/lib/Helpers';
import { Config } from '@backstage/config';
import type { ConnectionOptions } from 'tls';
import { ElasticSearchQueryTranslator as ElasticSearchQueryTranslator_2 } from '@backstage/plugin-search-backend-module-elasticsearch';
import { ExtensionPoint } from '@backstage/backend-plugin-api';
import { IndexableDocument } from '@backstage/plugin-search-common';
import { IndexableResultSet } from '@backstage/plugin-search-common';
@@ -332,7 +331,7 @@ export type ElasticSearchQueryTranslator = (
// @public (undocumented)
export interface ElasticSearchQueryTranslatorExtensionPoint {
// (undocumented)
setTranslator(translator: ElasticSearchQueryTranslator_2): void;
setTranslator(translator: ElasticSearchQueryTranslator): void;
}
// @public
@@ -22,7 +22,7 @@ import { searchEngineRegistryExtensionPoint } from '@backstage/plugin-search-bac
import {
ElasticSearchQueryTranslator,
ElasticSearchSearchEngine,
} from '@backstage/plugin-search-backend-module-elasticsearch';
} from './engines/ElasticSearchSearchEngine';
/** @public */
export interface ElasticSearchQueryTranslatorExtensionPoint {