get rid of circular imports

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-10-25 10:42:11 +02:00
parent bf117d7f1e
commit 7573b65232
29 changed files with 88 additions and 83 deletions
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { PluginEndpointDiscovery } from '@backstage/backend-common';
import { AuthenticationError } from '@backstage/errors';
import {
@@ -24,12 +25,12 @@ import {
jwtVerify,
} from 'jose';
import { GetKeyFunction } from 'jose/dist/types/types';
import {
BackstageIdentityResponse,
IdentityApiGetIdentityRequest,
} from './types';
import { getBearerTokenFromAuthorizationHeader, IdentityApi } from '.';
import { getBearerTokenFromAuthorizationHeader } from './getBearerTokenFromAuthorizationHeader';
import { IdentityApi } from './IdentityApi';
const CLOCK_MARGIN_S = 10;
@@ -30,8 +30,8 @@ import {
import { setupServer } from 'msw/node';
import { DateTime } from 'luxon';
import { siteMock } from '../../mocks/mocks';
import { azureSiteApiRef } from '../..';
import { AzureSitesOverviewTable } from './AzureSitesOverviewTable';
import { azureSiteApiRef } from '../../api';
const errorApiMock = { post: jest.fn(), error$: jest.fn() };
const identityApiMock = (getCredentials: any) => ({
@@ -13,17 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import React from 'react';
import { googleAuthApiRef, storageApiRef } from '@backstage/core-plugin-api';
import {
MockStorageApi,
TestApiProvider,
renderInTestApp,
} from '@backstage/test-utils';
import { HomePageCalendar } from '.';
import { gcalendarApiRef, gcalendarPlugin } from '../..';
import { HomePageCalendar } from './HomePageCalendar';
import { gcalendarApiRef } from '../../api';
import { gcalendarPlugin } from '../../plugin';
describe('<HomePageCalendar />', () => {
const primaryCalendar = {
@@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { Box, Button, styled } from '@material-ui/core';
import { CalendarEvent } from './CalendarEvent';
import { eventsMock } from './signInEventMock';
import { GCalendarEvent } from '../..';
import { GCalendarEvent } from '../../api';
type Props = {
handleAuthClick: React.MouseEventHandler<HTMLElement>;
@@ -34,7 +34,7 @@ import {
Link,
} from '@backstage/core-components';
import useAsync from 'react-use/lib/useAsync';
import { periskopApiRef } from '../..';
import { periskopApiRef } from '../../plugin';
import { AggregatedError, NotFoundInInstance } from '../../types';
/**
+1 -2
View File
@@ -15,8 +15,7 @@
*/
import { JsonPrimitive } from '@backstage/types';
import { ResourcePermission } from '.';
import { Permission } from './permission';
import { Permission, ResourcePermission } from './permission';
/**
* A request with a UUID identifier, so that batched responses can be matched up with the original
@@ -23,7 +23,7 @@ import {
import { ConfigReader } from '@backstage/config';
import { getVoidLogger } from '@backstage/backend-common';
import { PassThrough } from 'stream';
import { TemplateAction } from '../..';
import { TemplateAction } from '../../types';
const mockOctokit = {
rest: {
@@ -23,7 +23,7 @@ import {
import { ConfigReader } from '@backstage/config';
import { getVoidLogger } from '@backstage/backend-common';
import { PassThrough } from 'stream';
import { TemplateAction } from '../..';
import { TemplateAction } from '../../types';
const mockOctokit = {
rest: {
@@ -13,20 +13,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { JsonObject, Observable } from '@backstage/types';
import ObservableImpl from 'zen-observable';
import { TaskSpec } from '@backstage/plugin-scaffolder-common';
import { JsonObject, Observable } from '@backstage/types';
import { Logger } from 'winston';
import ObservableImpl from 'zen-observable';
import {
SerializedTask,
SerializedTaskEvent,
TaskBroker,
TaskBrokerDispatchOptions,
TaskCompletionState,
TaskContext,
TaskSecrets,
TaskStore,
TaskBroker,
SerializedTaskEvent,
SerializedTask,
} from './types';
import { TaskBrokerDispatchOptions } from '.';
/**
* TaskManager
+2 -1
View File
@@ -17,7 +17,8 @@
import { getVoidLogger } from '@backstage/backend-common';
import express from 'express';
import request from 'supertest';
import { createCacheMiddleware, TechDocsCache } from '.';
import { createCacheMiddleware } from './cacheMiddleware';
import { TechDocsCache } from './TechDocsCache';
/**
* Mocks cached HTTP response.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import type { Transformer } from './index';
import type { Transformer } from './transformer';
import {
replaceGithubUrlType,
ScmIntegrationRegistry,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import type { Transformer } from './index';
import type { Transformer } from './transformer';
import MenuIcon from '@material-ui/icons/Menu';
import React from 'react';
import ReactDOM from 'react-dom';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { scrollIntoNavigation } from '.';
import { scrollIntoNavigation } from './scrollIntoNavigation';
import { createTestShadowDom, FIXTURES } from '../../test-utils';
jest.useFakeTimers();
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { formatDuration } from '.';
import { formatDuration } from './format';
import { BuildCount, BuildTime } from '../api';
export const getErrorRatios = (buildCounts?: BuildCount[]) => {