apply core-imports codemod to all packages and plugins

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-06-17 17:56:24 +02:00
parent 9b9a8f3925
commit d453c05dc3
541 changed files with 1549 additions and 1321 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { createApiRef } from '@backstage/core';
import { createApiRef } from '@backstage/core-plugin-api';
export interface FindingSummary {
timestamp: string;
+3 -1
View File
@@ -14,12 +14,14 @@
* limitations under the License.
*/
import { IdentityApi, UrlPatternDiscovery } from '@backstage/core';
import { msw } from '@backstage/test-utils';
import { rest } from 'msw';
import { setupServer } from 'msw/node';
import { FindingSummary, FossaApi, FossaClient } from './index';
import { IdentityApi } from '@backstage/core-plugin-api';
import { UrlPatternDiscovery } from '@backstage/core-app-api';
const server = setupServer();
const identityApi: IdentityApi = {
+1 -1
View File
@@ -14,11 +14,11 @@
* limitations under the License.
*/
import { DiscoveryApi, IdentityApi } from '@backstage/core';
import { ResponseError } from '@backstage/errors';
import fetch from 'cross-fetch';
import pLimit from 'p-limit';
import { FindingSummary, FossaApi } from './FossaApi';
import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
type FossaProjectsResponse = {
title: string;
@@ -15,12 +15,12 @@
*/
import { Entity } from '@backstage/catalog-model';
import { ApiProvider, ApiRegistry } from '@backstage/core';
import { EntityProvider } from '@backstage/plugin-catalog-react';
import { renderInTestApp } from '@backstage/test-utils';
import React from 'react';
import { FossaApi, fossaApiRef } from '../../api';
import { FossaCard } from './FossaCard';
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
describe('<FossaCard />', () => {
const fossaApi: jest.Mocked<FossaApi> = {
@@ -14,15 +14,6 @@
* limitations under the License.
*/
import {
EmptyState,
InfoCard,
InfoCardVariants,
MissingAnnotationEmptyState,
Progress,
ResponseErrorPanel,
useApi,
} from '@backstage/core';
import { useEntity } from '@backstage/plugin-catalog-react';
import { Grid, Tooltip } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
@@ -35,6 +26,17 @@ import {
getProjectName,
} from '../getProjectName';
import {
EmptyState,
InfoCard,
InfoCardVariants,
MissingAnnotationEmptyState,
Progress,
ResponseErrorPanel,
} from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
const useStyles = makeStyles(theme => ({
numberError: {
fontSize: '5rem',
@@ -15,12 +15,12 @@
*/
import { Entity } from '@backstage/catalog-model';
import { ApiProvider, ApiRegistry } from '@backstage/core';
import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react';
import { renderInTestApp } from '@backstage/test-utils';
import React from 'react';
import { FossaApi, fossaApiRef } from '../../api';
import { FossaPage } from './FossaPage';
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
describe('<FossaPage />', () => {
const catalogApi: jest.Mocked<CatalogApi> = {
@@ -19,19 +19,6 @@ import {
EntityName,
RELATION_OWNED_BY,
} from '@backstage/catalog-model';
import {
Content,
Header,
Link,
Page,
StatusError,
StatusOK,
StatusWarning,
Table,
TableColumn,
TableFilter,
useApi,
} from '@backstage/core';
import {
catalogApiRef,
EntityRefLink,
@@ -48,6 +35,21 @@ import { useAsync } from 'react-use';
import { FindingSummary, fossaApiRef } from '../../api';
import { getProjectName } from '../getProjectName';
import {
Content,
Header,
Link,
Page,
StatusError,
StatusOK,
StatusWarning,
Table,
TableColumn,
TableFilter,
} from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
type FossaRow = {
entity: Entity;
resolved: {
+3 -3
View File
@@ -14,12 +14,12 @@
* limitations under the License.
*/
import { fossaPlugin } from './plugin';
import { rootRoute } from './routes';
import {
createComponentExtension,
createRoutableExtension,
} from '@backstage/core';
import { fossaPlugin } from './plugin';
import { rootRoute } from './routes';
} from '@backstage/core-plugin-api';
export const EntityFossaCard = fossaPlugin.provide(
createComponentExtension({
+3 -3
View File
@@ -14,15 +14,15 @@
* limitations under the License.
*/
import { fossaApiRef, FossaClient } from './api';
import { rootRoute } from './routes';
import {
configApiRef,
createApiFactory,
createPlugin,
discoveryApiRef,
identityApiRef,
} from '@backstage/core';
import { fossaApiRef, FossaClient } from './api';
import { rootRoute } from './routes';
} from '@backstage/core-plugin-api';
export const fossaPlugin = createPlugin({
id: 'fossa',
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { createRouteRef } from '@backstage/core';
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRoute = createRouteRef({
id: 'fossa-overview',