apply core-imports codemod to all packages and plugins
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { UrlPatternDiscovery } from '@backstage/core';
|
||||
import { msw } from '@backstage/test-utils';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import { BitriseClientApi } from './bitriseApi.client';
|
||||
import { BitriseApi } from './bitriseApi';
|
||||
import { UrlPatternDiscovery } from '@backstage/core-app-api';
|
||||
|
||||
const server = setupServer();
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DiscoveryApi } from '@backstage/core';
|
||||
import { BitriseApi } from './bitriseApi';
|
||||
import {
|
||||
BitriseBuildResponseItem,
|
||||
@@ -28,6 +27,7 @@ import {
|
||||
import qs from 'qs';
|
||||
import { DateTime, Interval } from 'luxon';
|
||||
import { pickBy, identity } from 'lodash';
|
||||
import { DiscoveryApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export class BitriseClientApi implements BitriseApi {
|
||||
constructor(private readonly discoveryApi: DiscoveryApi) {}
|
||||
|
||||
+1
-1
@@ -17,7 +17,6 @@
|
||||
import React from 'react';
|
||||
import { BitriseBuildResult } from '../../api/bitriseApi.model';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
import { Progress } from '@backstage/core';
|
||||
import { BitriseDownloadArtifactComponent } from '../BitriseDownloadArtifactComponent';
|
||||
import { useBitriseArtifacts } from '../useBitriseArtifacts';
|
||||
import {
|
||||
@@ -26,6 +25,7 @@ import {
|
||||
ListItemSecondaryAction,
|
||||
ListItemText,
|
||||
} from '@material-ui/core';
|
||||
import { Progress } from '@backstage/core-components';
|
||||
|
||||
type BitriseArtifactsComponentComponentProps = {
|
||||
build: BitriseBuildResult;
|
||||
|
||||
@@ -15,18 +15,18 @@
|
||||
*/
|
||||
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import {
|
||||
Content,
|
||||
ContentHeader,
|
||||
MissingAnnotationEmptyState,
|
||||
Page,
|
||||
} from '@backstage/core';
|
||||
import { useEntity } from '@backstage/plugin-catalog-react';
|
||||
import React, { useState } from 'react';
|
||||
import { useBitriseBuildWorkflows } from '../../hooks/useBitriseBuildWorkflows';
|
||||
import { AsyncState } from 'react-use/lib/useAsync';
|
||||
import { BitriseBuildsTable } from '../BitriseBuildsTableComponent';
|
||||
import { Item, Select } from '../Select';
|
||||
import {
|
||||
Content,
|
||||
ContentHeader,
|
||||
MissingAnnotationEmptyState,
|
||||
Page,
|
||||
} from '@backstage/core-components';
|
||||
|
||||
export type Props = {
|
||||
entity: Entity;
|
||||
|
||||
+5
-1
@@ -15,13 +15,17 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { ApiProvider, ApiRegistry, UrlPatternDiscovery } from '@backstage/core';
|
||||
import { bitriseApiRef } from '../../plugin';
|
||||
import { BitriseClientApi } from '../../api/bitriseApi.client';
|
||||
import { setupServer } from 'msw/node';
|
||||
import { msw, renderInTestApp } from '@backstage/test-utils';
|
||||
import { useBitriseBuilds } from '../../hooks/useBitriseBuilds';
|
||||
import { BitriseBuildsTable } from './BitriseBuildsTableComponent';
|
||||
import {
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
UrlPatternDiscovery,
|
||||
} from '@backstage/core-app-api';
|
||||
|
||||
jest.mock('../../hooks/useBitriseBuilds', () => ({
|
||||
useBitriseBuilds: jest.fn(),
|
||||
|
||||
+11
-11
@@ -15,17 +15,6 @@
|
||||
*/
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Table,
|
||||
TableColumn,
|
||||
Link,
|
||||
SubvalueCell,
|
||||
StatusOK,
|
||||
StatusWarning,
|
||||
StatusAborted,
|
||||
StatusError,
|
||||
StatusRunning,
|
||||
} from '@backstage/core';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
import { Button } from '@material-ui/core';
|
||||
import GitHubIcon from '@material-ui/icons/GitHub';
|
||||
@@ -36,6 +25,17 @@ import {
|
||||
} from '../../api/bitriseApi.model';
|
||||
import { BitriseBuildDetailsDialog } from '../BitriseBuildDetailsDialog';
|
||||
import { DateTime } from 'luxon';
|
||||
import {
|
||||
Table,
|
||||
TableColumn,
|
||||
Link,
|
||||
SubvalueCell,
|
||||
StatusOK,
|
||||
StatusWarning,
|
||||
StatusAborted,
|
||||
StatusError,
|
||||
StatusRunning,
|
||||
} from '@backstage/core-components';
|
||||
|
||||
type BitriseBuildsProps = {
|
||||
appName: string;
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { useApi } from '@backstage/core';
|
||||
import { useAsync } from 'react-use';
|
||||
import { BitriseBuildArtifactDetails } from '../api/bitriseApi.model';
|
||||
import { bitriseApiRef } from '../plugin';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export const useBitriseArtifactDetails = (
|
||||
appSlug: string,
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { useApi } from '@backstage/core';
|
||||
import { useAsync } from 'react-use';
|
||||
import { BitriseBuildArtifact } from '../api/bitriseApi.model';
|
||||
import { bitriseApiRef } from '../plugin';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export const useBitriseArtifacts = (appSlug: string, buildSlug: string) => {
|
||||
const bitriseApi = useApi(bitriseApiRef);
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createComponentExtension } from '@backstage/core';
|
||||
import { bitrisePlugin } from './plugin';
|
||||
import { createComponentExtension } from '@backstage/core-plugin-api';
|
||||
|
||||
export const EntityBitriseContent = bitrisePlugin.provide(
|
||||
createComponentExtension({
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { useApi } from '@backstage/core';
|
||||
import { useAsync } from 'react-use';
|
||||
import { bitriseApiRef } from '../plugin';
|
||||
import { AsyncState } from 'react-use/lib/useAsync';
|
||||
import { BitriseApp } from '../api/bitriseApi.model';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export const useBitriseBuildWorkflows = (
|
||||
appName: string,
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { useApi } from '@backstage/core';
|
||||
import { useAsync } from 'react-use';
|
||||
import {
|
||||
BitriseApp,
|
||||
@@ -23,6 +22,7 @@ import {
|
||||
} from '../api/bitriseApi.model';
|
||||
import { bitriseApiRef } from '../plugin';
|
||||
import { AsyncState } from 'react-use/lib/useAsync';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export const useBitriseBuilds = (
|
||||
appName: string,
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BitriseClientApi } from './api/bitriseApi.client';
|
||||
|
||||
import { BitriseApi } from './api/bitriseApi';
|
||||
import {
|
||||
discoveryApiRef,
|
||||
createApiRef,
|
||||
createApiFactory,
|
||||
createPlugin,
|
||||
} from '@backstage/core';
|
||||
|
||||
import { BitriseClientApi } from './api/bitriseApi.client';
|
||||
import { BitriseApi } from './api/bitriseApi';
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
export const bitriseApiRef = createApiRef<BitriseApi>({
|
||||
id: 'plugin.bitrise.service',
|
||||
|
||||
Reference in New Issue
Block a user