Merge pull request #5878 from backstage/rugvip/codemods

Introduce @backstage/codemods package, with an initial transform for migrating core-* imports
This commit is contained in:
Patrik Oldsberg
2021-06-10 11:53:44 +02:00
committed by GitHub
20 changed files with 1299 additions and 1036 deletions
+3 -8
View File
@@ -15,14 +15,6 @@
*/
import { Entity, LOCATION_ANNOTATION } from '@backstage/catalog-model';
import {
ApiProvider,
ApiRegistry,
Content,
Header,
HeaderLabel,
Page,
} from '@backstage/core';
import { createDevApp } from '@backstage/dev-utils';
import { EntityProvider } from '@backstage/plugin-catalog-react';
import OnlineIcon from '@material-ui/icons/Cloud';
@@ -30,6 +22,9 @@ import OfflineIcon from '@material-ui/icons/Storage';
import React from 'react';
import { EntityTodoContent, todoApiRef, todoPlugin } from '../src';
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
import { Content, Header, HeaderLabel, Page } from '@backstage/core-components';
const entity: Entity = {
apiVersion: 'backstage.io/v1alpha1',
kind: 'Component',
+3 -1
View File
@@ -27,7 +27,8 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.8.0",
"@backstage/core": "^0.7.11",
"@backstage/core-components": "^0.1.0",
"@backstage/core-plugin-api": "^0.1.0",
"@backstage/errors": "^0.1.1",
"@backstage/plugin-catalog-react": "^0.2.0",
"@backstage/theme": "^0.2.8",
@@ -40,6 +41,7 @@
},
"devDependencies": {
"@backstage/cli": "^0.6.14",
"@backstage/core-app-api": "^0.1.0",
"@backstage/dev-utils": "^0.1.17",
"@backstage/test-utils": "^0.1.13",
"@testing-library/jest-dom": "^5.10.1",
+1 -1
View File
@@ -16,8 +16,8 @@
import { serializeEntityRef } from '@backstage/catalog-model';
import { ResponseError } from '@backstage/errors';
import { DiscoveryApi, IdentityApi } from '@backstage/core';
import { TodoApi, TodoListOptions, TodoListResult } from './types';
import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
interface Options {
discoveryApi: DiscoveryApi;
+1 -1
View File
@@ -14,8 +14,8 @@
* limitations under the License.
*/
import { createApiRef } from '@backstage/core';
import { Entity } from '@backstage/catalog-model';
import { createApiRef } from '@backstage/core-plugin-api';
export type TodoItem = {
/** The contents of the TODO comment */
@@ -15,12 +15,12 @@
*/
import { Entity } from '@backstage/catalog-model';
import { ApiProvider, ApiRegistry } from '@backstage/core';
import { EntityProvider } from '@backstage/plugin-catalog-react';
import { renderWithEffects } from '@backstage/test-utils';
import React from 'react';
import { TodoApi, todoApiRef } from '../../api';
import { TodoList } from './TodoList';
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
describe('TodoList', () => {
it('should render', async () => {
@@ -14,19 +14,20 @@
* limitations under the License.
*/
import {
Table,
TableColumn,
useApi,
OverflowTooltip,
Link,
ResponseErrorPanel,
} from '@backstage/core';
import { useEntity } from '@backstage/plugin-catalog-react';
import React, { useState } from 'react';
import { todoApiRef } from '../../api';
import { TodoItem, TodoListOptions } from '../../api/types';
import {
Table,
TableColumn,
OverflowTooltip,
Link,
ResponseErrorPanel,
} from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
const PAGE_SIZE = 10;
const columns: TableColumn<TodoItem>[] = [
+2 -2
View File
@@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { todoApiRef, TodoClient } from './api';
import {
createApiFactory,
createPlugin,
createComponentExtension,
discoveryApiRef,
identityApiRef,
} from '@backstage/core';
import { todoApiRef, TodoClient } from './api';
} from '@backstage/core-plugin-api';
// import { rootRouteRef } from './routes';
+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: 'todo',