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
@@ -15,9 +15,9 @@
*/
import { EntityName, stringifyEntityRef } from '@backstage/catalog-model';
import { createApiRef, DiscoveryApi } from '@backstage/core';
import { ResponseError } from '@backstage/errors';
import { JsonCodeCoverage, JsonCoverageHistory } from './types';
import { createApiRef, DiscoveryApi } from '@backstage/core-plugin-api';
export type CodeCoverageApi = {
discovery: DiscoveryApi;
@@ -14,9 +14,9 @@
* limitations under the License.
*/
import React from 'react';
import { Content, ContentHeader, Page } from '@backstage/core';
import { CoverageHistoryChart } from '../CoverageHistoryChart';
import { FileExplorer } from '../FileExplorer';
import { Content, ContentHeader, Page } from '@backstage/core-components';
export const CodeCoveragePage = () => {
return (
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import { Progress, ResponseErrorPanel, useApi } from '@backstage/core';
import { useEntity } from '@backstage/plugin-catalog-react';
import { BackstageTheme } from '@backstage/theme';
import {
@@ -44,6 +43,9 @@ import {
} from 'recharts';
import { codeCoverageApiRef } from '../../api';
import { Progress, ResponseErrorPanel } from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
type Coverage = 'line' | 'branch';
const useStyles = makeStyles<BackstageTheme>(theme => ({
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import { Progress, ResponseErrorPanel, useApi } from '@backstage/core';
import { useEntity } from '@backstage/plugin-catalog-react';
import { makeStyles, Paper } from '@material-ui/core';
import { Alert } from '@material-ui/lab';
@@ -25,6 +24,9 @@ import { FileEntry } from '../../types';
import { CodeRow } from './CodeRow';
import { highlightLines } from './Highlighter';
import { Progress, ResponseErrorPanel } from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
type Props = {
filename: string;
coverage: FileEntry;
@@ -14,13 +14,6 @@
* limitations under the License.
*/
import {
Progress,
ResponseErrorPanel,
Table,
TableColumn,
useApi,
} from '@backstage/core';
import { useEntity } from '@backstage/plugin-catalog-react';
import {
Box,
@@ -38,6 +31,14 @@ import { codeCoverageApiRef } from '../../api';
import { FileEntry } from '../../types';
import { FileContent } from './FileContent';
import {
Progress,
ResponseErrorPanel,
Table,
TableColumn,
} from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
type FileStructureObject = Record<string, any>;
type CoverageTableRow = {
@@ -16,8 +16,8 @@
import React from 'react';
import { Entity } from '@backstage/catalog-model';
import { useEntity } from '@backstage/plugin-catalog-react';
import { MissingAnnotationEmptyState } from '@backstage/core';
import { CodeCoveragePage } from './CodeCoveragePage';
import { MissingAnnotationEmptyState } from '@backstage/core-components';
export const isCodeCoverageAvailable = (entity: Entity) =>
Boolean(entity.metadata.annotations?.['backstage.io/code-coverage']);
+4 -4
View File
@@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { codeCoverageApiRef, CodeCoverageRestApi } from './api';
import { rootRouteRef } from './routes';
import {
createApiFactory,
createPlugin,
createRoutableExtension,
discoveryApiRef,
} from '@backstage/core';
import { codeCoverageApiRef, CodeCoverageRestApi } from './api';
import { rootRouteRef } from './routes';
} from '@backstage/core-plugin-api';
export const codeCoveragePlugin = createPlugin({
id: 'code-coverage',
+1 -1
View File
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createRouteRef } from '@backstage/core';
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
title: 'code-coverage',