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
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createApiRef } from '@backstage/core';
import { createApiRef } from '@backstage/core-plugin-api';
export interface CloneFromTemplateRequest {
templateRepository: string;
@@ -15,6 +15,13 @@
*/
import React, { useState } from 'react';
import ClusterTable from '../ClusterTable/ClusterTable';
import { Button } from '@material-ui/core';
import { useAsync } from 'react-use';
import { gitOpsApiRef } from '../../api';
import { Alert } from '@material-ui/lab';
import {
Content,
ContentHeader,
@@ -23,15 +30,8 @@ import {
Page,
Progress,
HeaderLabel,
useApi,
githubAuthApiRef,
} from '@backstage/core';
import ClusterTable from '../ClusterTable/ClusterTable';
import { Button } from '@material-ui/core';
import { useAsync } from 'react-use';
import { gitOpsApiRef } from '../../api';
import { Alert } from '@material-ui/lab';
} from '@backstage/core-components';
import { useApi, githubAuthApiRef } from '@backstage/core-plugin-api';
const ClusterList = () => {
const api = useApi(gitOpsApiRef);
@@ -14,6 +14,12 @@
* limitations under the License.
*/
import React, { useEffect, useState } from 'react';
import { Link } from '@material-ui/core';
import { useParams } from 'react-router-dom';
import { gitOpsApiRef, Status } from '../../api';
import { transformRunStatus } from '../ProfileCatalog';
import {
Content,
Header,
@@ -21,14 +27,8 @@ import {
Table,
Progress,
HeaderLabel,
useApi,
githubAuthApiRef,
} from '@backstage/core';
import { Link } from '@material-ui/core';
import { useParams } from 'react-router-dom';
import { gitOpsApiRef, Status } from '../../api';
import { transformRunStatus } from '../ProfileCatalog';
} from '@backstage/core-components';
import { useApi, githubAuthApiRef } from '@backstage/core-plugin-api';
const ClusterPage = () => {
const params = useParams() as { owner: string; repo: string };
@@ -14,10 +14,10 @@
* limitations under the License.
*/
import React from 'react';
import { Table, TableColumn } from '@backstage/core';
import { Link } from '@material-ui/core';
import { ClusterStatus } from '../../api';
import { transformStatus } from '../ProfileCatalog/ProfileCatalog';
import { Table, TableColumn } from '@backstage/core-components';
const columns: TableColumn[] = [
{
@@ -14,14 +14,6 @@
* limitations under the License.
*/
import {
ApiProvider,
ApiRegistry,
GithubAuth,
githubAuthApiRef,
OAuthRequestManager,
UrlPatternDiscovery,
} from '@backstage/core';
import { renderInTestApp } from '@backstage/test-utils';
import { lightTheme } from '@backstage/theme';
import { ThemeProvider } from '@material-ui/core';
@@ -29,6 +21,16 @@ import React from 'react';
import { gitOpsApiRef, GitOpsRestApi } from '../../api';
import ProfileCatalog from './ProfileCatalog';
import {
ApiProvider,
ApiRegistry,
GithubAuth,
OAuthRequestManager,
UrlPatternDiscovery,
} from '@backstage/core-app-api';
import { githubAuthApiRef } from '@backstage/core-plugin-api';
describe('ProfileCatalog', () => {
it('should render', async () => {
const oauthRequestApi = new OAuthRequestManager();
@@ -15,6 +15,13 @@
*/
import React, { useEffect, useState } from 'react';
import { TextField, List, ListItem, Link } from '@material-ui/core';
import ClusterTemplateCardList from '../ClusterTemplateCardList';
import ProfileCardList from '../ProfileCardList';
import { useLocalStorage } from 'react-use';
import { gitOpsApiRef, Status } from '../../api';
import {
Header,
Page,
@@ -33,15 +40,9 @@ import {
StatusError,
StatusPending,
StatusAborted,
useApi,
githubAuthApiRef,
} from '@backstage/core';
import { TextField, List, ListItem, Link } from '@material-ui/core';
} from '@backstage/core-components';
import ClusterTemplateCardList from '../ClusterTemplateCardList';
import ProfileCardList from '../ProfileCardList';
import { useLocalStorage } from 'react-use';
import { gitOpsApiRef, Status } from '../../api';
import { useApi, githubAuthApiRef } from '@backstage/core-plugin-api';
// OK = (completed, success)
// Error = (?,failure)
+5 -5
View File
@@ -14,17 +14,17 @@
* limitations under the License.
*/
import {
createPlugin,
createApiFactory,
createRoutableExtension,
} from '@backstage/core';
import {
gitOpsClusterListRoute,
gitOpsClusterDetailsRoute,
gitOpsClusterCreateRoute,
} from './routes';
import { gitOpsApiRef, GitOpsRestApi } from './api';
import {
createPlugin,
createApiFactory,
createRoutableExtension,
} from '@backstage/core-plugin-api';
export const gitopsProfilesPlugin = createPlugin({
id: 'gitops-profiles',
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { createRouteRef } from '@backstage/core';
import { createRouteRef } from '@backstage/core-plugin-api';
const NoIcon = () => null;