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,12 +14,12 @@
* limitations under the License.
*/
import { createApiRef } from '@backstage/core';
import {
RollbarItemsResponse,
RollbarProject,
RollbarTopActiveItem,
} from './types';
import { createApiRef } from '@backstage/core-plugin-api';
export const rollbarApiRef = createApiRef<RollbarApi>({
id: 'plugin.rollbar.service',
+1 -1
View File
@@ -20,7 +20,7 @@ import {
RollbarProject,
RollbarTopActiveItem,
} from './types';
import { DiscoveryApi, IdentityApi } from '@backstage/core';
import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
export class RollbarClient implements RollbarApi {
private readonly discoveryApi: DiscoveryApi;
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import { Table, TableColumn } from '@backstage/core';
import { Box, Link, Typography } from '@material-ui/core';
import { Alert } from '@material-ui/lab';
import React from 'react';
@@ -25,6 +24,7 @@ import {
} from '../../api/types';
import { buildItemUrl } from '../../utils';
import { TrendGraph } from '../TrendGraph/TrendGraph';
import { Table, TableColumn } from '@backstage/core-components';
const columns: TableColumn[] = [
{
+1 -1
View File
@@ -15,13 +15,13 @@
*/
import { Entity } from '@backstage/catalog-model';
import { MissingAnnotationEmptyState } from '@backstage/core';
import { useEntity } from '@backstage/plugin-catalog-react';
import React from 'react';
import { Route, Routes } from 'react-router';
import { ROLLBAR_ANNOTATION } from '../constants';
import { rootRouteRef } from '../plugin';
import { EntityPageRollbar } from './EntityPageRollbar/EntityPageRollbar';
import { MissingAnnotationEmptyState } from '@backstage/core-components';
export const isPluginApplicableToEntity = (entity: Entity) =>
Boolean(entity.metadata.annotations?.[ROLLBAR_ANNOTATION]);
@@ -14,12 +14,12 @@
* limitations under the License.
*/
import { useApi } from '@backstage/core';
import {
catalogApiRef,
useEntityCompoundName,
} from '@backstage/plugin-catalog-react';
import { useAsync } from 'react-use';
import { useApi } from '@backstage/core-plugin-api';
export function useCatalogEntity() {
const catalogApi = useApi(catalogApiRef);
+1 -1
View File
@@ -14,9 +14,9 @@
* limitations under the License.
*/
import { useApi, configApiRef } from '@backstage/core';
import { Entity } from '@backstage/catalog-model';
import { ROLLBAR_ANNOTATION } from '../constants';
import { useApi, configApiRef } from '@backstage/core-plugin-api';
export function useProjectSlugFromEntity(entity: Entity) {
const configApi = useApi(configApiRef);
@@ -14,10 +14,10 @@
* limitations under the License.
*/
import { configApiRef, useApi } from '@backstage/core';
import { catalogApiRef } from '@backstage/plugin-catalog-react';
import { useAsync } from 'react-use';
import { ROLLBAR_ANNOTATION } from '../constants';
import { configApiRef, useApi } from '@backstage/core-plugin-api';
export function useRollbarEntities() {
const configApi = useApi(configApiRef);
@@ -15,11 +15,11 @@
*/
import { useAsync } from 'react-use';
import { useApi } from '@backstage/core';
import { Entity } from '@backstage/catalog-model';
import { rollbarApiRef } from '../api';
import { RollbarTopActiveItem } from '../api/types';
import { useProjectSlugFromEntity } from './useProject';
import { useApi } from '@backstage/core-plugin-api';
export function useTopActiveItems(entity: Entity) {
const api = useApi(rollbarApiRef);
+3 -3
View File
@@ -14,6 +14,8 @@
* limitations under the License.
*/
import { rollbarApiRef } from './api/RollbarApi';
import { RollbarClient } from './api/RollbarClient';
import {
createApiFactory,
createPlugin,
@@ -21,9 +23,7 @@ import {
createRouteRef,
discoveryApiRef,
identityApiRef,
} from '@backstage/core';
import { rollbarApiRef } from './api/RollbarApi';
import { RollbarClient } from './api/RollbarClient';
} from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
path: '',