diff --git a/packages/app/src/apis.ts b/packages/app/src/apis.ts index ccc576e727..cd843b2400 100644 --- a/packages/app/src/apis.ts +++ b/packages/app/src/apis.ts @@ -14,13 +14,6 @@ * limitations under the License. */ -import { - AnyApiFactory, - configApiRef, - createApiFactory, - errorApiRef, - githubAuthApiRef, -} from '@backstage/core'; import { ScmIntegrationsApi, scmIntegrationsApiRef, @@ -33,6 +26,13 @@ import { graphQlBrowseApiRef, GraphQLEndpoints, } from '@backstage/plugin-graphiql'; +import { + AnyApiFactory, + configApiRef, + createApiFactory, + errorApiRef, + githubAuthApiRef, +} from '@backstage/core-plugin-api'; export const apis: AnyApiFactory[] = [ createApiFactory({ diff --git a/packages/app/src/components/Root/Root.tsx b/packages/app/src/components/Root/Root.tsx index 9c62ec0b4d..e04774859f 100644 --- a/packages/app/src/components/Root/Root.tsx +++ b/packages/app/src/components/Root/Root.tsx @@ -26,6 +26,11 @@ import CreateComponentIcon from '@material-ui/icons/AddCircleOutline'; import MoneyIcon from '@material-ui/icons/MonetizationOn'; import LogoFull from './LogoFull'; import LogoIcon from './LogoIcon'; +import { NavLink } from 'react-router-dom'; +import { GraphiQLIcon } from '@backstage/plugin-graphiql'; +import { Settings as SidebarSettings } from '@backstage/plugin-user-settings'; +import { SidebarSearch } from '@backstage/plugin-search'; +import { Shortcuts } from '@backstage/plugin-shortcuts'; import { Sidebar, SidebarPage, @@ -34,12 +39,7 @@ import { SidebarItem, SidebarDivider, SidebarSpace, -} from '@backstage/core'; -import { NavLink } from 'react-router-dom'; -import { GraphiQLIcon } from '@backstage/plugin-graphiql'; -import { Settings as SidebarSettings } from '@backstage/plugin-user-settings'; -import { SidebarSearch } from '@backstage/plugin-search'; -import { Shortcuts } from '@backstage/plugin-shortcuts'; +} from '@backstage/core-components'; const useSidebarLogoStyles = makeStyles({ root: { diff --git a/packages/app/src/components/catalog/EntityPage.test.tsx b/packages/app/src/components/catalog/EntityPage.test.tsx index c33adf6c4a..7938fb38c1 100644 --- a/packages/app/src/components/catalog/EntityPage.test.tsx +++ b/packages/app/src/components/catalog/EntityPage.test.tsx @@ -15,12 +15,12 @@ */ import React from 'react'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { EntityLayout } from '@backstage/plugin-catalog'; import { EntityProvider } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { cicdContent } from './EntityPage'; import { githubActionsApiRef } from '@backstage/plugin-github-actions'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('EntityPage Test', () => { const entity = { diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index f646992c97..adc737c01e 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -16,7 +16,6 @@ import React, { ReactNode, useMemo, useState } from 'react'; import BadgeIcon from '@material-ui/icons/CallToAction'; -import { EmptyState } from '@backstage/core'; import { EntityApiDefinitionCard, EntityConsumingComponentsCard, @@ -108,6 +107,7 @@ import { isTravisciAvailable, } from '@roadiehq/backstage-plugin-travis-ci'; import { EntityCodeCoverageContent } from '@backstage/plugin-code-coverage'; +import { EmptyState } from '@backstage/core-components'; const EntityLayoutWrapper = (props: { children?: ReactNode }) => { const [badgesDialogOpen, setBadgesDialogOpen] = useState(false); diff --git a/packages/app/src/components/search/SearchPage.tsx b/packages/app/src/components/search/SearchPage.tsx index 7b94e876e6..0e01926e3a 100644 --- a/packages/app/src/components/search/SearchPage.tsx +++ b/packages/app/src/components/search/SearchPage.tsx @@ -17,7 +17,6 @@ import React from 'react'; import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core'; -import { Content, Header, Lifecycle, Page } from '@backstage/core'; import { CatalogResultListItem } from '@backstage/plugin-catalog'; import { SearchBar, @@ -25,6 +24,7 @@ import { SearchResult, DefaultResultListItem, } from '@backstage/plugin-search'; +import { Content, Header, Lifecycle, Page } from '@backstage/core-components'; const useStyles = makeStyles((theme: Theme) => ({ bar: { diff --git a/packages/app/src/identityProviders.ts b/packages/app/src/identityProviders.ts index 6f45f9ba32..b862be67ab 100644 --- a/packages/app/src/identityProviders.ts +++ b/packages/app/src/identityProviders.ts @@ -24,7 +24,7 @@ import { oneloginAuthApiRef, oauth2ApiRef, oidcAuthApiRef, -} from '@backstage/core'; +} from '@backstage/core-plugin-api'; export const providers = [ { diff --git a/packages/create-app/templates/default-app/packages/app/src/App.tsx b/packages/create-app/templates/default-app/packages/app/src/App.tsx index 07d030b2c1..c513c7e28e 100644 --- a/packages/create-app/templates/default-app/packages/app/src/App.tsx +++ b/packages/create-app/templates/default-app/packages/app/src/App.tsx @@ -1,11 +1,5 @@ import React from 'react'; import { Navigate, Route } from 'react-router'; -import { - AlertDisplay, - createApp, - FlatRoutes, - OAuthRequestDialog, -} from '@backstage/core'; import { apiDocsPlugin, ApiExplorerPage } from '@backstage/plugin-api-docs'; import { CatalogEntityPage, @@ -25,6 +19,9 @@ import { apis } from './apis'; import { entityPage } from './components/catalog/EntityPage'; import { Root } from './components/Root'; +import { AlertDisplay, OAuthRequestDialog } from '@backstage/core-components'; +import { createApp, FlatRoutes } from '@backstage/core-app-api'; + const app = createApp({ apis, bindRoutes({ bind }) { diff --git a/packages/create-app/templates/default-app/packages/app/src/apis.ts b/packages/create-app/templates/default-app/packages/app/src/apis.ts index d803416c3f..080b20fcbc 100644 --- a/packages/create-app/templates/default-app/packages/app/src/apis.ts +++ b/packages/create-app/templates/default-app/packages/app/src/apis.ts @@ -1,9 +1,7 @@ -import { - AnyApiFactory, configApiRef, createApiFactory -} from '@backstage/core'; import { ScmIntegrationsApi, scmIntegrationsApiRef } from '@backstage/integration-react'; +import { AnyApiFactory, configApiRef, createApiFactory } from '@backstage/core-plugin-api'; export const apis: AnyApiFactory[] = [ createApiFactory({ diff --git a/packages/create-app/templates/default-app/packages/app/src/components/Root/Root.tsx b/packages/create-app/templates/default-app/packages/app/src/components/Root/Root.tsx index 9c07e0c5e2..14ded73890 100644 --- a/packages/create-app/templates/default-app/packages/app/src/components/Root/Root.tsx +++ b/packages/create-app/templates/default-app/packages/app/src/components/Root/Root.tsx @@ -23,6 +23,9 @@ import LibraryBooks from '@material-ui/icons/LibraryBooks'; import CreateComponentIcon from '@material-ui/icons/AddCircleOutline'; import LogoFull from './LogoFull'; import LogoIcon from './LogoIcon'; +import { NavLink } from 'react-router-dom'; +import { Settings as SidebarSettings } from '@backstage/plugin-user-settings'; +import { SidebarSearch } from '@backstage/plugin-search'; import { Sidebar, SidebarPage, @@ -31,10 +34,7 @@ import { SidebarItem, SidebarDivider, SidebarSpace, -} from '@backstage/core'; -import { NavLink } from 'react-router-dom'; -import { Settings as SidebarSettings } from '@backstage/plugin-user-settings'; -import { SidebarSearch } from '@backstage/plugin-search'; +} from '@backstage/core-components'; const useSidebarLogoStyles = makeStyles({ root: { diff --git a/packages/create-app/templates/default-app/packages/app/src/components/catalog/EntityPage.tsx b/packages/create-app/templates/default-app/packages/app/src/components/catalog/EntityPage.tsx index 4f67dda235..d033cf7a9e 100644 --- a/packages/create-app/templates/default-app/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/create-app/templates/default-app/packages/app/src/components/catalog/EntityPage.tsx @@ -15,7 +15,6 @@ */ import React from 'react'; import { Button, Grid } from '@material-ui/core'; -import { EmptyState } from '@backstage/core'; import { EntityApiDefinitionCard, EntityConsumedApisCard, @@ -50,6 +49,7 @@ import { EntityOwnershipCard, } from '@backstage/plugin-org'; import { EntityTechdocsContent } from '@backstage/plugin-techdocs'; +import { EmptyState } from '@backstage/core-components'; const cicdContent = ( // This is an example of how you can implement your company's logic in entity page. diff --git a/packages/create-app/templates/default-app/packages/app/src/components/search/SearchPage.tsx b/packages/create-app/templates/default-app/packages/app/src/components/search/SearchPage.tsx index f525be80a2..7b3c2b29d4 100644 --- a/packages/create-app/templates/default-app/packages/app/src/components/search/SearchPage.tsx +++ b/packages/create-app/templates/default-app/packages/app/src/components/search/SearchPage.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core'; -import { Content, Header, Page } from '@backstage/core'; import { CatalogResultListItem } from '@backstage/plugin-catalog'; import { SearchBar, @@ -9,6 +8,7 @@ import { SearchResult, DefaultResultListItem, } from '@backstage/plugin-search'; +import { Content, Header, Page } from '@backstage/core-components'; const useStyles = makeStyles((theme: Theme) => ({ bar: { diff --git a/packages/dev-utils/src/devApp/render.test.tsx b/packages/dev-utils/src/devApp/render.test.tsx index 9cb680c53b..9726cb25f2 100644 --- a/packages/dev-utils/src/devApp/render.test.tsx +++ b/packages/dev-utils/src/devApp/render.test.tsx @@ -16,8 +16,8 @@ import React from 'react'; import { render } from '@testing-library/react'; -import { useApi, configApiRef } from '@backstage/core'; import { createDevApp } from './render'; +import { useApi, configApiRef } from '@backstage/core-plugin-api'; const anyEnv = (process.env = { ...process.env }) as any; diff --git a/packages/dev-utils/src/devApp/render.tsx b/packages/dev-utils/src/devApp/render.tsx index 271c8d70cf..c55c87c5c9 100644 --- a/packages/dev-utils/src/devApp/render.tsx +++ b/packages/dev-utils/src/devApp/render.tsx @@ -14,25 +14,6 @@ * limitations under the License. */ -import { - AlertDisplay, - AnyApiFactory, - ApiFactory, - attachComponentData, - configApiRef, - createApiFactory, - createApp, - createPlugin, - createRouteRef, - FlatRoutes, - IconComponent, - OAuthRequestDialog, - RouteRef, - Sidebar, - SidebarItem, - SidebarPage, - SidebarSpacer, -} from '@backstage/core'; import { ScmIntegrationsApi, scmIntegrationsApiRef, @@ -44,6 +25,29 @@ import ReactDOM from 'react-dom'; import { hot } from 'react-hot-loader'; import { Route } from 'react-router'; +import { + AlertDisplay, + OAuthRequestDialog, + Sidebar, + SidebarItem, + SidebarPage, + SidebarSpacer, +} from '@backstage/core-components'; + +import { + AnyApiFactory, + ApiFactory, + attachComponentData, + configApiRef, + createApiFactory, + createPlugin, + createRouteRef, + IconComponent, + RouteRef, +} from '@backstage/core-plugin-api'; + +import { createApp, FlatRoutes } from '@backstage/core-app-api'; + const GatheringRoute: (props: { path: string; element: JSX.Element; diff --git a/packages/integration-react/dev/DevPage.tsx b/packages/integration-react/dev/DevPage.tsx index f86cc35fc5..eb3681bf22 100644 --- a/packages/integration-react/dev/DevPage.tsx +++ b/packages/integration-react/dev/DevPage.tsx @@ -14,12 +14,14 @@ * limitations under the License. */ -import { Content, useApi } from '@backstage/core'; import { ScmIntegration, ScmIntegrationsGroup } from '@backstage/integration'; import { Typography } from '@material-ui/core'; import React from 'react'; import { scmIntegrationsApiRef } from '../src/ScmIntegrationsApi'; +import { Content } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + const Integrations = (props: { group: ScmIntegrationsGroup; }) => { diff --git a/packages/integration-react/dev/index.tsx b/packages/integration-react/dev/index.tsx index 34cfee3fd8..acc155b360 100644 --- a/packages/integration-react/dev/index.tsx +++ b/packages/integration-react/dev/index.tsx @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { configApiRef, createApiFactory } from '@backstage/core'; import { createDevApp } from '@backstage/dev-utils'; import { ScmIntegrations } from '@backstage/integration'; import React from 'react'; import { scmIntegrationsApiRef } from '../src/ScmIntegrationsApi'; import { DevPage } from './DevPage'; +import { configApiRef, createApiFactory } from '@backstage/core-plugin-api'; createDevApp() .registerApi( diff --git a/packages/integration-react/src/api/ScmIntegrationsApi.ts b/packages/integration-react/src/api/ScmIntegrationsApi.ts index 507ecd8913..b0e2f3cf0d 100644 --- a/packages/integration-react/src/api/ScmIntegrationsApi.ts +++ b/packages/integration-react/src/api/ScmIntegrationsApi.ts @@ -15,11 +15,11 @@ */ import { Config } from '@backstage/config'; -import { ApiRef, createApiRef } from '@backstage/core'; import { ScmIntegrationRegistry, ScmIntegrations, } from '@backstage/integration'; +import { ApiRef, createApiRef } from '@backstage/core-plugin-api'; export class ScmIntegrationsApi { static fromConfig(config: Config): ScmIntegrationRegistry { diff --git a/packages/integration-react/src/components/ScmIntegrationIcon/ScmIntegrationIcon.tsx b/packages/integration-react/src/components/ScmIntegrationIcon/ScmIntegrationIcon.tsx index 99745f977e..0f9ce93557 100644 --- a/packages/integration-react/src/components/ScmIntegrationIcon/ScmIntegrationIcon.tsx +++ b/packages/integration-react/src/components/ScmIntegrationIcon/ScmIntegrationIcon.tsx @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useApp } from '@backstage/core'; import CodeIcon from '@material-ui/icons/Code'; import React from 'react'; +import { useApp } from '@backstage/core-plugin-api'; export const ScmIntegrationIcon = ({ type }: { type?: string }) => { const app = useApp(); diff --git a/packages/storybook/.storybook/apis.js b/packages/storybook/.storybook/apis.js index 128ccfc67a..41b8433594 100644 --- a/packages/storybook/.storybook/apis.js +++ b/packages/storybook/.storybook/apis.js @@ -1,28 +1,31 @@ import { AlertApiForwarder, - alertApiRef, ApiRegistry, ErrorAlerter, ErrorApiForwarder, - errorApiRef, GithubAuth, - githubAuthApiRef, GitlabAuth, - gitlabAuthApiRef, GoogleAuth, - googleAuthApiRef, - identityApiRef, OAuth2, - oauth2ApiRef, - oauthRequestApiRef, OAuthRequestManager, OktaAuth, - oktaAuthApiRef, Auth0Auth, + ConfigReader, +} from '@backstage/core-app-api'; + +import { + alertApiRef, + errorApiRef, + githubAuthApiRef, + gitlabAuthApiRef, + googleAuthApiRef, + identityApiRef, + oauth2ApiRef, + oauthRequestApiRef, + oktaAuthApiRef, auth0AuthApiRef, configApiRef, - ConfigReader, -} from '@backstage/core'; +} from '@backstage/core-plugin-api'; const builder = ApiRegistry.builder(); diff --git a/packages/storybook/.storybook/preview.js b/packages/storybook/.storybook/preview.js index dd2d2e9cdd..6186b82ca5 100644 --- a/packages/storybook/.storybook/preview.js +++ b/packages/storybook/.storybook/preview.js @@ -3,9 +3,11 @@ import { addDecorator, addParameters } from '@storybook/react'; import { lightTheme, darkTheme } from '@backstage/theme'; import { CssBaseline, ThemeProvider } from '@material-ui/core'; import { useDarkMode } from 'storybook-dark-mode'; -import { Content, ApiProvider, AlertDisplay } from '@backstage/core'; import { apis } from './apis'; +import { Content, AlertDisplay } from '@backstage/core-components'; +import { ApiProvider } from '@backstage/core-app-api'; + addDecorator(story => ( diff --git a/plugins/api-docs/dev/index.tsx b/plugins/api-docs/dev/index.tsx index 6d4b0c199e..26814cb12d 100644 --- a/plugins/api-docs/dev/index.tsx +++ b/plugins/api-docs/dev/index.tsx @@ -15,7 +15,6 @@ */ import { ApiEntity, Entity } from '@backstage/catalog-model'; -import { Content, Header, Page } from '@backstage/core'; import { createDevApp } from '@backstage/dev-utils'; import { catalogApiRef, EntityProvider } from '@backstage/plugin-catalog-react'; import React from 'react'; @@ -29,6 +28,7 @@ import asyncapiApiEntity from './asyncapi-example-api.yaml'; import graphqlApiEntity from './graphql-example-api.yaml'; import openapiApiEntity from './openapi-example-api.yaml'; import otherApiEntity from './other-example-api.yaml'; +import { Content, Header, Page } from '@backstage/core-components'; const mockEntities = ([ openapiApiEntity, diff --git a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.test.tsx b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.test.tsx index 0107472acf..3b9fe806cf 100644 --- a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.test.tsx +++ b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.test.tsx @@ -15,7 +15,6 @@ */ import { ApiEntity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { EntityProvider } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; @@ -23,6 +22,7 @@ import React from 'react'; import { ApiDocsConfig, apiDocsConfigRef } from '../../config'; import { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget'; import { ApiDefinitionCard } from './ApiDefinitionCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const apiDocsConfig: jest.Mocked = { diff --git a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.tsx b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.tsx index ce6f0658bf..3ddc07248c 100644 --- a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.tsx +++ b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.tsx @@ -15,13 +15,15 @@ */ import { ApiEntity } from '@backstage/catalog-model'; -import { CardTab, TabbedCard, useApi } from '@backstage/core'; import { useEntity } from '@backstage/plugin-catalog-react'; import { Alert } from '@material-ui/lab'; import React from 'react'; import { apiDocsConfigRef } from '../../config'; import { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget'; +import { CardTab, TabbedCard } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + type Props = { /** @deprecated The entity is now grabbed from context instead */ apiEntity?: ApiEntity; diff --git a/plugins/api-docs/src/components/ApiDefinitionCard/ApiTypeTitle.test.tsx b/plugins/api-docs/src/components/ApiDefinitionCard/ApiTypeTitle.test.tsx index 4f1b2d2f3b..f0fda31829 100644 --- a/plugins/api-docs/src/components/ApiDefinitionCard/ApiTypeTitle.test.tsx +++ b/plugins/api-docs/src/components/ApiDefinitionCard/ApiTypeTitle.test.tsx @@ -15,11 +15,11 @@ */ import { ApiEntity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { renderInTestApp } from '@backstage/test-utils'; import React from 'react'; import { ApiDocsConfig, apiDocsConfigRef } from '../../config'; import { ApiTypeTitle } from './ApiTypeTitle'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const apiDocsConfig: jest.Mocked = { diff --git a/plugins/api-docs/src/components/ApiDefinitionCard/ApiTypeTitle.tsx b/plugins/api-docs/src/components/ApiDefinitionCard/ApiTypeTitle.tsx index be6212edf7..4570b82dea 100644 --- a/plugins/api-docs/src/components/ApiDefinitionCard/ApiTypeTitle.tsx +++ b/plugins/api-docs/src/components/ApiDefinitionCard/ApiTypeTitle.tsx @@ -15,9 +15,9 @@ */ import { ApiEntity } from '@backstage/catalog-model'; -import { useApi } from '@backstage/core'; import React from 'react'; import { apiDocsConfigRef } from '../../config'; +import { useApi } from '@backstage/core-plugin-api'; export const ApiTypeTitle = ({ apiEntity }: { apiEntity: ApiEntity }) => { const config = useApi(apiDocsConfigRef); diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx index fb94df8528..90dc586c45 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx @@ -14,9 +14,11 @@ * limitations under the License. */ -import { Header, Page, useApi, configApiRef } from '@backstage/core'; import React from 'react'; +import { Header, Page } from '@backstage/core-components'; +import { useApi, configApiRef } from '@backstage/core-plugin-api'; + type Props = { children?: React.ReactNode; }; diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx index c52c5b88fc..8c2c2765c9 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx @@ -15,14 +15,6 @@ */ import { Entity, RELATION_MEMBER_OF } from '@backstage/catalog-model'; -import { - ApiProvider, - ApiRegistry, - storageApiRef, - ConfigApi, - configApiRef, - ConfigReader, -} from '@backstage/core'; import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react'; import { MockStorageApi, wrapInTestApp } from '@backstage/test-utils'; import { render } from '@testing-library/react'; @@ -30,6 +22,17 @@ import React from 'react'; import { apiDocsConfigRef } from '../../config'; import { ApiExplorerPage } from './ApiExplorerPage'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; +import { + storageApiRef, + ConfigApi, + configApiRef, +} from '@backstage/core-plugin-api'; + describe('ApiCatalogPage', () => { const catalogApi: Partial = { getEntities: () => diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx index 6d551ea0c6..d12ca97811 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx @@ -14,13 +14,6 @@ * limitations under the License. */ -import { - Content, - ContentHeader, - SupportButton, - TableColumn, - useRouteRef, -} from '@backstage/core'; import { EntityKindPicker, EntityLifecyclePicker, @@ -38,6 +31,14 @@ import { Link as RouterLink } from 'react-router-dom'; import { createComponentRouteRef } from '../../routes'; import { ApiExplorerLayout } from './ApiExplorerLayout'; +import { + Content, + ContentHeader, + SupportButton, + TableColumn, +} from '@backstage/core-components'; +import { useRouteRef } from '@backstage/core-plugin-api'; + const useStyles = makeStyles(theme => ({ contentWrapper: { display: 'grid', diff --git a/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx b/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx index fa956cd042..ae133b2ed5 100644 --- a/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx +++ b/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_CONSUMES_API } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -26,6 +25,7 @@ import { waitFor } from '@testing-library/react'; import React from 'react'; import { ApiDocsConfig, apiDocsConfigRef } from '../../config'; import { ConsumedApisCard } from './ConsumedApisCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const apiDocsConfig: jest.Mocked = { diff --git a/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.tsx b/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.tsx index 7cc0257e85..9a0a569f85 100644 --- a/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.tsx +++ b/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.tsx @@ -19,13 +19,6 @@ import { Entity, RELATION_CONSUMES_API, } from '@backstage/catalog-model'; -import { - CodeSnippet, - InfoCard, - Link, - Progress, - WarningPanel, -} from '@backstage/core'; import { Typography } from '@material-ui/core'; import { EntityTable, @@ -34,6 +27,13 @@ import { } from '@backstage/plugin-catalog-react'; import React from 'react'; import { apiEntityColumns } from './presets'; +import { + CodeSnippet, + InfoCard, + Link, + Progress, + WarningPanel, +} from '@backstage/core-components'; type Props = { /** @deprecated The entity is now grabbed from context instead */ diff --git a/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx b/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx index e721f6e918..6ba0ada9c4 100644 --- a/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx +++ b/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_HAS_PART } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -26,6 +25,7 @@ import { waitFor } from '@testing-library/react'; import React from 'react'; import { ApiDocsConfig, apiDocsConfigRef } from '../../config'; import { HasApisCard } from './HasApisCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const apiDocsConfig: jest.Mocked = { diff --git a/plugins/api-docs/src/components/ApisCards/HasApisCard.tsx b/plugins/api-docs/src/components/ApisCards/HasApisCard.tsx index e6da61fcd9..6bb8b7a3c2 100644 --- a/plugins/api-docs/src/components/ApisCards/HasApisCard.tsx +++ b/plugins/api-docs/src/components/ApisCards/HasApisCard.tsx @@ -15,14 +15,6 @@ */ import { ApiEntity, RELATION_HAS_PART } from '@backstage/catalog-model'; -import { - CodeSnippet, - InfoCard, - Link, - Progress, - TableColumn, - WarningPanel, -} from '@backstage/core'; import { Typography } from '@material-ui/core'; import { EntityTable, @@ -31,6 +23,14 @@ import { } from '@backstage/plugin-catalog-react'; import React from 'react'; import { createSpecApiTypeColumn } from './presets'; +import { + CodeSnippet, + InfoCard, + Link, + Progress, + TableColumn, + WarningPanel, +} from '@backstage/core-components'; type Props = { variant?: 'gridItem'; diff --git a/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx b/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx index 67d95605e4..48ba0f6ec6 100644 --- a/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx +++ b/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_PROVIDES_API } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -26,6 +25,7 @@ import { waitFor } from '@testing-library/react'; import React from 'react'; import { ApiDocsConfig, apiDocsConfigRef } from '../../config'; import { ProvidedApisCard } from './ProvidedApisCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const apiDocsConfig: jest.Mocked = { diff --git a/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.tsx b/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.tsx index 6659d7d85e..d49833f2da 100644 --- a/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.tsx +++ b/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.tsx @@ -19,13 +19,6 @@ import { Entity, RELATION_PROVIDES_API, } from '@backstage/catalog-model'; -import { - CodeSnippet, - InfoCard, - Link, - Progress, - WarningPanel, -} from '@backstage/core'; import { Typography } from '@material-ui/core'; import { EntityTable, @@ -34,6 +27,13 @@ import { } from '@backstage/plugin-catalog-react'; import React from 'react'; import { apiEntityColumns } from './presets'; +import { + CodeSnippet, + InfoCard, + Link, + Progress, + WarningPanel, +} from '@backstage/core-components'; type Props = { /** @deprecated The entity is now grabbed from context instead */ diff --git a/plugins/api-docs/src/components/ApisCards/presets.tsx b/plugins/api-docs/src/components/ApisCards/presets.tsx index 151cccf846..c428bc3379 100644 --- a/plugins/api-docs/src/components/ApisCards/presets.tsx +++ b/plugins/api-docs/src/components/ApisCards/presets.tsx @@ -15,10 +15,10 @@ */ import { ApiEntity } from '@backstage/catalog-model'; -import { TableColumn } from '@backstage/core'; import { EntityTable } from '@backstage/plugin-catalog-react'; import React from 'react'; import { ApiTypeTitle } from '../ApiDefinitionCard'; +import { TableColumn } from '@backstage/core-components'; export function createSpecApiTypeColumn(): TableColumn { return { diff --git a/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx b/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx index 104b360ff6..0b4c66244e 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_API_CONSUMED_BY } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -25,6 +24,7 @@ import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { ConsumingComponentsCard } from './ConsumingComponentsCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.tsx b/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.tsx index 914d034237..c6cec12da2 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.tsx @@ -19,13 +19,6 @@ import { Entity, RELATION_API_CONSUMED_BY, } from '@backstage/catalog-model'; -import { - CodeSnippet, - InfoCard, - Link, - Progress, - WarningPanel, -} from '@backstage/core'; import { Typography } from '@material-ui/core'; import { EntityTable, @@ -33,6 +26,13 @@ import { useRelatedEntities, } from '@backstage/plugin-catalog-react'; import React from 'react'; +import { + CodeSnippet, + InfoCard, + Link, + Progress, + WarningPanel, +} from '@backstage/core-components'; type Props = { /** @deprecated The entity is now grabbed from context instead */ diff --git a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx index c7c6bacc84..f4257037aa 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_API_PROVIDED_BY } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -25,6 +24,7 @@ import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { ProvidingComponentsCard } from './ProvidingComponentsCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx index 7c87943a9b..cf3aa2ea3e 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.tsx @@ -19,13 +19,6 @@ import { Entity, RELATION_API_PROVIDED_BY, } from '@backstage/catalog-model'; -import { - CodeSnippet, - InfoCard, - Link, - Progress, - WarningPanel, -} from '@backstage/core'; import { Typography } from '@material-ui/core'; import { EntityTable, @@ -33,6 +26,13 @@ import { useRelatedEntities, } from '@backstage/plugin-catalog-react'; import React from 'react'; +import { + CodeSnippet, + InfoCard, + Link, + Progress, + WarningPanel, +} from '@backstage/core-components'; type Props = { /** @deprecated The entity is now grabbed from context instead */ diff --git a/plugins/api-docs/src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx b/plugins/api-docs/src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx index 56d6914f5b..5b8d193b1a 100644 --- a/plugins/api-docs/src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx +++ b/plugins/api-docs/src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ -import { Progress } from '@backstage/core'; import { BackstageTheme } from '@backstage/theme'; import { makeStyles } from '@material-ui/core/styles'; import 'graphiql/graphiql.css'; import { buildSchema } from 'graphql'; import React, { Suspense } from 'react'; +import { Progress } from '@backstage/core-components'; const GraphiQL = React.lazy(() => import('graphiql')); diff --git a/plugins/api-docs/src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx b/plugins/api-docs/src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx index 0b2ebb4ca4..36b32b6831 100644 --- a/plugins/api-docs/src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx +++ b/plugins/api-docs/src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ -import { CodeSnippet } from '@backstage/core'; import React from 'react'; +import { CodeSnippet } from '@backstage/core-components'; type Props = { definition: any; diff --git a/plugins/api-docs/src/config.ts b/plugins/api-docs/src/config.ts index c2a806d8b2..996fcacac6 100644 --- a/plugins/api-docs/src/config.ts +++ b/plugins/api-docs/src/config.ts @@ -15,8 +15,8 @@ */ import { ApiEntity } from '@backstage/catalog-model'; -import { createApiRef } from '@backstage/core'; import { ApiDefinitionWidget } from './components/ApiDefinitionCard/ApiDefinitionWidget'; +import { createApiRef } from '@backstage/core-plugin-api'; export const apiDocsConfigRef = createApiRef({ id: 'plugin.api-docs.config', diff --git a/plugins/api-docs/src/plugin.ts b/plugins/api-docs/src/plugin.ts index bb8395081f..6004cedc31 100644 --- a/plugins/api-docs/src/plugin.ts +++ b/plugins/api-docs/src/plugin.ts @@ -15,15 +15,15 @@ */ import { ApiEntity } from '@backstage/catalog-model'; +import { defaultDefinitionWidgets } from './components/ApiDefinitionCard'; +import { apiDocsConfigRef } from './config'; +import { createComponentRouteRef, rootRoute } from './routes'; import { createApiFactory, createComponentExtension, createPlugin, createRoutableExtension, -} from '@backstage/core'; -import { defaultDefinitionWidgets } from './components/ApiDefinitionCard'; -import { apiDocsConfigRef } from './config'; -import { createComponentRouteRef, rootRoute } from './routes'; +} from '@backstage/core-plugin-api'; export const apiDocsPlugin = createPlugin({ id: 'api-docs', diff --git a/plugins/api-docs/src/routes.ts b/plugins/api-docs/src/routes.ts index 9ca11c59ee..d56bc16979 100644 --- a/plugins/api-docs/src/routes.ts +++ b/plugins/api-docs/src/routes.ts @@ -14,7 +14,10 @@ * limitations under the License. */ -import { createExternalRouteRef, createRouteRef } from '@backstage/core'; +import { + createExternalRouteRef, + createRouteRef, +} from '@backstage/core-plugin-api'; const NoIcon = () => null; diff --git a/plugins/badges/src/api/BadgesClient.ts b/plugins/badges/src/api/BadgesClient.ts index c015a59703..82fb286799 100644 --- a/plugins/badges/src/api/BadgesClient.ts +++ b/plugins/badges/src/api/BadgesClient.ts @@ -15,11 +15,11 @@ */ import { generatePath } from 'react-router'; -import { DiscoveryApi, IdentityApi } from '@backstage/core'; import { ResponseError } from '@backstage/errors'; import { Entity, ENTITY_DEFAULT_NAMESPACE } from '@backstage/catalog-model'; import { entityRoute } from '@backstage/plugin-catalog-react'; import { BadgesApi, BadgeSpec } from './types'; +import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api'; export class BadgesClient implements BadgesApi { private readonly discoveryApi: DiscoveryApi; diff --git a/plugins/badges/src/api/types.ts b/plugins/badges/src/api/types.ts index 9765af2c93..64d19d43b1 100644 --- a/plugins/badges/src/api/types.ts +++ b/plugins/badges/src/api/types.ts @@ -15,7 +15,7 @@ */ import { Entity } from '@backstage/catalog-model'; -import { createApiRef } from '@backstage/core'; +import { createApiRef } from '@backstage/core-plugin-api'; export const badgesApiRef = createApiRef({ id: 'plugin.badges.client', diff --git a/plugins/badges/src/components/EntityBadgesDialog.test.tsx b/plugins/badges/src/components/EntityBadgesDialog.test.tsx index 62f2b55bc5..32c95041a1 100644 --- a/plugins/badges/src/components/EntityBadgesDialog.test.tsx +++ b/plugins/badges/src/components/EntityBadgesDialog.test.tsx @@ -16,17 +16,14 @@ import React from 'react'; import { Entity } from '@backstage/catalog-model'; -import { - ApiProvider, - ApiRegistry, - ErrorApi, - errorApiRef, -} from '@backstage/core'; import { renderWithEffects } from '@backstage/test-utils'; import { BadgesApi, badgesApiRef } from '../api'; import { EntityBadgesDialog } from './EntityBadgesDialog'; import { EntityProvider } from '@backstage/plugin-catalog-react'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { ErrorApi, errorApiRef } from '@backstage/core-plugin-api'; + describe('EntityBadgesDialog', () => { it('should render', async () => { const mockApi: jest.Mocked = { diff --git a/plugins/badges/src/components/EntityBadgesDialog.tsx b/plugins/badges/src/components/EntityBadgesDialog.tsx index c0cbd6b15c..2eee3f9540 100644 --- a/plugins/badges/src/components/EntityBadgesDialog.tsx +++ b/plugins/badges/src/components/EntityBadgesDialog.tsx @@ -14,12 +14,6 @@ * limitations under the License. */ -import { - CodeSnippet, - Progress, - ResponseErrorPanel, - useApi, -} from '@backstage/core'; import { useEntity } from '@backstage/plugin-catalog-react'; import { Box, @@ -36,6 +30,13 @@ import React from 'react'; import { useAsync } from 'react-use'; import { badgesApiRef } from '../api'; +import { + CodeSnippet, + Progress, + ResponseErrorPanel, +} from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + type Props = { open: boolean; onClose?: () => any; diff --git a/plugins/badges/src/plugin.ts b/plugins/badges/src/plugin.ts index a247c93a4b..c449e12f8e 100644 --- a/plugins/badges/src/plugin.ts +++ b/plugins/badges/src/plugin.ts @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { badgesApiRef, BadgesClient } from './api'; import { createApiFactory, createComponentExtension, createPlugin, discoveryApiRef, identityApiRef, -} from '@backstage/core'; -import { badgesApiRef, BadgesClient } from './api'; +} from '@backstage/core-plugin-api'; export const badgesPlugin = createPlugin({ id: 'badges', diff --git a/plugins/bitrise/dev/index.tsx b/plugins/bitrise/dev/index.tsx index 8d328b3e7f..277b6fa10b 100644 --- a/plugins/bitrise/dev/index.tsx +++ b/plugins/bitrise/dev/index.tsx @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { Content, Header, Page } from '@backstage/core'; import { createDevApp, EntityGridItem } from '@backstage/dev-utils'; import React from 'react'; import { EntityBitriseContent } from '../src'; @@ -28,6 +27,7 @@ import { } from '../src/api/bitriseApi.model'; import { BITRISE_APP_ANNOTATION } from '../src/components/BitriseBuildsComponent'; import { bitriseApiRef } from '../src/plugin'; +import { Content, Header, Page } from '@backstage/core-components'; const mockedPagingResponse: BitrisePagingResponse = { next: 'fae3232de3d2', diff --git a/plugins/bitrise/src/api/bitriseApi.client.test.ts b/plugins/bitrise/src/api/bitriseApi.client.test.ts index bc62491c34..e7c355d261 100644 --- a/plugins/bitrise/src/api/bitriseApi.client.test.ts +++ b/plugins/bitrise/src/api/bitriseApi.client.test.ts @@ -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(); diff --git a/plugins/bitrise/src/api/bitriseApi.client.ts b/plugins/bitrise/src/api/bitriseApi.client.ts index e7af5259ab..747836878d 100644 --- a/plugins/bitrise/src/api/bitriseApi.client.ts +++ b/plugins/bitrise/src/api/bitriseApi.client.ts @@ -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) {} diff --git a/plugins/bitrise/src/components/BitriseArtifactsComponent/BitriseArtifactsComponent.tsx b/plugins/bitrise/src/components/BitriseArtifactsComponent/BitriseArtifactsComponent.tsx index 6ff1d50db5..f5cc73c0d9 100644 --- a/plugins/bitrise/src/components/BitriseArtifactsComponent/BitriseArtifactsComponent.tsx +++ b/plugins/bitrise/src/components/BitriseArtifactsComponent/BitriseArtifactsComponent.tsx @@ -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; diff --git a/plugins/bitrise/src/components/BitriseBuildsComponent/BitriseBuildsComponent.tsx b/plugins/bitrise/src/components/BitriseBuildsComponent/BitriseBuildsComponent.tsx index eeabaf0b08..58ebf2a873 100644 --- a/plugins/bitrise/src/components/BitriseBuildsComponent/BitriseBuildsComponent.tsx +++ b/plugins/bitrise/src/components/BitriseBuildsComponent/BitriseBuildsComponent.tsx @@ -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; diff --git a/plugins/bitrise/src/components/BitriseBuildsTableComponent/BitriseBuildsTableComponent.test.tsx b/plugins/bitrise/src/components/BitriseBuildsTableComponent/BitriseBuildsTableComponent.test.tsx index b3b6dfdc81..2a1d2d5b74 100644 --- a/plugins/bitrise/src/components/BitriseBuildsTableComponent/BitriseBuildsTableComponent.test.tsx +++ b/plugins/bitrise/src/components/BitriseBuildsTableComponent/BitriseBuildsTableComponent.test.tsx @@ -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(), diff --git a/plugins/bitrise/src/components/BitriseBuildsTableComponent/BitriseBuildsTableComponent.tsx b/plugins/bitrise/src/components/BitriseBuildsTableComponent/BitriseBuildsTableComponent.tsx index 06a9ddd9f8..71c3e7de46 100644 --- a/plugins/bitrise/src/components/BitriseBuildsTableComponent/BitriseBuildsTableComponent.tsx +++ b/plugins/bitrise/src/components/BitriseBuildsTableComponent/BitriseBuildsTableComponent.tsx @@ -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; diff --git a/plugins/bitrise/src/components/useBitriseArtifactDetails.ts b/plugins/bitrise/src/components/useBitriseArtifactDetails.ts index 06c38cf8b1..c66dad3892 100644 --- a/plugins/bitrise/src/components/useBitriseArtifactDetails.ts +++ b/plugins/bitrise/src/components/useBitriseArtifactDetails.ts @@ -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, diff --git a/plugins/bitrise/src/components/useBitriseArtifacts.ts b/plugins/bitrise/src/components/useBitriseArtifacts.ts index 0194f1752d..465a9f8d48 100644 --- a/plugins/bitrise/src/components/useBitriseArtifacts.ts +++ b/plugins/bitrise/src/components/useBitriseArtifacts.ts @@ -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); diff --git a/plugins/bitrise/src/extensions.ts b/plugins/bitrise/src/extensions.ts index 04e9ee2a09..f280252a9c 100644 --- a/plugins/bitrise/src/extensions.ts +++ b/plugins/bitrise/src/extensions.ts @@ -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({ diff --git a/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts b/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts index a1a7baf0a4..437d350d2b 100644 --- a/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts +++ b/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts @@ -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, diff --git a/plugins/bitrise/src/hooks/useBitriseBuilds.ts b/plugins/bitrise/src/hooks/useBitriseBuilds.ts index 96bd8628b3..88f0985058 100644 --- a/plugins/bitrise/src/hooks/useBitriseBuilds.ts +++ b/plugins/bitrise/src/hooks/useBitriseBuilds.ts @@ -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, diff --git a/plugins/bitrise/src/plugin.ts b/plugins/bitrise/src/plugin.ts index acd001d84b..f6d58bc40a 100644 --- a/plugins/bitrise/src/plugin.ts +++ b/plugins/bitrise/src/plugin.ts @@ -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({ id: 'plugin.bitrise.service', diff --git a/plugins/catalog-import/dev/index.tsx b/plugins/catalog-import/dev/index.tsx index e794628e6c..094fde250d 100644 --- a/plugins/catalog-import/dev/index.tsx +++ b/plugins/catalog-import/dev/index.tsx @@ -16,7 +16,6 @@ import { CatalogApi } from '@backstage/catalog-client'; import { Entity, EntityName } from '@backstage/catalog-model'; -import { Content, Header, InfoCard, Page } from '@backstage/core'; import { createDevApp } from '@backstage/dev-utils'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { Grid, ListItem, ListItemIcon, ListItemText } from '@material-ui/core'; @@ -31,6 +30,7 @@ import { ImportStepper, } from '../src'; import { ImportComponentPage } from '../src/components/ImportComponentPage'; +import { Content, Header, InfoCard, Page } from '@backstage/core-components'; const getEntityNames = (url: string): EntityName[] => [ { diff --git a/plugins/catalog-import/src/api/CatalogImportApi.ts b/plugins/catalog-import/src/api/CatalogImportApi.ts index 5237e0339f..2adac5d00d 100644 --- a/plugins/catalog-import/src/api/CatalogImportApi.ts +++ b/plugins/catalog-import/src/api/CatalogImportApi.ts @@ -15,8 +15,8 @@ */ import { EntityName } from '@backstage/catalog-model'; -import { createApiRef } from '@backstage/core'; import { PartialEntity } from '../types'; +import { createApiRef } from '@backstage/core-plugin-api'; export const catalogImportApiRef = createApiRef({ id: 'plugin.catalog-import.service', diff --git a/plugins/catalog-import/src/api/CatalogImportClient.test.ts b/plugins/catalog-import/src/api/CatalogImportClient.test.ts index de7055cf25..f39ebed14a 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.test.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.test.ts @@ -51,7 +51,6 @@ jest.mock('./GitHub', () => ({ getGithubIntegrationConfig: jest.fn(), })); -import { ConfigReader, OAuthApi, UrlPatternDiscovery } from '@backstage/core'; import { GitHubIntegrationConfig, ScmIntegrations, @@ -64,6 +63,9 @@ import { setupServer } from 'msw/node'; import { CatalogImportClient } from './CatalogImportClient'; import { getGithubIntegrationConfig } from './GitHub'; +import { ConfigReader, UrlPatternDiscovery } from '@backstage/core-app-api'; +import { OAuthApi } from '@backstage/core-plugin-api'; + const server = setupServer(); describe('CatalogImportClient', () => { diff --git a/plugins/catalog-import/src/api/CatalogImportClient.ts b/plugins/catalog-import/src/api/CatalogImportClient.ts index 6dd48d2aa7..ea3f58ac78 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.ts @@ -16,7 +16,6 @@ import { CatalogApi } from '@backstage/catalog-client'; import { EntityName } from '@backstage/catalog-model'; -import { DiscoveryApi, IdentityApi, OAuthApi } from '@backstage/core'; import { GitHubIntegrationConfig, ScmIntegrationRegistry, @@ -26,6 +25,11 @@ import { Octokit } from '@octokit/rest'; import { PartialEntity } from '../types'; import { AnalyzeResult, CatalogImportApi } from './CatalogImportApi'; import { getGithubIntegrationConfig } from './GitHub'; +import { + DiscoveryApi, + IdentityApi, + OAuthApi, +} from '@backstage/core-plugin-api'; export class CatalogImportClient implements CatalogImportApi { private readonly discoveryApi: DiscoveryApi; diff --git a/plugins/catalog-import/src/components/ImportComponentPage.test.tsx b/plugins/catalog-import/src/components/ImportComponentPage.test.tsx index 08903e9933..48be47143a 100644 --- a/plugins/catalog-import/src/components/ImportComponentPage.test.tsx +++ b/plugins/catalog-import/src/components/ImportComponentPage.test.tsx @@ -15,12 +15,6 @@ */ import { CatalogClient } from '@backstage/catalog-client'; -import { - ApiProvider, - ApiRegistry, - configApiRef, - ConfigReader, -} from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { wrapInTestApp } from '@backstage/test-utils'; import { act, render } from '@testing-library/react'; @@ -28,6 +22,13 @@ import React from 'react'; import { catalogImportApiRef, CatalogImportClient } from '../api'; import { ImportComponentPage } from './ImportComponentPage'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; +import { configApiRef } from '@backstage/core-plugin-api'; + describe('', () => { const identityApi = { getUserId: () => { diff --git a/plugins/catalog-import/src/components/ImportComponentPage.tsx b/plugins/catalog-import/src/components/ImportComponentPage.tsx index 1d1a8056bd..c9ed3f29b0 100644 --- a/plugins/catalog-import/src/components/ImportComponentPage.tsx +++ b/plugins/catalog-import/src/components/ImportComponentPage.tsx @@ -14,21 +14,20 @@ * limitations under the License. */ +import { Grid, Typography } from '@material-ui/core'; +import React from 'react'; +import { ImportStepper } from './ImportStepper'; +import { StepperProviderOpts } from './ImportStepper/defaults'; + +import { ConfigApi, configApiRef, useApi } from '@backstage/core-plugin-api'; import { - ConfigApi, - configApiRef, Content, ContentHeader, Header, InfoCard, Page, SupportButton, - useApi, -} from '@backstage/core'; -import { Grid, Typography } from '@material-ui/core'; -import React from 'react'; -import { ImportStepper } from './ImportStepper'; -import { StepperProviderOpts } from './ImportStepper/defaults'; +} from '@backstage/core-components'; function repositories(configApi: ConfigApi): string[] { const integrations = configApi.getConfig('integrations'); diff --git a/plugins/catalog-import/src/components/ImportStepper/ImportStepper.tsx b/plugins/catalog-import/src/components/ImportStepper/ImportStepper.tsx index 49fce69b5a..abae68fa58 100644 --- a/plugins/catalog-import/src/components/ImportStepper/ImportStepper.tsx +++ b/plugins/catalog-import/src/components/ImportStepper/ImportStepper.tsx @@ -14,12 +14,6 @@ * limitations under the License. */ -import { - configApiRef, - InfoCard, - InfoCardVariants, - useApi, -} from '@backstage/core'; import { Step, StepContent, Stepper } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import React, { useMemo } from 'react'; @@ -32,6 +26,9 @@ import { StepperProviderOpts, } from './defaults'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; +import { InfoCard, InfoCardVariants } from '@backstage/core-components'; + const useStyles = makeStyles(() => ({ stepperRoot: { padding: 0, diff --git a/plugins/catalog-import/src/components/ImportStepper/defaults.tsx b/plugins/catalog-import/src/components/ImportStepper/defaults.tsx index 1c4891855f..2c4febf06d 100644 --- a/plugins/catalog-import/src/components/ImportStepper/defaults.tsx +++ b/plugins/catalog-import/src/components/ImportStepper/defaults.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { ConfigApi } from '@backstage/core'; import { Box, Checkbox, @@ -35,6 +34,7 @@ import { import { StepPrepareSelectLocations } from '../StepPrepareSelectLocations'; import { StepReviewLocation } from '../StepReviewLocation'; import { ImportFlows, ImportState } from '../useImportState'; +import { ConfigApi } from '@backstage/core-plugin-api'; export type StepperProviderOpts = { pullRequest?: { diff --git a/plugins/catalog-import/src/components/StepFinishImportLocation/StepFinishImportLocation.tsx b/plugins/catalog-import/src/components/StepFinishImportLocation/StepFinishImportLocation.tsx index 5d7d0b919c..b8471b704f 100644 --- a/plugins/catalog-import/src/components/StepFinishImportLocation/StepFinishImportLocation.tsx +++ b/plugins/catalog-import/src/components/StepFinishImportLocation/StepFinishImportLocation.tsx @@ -14,13 +14,13 @@ * limitations under the License. */ -import { Link } from '@backstage/core'; import { Grid, Typography } from '@material-ui/core'; import LocationOnIcon from '@material-ui/icons/LocationOn'; import React from 'react'; import { BackButton } from '../Buttons'; import { EntityListComponent } from '../EntityListComponent'; import { PrepareResult } from '../useImportState'; +import { Link } from '@backstage/core-components'; type Props = { prepareResult: PrepareResult; diff --git a/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.test.tsx b/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.test.tsx index 03882d48ce..c25d83a044 100644 --- a/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.test.tsx +++ b/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.test.tsx @@ -14,13 +14,15 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core'; import { act, render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; import { AnalyzeResult, catalogImportApiRef } from '../../api/'; import { StepInitAnalyzeUrl } from './StepInitAnalyzeUrl'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { errorApiRef } from '@backstage/core-plugin-api'; + describe('', () => { const catalogImportApi: jest.Mocked = { analyzeUrl: jest.fn(), diff --git a/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.tsx b/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.tsx index 09f6230fdc..5338219bc6 100644 --- a/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.tsx +++ b/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.tsx @@ -14,13 +14,13 @@ * limitations under the License. */ -import { errorApiRef, useApi } from '@backstage/core'; import { FormHelperText, Grid, TextField } from '@material-ui/core'; import React, { useCallback, useState } from 'react'; import { useForm } from 'react-hook-form'; import { AnalyzeResult, catalogImportApiRef } from '../../api'; import { NextButton } from '../Buttons'; import { ImportFlows, PrepareResult } from '../useImportState'; +import { errorApiRef, useApi } from '@backstage/core-plugin-api'; type FormData = { url: string; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.tsx index c10c011820..76ff94d224 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.tsx @@ -15,10 +15,10 @@ */ import { Entity } from '@backstage/catalog-model'; -import { CodeSnippet } from '@backstage/core'; import { Card, CardContent, CardHeader } from '@material-ui/core'; import React from 'react'; import YAML from 'yaml'; +import { CodeSnippet } from '@backstage/core-components'; type Props = { repositoryUrl: string; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.tsx index 01af05d43a..6c0dd62373 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ -import { MarkdownContent } from '@backstage/core'; import { Card, CardContent, CardHeader } from '@material-ui/core'; import React from 'react'; +import { MarkdownContent } from '@backstage/core-components'; type Props = { title: string; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx index be923c9ee8..40b9559354 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { TextField } from '@material-ui/core'; import { act, render, screen } from '@testing-library/react'; @@ -25,6 +24,7 @@ import { generateEntities, StepPrepareCreatePullRequest, } from './StepPrepareCreatePullRequest'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogImportApi: jest.Mocked = { diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx index d1f8be7065..6cd7cc16ee 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { useApi } from '@backstage/core'; import { catalogApiRef, formatEntityRefTitle, @@ -33,6 +32,7 @@ import { PrepareResult } from '../useImportState'; import { PreparePullRequestForm } from './PreparePullRequestForm'; import { PreviewCatalogInfoComponent } from './PreviewCatalogInfoComponent'; import { PreviewPullRequestComponent } from './PreviewPullRequestComponent'; +import { useApi } from '@backstage/core-plugin-api'; const useStyles = makeStyles(theme => ({ previewCard: { diff --git a/plugins/catalog-import/src/components/StepReviewLocation/StepReviewLocation.tsx b/plugins/catalog-import/src/components/StepReviewLocation/StepReviewLocation.tsx index eb2268f212..74f030f855 100644 --- a/plugins/catalog-import/src/components/StepReviewLocation/StepReviewLocation.tsx +++ b/plugins/catalog-import/src/components/StepReviewLocation/StepReviewLocation.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { configApiRef, Link, useApi } from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { FormHelperText, Grid, Typography } from '@material-ui/core'; import LocationOnIcon from '@material-ui/icons/LocationOn'; @@ -23,6 +22,9 @@ import { BackButton, NextButton } from '../Buttons'; import { EntityListComponent } from '../EntityListComponent'; import { PrepareResult, ReviewResult } from '../useImportState'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; +import { Link } from '@backstage/core-components'; + type Props = { prepareResult: PrepareResult; onReview: (result: ReviewResult) => void; diff --git a/plugins/catalog-import/src/plugin.ts b/plugins/catalog-import/src/plugin.ts index b0beaf5a50..d056fd6ca4 100644 --- a/plugins/catalog-import/src/plugin.ts +++ b/plugins/catalog-import/src/plugin.ts @@ -14,6 +14,9 @@ * limitations under the License. */ +import { scmIntegrationsApiRef } from '@backstage/integration-react'; +import { catalogApiRef } from '@backstage/plugin-catalog-react'; +import { catalogImportApiRef, CatalogImportClient } from './api'; import { createApiFactory, createPlugin, @@ -22,10 +25,7 @@ import { discoveryApiRef, githubAuthApiRef, identityApiRef, -} from '@backstage/core'; -import { scmIntegrationsApiRef } from '@backstage/integration-react'; -import { catalogApiRef } from '@backstage/plugin-catalog-react'; -import { catalogImportApiRef, CatalogImportClient } from './api'; +} from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ path: '', diff --git a/plugins/catalog-react/src/components/EntityRefLink/EntityRefLink.tsx b/plugins/catalog-react/src/components/EntityRefLink/EntityRefLink.tsx index c19c9c1703..6a00445d31 100644 --- a/plugins/catalog-react/src/components/EntityRefLink/EntityRefLink.tsx +++ b/plugins/catalog-react/src/components/EntityRefLink/EntityRefLink.tsx @@ -18,11 +18,11 @@ import { EntityName, ENTITY_DEFAULT_NAMESPACE, } from '@backstage/catalog-model'; -import { Link, LinkProps } from '@backstage/core'; import React, { forwardRef } from 'react'; import { generatePath } from 'react-router'; import { entityRoute } from '../../routes'; import { formatEntityRefTitle } from './format'; +import { Link, LinkProps } from '@backstage/core-components'; export type EntityRefLinkProps = { entityRef: Entity | EntityName; diff --git a/plugins/catalog-react/src/components/EntityRefLink/EntityRefLinks.tsx b/plugins/catalog-react/src/components/EntityRefLink/EntityRefLinks.tsx index 52ed87c80b..632fb0531d 100644 --- a/plugins/catalog-react/src/components/EntityRefLink/EntityRefLinks.tsx +++ b/plugins/catalog-react/src/components/EntityRefLink/EntityRefLinks.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ import { Entity, EntityName } from '@backstage/catalog-model'; -import { LinkProps } from '@backstage/core'; import React from 'react'; import { EntityRefLink } from './EntityRefLink'; +import { LinkProps } from '@backstage/core-components'; export type EntityRefLinksProps = { entityRefs: (Entity | EntityName)[]; diff --git a/plugins/catalog-react/src/components/EntityTable/EntityTable.tsx b/plugins/catalog-react/src/components/EntityTable/EntityTable.tsx index afcaaea305..6cf477e685 100644 --- a/plugins/catalog-react/src/components/EntityTable/EntityTable.tsx +++ b/plugins/catalog-react/src/components/EntityTable/EntityTable.tsx @@ -15,11 +15,11 @@ */ import { Entity } from '@backstage/catalog-model'; -import { Table, TableColumn } from '@backstage/core'; import { makeStyles } from '@material-ui/core'; import React, { ReactNode } from 'react'; import * as columnFactories from './columns'; import { componentEntityColumns, systemEntityColumns } from './presets'; +import { Table, TableColumn } from '@backstage/core-components'; type Props = { title: string; diff --git a/plugins/catalog-react/src/components/EntityTable/columns.tsx b/plugins/catalog-react/src/components/EntityTable/columns.tsx index 7f5417df4e..03f31963f3 100644 --- a/plugins/catalog-react/src/components/EntityTable/columns.tsx +++ b/plugins/catalog-react/src/components/EntityTable/columns.tsx @@ -20,7 +20,6 @@ import { RELATION_OWNED_BY, RELATION_PART_OF, } from '@backstage/catalog-model'; -import { OverflowTooltip, TableColumn } from '@backstage/core'; import React from 'react'; import { getEntityRelations } from '../../utils'; import { @@ -28,6 +27,7 @@ import { EntityRefLinks, formatEntityRefTitle, } from '../EntityRefLink'; +import { OverflowTooltip, TableColumn } from '@backstage/core-components'; export function createEntityRefColumn({ defaultKind, diff --git a/plugins/catalog-react/src/components/EntityTable/presets.tsx b/plugins/catalog-react/src/components/EntityTable/presets.tsx index 7ce6b75532..816115f42d 100644 --- a/plugins/catalog-react/src/components/EntityTable/presets.tsx +++ b/plugins/catalog-react/src/components/EntityTable/presets.tsx @@ -15,7 +15,6 @@ */ import { ComponentEntity, SystemEntity } from '@backstage/catalog-model'; -import { TableColumn } from '@backstage/core'; import { createDomainColumn, createEntityRefColumn, @@ -25,6 +24,7 @@ import { createSpecTypeColumn, createSystemColumn, } from './columns'; +import { TableColumn } from '@backstage/core-components'; export const systemEntityColumns: TableColumn[] = [ createEntityRefColumn({ defaultKind: 'system' }), diff --git a/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx b/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx index f33feb3a57..b06f4202d3 100644 --- a/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx +++ b/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx @@ -17,12 +17,6 @@ import React from 'react'; import { fireEvent, render, waitFor } from '@testing-library/react'; import { capitalize } from 'lodash'; -import { - AlertApi, - alertApiRef, - ApiProvider, - ApiRegistry, -} from '@backstage/core'; import { CatalogApi } from '@backstage/catalog-client'; import { Entity } from '@backstage/catalog-model'; import { EntityTypePicker } from './EntityTypePicker'; @@ -30,6 +24,9 @@ import { MockEntityListContextProvider } from '../../testUtils/providers'; import { catalogApiRef } from '../../api'; import { EntityKindFilter, EntityTypeFilter } from '../../types'; +import { AlertApi, alertApiRef } from '@backstage/core-plugin-api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; + const entities: Entity[] = [ { apiVersion: '1', diff --git a/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.tsx b/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.tsx index f5a21d4284..1f84ba7c5f 100644 --- a/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.tsx +++ b/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.tsx @@ -17,9 +17,11 @@ import React from 'react'; import { capitalize } from 'lodash'; import { Box } from '@material-ui/core'; -import { alertApiRef, Select, useApi } from '@backstage/core'; import { useEntityTypeFilter } from '../../hooks/useEntityTypeFilter'; +import { alertApiRef, useApi } from '@backstage/core-plugin-api'; +import { Select } from '@backstage/core-components'; + export const EntityTypePicker = () => { const alertApi = useApi(alertApiRef); const { error, types, selectedType, setType } = useEntityTypeFilter(); diff --git a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx index dc3338645c..7432c6bbd2 100644 --- a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx +++ b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx @@ -23,19 +23,19 @@ import { } from '@backstage/catalog-model'; import { UserListPicker } from './UserListPicker'; import { MockEntityListContextProvider } from '../../testUtils/providers'; +import { EntityTagFilter, UserListFilter } from '../../types'; +import { CatalogApi } from '@backstage/catalog-client'; +import { catalogApiRef } from '../../api'; +import { MockStorageApi } from '@backstage/test-utils'; + +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; import { - ApiProvider, - ApiRegistry, ConfigApi, configApiRef, IdentityApi, identityApiRef, storageApiRef, -} from '@backstage/core'; -import { EntityTagFilter, UserListFilter } from '../../types'; -import { CatalogApi } from '@backstage/catalog-client'; -import { catalogApiRef } from '../../api'; -import { MockStorageApi } from '@backstage/test-utils'; +} from '@backstage/core-plugin-api'; const mockUser: UserEntity = { apiVersion: 'backstage.io/v1alpha1', diff --git a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.tsx b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.tsx index c799a317a5..d8b1374227 100644 --- a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.tsx +++ b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.tsx @@ -16,7 +16,6 @@ import React, { Fragment, useEffect, useMemo, useState } from 'react'; import { compact } from 'lodash'; -import { configApiRef, IconComponent, useApi } from '@backstage/core'; import { UserListFilter, UserListFilterKind } from '../../types'; import { useEntityListProvider, @@ -37,6 +36,11 @@ import { import SettingsIcon from '@material-ui/icons/Settings'; import StarIcon from '@material-ui/icons/Star'; import { reduceEntityFilters } from '../../utils'; +import { + configApiRef, + IconComponent, + useApi, +} from '@backstage/core-plugin-api'; const useStyles = makeStyles(theme => ({ root: { diff --git a/plugins/catalog-react/src/hooks/useEntityCompoundName.ts b/plugins/catalog-react/src/hooks/useEntityCompoundName.ts index f76097a6dc..0eb501bc4e 100644 --- a/plugins/catalog-react/src/hooks/useEntityCompoundName.ts +++ b/plugins/catalog-react/src/hooks/useEntityCompoundName.ts @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useRouteRefParams } from '@backstage/core'; import { entityRouteRef } from '../routes'; +import { useRouteRefParams } from '@backstage/core-plugin-api'; /** * Grabs entity kind, namespace, and name from the location diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx index e2dfbd91da..ec5e3bc684 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx @@ -16,15 +16,6 @@ import React, { PropsWithChildren } from 'react'; import { act, renderHook } from '@testing-library/react-hooks'; -import { - ApiProvider, - ApiRegistry, - ConfigApi, - configApiRef, - IdentityApi, - identityApiRef, - storageApiRef, -} from '@backstage/core'; import { MockStorageApi } from '@backstage/test-utils'; import { CatalogApi } from '@backstage/catalog-client'; import { Entity, UserEntity } from '@backstage/catalog-model'; @@ -41,6 +32,15 @@ import { } from '../types'; import { EntityKindPicker, UserListPicker } from '../components'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { + ConfigApi, + configApiRef, + IdentityApi, + identityApiRef, + storageApiRef, +} from '@backstage/core-plugin-api'; + const mockUser: UserEntity = { apiVersion: 'backstage.io/v1beta1', kind: 'User', diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx index 6168a3ac3c..44d26eaef7 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { useApi } from '@backstage/core'; import { compact, isEqual } from 'lodash'; import React, { createContext, @@ -36,6 +35,7 @@ import { UserListFilter, } from '../types'; import { reduceCatalogFilters, reduceEntityFilters } from '../utils'; +import { useApi } from '@backstage/core-plugin-api'; export type DefaultEntityFilters = { kind?: EntityKindFilter; diff --git a/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx b/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx index c5e03b90c6..311cce3239 100644 --- a/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx +++ b/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx @@ -16,13 +16,13 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import { useAsync } from 'react-use'; -import { useApi } from '@backstage/core'; import { catalogApiRef } from '../api'; import { DefaultEntityFilters, useEntityListProvider, } from './useEntityListProvider'; import { EntityTypeFilter } from '../types'; +import { useApi } from '@backstage/core-plugin-api'; type EntityTypeReturn = { loading: boolean; diff --git a/plugins/catalog-react/src/hooks/useOwnUser.ts b/plugins/catalog-react/src/hooks/useOwnUser.ts index d79cfbe92c..ff080d167f 100644 --- a/plugins/catalog-react/src/hooks/useOwnUser.ts +++ b/plugins/catalog-react/src/hooks/useOwnUser.ts @@ -15,10 +15,10 @@ */ import { UserEntity } from '@backstage/catalog-model'; -import { identityApiRef, useApi } from '@backstage/core'; import { useAsync } from 'react-use'; import { AsyncState } from 'react-use/lib/useAsync'; import { catalogApiRef } from '../api'; +import { identityApiRef, useApi } from '@backstage/core-plugin-api'; /** * Get the catalog User entity (if any) that matches the logged-in user. diff --git a/plugins/catalog-react/src/hooks/useStarredEntities.test.tsx b/plugins/catalog-react/src/hooks/useStarredEntities.test.tsx index 1541fef9d1..ba7061a48b 100644 --- a/plugins/catalog-react/src/hooks/useStarredEntities.test.tsx +++ b/plugins/catalog-react/src/hooks/useStarredEntities.test.tsx @@ -17,10 +17,10 @@ import React, { PropsWithChildren } from 'react'; import { renderHook, act } from '@testing-library/react-hooks'; import { useStarredEntities } from './useStarredEntities'; -import { ApiProvider, ApiRegistry, WebStorage } from '@backstage/core'; import { storageApiRef, StorageApi } from '@backstage/core-plugin-api'; import { MockErrorApi } from '@backstage/test-utils'; import { Entity } from '@backstage/catalog-model'; +import { ApiProvider, ApiRegistry, WebStorage } from '@backstage/core-app-api'; describe('useStarredEntities', () => { let mockStorage: StorageApi | undefined; diff --git a/plugins/catalog-react/src/routes.ts b/plugins/catalog-react/src/routes.ts index 7470b8030e..39adf103d9 100644 --- a/plugins/catalog-react/src/routes.ts +++ b/plugins/catalog-react/src/routes.ts @@ -15,7 +15,7 @@ */ import { Entity, ENTITY_DEFAULT_NAMESPACE } from '@backstage/catalog-model'; -import { createRouteRef } from '@backstage/core'; +import { createRouteRef } from '@backstage/core-plugin-api'; const NoIcon = () => null; diff --git a/plugins/catalog/src/CatalogClientWrapper.test.ts b/plugins/catalog/src/CatalogClientWrapper.test.ts index 87dcd8f74b..d6b18b8ed1 100644 --- a/plugins/catalog/src/CatalogClientWrapper.test.ts +++ b/plugins/catalog/src/CatalogClientWrapper.test.ts @@ -15,8 +15,8 @@ */ import { CatalogClient } from '@backstage/catalog-client'; -import { DiscoveryApi, IdentityApi } from '@backstage/core'; import { CatalogClientWrapper } from './CatalogClientWrapper'; +import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api'; jest.mock('@backstage/catalog-client'); const MockedCatalogClient = CatalogClient as jest.Mock; diff --git a/plugins/catalog/src/CatalogClientWrapper.ts b/plugins/catalog/src/CatalogClientWrapper.ts index 4966d9c13f..f2c2ee29d9 100644 --- a/plugins/catalog/src/CatalogClientWrapper.ts +++ b/plugins/catalog/src/CatalogClientWrapper.ts @@ -23,7 +23,7 @@ import { CatalogListResponse, CatalogClient, } from '@backstage/catalog-client'; -import { IdentityApi } from '@backstage/core'; +import { IdentityApi } from '@backstage/core-plugin-api'; type CatalogRequestOptions = { token?: string; diff --git a/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx b/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx index 435a8d14d5..f0535e2f61 100644 --- a/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx +++ b/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx @@ -15,7 +15,6 @@ */ import { RELATION_OWNED_BY } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry, ConfigReader } from '@backstage/core'; import { ScmIntegrationsApi, scmIntegrationsApiRef, @@ -25,6 +24,11 @@ import { renderInTestApp } from '@backstage/test-utils'; import { act, fireEvent } from '@testing-library/react'; import React from 'react'; import { AboutCard } from './AboutCard'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; describe('', () => { it('renders info', async () => { diff --git a/plugins/catalog/src/components/AboutCard/AboutCard.tsx b/plugins/catalog/src/components/AboutCard/AboutCard.tsx index 3e8aec3e73..e795fb8a9b 100644 --- a/plugins/catalog/src/components/AboutCard/AboutCard.tsx +++ b/plugins/catalog/src/components/AboutCard/AboutCard.tsx @@ -20,12 +20,6 @@ import { RELATION_CONSUMES_API, RELATION_PROVIDES_API, } from '@backstage/catalog-model'; -import { - HeaderIconLinkRow, - IconLinkVerticalProps, - InfoCardVariants, - useApi, -} from '@backstage/core'; import { ScmIntegrationIcon, scmIntegrationsApiRef, @@ -50,6 +44,13 @@ import ExtensionIcon from '@material-ui/icons/Extension'; import React from 'react'; import { AboutContent } from './AboutContent'; +import { + HeaderIconLinkRow, + IconLinkVerticalProps, + InfoCardVariants, +} from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + const useStyles = makeStyles({ gridItemCard: { display: 'flex', diff --git a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx index a604166688..0d48822118 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx @@ -14,9 +14,11 @@ * limitations under the License. */ -import { configApiRef, Header, Page, useApi } from '@backstage/core'; import React from 'react'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; +import { Header, Page } from '@backstage/core-components'; + type Props = { children?: React.ReactNode; }; diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx index e6a1f1f687..7d7a496afe 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx @@ -20,14 +20,6 @@ import { RELATION_MEMBER_OF, RELATION_OWNED_BY, } from '@backstage/catalog-model'; -import { - ApiProvider, - ApiRegistry, - IdentityApi, - identityApiRef, - ProfileInfo, - storageApiRef, -} from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { MockStorageApi, @@ -39,6 +31,14 @@ import React from 'react'; import { createComponentRouteRef } from '../../routes'; import { CatalogPage } from './CatalogPage'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { + IdentityApi, + identityApiRef, + ProfileInfo, + storageApiRef, +} from '@backstage/core-plugin-api'; + describe('CatalogPage', () => { const catalogApi: Partial = { getEntities: () => diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index d3ade03fe4..efe08802e2 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -16,12 +16,6 @@ import React from 'react'; import { makeStyles } from '@material-ui/core'; -import { - Content, - ContentHeader, - SupportButton, - TableColumn, -} from '@backstage/core'; import { EntityKindPicker, EntityLifecyclePicker, @@ -32,11 +26,17 @@ import { UserListFilterKind, UserListPicker, } from '@backstage/plugin-catalog-react'; - import { CatalogTable } from '../CatalogTable'; + import { EntityRow } from '../CatalogTable/types'; import CatalogLayout from './CatalogLayout'; import { CreateComponentButton } from '../CreateComponentButton'; +import { + Content, + ContentHeader, + SupportButton, + TableColumn, +} from '@backstage/core-components'; const useStyles = makeStyles(theme => ({ contentWrapper: { diff --git a/plugins/catalog/src/components/CatalogResultListItem/CatalogResultListItem.tsx b/plugins/catalog/src/components/CatalogResultListItem/CatalogResultListItem.tsx index 8533de22f7..e84c9e6553 100644 --- a/plugins/catalog/src/components/CatalogResultListItem/CatalogResultListItem.tsx +++ b/plugins/catalog/src/components/CatalogResultListItem/CatalogResultListItem.tsx @@ -15,7 +15,6 @@ */ import React from 'react'; -import { Link } from '@backstage/core'; import { Box, Chip, @@ -24,6 +23,7 @@ import { ListItemText, makeStyles, } from '@material-ui/core'; +import { Link } from '@backstage/core-components'; const useStyles = makeStyles({ flexContainer: { diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index 6d9f0c21bd..f2b82d0428 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -14,13 +14,6 @@ * limitations under the License. */ import { RELATION_OWNED_BY, RELATION_PART_OF } from '@backstage/catalog-model'; -import { - CodeSnippet, - Table, - TableColumn, - TableProps, - WarningPanel, -} from '@backstage/core'; import { formatEntityRefTitle, getEntityMetadataEditUrl, @@ -39,6 +32,13 @@ import { } from '../FavouriteEntity/FavouriteEntity'; import * as columnFactories from './columns'; import { EntityRow } from './types'; +import { + CodeSnippet, + Table, + TableColumn, + TableProps, + WarningPanel, +} from '@backstage/core-components'; const defaultColumns: TableColumn[] = [ columnFactories.createNameColumn(), diff --git a/plugins/catalog/src/components/CatalogTable/columns.tsx b/plugins/catalog/src/components/CatalogTable/columns.tsx index 4f65e4b0c7..4b8784d72d 100644 --- a/plugins/catalog/src/components/CatalogTable/columns.tsx +++ b/plugins/catalog/src/components/CatalogTable/columns.tsx @@ -15,9 +15,9 @@ */ import React from 'react'; import { EntityRefLink, EntityRefLinks } from '@backstage/plugin-catalog-react'; -import { OverflowTooltip, TableColumn } from '@backstage/core'; import { Chip } from '@material-ui/core'; import { EntityRow } from './types'; +import { OverflowTooltip, TableColumn } from '@backstage/core-components'; export function createNameColumn(): TableColumn { return { diff --git a/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx b/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx index 896e9bada3..6144077a86 100644 --- a/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx +++ b/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx @@ -17,8 +17,8 @@ import React from 'react'; import { Link as RouterLink } from 'react-router-dom'; import { Button } from '@material-ui/core'; -import { useRouteRef } from '@backstage/core'; import { createComponentRouteRef } from '../../routes'; +import { useRouteRef } from '@backstage/core-plugin-api'; export const CreateComponentButton = () => { const createComponentLink = useRouteRef(createComponentRouteRef); diff --git a/plugins/catalog/src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.test.tsx b/plugins/catalog/src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.test.tsx index 4d78ce5019..6e78b1ec74 100644 --- a/plugins/catalog/src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.test.tsx +++ b/plugins/catalog/src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_DEPENDENCY_OF } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -25,6 +24,7 @@ import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { DependencyOfComponentsCard } from './DependencyOfComponentsCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/catalog/src/components/DependsOnComponentsCard/DependsOnComponentsCard.test.tsx b/plugins/catalog/src/components/DependsOnComponentsCard/DependsOnComponentsCard.test.tsx index 8ea7638c8e..a140120a09 100644 --- a/plugins/catalog/src/components/DependsOnComponentsCard/DependsOnComponentsCard.test.tsx +++ b/plugins/catalog/src/components/DependsOnComponentsCard/DependsOnComponentsCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_DEPENDS_ON } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -25,6 +24,7 @@ import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { DependsOnComponentsCard } from './DependsOnComponentsCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/catalog/src/components/DependsOnResourcesCard/DependsOnResourcesCard.test.tsx b/plugins/catalog/src/components/DependsOnResourcesCard/DependsOnResourcesCard.test.tsx index 8f425ba6aa..e5150f97a5 100644 --- a/plugins/catalog/src/components/DependsOnResourcesCard/DependsOnResourcesCard.test.tsx +++ b/plugins/catalog/src/components/DependsOnResourcesCard/DependsOnResourcesCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_DEPENDS_ON } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -25,6 +24,7 @@ import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { DependsOnResourcesCard } from './DependsOnResourcesCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx b/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx index 809a4fd16e..54a06a01a6 100644 --- a/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx +++ b/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { IconComponent } from '@backstage/core'; import { Divider, IconButton, @@ -28,6 +27,7 @@ import { makeStyles } from '@material-ui/core/styles'; import Cancel from '@material-ui/icons/Cancel'; import MoreVert from '@material-ui/icons/MoreVert'; import React, { useState } from 'react'; +import { IconComponent } from '@backstage/core-plugin-api'; // TODO(freben): It should probably instead be the case that Header sets the theme text color to white inside itself unconditionally instead const useStyles = makeStyles({ diff --git a/plugins/catalog/src/components/EntityLayout/EntityLayout.test.tsx b/plugins/catalog/src/components/EntityLayout/EntityLayout.test.tsx index c5b51b8334..c1a6f3d5f9 100644 --- a/plugins/catalog/src/components/EntityLayout/EntityLayout.test.tsx +++ b/plugins/catalog/src/components/EntityLayout/EntityLayout.test.tsx @@ -15,12 +15,6 @@ */ import { CatalogApi } from '@backstage/catalog-client'; import { Entity } from '@backstage/catalog-model'; -import { - AlertApi, - alertApiRef, - ApiProvider, - ApiRegistry, -} from '@backstage/core'; import { catalogApiRef, EntityContext } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { fireEvent } from '@testing-library/react'; @@ -29,6 +23,9 @@ import { act } from 'react-dom/test-utils'; import { Route, Routes } from 'react-router'; import { EntityLayout } from './EntityLayout'; +import { AlertApi, alertApiRef } from '@backstage/core-plugin-api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; + const mockEntityData = { loading: false, error: undefined, diff --git a/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx b/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx index aceb1da6f2..fef2cc0cd8 100644 --- a/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx +++ b/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx @@ -20,16 +20,10 @@ import { RELATION_OWNED_BY, } from '@backstage/catalog-model'; import { + useElementFilter, attachComponentData, - Content, - Header, - HeaderLabel, IconComponent, - Page, - Progress, - RoutedTabs, -} from '@backstage/core'; -import { useElementFilter } from '@backstage/core-plugin-api'; +} from '@backstage/core-plugin-api'; import { EntityContext, EntityRefLinks, @@ -43,6 +37,14 @@ import { useNavigate } from 'react-router'; import { EntityContextMenu } from '../EntityContextMenu/EntityContextMenu'; import { FavouriteEntity } from '../FavouriteEntity/FavouriteEntity'; import { UnregisterEntityDialog } from '../UnregisterEntityDialog/UnregisterEntityDialog'; +import { + Content, + Header, + HeaderLabel, + Page, + Progress, + RoutedTabs, +} from '@backstage/core-components'; type SubRoute = { path: string; diff --git a/plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx b/plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx index 3ced50decc..5ad29a5c84 100644 --- a/plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx +++ b/plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ -import { CodeSnippet } from '@backstage/core'; import { BackstageTheme } from '@backstage/theme'; import { Button, makeStyles, Typography } from '@material-ui/core'; import React from 'react'; +import { CodeSnippet } from '@backstage/core-components'; const ENTITY_YAML = `metadata: name: example diff --git a/plugins/catalog/src/components/EntityLinksCard/IconLink.tsx b/plugins/catalog/src/components/EntityLinksCard/IconLink.tsx index 32ea085889..9bc344978a 100644 --- a/plugins/catalog/src/components/EntityLinksCard/IconLink.tsx +++ b/plugins/catalog/src/components/EntityLinksCard/IconLink.tsx @@ -14,11 +14,13 @@ * limitations under the License. */ -import { Link, IconComponent } from '@backstage/core'; import { Grid, makeStyles, Typography } from '@material-ui/core'; import LanguageIcon from '@material-ui/icons/Language'; import React from 'react'; +import { Link } from '@backstage/core-components'; +import { IconComponent } from '@backstage/core-plugin-api'; + const useStyles = makeStyles({ svgIcon: { display: 'inline-block', diff --git a/plugins/catalog/src/components/EntityLinksCard/LinksGridList.tsx b/plugins/catalog/src/components/EntityLinksCard/LinksGridList.tsx index 9ef77a4bbf..7a387f52a2 100644 --- a/plugins/catalog/src/components/EntityLinksCard/LinksGridList.tsx +++ b/plugins/catalog/src/components/EntityLinksCard/LinksGridList.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ -import { IconComponent } from '@backstage/core'; import { GridList, GridListTile } from '@material-ui/core'; import React from 'react'; import { IconLink } from './IconLink'; import { ColumnBreakpoints } from './types'; import { useDynamicColumns } from './useDynamicColumns'; +import { IconComponent } from '@backstage/core-plugin-api'; export type LinksGridListItem = { href: string; diff --git a/plugins/catalog/src/components/EntityOrphanWarning/DeleteEntityDialog.test.tsx b/plugins/catalog/src/components/EntityOrphanWarning/DeleteEntityDialog.test.tsx index d9f266cce7..8393219e1f 100644 --- a/plugins/catalog/src/components/EntityOrphanWarning/DeleteEntityDialog.test.tsx +++ b/plugins/catalog/src/components/EntityOrphanWarning/DeleteEntityDialog.test.tsx @@ -17,17 +17,14 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { DeleteEntityDialog } from './DeleteEntityDialog'; import { ORIGIN_LOCATION_ANNOTATION } from '@backstage/catalog-model'; -import { - AlertApi, - alertApiRef, - ApiProvider, - ApiRegistry, -} from '@backstage/core'; import { CatalogApi } from '@backstage/catalog-client'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { screen, waitFor } from '@testing-library/react'; import { renderInTestApp } from '@backstage/test-utils'; +import { AlertApi, alertApiRef } from '@backstage/core-plugin-api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; + describe('DeleteEntityDialog', () => { const alertApi: jest.Mocked = { post: jest.fn(), diff --git a/plugins/catalog/src/components/EntityOrphanWarning/DeleteEntityDialog.tsx b/plugins/catalog/src/components/EntityOrphanWarning/DeleteEntityDialog.tsx index 26b6b29650..840f9eef86 100644 --- a/plugins/catalog/src/components/EntityOrphanWarning/DeleteEntityDialog.tsx +++ b/plugins/catalog/src/components/EntityOrphanWarning/DeleteEntityDialog.tsx @@ -15,10 +15,10 @@ */ import { Entity } from '@backstage/catalog-model'; -import { alertApiRef, useApi } from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { Button, Dialog, DialogActions, DialogTitle } from '@material-ui/core'; import React, { useState } from 'react'; +import { alertApiRef, useApi } from '@backstage/core-plugin-api'; type Props = { open: boolean; diff --git a/plugins/catalog/src/components/EntityOrphanWarning/EntityOrphanWarning.test.tsx b/plugins/catalog/src/components/EntityOrphanWarning/EntityOrphanWarning.test.tsx index 0b3b8de504..8fa459425f 100644 --- a/plugins/catalog/src/components/EntityOrphanWarning/EntityOrphanWarning.test.tsx +++ b/plugins/catalog/src/components/EntityOrphanWarning/EntityOrphanWarning.test.tsx @@ -14,17 +14,17 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry } from '@backstage/core'; - import { CatalogApi, catalogApiRef, catalogRouteRef, EntityProvider, } from '@backstage/plugin-catalog-react'; + import { renderInTestApp } from '@backstage/test-utils'; import React from 'react'; import { EntityOrphanWarning } from './EntityOrphanWarning'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogClient: jest.Mocked = { diff --git a/plugins/catalog/src/components/EntityOrphanWarning/EntityOrphanWarning.tsx b/plugins/catalog/src/components/EntityOrphanWarning/EntityOrphanWarning.tsx index 070c36c56c..3cc9e13206 100644 --- a/plugins/catalog/src/components/EntityOrphanWarning/EntityOrphanWarning.tsx +++ b/plugins/catalog/src/components/EntityOrphanWarning/EntityOrphanWarning.tsx @@ -15,12 +15,12 @@ */ import { Entity } from '@backstage/catalog-model'; -import { useRouteRef } from '@backstage/core'; import { catalogRouteRef, useEntity } from '@backstage/plugin-catalog-react'; import { Alert } from '@material-ui/lab'; import React, { useState } from 'react'; import { useNavigate } from 'react-router'; import { DeleteEntityDialog } from './DeleteEntityDialog'; +import { useRouteRef } from '@backstage/core-plugin-api'; export const isOrphan = (entity: Entity) => entity?.metadata?.annotations?.['backstage.io/orphan'] === 'true'; diff --git a/plugins/catalog/src/components/EntityPageLayout/EntityPageLayout.tsx b/plugins/catalog/src/components/EntityPageLayout/EntityPageLayout.tsx index efe62de6c2..ed29703e16 100644 --- a/plugins/catalog/src/components/EntityPageLayout/EntityPageLayout.tsx +++ b/plugins/catalog/src/components/EntityPageLayout/EntityPageLayout.tsx @@ -18,17 +18,6 @@ import { ENTITY_DEFAULT_NAMESPACE, RELATION_OWNED_BY, } from '@backstage/catalog-model'; -import { - Content, - Header, - HeaderLabel, - IconComponent, - Link, - Page, - Progress, - ResponseErrorPanel, - WarningPanel, -} from '@backstage/core'; import { EntityContext, EntityRefLinks, @@ -43,6 +32,19 @@ import { FavouriteEntity } from '../FavouriteEntity/FavouriteEntity'; import { UnregisterEntityDialog } from '../UnregisterEntityDialog/UnregisterEntityDialog'; import { Tabbed } from './Tabbed'; +import { + Content, + Header, + HeaderLabel, + Link, + Page, + Progress, + ResponseErrorPanel, + WarningPanel, +} from '@backstage/core-components'; + +import { IconComponent } from '@backstage/core-plugin-api'; + const EntityPageTitle = ({ entity, title, diff --git a/plugins/catalog/src/components/EntityPageLayout/Tabbed/Tabbed.tsx b/plugins/catalog/src/components/EntityPageLayout/Tabbed/Tabbed.tsx index 9a4e872d8f..e14466e73f 100644 --- a/plugins/catalog/src/components/EntityPageLayout/Tabbed/Tabbed.tsx +++ b/plugins/catalog/src/components/EntityPageLayout/Tabbed/Tabbed.tsx @@ -24,8 +24,8 @@ import { Navigate, RouteMatch, } from 'react-router'; -import { Tab, HeaderTabs, Content } from '@backstage/core'; import { Helmet } from 'react-helmet'; +import { Tab, HeaderTabs, Content } from '@backstage/core-components'; const getSelectedIndexOrDefault = ( matchedRoute: RouteMatch, diff --git a/plugins/catalog/src/components/HasComponentsCard/HasComponentsCard.test.tsx b/plugins/catalog/src/components/HasComponentsCard/HasComponentsCard.test.tsx index 8e0a61b05a..19ada85138 100644 --- a/plugins/catalog/src/components/HasComponentsCard/HasComponentsCard.test.tsx +++ b/plugins/catalog/src/components/HasComponentsCard/HasComponentsCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_HAS_PART } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -25,6 +24,7 @@ import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { HasComponentsCard } from './HasComponentsCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/catalog/src/components/HasResourcesCard/HasResourcesCard.test.tsx b/plugins/catalog/src/components/HasResourcesCard/HasResourcesCard.test.tsx index 38c8a3b5f5..7752bc3c99 100644 --- a/plugins/catalog/src/components/HasResourcesCard/HasResourcesCard.test.tsx +++ b/plugins/catalog/src/components/HasResourcesCard/HasResourcesCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_HAS_PART } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -25,6 +24,7 @@ import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { HasResourcesCard } from './HasResourcesCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/catalog/src/components/HasSubcomponentsCard/HasSubcomponentsCard.test.tsx b/plugins/catalog/src/components/HasSubcomponentsCard/HasSubcomponentsCard.test.tsx index 9ad69c9a0c..8e67aa319e 100644 --- a/plugins/catalog/src/components/HasSubcomponentsCard/HasSubcomponentsCard.test.tsx +++ b/plugins/catalog/src/components/HasSubcomponentsCard/HasSubcomponentsCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_HAS_PART } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -25,6 +24,7 @@ import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { HasSubcomponentsCard } from './HasSubcomponentsCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/catalog/src/components/HasSystemsCard/HasSystemsCard.test.tsx b/plugins/catalog/src/components/HasSystemsCard/HasSystemsCard.test.tsx index 9b7fb0adae..fb905dc203 100644 --- a/plugins/catalog/src/components/HasSystemsCard/HasSystemsCard.test.tsx +++ b/plugins/catalog/src/components/HasSystemsCard/HasSystemsCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_HAS_PART } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -25,6 +24,7 @@ import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { HasSystemsCard } from './HasSystemsCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx b/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx index f80f138515..e5c9ccf4a8 100644 --- a/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx +++ b/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx @@ -15,13 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { - InfoCard, - Link, - Progress, - ResponseErrorPanel, - TableColumn, -} from '@backstage/core'; import { Typography } from '@material-ui/core'; import { EntityTable, @@ -29,6 +22,13 @@ import { useRelatedEntities, } from '@backstage/plugin-catalog-react'; import React from 'react'; +import { + InfoCard, + Link, + Progress, + ResponseErrorPanel, + TableColumn, +} from '@backstage/core-components'; type Props = { variant?: 'gridItem'; diff --git a/plugins/catalog/src/components/RelatedEntitiesCard/presets.ts b/plugins/catalog/src/components/RelatedEntitiesCard/presets.ts index 9d3586a7e9..9d731fc386 100644 --- a/plugins/catalog/src/components/RelatedEntitiesCard/presets.ts +++ b/plugins/catalog/src/components/RelatedEntitiesCard/presets.ts @@ -19,8 +19,8 @@ import { ResourceEntity, SystemEntity, } from '@backstage/catalog-model'; -import { TableColumn } from '@backstage/core'; import { EntityTable } from '@backstage/plugin-catalog-react'; +import { TableColumn } from '@backstage/core-components'; export const componentEntityColumns: TableColumn[] = [ EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }), diff --git a/plugins/catalog/src/components/Router.tsx b/plugins/catalog/src/components/Router.tsx index f86f5959cb..7ce7eefbaa 100644 --- a/plugins/catalog/src/components/Router.tsx +++ b/plugins/catalog/src/components/Router.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import { ENTITY_DEFAULT_NAMESPACE } from '@backstage/catalog-model'; -import { Content } from '@backstage/core'; import { entityRoute, rootRoute, @@ -27,6 +26,7 @@ import { CatalogPage } from './CatalogPage'; import { EntityLoaderProvider } from './EntityLoaderProvider'; import { EntityNotFound } from './EntityNotFound'; import { EntityPageLayout } from './EntityPageLayout'; +import { Content } from '@backstage/core-components'; const DefaultEntityPage = () => ( diff --git a/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.test.tsx b/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.test.tsx index 412cc56309..d21510d956 100644 --- a/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.test.tsx +++ b/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.test.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { catalogApiRef, CatalogApi, @@ -25,6 +24,7 @@ import { Entity, RELATION_PART_OF } from '@backstage/catalog-model'; import { renderInTestApp } from '@backstage/test-utils'; import React from 'react'; import { SystemDiagramCard } from './SystemDiagramCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { beforeAll(() => { diff --git a/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx b/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx index 09cdfe4019..c6e9c0a828 100644 --- a/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx +++ b/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx @@ -29,22 +29,23 @@ import { getEntityRelations, useEntity, } from '@backstage/plugin-catalog-react'; -import { - DependencyGraph, - DependencyGraphTypes, - InfoCard, - Progress, - useApi, - ResponseErrorPanel, - Link, - useRouteRef, -} from '@backstage/core'; import { Box, makeStyles, Typography } from '@material-ui/core'; import ZoomOutMap from '@material-ui/icons/ZoomOutMap'; import React from 'react'; import { useAsync } from 'react-use'; import { BackstageTheme } from '@backstage/theme'; +import { + DependencyGraph, + DependencyGraphTypes, + InfoCard, + Progress, + ResponseErrorPanel, + Link, +} from '@backstage/core-components'; + +import { useApi, useRouteRef } from '@backstage/core-plugin-api'; + const useStyles = makeStyles((theme: BackstageTheme) => ({ domainNode: { fill: theme.palette.primary.main, diff --git a/plugins/catalog/src/components/UnregisterEntityDialog/UnregisterEntityDialog.test.tsx b/plugins/catalog/src/components/UnregisterEntityDialog/UnregisterEntityDialog.test.tsx index d134cdd5f6..aabf037884 100644 --- a/plugins/catalog/src/components/UnregisterEntityDialog/UnregisterEntityDialog.test.tsx +++ b/plugins/catalog/src/components/UnregisterEntityDialog/UnregisterEntityDialog.test.tsx @@ -20,19 +20,19 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { UnregisterEntityDialog } from './UnregisterEntityDialog'; import { ORIGIN_LOCATION_ANNOTATION } from '@backstage/catalog-model'; -import { - AlertApi, - alertApiRef, - ApiProvider, - ApiRegistry, - DiscoveryApi, -} from '@backstage/core'; import { CatalogClient } from '@backstage/catalog-client'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { screen, waitFor } from '@testing-library/react'; import { renderInTestApp } from '@backstage/test-utils'; import * as state from './useUnregisterEntityDialogState'; +import { + AlertApi, + alertApiRef, + DiscoveryApi, +} from '@backstage/core-plugin-api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; + describe('UnregisterEntityDialog', () => { const discoveryApi: DiscoveryApi = { async getBaseUrl(pluginId) { diff --git a/plugins/catalog/src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx b/plugins/catalog/src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx index 9e6489593e..478b01a8a6 100644 --- a/plugins/catalog/src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx +++ b/plugins/catalog/src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx @@ -15,13 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { - alertApiRef, - configApiRef, - Progress, - ResponseErrorPanel, - useApi, -} from '@backstage/core'; import { EntityRefLink } from '@backstage/plugin-catalog-react'; import { Box, @@ -38,6 +31,9 @@ import Alert from '@material-ui/lab/Alert'; import React, { useCallback, useState } from 'react'; import { useUnregisterEntityDialogState } from './useUnregisterEntityDialogState'; +import { alertApiRef, configApiRef, useApi } from '@backstage/core-plugin-api'; +import { Progress, ResponseErrorPanel } from '@backstage/core-components'; + const useStyles = makeStyles({ advancedButton: { fontSize: '0.7em', diff --git a/plugins/catalog/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx b/plugins/catalog/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx index e0e1ec1600..494a51131c 100644 --- a/plugins/catalog/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx +++ b/plugins/catalog/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx @@ -19,7 +19,6 @@ import { Location, ORIGIN_LOCATION_ANNOTATION, } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react'; import { act, @@ -31,6 +30,7 @@ import { UseUnregisterEntityDialogState, useUnregisterEntityDialogState, } from './useUnregisterEntityDialogState'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; function defer(): { promise: Promise; resolve: (value: T) => void } { let resolve: (value: T) => void = () => {}; diff --git a/plugins/catalog/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts b/plugins/catalog/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts index 85cc219914..54af0e3378 100644 --- a/plugins/catalog/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts +++ b/plugins/catalog/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts @@ -20,10 +20,10 @@ import { getEntityName, ORIGIN_LOCATION_ANNOTATION, } from '@backstage/catalog-model'; -import { useApi } from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { useCallback } from 'react'; import { useAsync } from 'react-use'; +import { useApi } from '@backstage/core-plugin-api'; /** * Each distinct state that the dialog can be in at any given time. diff --git a/plugins/catalog/src/plugin.ts b/plugins/catalog/src/plugin.ts index 3a62e59729..ad3f1352ce 100644 --- a/plugins/catalog/src/plugin.ts +++ b/plugins/catalog/src/plugin.ts @@ -15,14 +15,6 @@ */ import { CatalogClient } from '@backstage/catalog-client'; -import { - createApiFactory, - createComponentExtension, - createPlugin, - createRoutableExtension, - discoveryApiRef, - identityApiRef, -} from '@backstage/core'; import { catalogApiRef, catalogRouteRef, @@ -30,6 +22,14 @@ import { } from '@backstage/plugin-catalog-react'; import { CatalogClientWrapper } from './CatalogClientWrapper'; import { createComponentRouteRef } from './routes'; +import { + createApiFactory, + createComponentExtension, + createPlugin, + createRoutableExtension, + discoveryApiRef, + identityApiRef, +} from '@backstage/core-plugin-api'; export const catalogPlugin = createPlugin({ id: 'catalog', diff --git a/plugins/catalog/src/routes.ts b/plugins/catalog/src/routes.ts index 2c7fae5002..7914e21c26 100644 --- a/plugins/catalog/src/routes.ts +++ b/plugins/catalog/src/routes.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createExternalRouteRef } from '@backstage/core'; +import { createExternalRouteRef } from '@backstage/core-plugin-api'; export const createComponentRouteRef = createExternalRouteRef({ id: 'create-component', diff --git a/plugins/circleci/src/api/CircleCIApi.ts b/plugins/circleci/src/api/CircleCIApi.ts index c71be6b781..55454fed0f 100644 --- a/plugins/circleci/src/api/CircleCIApi.ts +++ b/plugins/circleci/src/api/CircleCIApi.ts @@ -26,7 +26,7 @@ import { BuildSummary, GitType, } from 'circleci-api'; -import { createApiRef, DiscoveryApi } from '@backstage/core'; +import { createApiRef, DiscoveryApi } from '@backstage/core-plugin-api'; export { GitType }; export type { BuildWithSteps, BuildStepAction, BuildSummary }; diff --git a/plugins/circleci/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx b/plugins/circleci/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx index ca163c194a..9488ed00c7 100644 --- a/plugins/circleci/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx +++ b/plugins/circleci/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx @@ -16,7 +16,6 @@ import React, { useEffect } from 'react'; import { useParams } from 'react-router-dom'; -import { Breadcrumbs, InfoCard, Progress, Link } from '@backstage/core'; import { BuildWithSteps, BuildStepAction } from '../../api'; import { Grid, @@ -29,6 +28,12 @@ import { makeStyles } from '@material-ui/core/styles'; import { ActionOutput } from './lib/ActionOutput/ActionOutput'; import LaunchIcon from '@material-ui/icons/Launch'; import { useBuildWithSteps } from '../../state/useBuildWithSteps'; +import { + Breadcrumbs, + InfoCard, + Progress, + Link, +} from '@backstage/core-components'; const IconLink = (IconButton as any) as typeof MaterialLink; diff --git a/plugins/circleci/src/components/BuildsPage/lib/CITable/CITable.tsx b/plugins/circleci/src/components/BuildsPage/lib/CITable/CITable.tsx index a9ae5e4e6f..23eb7405a3 100644 --- a/plugins/circleci/src/components/BuildsPage/lib/CITable/CITable.tsx +++ b/plugins/circleci/src/components/BuildsPage/lib/CITable/CITable.tsx @@ -27,6 +27,8 @@ import RetryIcon from '@material-ui/icons/Replay'; import GitHubIcon from '@material-ui/icons/GitHub'; import LaunchIcon from '@material-ui/icons/Launch'; import { Link as RouterLink, generatePath } from 'react-router-dom'; +import { durationHumanized, relativeTimeTo } from '../../../../util'; +import { circleCIBuildRouteRef } from '../../../../route-refs'; import { StatusError, StatusWarning, @@ -35,9 +37,7 @@ import { StatusRunning, Table, TableColumn, -} from '@backstage/core'; -import { durationHumanized, relativeTimeTo } from '../../../../util'; -import { circleCIBuildRouteRef } from '../../../../route-refs'; +} from '@backstage/core-components'; export type CITableBuildInfo = { id: string; diff --git a/plugins/circleci/src/components/Router.tsx b/plugins/circleci/src/components/Router.tsx index d18b6c1e61..e733f8739f 100644 --- a/plugins/circleci/src/components/Router.tsx +++ b/plugins/circleci/src/components/Router.tsx @@ -22,7 +22,7 @@ import { BuildsPage } from './BuildsPage'; import { CIRCLECI_ANNOTATION } from '../constants'; import { Entity } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; -import { MissingAnnotationEmptyState } from '@backstage/core'; +import { MissingAnnotationEmptyState } from '@backstage/core-components'; export const isCircleCIAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[CIRCLECI_ANNOTATION]); diff --git a/plugins/circleci/src/plugin.ts b/plugins/circleci/src/plugin.ts index 4e0d485726..3c20dfeecf 100644 --- a/plugins/circleci/src/plugin.ts +++ b/plugins/circleci/src/plugin.ts @@ -14,14 +14,14 @@ * limitations under the License. */ +import { circleCIApiRef, CircleCIApi } from './api'; +import { circleCIRouteRef } from './route-refs'; import { createPlugin, createApiFactory, discoveryApiRef, createRoutableExtension, -} from '@backstage/core'; -import { circleCIApiRef, CircleCIApi } from './api'; -import { circleCIRouteRef } from './route-refs'; +} from '@backstage/core-plugin-api'; export const circleCIPlugin = createPlugin({ id: 'circleci', diff --git a/plugins/circleci/src/route-refs.tsx b/plugins/circleci/src/route-refs.tsx index 3b36973e54..ce0fb8f61b 100644 --- a/plugins/circleci/src/route-refs.tsx +++ b/plugins/circleci/src/route-refs.tsx @@ -15,8 +15,8 @@ */ import React from 'react'; -import { createRouteRef } from '@backstage/core'; import { SvgIcon, SvgIconProps } from '@material-ui/core'; +import { createRouteRef } from '@backstage/core-plugin-api'; const CircleCIIcon = (props: SvgIconProps) => ( { if (!status) return ''; diff --git a/plugins/cloudbuild/src/api/CloudbuildApi.ts b/plugins/cloudbuild/src/api/CloudbuildApi.ts index 5aecf970ef..88f9dab91b 100644 --- a/plugins/cloudbuild/src/api/CloudbuildApi.ts +++ b/plugins/cloudbuild/src/api/CloudbuildApi.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; import { ActionsListWorkflowRunsForRepoResponseData, ActionsGetWorkflowResponseData, } from '../api/types'; +import { createApiRef } from '@backstage/core-plugin-api'; export const cloudbuildApiRef = createApiRef({ id: 'plugin.cloudbuild.service', diff --git a/plugins/cloudbuild/src/api/CloudbuildClient.ts b/plugins/cloudbuild/src/api/CloudbuildClient.ts index 0c3223aa04..b1822fee41 100644 --- a/plugins/cloudbuild/src/api/CloudbuildClient.ts +++ b/plugins/cloudbuild/src/api/CloudbuildClient.ts @@ -19,7 +19,7 @@ import { ActionsListWorkflowRunsForRepoResponseData, ActionsGetWorkflowResponseData, } from '../api/types'; -import { OAuthApi } from '@backstage/core'; +import { OAuthApi } from '@backstage/core-plugin-api'; export class CloudbuildClient implements CloudbuildApi { constructor(private readonly googleAuthApi: OAuthApi) {} diff --git a/plugins/cloudbuild/src/components/Cards/Cards.tsx b/plugins/cloudbuild/src/components/Cards/Cards.tsx index e7b3d54de1..a6b8ffc30c 100644 --- a/plugins/cloudbuild/src/components/Cards/Cards.tsx +++ b/plugins/cloudbuild/src/components/Cards/Cards.tsx @@ -20,15 +20,15 @@ import { Entity } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; import { WorkflowRunStatus } from '../WorkflowRunStatus'; import { Link, Theme, makeStyles, LinearProgress } from '@material-ui/core'; +import ExternalLinkIcon from '@material-ui/icons/Launch'; +import { CLOUDBUILD_ANNOTATION } from '../useProjectName'; + import { InfoCard, StructuredMetadataTable, - errorApiRef, - useApi, WarningPanel, -} from '@backstage/core'; -import ExternalLinkIcon from '@material-ui/icons/Launch'; -import { CLOUDBUILD_ANNOTATION } from '../useProjectName'; +} from '@backstage/core-components'; +import { errorApiRef, useApi } from '@backstage/core-plugin-api'; const useStyles = makeStyles({ externalLinkIcon: { diff --git a/plugins/cloudbuild/src/components/Router.tsx b/plugins/cloudbuild/src/components/Router.tsx index bd2299f8e9..cbadb13859 100644 --- a/plugins/cloudbuild/src/components/Router.tsx +++ b/plugins/cloudbuild/src/components/Router.tsx @@ -21,7 +21,7 @@ import { rootRouteRef, buildRouteRef } from '../routes'; import { WorkflowRunDetails } from './WorkflowRunDetails'; import { WorkflowRunsTable } from './WorkflowRunsTable'; import { CLOUDBUILD_ANNOTATION } from './useProjectName'; -import { MissingAnnotationEmptyState } from '@backstage/core'; +import { MissingAnnotationEmptyState } from '@backstage/core-components'; export const isCloudbuildAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[CLOUDBUILD_ANNOTATION]); diff --git a/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx b/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx index 7c2d171f8d..14f4bfb4f9 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx +++ b/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import { Entity } from '@backstage/catalog-model'; -import { Breadcrumbs, Link, WarningPanel } from '@backstage/core'; import { Box, LinearProgress, @@ -35,6 +34,7 @@ import React from 'react'; import { useProjectName } from '../useProjectName'; import { WorkflowRunStatus } from '../WorkflowRunStatus'; import { useWorkflowRunsDetails } from './useWorkflowRunsDetails'; +import { Breadcrumbs, Link, WarningPanel } from '@backstage/core-components'; const useStyles = makeStyles(theme => ({ root: { diff --git a/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts b/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts index ae5e750d15..afbd6fd481 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts +++ b/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useApi } from '@backstage/core'; import { useParams } from 'react-router-dom'; import { useAsync } from 'react-use'; import { cloudbuildApiRef } from '../../api'; +import { useApi } from '@backstage/core-plugin-api'; export const useWorkflowRunsDetails = (projectId: string) => { const api = useApi(cloudbuildApiRef); diff --git a/plugins/cloudbuild/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx b/plugins/cloudbuild/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx index 931bcd7b2d..cbeb85c70d 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx +++ b/plugins/cloudbuild/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx @@ -14,14 +14,14 @@ * limitations under the License. */ +import React from 'react'; import { StatusPending, StatusRunning, StatusOK, StatusAborted, StatusError, -} from '@backstage/core'; -import React from 'react'; +} from '@backstage/core-components'; export const WorkflowRunStatus = ({ status, diff --git a/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx b/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx index 886d772dd5..a5e9ce8452 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx +++ b/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx @@ -18,7 +18,6 @@ import { Link, Typography, Box, IconButton, Tooltip } from '@material-ui/core'; import RetryIcon from '@material-ui/icons/Replay'; import GoogleIcon from '@material-ui/icons/CloudCircle'; import { Link as RouterLink, generatePath } from 'react-router-dom'; -import { Table, TableColumn } from '@backstage/core'; import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns'; import { WorkflowRunStatus } from '../WorkflowRunStatus'; import SyncIcon from '@material-ui/icons/Sync'; @@ -26,6 +25,7 @@ import { useProjectName } from '../useProjectName'; import { Entity } from '@backstage/catalog-model'; import { buildRouteRef } from '../../routes'; import moment from 'moment'; +import { Table, TableColumn } from '@backstage/core-components'; const generatedColumns: TableColumn[] = [ { diff --git a/plugins/cloudbuild/src/components/useWorkflowRuns.ts b/plugins/cloudbuild/src/components/useWorkflowRuns.ts index ac7400cbf3..0fd93bd3cf 100644 --- a/plugins/cloudbuild/src/components/useWorkflowRuns.ts +++ b/plugins/cloudbuild/src/components/useWorkflowRuns.ts @@ -16,11 +16,11 @@ import { useState } from 'react'; import { useAsyncRetry } from 'react-use'; import { cloudbuildApiRef } from '../api/CloudbuildApi'; -import { useApi, errorApiRef } from '@backstage/core'; import { ActionsListWorkflowRunsForRepoResponseData, Substitutions, } from '../api/types'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export type WorkflowRun = { id: string; diff --git a/plugins/cloudbuild/src/plugin.ts b/plugins/cloudbuild/src/plugin.ts index f0db5702e6..648a3b8886 100644 --- a/plugins/cloudbuild/src/plugin.ts +++ b/plugins/cloudbuild/src/plugin.ts @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { cloudbuildApiRef, CloudbuildClient } from './api'; +import { rootRouteRef } from './routes'; import { createPlugin, createApiFactory, googleAuthApiRef, createRoutableExtension, createComponentExtension, -} from '@backstage/core'; -import { cloudbuildApiRef, CloudbuildClient } from './api'; -import { rootRouteRef } from './routes'; +} from '@backstage/core-plugin-api'; export const cloudbuildPlugin = createPlugin({ id: 'cloudbuild', diff --git a/plugins/cloudbuild/src/routes.ts b/plugins/cloudbuild/src/routes.ts index 610d708b44..5f90921bac 100644 --- a/plugins/cloudbuild/src/routes.ts +++ b/plugins/cloudbuild/src/routes.ts @@ -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({ path: '', diff --git a/plugins/code-coverage/src/api.ts b/plugins/code-coverage/src/api.ts index 6331f8020f..fce9050805 100644 --- a/plugins/code-coverage/src/api.ts +++ b/plugins/code-coverage/src/api.ts @@ -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; diff --git a/plugins/code-coverage/src/components/CodeCoveragePage/CodeCoveragePage.tsx b/plugins/code-coverage/src/components/CodeCoveragePage/CodeCoveragePage.tsx index 47811b93cd..6df1b3b1cd 100644 --- a/plugins/code-coverage/src/components/CodeCoveragePage/CodeCoveragePage.tsx +++ b/plugins/code-coverage/src/components/CodeCoveragePage/CodeCoveragePage.tsx @@ -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 ( diff --git a/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx b/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx index 7bb4648f6f..628b6cad64 100644 --- a/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx +++ b/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx @@ -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(theme => ({ diff --git a/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx b/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx index b43874123d..c0b3f2f084 100644 --- a/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx +++ b/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx @@ -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; diff --git a/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx b/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx index b49b78c5dc..a2ac5695ca 100644 --- a/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx +++ b/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx @@ -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; type CoverageTableRow = { diff --git a/plugins/code-coverage/src/components/Router.tsx b/plugins/code-coverage/src/components/Router.tsx index 12be6ef5a8..923d253324 100644 --- a/plugins/code-coverage/src/components/Router.tsx +++ b/plugins/code-coverage/src/components/Router.tsx @@ -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']); diff --git a/plugins/code-coverage/src/plugin.ts b/plugins/code-coverage/src/plugin.ts index 68e8291bc4..6e42b64a49 100644 --- a/plugins/code-coverage/src/plugin.ts +++ b/plugins/code-coverage/src/plugin.ts @@ -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', diff --git a/plugins/code-coverage/src/routes.ts b/plugins/code-coverage/src/routes.ts index 9eaf7859f5..4d5619b478 100644 --- a/plugins/code-coverage/src/routes.ts +++ b/plugins/code-coverage/src/routes.ts @@ -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', diff --git a/plugins/config-schema/src/api/StaticSchemaLoader.ts b/plugins/config-schema/src/api/StaticSchemaLoader.ts index ee61370468..3b766dd419 100644 --- a/plugins/config-schema/src/api/StaticSchemaLoader.ts +++ b/plugins/config-schema/src/api/StaticSchemaLoader.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import { Observable } from '@backstage/core'; import ObservableImpl from 'zen-observable'; import { ResponseError } from '@backstage/errors'; import { Schema } from 'jsonschema'; import { ConfigSchemaApi, ConfigSchemaResult } from './types'; +import { Observable } from '@backstage/core-plugin-api'; const DEFAULT_URL = 'config-schema.json'; diff --git a/plugins/config-schema/src/api/types.ts b/plugins/config-schema/src/api/types.ts index 025ef76f0c..2a52ffa7e9 100644 --- a/plugins/config-schema/src/api/types.ts +++ b/plugins/config-schema/src/api/types.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { createApiRef, Observable } from '@backstage/core'; import { Schema } from 'jsonschema'; +import { createApiRef, Observable } from '@backstage/core-plugin-api'; export interface ConfigSchemaResult { schema?: Schema; diff --git a/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx b/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx index a2082ef972..fecefcd9a5 100644 --- a/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx +++ b/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx @@ -14,12 +14,14 @@ * limitations under the License. */ import React, { useMemo } from 'react'; -import { Header, Page, Content, useApi, Progress } from '@backstage/core'; import { useObservable } from 'react-use'; import { configSchemaApiRef } from '../../api'; import { SchemaViewer } from '../SchemaViewer'; import { Typography } from '@material-ui/core'; +import { Header, Page, Content, Progress } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + export const ConfigSchemaPage = () => { const configSchemaApi = useApi(configSchemaApiRef); const schemaResult = useObservable( diff --git a/plugins/config-schema/src/plugin.ts b/plugins/config-schema/src/plugin.ts index 841f9f7f04..40934c9ac5 100644 --- a/plugins/config-schema/src/plugin.ts +++ b/plugins/config-schema/src/plugin.ts @@ -13,10 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { createPlugin, createRoutableExtension } from '@backstage/core'; - import { rootRouteRef } from './routes'; +import { + createPlugin, + createRoutableExtension, +} from '@backstage/core-plugin-api'; + export const configSchemaPlugin = createPlugin({ id: 'config-schema', routes: { diff --git a/plugins/config-schema/src/routes.ts b/plugins/config-schema/src/routes.ts index 8128e1f49f..944a54c0a5 100644 --- a/plugins/config-schema/src/routes.ts +++ b/plugins/config-schema/src/routes.ts @@ -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: 'config-schema', diff --git a/plugins/cost-insights/src/api/CostInsightsApi.ts b/plugins/cost-insights/src/api/CostInsightsApi.ts index 5e94c4647b..fb180756cf 100644 --- a/plugins/cost-insights/src/api/CostInsightsApi.ts +++ b/plugins/cost-insights/src/api/CostInsightsApi.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; import { Alert, Cost, @@ -24,6 +23,7 @@ import { Maybe, MetricData, } from '../types'; +import { createApiRef } from '@backstage/core-plugin-api'; export type ProductInsightsOptions = { /** diff --git a/plugins/cost-insights/src/components/AlertInstructionsLayout/AlertInstructionsLayout.tsx b/plugins/cost-insights/src/components/AlertInstructionsLayout/AlertInstructionsLayout.tsx index e46b718060..2dd732d3c3 100644 --- a/plugins/cost-insights/src/components/AlertInstructionsLayout/AlertInstructionsLayout.tsx +++ b/plugins/cost-insights/src/components/AlertInstructionsLayout/AlertInstructionsLayout.tsx @@ -17,9 +17,9 @@ import React, { PropsWithChildren } from 'react'; import { Box, Button, Container, makeStyles } from '@material-ui/core'; import ChevronLeftIcon from '@material-ui/icons/ChevronLeft'; -import { Header, Page } from '@backstage/core'; import { CostInsightsThemeProvider } from '../CostInsightsPage/CostInsightsThemeProvider'; import { ConfigProvider, CurrencyProvider } from '../../hooks'; +import { Header, Page } from '@backstage/core-components'; const useStyles = makeStyles(theme => ({ root: { diff --git a/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.test.tsx b/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.test.tsx index 8f299b0a3b..96223253ab 100644 --- a/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.test.tsx +++ b/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.test.tsx @@ -16,14 +16,11 @@ import { CostInsightsHeader } from './CostInsightsHeader'; import { renderInTestApp } from '@backstage/test-utils'; -import { - ApiProvider, - ApiRegistry, - IdentityApi, - identityApiRef, -} from '@backstage/core'; import React from 'react'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { IdentityApi, identityApiRef } from '@backstage/core-plugin-api'; + describe('', () => { const identityApi: Partial = { getProfile: () => ({ diff --git a/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.tsx b/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.tsx index b3c5be94ba..d0821732ea 100644 --- a/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.tsx +++ b/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.tsx @@ -16,9 +16,13 @@ import React from 'react'; import { Typography } from '@material-ui/core'; -import { identityApiRef, ProfileInfo, useApi } from '@backstage/core'; import { useCostInsightsStyles } from '../../utils/styles'; import { Group } from '../../types'; +import { + identityApiRef, + ProfileInfo, + useApi, +} from '@backstage/core-plugin-api'; function name(profile: ProfileInfo | undefined): string { return profile?.displayName || 'Mysterious Stranger'; diff --git a/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx b/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx index 2fc43957df..262dcaa57f 100644 --- a/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx +++ b/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx @@ -15,9 +15,9 @@ */ import React, { PropsWithChildren } from 'react'; import { makeStyles } from '@material-ui/core'; -import { Header, Page } from '@backstage/core'; import { Group } from '../../types'; import { CostInsightsTabs } from '../CostInsightsTabs'; +import { Header, Page } from '@backstage/core-components'; const useStyles = makeStyles(theme => ({ root: { diff --git a/plugins/cost-insights/src/components/CostInsightsPage/CostInsightsPage.tsx b/plugins/cost-insights/src/components/CostInsightsPage/CostInsightsPage.tsx index a8ba454d11..2ac9010c6d 100644 --- a/plugins/cost-insights/src/components/CostInsightsPage/CostInsightsPage.tsx +++ b/plugins/cost-insights/src/components/CostInsightsPage/CostInsightsPage.tsx @@ -23,7 +23,6 @@ import { Grid, Typography, } from '@material-ui/core'; -import { Progress, useApi } from '@backstage/core'; import { default as MaterialAlert } from '@material-ui/lab/Alert'; import { costInsightsApiRef } from '../../api'; import { ActionItems } from '../ActionItems'; @@ -61,6 +60,9 @@ import { isAlertSnoozed, } from '../../utils/alerts'; +import { Progress } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + export const CostInsightsPage = () => { const classes = useSubtleTypographyStyles(); const client = useApi(costInsightsApiRef); diff --git a/plugins/cost-insights/src/components/CostInsightsSupportButton/CostInsightsSupportButton.tsx b/plugins/cost-insights/src/components/CostInsightsSupportButton/CostInsightsSupportButton.tsx index 4dde49b3ef..4101b39932 100644 --- a/plugins/cost-insights/src/components/CostInsightsSupportButton/CostInsightsSupportButton.tsx +++ b/plugins/cost-insights/src/components/CostInsightsSupportButton/CostInsightsSupportButton.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { SupportButton } from '@backstage/core'; +import { SupportButton } from '@backstage/core-components'; export const CostInsightsSupportButton = () => { return ( diff --git a/plugins/cost-insights/src/components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.tsx b/plugins/cost-insights/src/components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.tsx index c3f4b4f79c..155dd6b158 100644 --- a/plugins/cost-insights/src/components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.tsx +++ b/plugins/cost-insights/src/components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.tsx @@ -16,8 +16,8 @@ import React from 'react'; import { Box, Typography } from '@material-ui/core'; -import { CodeSnippet, Link } from '@backstage/core'; import { AlertInstructionsLayout } from '../AlertInstructionsLayout'; +import { CodeSnippet, Link } from '@backstage/core-components'; export const LabelDataflowInstructionsPage = () => { return ( diff --git a/plugins/cost-insights/src/components/ProductInsights/ProductInsights.tsx b/plugins/cost-insights/src/components/ProductInsights/ProductInsights.tsx index 5702e67172..c428efd01e 100644 --- a/plugins/cost-insights/src/components/ProductInsights/ProductInsights.tsx +++ b/plugins/cost-insights/src/components/ProductInsights/ProductInsights.tsx @@ -17,7 +17,6 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; import { Box, Typography } from '@material-ui/core'; import { default as Alert } from '@material-ui/lab/Alert'; -import { useApi } from '@backstage/core'; import { costInsightsApiRef } from '../../api'; import { ProductInsightsCardList } from '../ProductInsightsCard/ProductInsightsCardList'; import { Duration, Entity, Maybe, Product } from '../../types'; @@ -34,6 +33,7 @@ import { useLastCompleteBillingDate, MapLoadingToProps, } from '../../hooks'; +import { useApi } from '@backstage/core-plugin-api'; type LoadingProps = (isLoading: boolean) => void; diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx index a98e5dc87a..bbd9c09d99 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx @@ -15,7 +15,6 @@ */ import React, { useState } from 'react'; -import { HeaderTabs } from '@backstage/core'; import { Dialog, IconButton } from '@material-ui/core'; import { default as CloseButton } from '@material-ui/icons/Close'; import { useEntityDialogStyles as useStyles } from '../../utils/styles'; @@ -25,6 +24,7 @@ import { ProductEntityTableOptions, } from './ProductEntityTable'; import { findAlways } from '../../utils/assert'; +import { HeaderTabs } from '@backstage/core-components'; type ProductEntityDialogProps = { open: boolean; diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityTable.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityTable.tsx index f9bb44058b..55b042a09a 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityTable.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityTable.tsx @@ -16,12 +16,12 @@ import React from 'react'; import classnames from 'classnames'; -import { Table, TableColumn } from '@backstage/core'; import { Typography } from '@material-ui/core'; import { costFormatter, formatChange } from '../../utils/formatters'; import { useEntityDialogStyles as useStyles } from '../../utils/styles'; import { CostGrowthIndicator } from '../CostGrowth'; import { BarChartOptions, ChangeStatistic, Entity } from '../../types'; +import { Table, TableColumn } from '@backstage/core-components'; export type ProductEntityTableOptions = Partial< Pick diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx index d46737cafb..9b5690ead7 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx @@ -22,7 +22,6 @@ import React, { useState, } from 'react'; import pluralize from 'pluralize'; -import { InfoCard } from '@backstage/core'; import { Typography } from '@material-ui/core'; import { default as Alert } from '@material-ui/lab/Alert'; import { PeriodSelect } from '../PeriodSelect'; @@ -37,6 +36,7 @@ import { } from '../../hooks'; import { findAnyKey } from '../../utils/assert'; import { ScrollAnchor } from '../../utils/scroll'; +import { InfoCard } from '@backstage/core-components'; type LoadingProps = (isLoading: boolean) => void; diff --git a/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.tsx b/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.tsx index a3df76088c..72402343bc 100644 --- a/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.tsx +++ b/plugins/cost-insights/src/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.tsx @@ -16,9 +16,9 @@ import React from 'react'; import pluralize from 'pluralize'; -import { InfoCard } from '@backstage/core'; import { ProjectGrowthAlertChart } from './ProjectGrowthAlertChart'; import { ProjectGrowthData } from '../../types'; +import { InfoCard } from '@backstage/core-components'; type ProjectGrowthAlertProps = { alert: ProjectGrowthData; diff --git a/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx b/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx index 777ea26822..3c92b8a496 100644 --- a/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx +++ b/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx @@ -17,7 +17,6 @@ import React from 'react'; import moment from 'moment'; import { Box, Typography } from '@material-ui/core'; -import { InfoCard } from '@backstage/core'; import { AlertInstructionsLayout } from '../AlertInstructionsLayout'; import { ProductInsightsChart } from '../ProductInsightsCard'; import { @@ -29,6 +28,7 @@ import { ProjectGrowthData, } from '../../types'; import { ProjectGrowthAlert } from '../../alerts'; +import { InfoCard } from '@backstage/core-components'; const today = moment().format(DEFAULT_DATE_FORMAT); diff --git a/plugins/cost-insights/src/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.tsx b/plugins/cost-insights/src/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.tsx index f5715bdb0d..4b60b68e41 100644 --- a/plugins/cost-insights/src/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.tsx +++ b/plugins/cost-insights/src/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.tsx @@ -16,11 +16,11 @@ import React from 'react'; import pluralize from 'pluralize'; -import { InfoCard } from '@backstage/core'; import { Box } from '@material-ui/core'; import { BarChart, BarChartLegend } from '../BarChart'; import { UnlabeledDataflowData, ResourceData } from '../../types'; import { useBarChartLayoutStyles as useStyles } from '../../utils/styles'; +import { InfoCard } from '@backstage/core-components'; type UnlabeledDataflowAlertProps = { alert: UnlabeledDataflowData; diff --git a/plugins/cost-insights/src/example/alerts/KubernetesMigrationAlert.tsx b/plugins/cost-insights/src/example/alerts/KubernetesMigrationAlert.tsx index 8b386f338c..3b87e00a05 100644 --- a/plugins/cost-insights/src/example/alerts/KubernetesMigrationAlert.tsx +++ b/plugins/cost-insights/src/example/alerts/KubernetesMigrationAlert.tsx @@ -17,7 +17,6 @@ import React from 'react'; import pluralize from 'pluralize'; import { KubernetesMigrationAlertCard } from '../components'; -import { Lifecycle } from '@backstage/core'; import { CostInsightsApi } from '../../api'; import { Alert, @@ -32,6 +31,7 @@ import { KubernetesMigrationDismissForm, KubernetesMigrationDismissFormData, } from '../forms'; +import { Lifecycle } from '@backstage/core-components'; export interface KubernetesMigrationData { startDate: string; diff --git a/plugins/cost-insights/src/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.tsx b/plugins/cost-insights/src/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.tsx index 3cba2b7e4d..9cd208037b 100644 --- a/plugins/cost-insights/src/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.tsx +++ b/plugins/cost-insights/src/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.tsx @@ -16,10 +16,10 @@ import React from 'react'; import { Box } from '@material-ui/core'; -import { InfoCard } from '@backstage/core'; import { KubernetesMigrationBarChartLegend } from './KubernetesMigrationBarChartLegend'; import { KubernetesMigrationBarChart } from './KubernetesMigrationBarChart'; import { KubernetesMigrationData } from '../../alerts'; +import { InfoCard } from '@backstage/core-components'; type KubernetesMigrationAlertProps = { data: KubernetesMigrationData; diff --git a/plugins/cost-insights/src/hooks/useConfig.tsx b/plugins/cost-insights/src/hooks/useConfig.tsx index 450ab545ac..1924d3dd24 100644 --- a/plugins/cost-insights/src/hooks/useConfig.tsx +++ b/plugins/cost-insights/src/hooks/useConfig.tsx @@ -21,12 +21,12 @@ import React, { useEffect, useState, } from 'react'; -import { configApiRef, useApi } from '@backstage/core'; import { Config as BackstageConfig } from '@backstage/config'; import { Currency, Icon, Metric, Product } from '../types'; import { getIcon } from '../utils/navigation'; import { validateMetrics } from '../utils/config'; import { defaultCurrencies } from '../utils/currency'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; /* * Config schema 2020-10-15 diff --git a/plugins/cost-insights/src/hooks/useGroups.tsx b/plugins/cost-insights/src/hooks/useGroups.tsx index 50444f2915..4603357ad4 100644 --- a/plugins/cost-insights/src/hooks/useGroups.tsx +++ b/plugins/cost-insights/src/hooks/useGroups.tsx @@ -21,11 +21,11 @@ import React, { useState, } from 'react'; import { Alert } from '@material-ui/lab'; -import { useApi, identityApiRef } from '@backstage/core'; import { costInsightsApiRef } from '../api'; import { MapLoadingToProps, useLoading } from './useLoading'; import { Group, Maybe } from '../types'; import { DefaultLoadingAction } from '../utils/loading'; +import { useApi, identityApiRef } from '@backstage/core-plugin-api'; type GroupsProviderLoadingProps = { dispatchLoadingGroups: (isLoading: boolean) => void; diff --git a/plugins/cost-insights/src/hooks/useLastCompleteBillingDate.tsx b/plugins/cost-insights/src/hooks/useLastCompleteBillingDate.tsx index d2ee43980f..772aabced1 100644 --- a/plugins/cost-insights/src/hooks/useLastCompleteBillingDate.tsx +++ b/plugins/cost-insights/src/hooks/useLastCompleteBillingDate.tsx @@ -22,11 +22,11 @@ import React, { } from 'react'; import * as yup from 'yup'; import { Alert } from '@material-ui/lab'; -import { useApi } from '@backstage/core'; import { costInsightsApiRef } from '../api'; import { MapLoadingToProps, useLoading } from './useLoading'; import { DefaultLoadingAction } from '../utils/loading'; import { Maybe } from '../types'; +import { useApi } from '@backstage/core-plugin-api'; type BillingDateProviderLoadingProps = { dispatchLoadingBillingDate: (isLoading: boolean) => void; diff --git a/plugins/cost-insights/src/plugin.ts b/plugins/cost-insights/src/plugin.ts index aabafade9a..d85148f60f 100644 --- a/plugins/cost-insights/src/plugin.ts +++ b/plugins/cost-insights/src/plugin.ts @@ -18,7 +18,7 @@ import { createPlugin, createRouteRef, createRoutableExtension, -} from '@backstage/core'; +} from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ path: '/cost-insights', diff --git a/plugins/cost-insights/src/testUtils/config.ts b/plugins/cost-insights/src/testUtils/config.ts index 7d48121506..9d560d43f3 100644 --- a/plugins/cost-insights/src/testUtils/config.ts +++ b/plugins/cost-insights/src/testUtils/config.ts @@ -15,8 +15,8 @@ */ import { Config } from '@backstage/config'; -import { ConfigApi } from '@backstage/core'; import { MockProductTypes } from './products'; +import { ConfigApi } from '@backstage/core-plugin-api'; export const MockProductsConfig: Partial = { keys: () => Object.keys(MockProductTypes), diff --git a/plugins/cost-insights/src/testUtils/providers.tsx b/plugins/cost-insights/src/testUtils/providers.tsx index 26f51fbed2..90a8839f99 100644 --- a/plugins/cost-insights/src/testUtils/providers.tsx +++ b/plugins/cost-insights/src/testUtils/providers.tsx @@ -16,12 +16,6 @@ import React, { PropsWithChildren } from 'react'; import { costInsightsApiRef, CostInsightsApi } from '../api'; -import { - ApiProvider, - ApiRegistry, - IdentityApi, - identityApiRef, -} from '@backstage/core'; import { LoadingContext, LoadingContextProps } from '../hooks/useLoading'; import { GroupsContext, GroupsContextProps } from '../hooks/useGroups'; import { FilterContext, FilterContextProps } from '../hooks/useFilters'; @@ -34,6 +28,9 @@ import { import { ScrollContext, ScrollContextProps } from '../hooks/useScroll'; import { Group, Duration } from '../types'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { IdentityApi, identityApiRef } from '@backstage/core-plugin-api'; + type PartialPropsWithChildren = PropsWithChildren>; export const MockGroups: Group[] = [{ id: 'tech' }, { id: 'mock-group' }]; diff --git a/plugins/explore-react/src/tools/api.ts b/plugins/explore-react/src/tools/api.ts index b7c39b4d50..bcf33277a5 100644 --- a/plugins/explore-react/src/tools/api.ts +++ b/plugins/explore-react/src/tools/api.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; +import { createApiRef } from '@backstage/core-plugin-api'; export const exploreToolsConfigRef = createApiRef({ id: 'plugin.explore.toolsconfig', diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx index 8f69ea3527..21fe0a9cc9 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { waitFor, getByText } from '@testing-library/react'; import React from 'react'; import { DefaultExplorePage } from './DefaultExplorePage'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx index abc73dca31..48abb45f5c 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx @@ -15,11 +15,11 @@ */ import React from 'react'; -import { configApiRef, useApi } from '@backstage/core'; import { DomainExplorerContent } from '../DomainExplorerContent'; import { ExploreLayout } from '../ExploreLayout'; import { GroupsExplorerContent } from '../GroupsExplorerContent'; import { ToolExplorerContent } from '../ToolExplorerContent'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; export const DefaultExplorePage = () => { const configApi = useApi(configApiRef); diff --git a/plugins/explore/src/components/DomainCard/DomainCard.tsx b/plugins/explore/src/components/DomainCard/DomainCard.tsx index ee06fd39fd..fb4b31bd26 100644 --- a/plugins/explore/src/components/DomainCard/DomainCard.tsx +++ b/plugins/explore/src/components/DomainCard/DomainCard.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import { DomainEntity, RELATION_OWNED_BY } from '@backstage/catalog-model'; -import { Button, ItemCardHeader, useRouteRef } from '@backstage/core'; import { EntityRefLinks, entityRouteParams, @@ -31,6 +30,9 @@ import { import React from 'react'; import { catalogEntityRouteRef } from '../../routes'; +import { Button, ItemCardHeader } from '@backstage/core-components'; +import { useRouteRef } from '@backstage/core-plugin-api'; + type DomainCardProps = { entity: DomainEntity; }; diff --git a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx index 1a93463862..a56890916a 100644 --- a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx +++ b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx @@ -15,13 +15,13 @@ */ import { DomainEntity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { catalogEntityRouteRef } from '../../routes'; import { DomainExplorerContent } from './DomainExplorerContent'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx index 8217413842..eaa130dc35 100644 --- a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx +++ b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx @@ -14,6 +14,12 @@ * limitations under the License. */ import { DomainEntity } from '@backstage/catalog-model'; +import { catalogApiRef } from '@backstage/plugin-catalog-react'; +import { Button } from '@material-ui/core'; +import React from 'react'; +import { useAsync } from 'react-use'; +import { DomainCard } from '../DomainCard'; + import { Content, ContentHeader, @@ -21,14 +27,10 @@ import { ItemCardGrid, Progress, SupportButton, - useApi, WarningPanel, -} from '@backstage/core'; -import { catalogApiRef } from '@backstage/plugin-catalog-react'; -import { Button } from '@material-ui/core'; -import React from 'react'; -import { useAsync } from 'react-use'; -import { DomainCard } from '../DomainCard'; +} from '@backstage/core-components'; + +import { useApi } from '@backstage/core-plugin-api'; const Body = () => { const catalogApi = useApi(catalogApiRef); diff --git a/plugins/explore/src/components/ExploreLayout/ExploreLayout.tsx b/plugins/explore/src/components/ExploreLayout/ExploreLayout.tsx index 7e64ed815c..3f692f4368 100644 --- a/plugins/explore/src/components/ExploreLayout/ExploreLayout.tsx +++ b/plugins/explore/src/components/ExploreLayout/ExploreLayout.tsx @@ -14,10 +14,12 @@ * limitations under the License. */ -import { attachComponentData, Header, Page, RoutedTabs } from '@backstage/core'; import { TabProps } from '@material-ui/core'; import { Children, default as React, Fragment, isValidElement } from 'react'; +import { attachComponentData } from '@backstage/core-plugin-api'; +import { Header, Page, RoutedTabs } from '@backstage/core-components'; + // TODO: This layout could be a shared based component if it was possible to create custom TabbedLayouts // A generalized version of createSubRoutesFromChildren, etc. would be required diff --git a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.test.tsx b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.test.tsx index 022387faca..6d4c7d9727 100644 --- a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.test.tsx +++ b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.test.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { catalogApiRef, CatalogApi, @@ -24,6 +23,7 @@ import { Entity } from '@backstage/catalog-model'; import { renderInTestApp } from '@backstage/test-utils'; import React from 'react'; import { GroupsDiagram } from './GroupsDiagram'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { beforeAll(() => { diff --git a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx index 99157b878f..1b425a9799 100644 --- a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx +++ b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx @@ -25,22 +25,21 @@ import { getEntityRelations, formatEntityRefTitle, } from '@backstage/plugin-catalog-react'; -import { - DependencyGraph, - DependencyGraphTypes, - Progress, - useApi, - ResponseErrorPanel, - Link, - useRouteRef, - configApiRef, -} from '@backstage/core'; import { makeStyles, Typography } from '@material-ui/core'; import ZoomOutMap from '@material-ui/icons/ZoomOutMap'; import React from 'react'; import { useAsync } from 'react-use'; import { BackstageTheme } from '@backstage/theme'; +import { + DependencyGraph, + DependencyGraphTypes, + Progress, + ResponseErrorPanel, + Link, +} from '@backstage/core-components'; +import { useApi, useRouteRef, configApiRef } from '@backstage/core-plugin-api'; + const useStyles = makeStyles((theme: BackstageTheme) => ({ organizationNode: { fill: 'coral', diff --git a/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx b/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx index 4e92784818..8857132711 100644 --- a/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx +++ b/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx @@ -15,12 +15,12 @@ */ import { Entity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { GroupsExplorerContent } from '../GroupsExplorerContent'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.tsx b/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.tsx index bf2363f16c..5f1291b137 100644 --- a/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.tsx +++ b/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.tsx @@ -14,9 +14,13 @@ * limitations under the License. */ -import { Content, ContentHeader, SupportButton } from '@backstage/core'; import React from 'react'; import { GroupsDiagram } from './GroupsDiagram'; +import { + Content, + ContentHeader, + SupportButton, +} from '@backstage/core-components'; type GroupsExplorerContentProps = { title?: string; diff --git a/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.test.tsx b/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.test.tsx index 5cc444ace5..9f21ed1e2a 100644 --- a/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.test.tsx +++ b/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.test.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { ExploreTool, exploreToolsConfigRef, @@ -25,6 +24,7 @@ import { ThemeProvider } from '@material-ui/core'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { ToolExplorerContent } from './ToolExplorerContent'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const exploreToolsConfigApi: jest.Mocked = { diff --git a/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx b/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx index 8dcf1957d0..385e709df6 100644 --- a/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx +++ b/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx @@ -14,6 +14,11 @@ * limitations under the License. */ +import { exploreToolsConfigRef } from '@backstage/plugin-explore-react'; +import React from 'react'; +import { useAsync } from 'react-use'; +import { ToolCard } from '../ToolCard'; + import { Content, ContentHeader, @@ -21,13 +26,10 @@ import { ItemCardGrid, Progress, SupportButton, - useApi, WarningPanel, -} from '@backstage/core'; -import { exploreToolsConfigRef } from '@backstage/plugin-explore-react'; -import React from 'react'; -import { useAsync } from 'react-use'; -import { ToolCard } from '../ToolCard'; +} from '@backstage/core-components'; + +import { useApi } from '@backstage/core-plugin-api'; const Body = () => { const exploreToolsConfigApi = useApi(exploreToolsConfigRef); diff --git a/plugins/explore/src/extensions.tsx b/plugins/explore/src/extensions.tsx index 88ea2561fa..b52035a662 100644 --- a/plugins/explore/src/extensions.tsx +++ b/plugins/explore/src/extensions.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ +import { explorePlugin } from './plugin'; +import { exploreRouteRef } from './routes'; import { createComponentExtension, createRoutableExtension, -} from '@backstage/core'; -import { explorePlugin } from './plugin'; -import { exploreRouteRef } from './routes'; +} from '@backstage/core-plugin-api'; export const ExplorePage = explorePlugin.provide( createRoutableExtension({ diff --git a/plugins/explore/src/plugin.ts b/plugins/explore/src/plugin.ts index c5dd6644e7..a4ae2c1d9f 100644 --- a/plugins/explore/src/plugin.ts +++ b/plugins/explore/src/plugin.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import { createApiFactory, createPlugin } from '@backstage/core'; import { exploreToolsConfigRef } from '@backstage/plugin-explore-react'; import { catalogEntityRouteRef, exploreRouteRef } from './routes'; import { exampleTools } from './util/examples'; +import { createApiFactory, createPlugin } from '@backstage/core-plugin-api'; export const explorePlugin = createPlugin({ id: 'explore', diff --git a/plugins/explore/src/routes.ts b/plugins/explore/src/routes.ts index fc7868c4c9..50322c5ea9 100644 --- a/plugins/explore/src/routes.ts +++ b/plugins/explore/src/routes.ts @@ -14,7 +14,10 @@ * limitations under the License. */ -import { createExternalRouteRef, createRouteRef } from '@backstage/core'; +import { + createExternalRouteRef, + createRouteRef, +} from '@backstage/core-plugin-api'; const NoIcon = () => null; diff --git a/plugins/fossa/dev/index.tsx b/plugins/fossa/dev/index.tsx index 563c63faf5..1de2dd8114 100644 --- a/plugins/fossa/dev/index.tsx +++ b/plugins/fossa/dev/index.tsx @@ -15,7 +15,6 @@ */ import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model'; -import { Content, Header, Page } from '@backstage/core'; import { createDevApp } from '@backstage/dev-utils'; import { CatalogApi, @@ -28,6 +27,7 @@ import { EntityFossaCard, fossaPlugin } from '../src'; import { FindingSummary, FossaApi, fossaApiRef } from '../src/api'; import { FossaPage } from '../src/components/FossaPage'; import { FOSSA_PROJECT_NAME_ANNOTATION } from '../src/components/getProjectName'; +import { Content, Header, Page } from '@backstage/core-components'; const entity = (name?: string) => ({ diff --git a/plugins/fossa/src/api/FossaApi.ts b/plugins/fossa/src/api/FossaApi.ts index 15e8b4473e..5c568460ed 100644 --- a/plugins/fossa/src/api/FossaApi.ts +++ b/plugins/fossa/src/api/FossaApi.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; +import { createApiRef } from '@backstage/core-plugin-api'; export interface FindingSummary { timestamp: string; diff --git a/plugins/fossa/src/api/FossaClient.test.ts b/plugins/fossa/src/api/FossaClient.test.ts index 29e5b50fcd..6a2c7269f1 100644 --- a/plugins/fossa/src/api/FossaClient.test.ts +++ b/plugins/fossa/src/api/FossaClient.test.ts @@ -14,12 +14,14 @@ * limitations under the License. */ -import { IdentityApi, UrlPatternDiscovery } from '@backstage/core'; import { msw } from '@backstage/test-utils'; import { rest } from 'msw'; import { setupServer } from 'msw/node'; import { FindingSummary, FossaApi, FossaClient } from './index'; +import { IdentityApi } from '@backstage/core-plugin-api'; +import { UrlPatternDiscovery } from '@backstage/core-app-api'; + const server = setupServer(); const identityApi: IdentityApi = { diff --git a/plugins/fossa/src/api/FossaClient.ts b/plugins/fossa/src/api/FossaClient.ts index e8f3ecb7cd..f3512543ba 100644 --- a/plugins/fossa/src/api/FossaClient.ts +++ b/plugins/fossa/src/api/FossaClient.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import { DiscoveryApi, IdentityApi } from '@backstage/core'; import { ResponseError } from '@backstage/errors'; import fetch from 'cross-fetch'; import pLimit from 'p-limit'; import { FindingSummary, FossaApi } from './FossaApi'; +import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api'; type FossaProjectsResponse = { title: string; diff --git a/plugins/fossa/src/components/FossaCard/FossaCard.test.tsx b/plugins/fossa/src/components/FossaCard/FossaCard.test.tsx index 0761c85da5..0de178b230 100644 --- a/plugins/fossa/src/components/FossaCard/FossaCard.test.tsx +++ b/plugins/fossa/src/components/FossaCard/FossaCard.test.tsx @@ -15,12 +15,12 @@ */ import { Entity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { EntityProvider } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import React from 'react'; import { FossaApi, fossaApiRef } from '../../api'; import { FossaCard } from './FossaCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const fossaApi: jest.Mocked = { diff --git a/plugins/fossa/src/components/FossaCard/FossaCard.tsx b/plugins/fossa/src/components/FossaCard/FossaCard.tsx index 034ba57dfc..b2c4a355c0 100644 --- a/plugins/fossa/src/components/FossaCard/FossaCard.tsx +++ b/plugins/fossa/src/components/FossaCard/FossaCard.tsx @@ -14,15 +14,6 @@ * limitations under the License. */ -import { - EmptyState, - InfoCard, - InfoCardVariants, - MissingAnnotationEmptyState, - Progress, - ResponseErrorPanel, - useApi, -} from '@backstage/core'; import { useEntity } from '@backstage/plugin-catalog-react'; import { Grid, Tooltip } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; @@ -35,6 +26,17 @@ import { getProjectName, } from '../getProjectName'; +import { + EmptyState, + InfoCard, + InfoCardVariants, + MissingAnnotationEmptyState, + Progress, + ResponseErrorPanel, +} from '@backstage/core-components'; + +import { useApi } from '@backstage/core-plugin-api'; + const useStyles = makeStyles(theme => ({ numberError: { fontSize: '5rem', diff --git a/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx b/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx index efab6ab091..9085d7d893 100644 --- a/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx +++ b/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx @@ -15,12 +15,12 @@ */ import { Entity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import React from 'react'; import { FossaApi, fossaApiRef } from '../../api'; import { FossaPage } from './FossaPage'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const catalogApi: jest.Mocked = { diff --git a/plugins/fossa/src/components/FossaPage/FossaPage.tsx b/plugins/fossa/src/components/FossaPage/FossaPage.tsx index 4a5c1b9bff..b84096b945 100644 --- a/plugins/fossa/src/components/FossaPage/FossaPage.tsx +++ b/plugins/fossa/src/components/FossaPage/FossaPage.tsx @@ -19,19 +19,6 @@ import { EntityName, RELATION_OWNED_BY, } from '@backstage/catalog-model'; -import { - Content, - Header, - Link, - Page, - StatusError, - StatusOK, - StatusWarning, - Table, - TableColumn, - TableFilter, - useApi, -} from '@backstage/core'; import { catalogApiRef, EntityRefLink, @@ -48,6 +35,21 @@ import { useAsync } from 'react-use'; import { FindingSummary, fossaApiRef } from '../../api'; import { getProjectName } from '../getProjectName'; +import { + Content, + Header, + Link, + Page, + StatusError, + StatusOK, + StatusWarning, + Table, + TableColumn, + TableFilter, +} from '@backstage/core-components'; + +import { useApi } from '@backstage/core-plugin-api'; + type FossaRow = { entity: Entity; resolved: { diff --git a/plugins/fossa/src/extensions.tsx b/plugins/fossa/src/extensions.tsx index 21e53996ba..0f1453f0fb 100644 --- a/plugins/fossa/src/extensions.tsx +++ b/plugins/fossa/src/extensions.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ +import { fossaPlugin } from './plugin'; +import { rootRoute } from './routes'; import { createComponentExtension, createRoutableExtension, -} from '@backstage/core'; -import { fossaPlugin } from './plugin'; -import { rootRoute } from './routes'; +} from '@backstage/core-plugin-api'; export const EntityFossaCard = fossaPlugin.provide( createComponentExtension({ diff --git a/plugins/fossa/src/plugin.ts b/plugins/fossa/src/plugin.ts index 849769d42c..2f48ece0d0 100644 --- a/plugins/fossa/src/plugin.ts +++ b/plugins/fossa/src/plugin.ts @@ -14,15 +14,15 @@ * limitations under the License. */ +import { fossaApiRef, FossaClient } from './api'; +import { rootRoute } from './routes'; import { configApiRef, createApiFactory, createPlugin, discoveryApiRef, identityApiRef, -} from '@backstage/core'; -import { fossaApiRef, FossaClient } from './api'; -import { rootRoute } from './routes'; +} from '@backstage/core-plugin-api'; export const fossaPlugin = createPlugin({ id: 'fossa', diff --git a/plugins/fossa/src/routes.ts b/plugins/fossa/src/routes.ts index 6e8ce07b29..b2281fe3a8 100644 --- a/plugins/fossa/src/routes.ts +++ b/plugins/fossa/src/routes.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createRouteRef } from '@backstage/core'; +import { createRouteRef } from '@backstage/core-plugin-api'; export const rootRoute = createRouteRef({ id: 'fossa-overview', diff --git a/plugins/gcp-projects/src/api/GcpApi.ts b/plugins/gcp-projects/src/api/GcpApi.ts index 24ad1a93cc..1442a01a5c 100644 --- a/plugins/gcp-projects/src/api/GcpApi.ts +++ b/plugins/gcp-projects/src/api/GcpApi.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; import { Project, Operation } from './types'; +import { createApiRef } from '@backstage/core-plugin-api'; export const gcpApiRef = createApiRef({ id: 'plugin.gcpprojects.service', diff --git a/plugins/gcp-projects/src/api/GcpClient.ts b/plugins/gcp-projects/src/api/GcpClient.ts index 00bb859219..cf73c57036 100644 --- a/plugins/gcp-projects/src/api/GcpClient.ts +++ b/plugins/gcp-projects/src/api/GcpClient.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import { OAuthApi } from '@backstage/core'; import { GcpApi } from './GcpApi'; import { Operation, Project } from './types'; +import { OAuthApi } from '@backstage/core-plugin-api'; const BASE_URL = 'https://content-cloudresourcemanager.googleapis.com/v1/projects'; diff --git a/plugins/gcp-projects/src/components/NewProjectPage/NewProjectPage.tsx b/plugins/gcp-projects/src/components/NewProjectPage/NewProjectPage.tsx index 462aa17099..e3e3be2858 100644 --- a/plugins/gcp-projects/src/components/NewProjectPage/NewProjectPage.tsx +++ b/plugins/gcp-projects/src/components/NewProjectPage/NewProjectPage.tsx @@ -14,6 +14,8 @@ * limitations under the License. */ +import { Button, Grid, TextField } from '@material-ui/core'; +import React, { useState } from 'react'; import { Content, ContentHeader, @@ -25,9 +27,7 @@ import { SimpleStepperStep, StructuredMetadataTable, SupportButton, -} from '@backstage/core'; -import { Button, Grid, TextField } from '@material-ui/core'; -import React, { useState } from 'react'; +} from '@backstage/core-components'; export const Project = () => { const [projectName, setProjectName] = useState(''); diff --git a/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx b/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx index 0c6350b849..9493b96cf9 100644 --- a/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx +++ b/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx @@ -13,16 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { - Content, - ContentHeader, - Header, - HeaderLabel, - Page, - SupportButton, - useApi, - WarningPanel, -} from '@backstage/core'; import { Button, ButtonGroup, @@ -40,6 +30,18 @@ import React from 'react'; import { useAsync } from 'react-use'; import { gcpApiRef } from '../../api'; +import { + Content, + ContentHeader, + Header, + HeaderLabel, + Page, + SupportButton, + WarningPanel, +} from '@backstage/core-components'; + +import { useApi } from '@backstage/core-plugin-api'; + const useStyles = makeStyles(theme => ({ root: { maxWidth: 720, diff --git a/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx b/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx index b911040535..3ddb251765 100644 --- a/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx +++ b/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx @@ -15,17 +15,6 @@ */ // NEEDS WORK -import { - Content, - ContentHeader, - Header, - HeaderLabel, - Link, - Page, - SupportButton, - useApi, - WarningPanel, -} from '@backstage/core'; import { Button, LinearProgress, @@ -42,6 +31,19 @@ import React from 'react'; import { useAsync } from 'react-use'; import { gcpApiRef, Project } from '../../api'; +import { + Content, + ContentHeader, + Header, + HeaderLabel, + Link, + Page, + SupportButton, + WarningPanel, +} from '@backstage/core-components'; + +import { useApi } from '@backstage/core-plugin-api'; + const LongText = ({ text, max }: { text: string; max: number }) => { if (text.length < max) { return {text}; diff --git a/plugins/gcp-projects/src/plugin.ts b/plugins/gcp-projects/src/plugin.ts index 5280ff8e35..7775eb2ef9 100644 --- a/plugins/gcp-projects/src/plugin.ts +++ b/plugins/gcp-projects/src/plugin.ts @@ -14,14 +14,14 @@ * limitations under the License. */ +import { gcpApiRef, GcpClient } from './api'; +import { rootRouteRef } from './routes'; import { createApiFactory, createPlugin, createRoutableExtension, googleAuthApiRef, -} from '@backstage/core'; -import { gcpApiRef, GcpClient } from './api'; -import { rootRouteRef } from './routes'; +} from '@backstage/core-plugin-api'; export const gcpProjectsPlugin = createPlugin({ id: 'gcp-projects', diff --git a/plugins/gcp-projects/src/routes.ts b/plugins/gcp-projects/src/routes.ts index ff9bf9d85c..e597b7c4b0 100644 --- a/plugins/gcp-projects/src/routes.ts +++ b/plugins/gcp-projects/src/routes.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createRouteRef } from '@backstage/core'; +import { createRouteRef } from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ path: '/gcp-projects', diff --git a/plugins/git-release-manager/src/GitReleaseManager.tsx b/plugins/git-release-manager/src/GitReleaseManager.tsx index 1b388ffc82..4a8edcdcaf 100644 --- a/plugins/git-release-manager/src/GitReleaseManager.tsx +++ b/plugins/git-release-manager/src/GitReleaseManager.tsx @@ -17,7 +17,6 @@ import React from 'react'; import { useAsync } from 'react-use'; import { Alert } from '@material-ui/lab'; -import { useApi, ContentHeader, Progress } from '@backstage/core'; import { Box } from '@material-ui/core'; import { @@ -35,6 +34,9 @@ import { RepoDetailsForm } from './features/RepoDetailsForm/RepoDetailsForm'; import { useQueryHandler } from './hooks/useQueryHandler'; import { UserContext } from './contexts/UserContext'; +import { useApi } from '@backstage/core-plugin-api'; +import { ContentHeader, Progress } from '@backstage/core-components'; + interface GitReleaseManagerProps { project?: Omit; features?: { diff --git a/plugins/git-release-manager/src/api/GitReleaseClient.test.ts b/plugins/git-release-manager/src/api/GitReleaseClient.test.ts index 1b7cc7876a..b70d4772a8 100644 --- a/plugins/git-release-manager/src/api/GitReleaseClient.test.ts +++ b/plugins/git-release-manager/src/api/GitReleaseClient.test.ts @@ -14,10 +14,11 @@ * limitations under the License. */ -import { ConfigReader, OAuthApi } from '@backstage/core'; - import { GitReleaseClient } from './GitReleaseClient'; +import { ConfigReader } from '@backstage/core-app-api'; +import { OAuthApi } from '@backstage/core-plugin-api'; + describe('GitReleaseClient', () => { it('should return the default plugin api client', () => { const configApi = new ConfigReader({}); diff --git a/plugins/git-release-manager/src/api/GitReleaseClient.ts b/plugins/git-release-manager/src/api/GitReleaseClient.ts index cd178f292a..4fa326f5e1 100644 --- a/plugins/git-release-manager/src/api/GitReleaseClient.ts +++ b/plugins/git-release-manager/src/api/GitReleaseClient.ts @@ -14,14 +14,14 @@ * limitations under the License. */ -import { ConfigApi, OAuthApi } from '@backstage/core'; import { Octokit } from '@octokit/rest'; import { GitHubIntegration, ScmIntegrations } from '@backstage/integration'; - import { DISABLE_CACHE } from '../constants/constants'; + import { Project } from '../contexts/ProjectContext'; import { UnboxArray, UnboxReturnedPromise } from '../types/helpers'; import { GitReleaseManagerError } from '../errors/GitReleaseManagerError'; +import { ConfigApi, OAuthApi } from '@backstage/core-plugin-api'; export class GitReleaseClient implements GitReleaseApi { private readonly githubAuthApi: OAuthApi; diff --git a/plugins/git-release-manager/src/api/serviceApiRef.ts b/plugins/git-release-manager/src/api/serviceApiRef.ts index 7a5c045d40..3578a7dec5 100644 --- a/plugins/git-release-manager/src/api/serviceApiRef.ts +++ b/plugins/git-release-manager/src/api/serviceApiRef.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; - import { GitReleaseApi } from './GitReleaseClient'; +import { createApiRef } from '@backstage/core-plugin-api'; + export const gitReleaseManagerApiRef = createApiRef({ id: 'plugin.git-release-manager.service', description: 'Used by the Git Release Manager plugin to make requests', diff --git a/plugins/git-release-manager/src/components/InfoCardPlus.tsx b/plugins/git-release-manager/src/components/InfoCardPlus.tsx index fe2da57402..c704275a9d 100644 --- a/plugins/git-release-manager/src/components/InfoCardPlus.tsx +++ b/plugins/git-release-manager/src/components/InfoCardPlus.tsx @@ -15,11 +15,11 @@ */ import React from 'react'; -import { InfoCard } from '@backstage/core'; import { makeStyles } from '@material-ui/core'; - import { TEST_IDS } from '../test-helpers/test-ids'; +import { InfoCard } from '@backstage/core-components'; + const useStyles = makeStyles(() => ({ feature: { marginBottom: '3em', diff --git a/plugins/git-release-manager/src/components/ResponseStepDialog/ResponseStepList.tsx b/plugins/git-release-manager/src/components/ResponseStepDialog/ResponseStepList.tsx index 77bcd22957..4c6e958e51 100644 --- a/plugins/git-release-manager/src/components/ResponseStepDialog/ResponseStepList.tsx +++ b/plugins/git-release-manager/src/components/ResponseStepDialog/ResponseStepList.tsx @@ -16,11 +16,11 @@ import React, { PropsWithChildren } from 'react'; import { DialogContent, List } from '@material-ui/core'; -import { Progress } from '@backstage/core'; - import { ResponseStep } from '../../types/types'; + import { ResponseStepListItem } from './ResponseStepListItem'; import { TEST_IDS } from '../../test-helpers/test-ids'; +import { Progress } from '@backstage/core-components'; interface ResponseStepListProps { responseSteps: (ResponseStep | undefined)[]; diff --git a/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts b/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts index 477e404d78..9731c2b1e0 100644 --- a/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts +++ b/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts @@ -16,12 +16,11 @@ import { useEffect, useState } from 'react'; import { useAsync, useAsyncFn } from 'react-use'; -import { useApi } from '@backstage/core'; - import { GetLatestReleaseResult, GetRepositoryResult, } from '../../../api/GitReleaseClient'; + import { CardHook, ComponentConfigCreateRc } from '../../../types/types'; import { getReleaseCandidateGitInfo } from '../../../helpers/getReleaseCandidateGitInfo'; import { gitReleaseManagerApiRef } from '../../../api/serviceApiRef'; @@ -30,6 +29,7 @@ import { Project } from '../../../contexts/ProjectContext'; import { TAG_OBJECT_MESSAGE } from '../../../constants/constants'; import { useResponseSteps } from '../../../hooks/useResponseSteps'; import { useUserContext } from '../../../contexts/UserContext'; +import { useApi } from '@backstage/core-plugin-api'; interface UseCreateReleaseCandidate { defaultBranch: GetRepositoryResult['repository']['defaultBranch']; diff --git a/plugins/git-release-manager/src/features/Features.tsx b/plugins/git-release-manager/src/features/Features.tsx index f147a4b9f0..7c9844e4df 100644 --- a/plugins/git-release-manager/src/features/Features.tsx +++ b/plugins/git-release-manager/src/features/Features.tsx @@ -16,7 +16,6 @@ import React, { ComponentProps } from 'react'; import { Alert, AlertTitle } from '@material-ui/lab'; -import { ErrorBoundary, Progress, useApi } from '@backstage/core'; import { CreateReleaseCandidate } from './CreateReleaseCandidate/CreateReleaseCandidate'; import { GitReleaseManager } from '../GitReleaseManager'; @@ -30,6 +29,9 @@ import { useProjectContext } from '../contexts/ProjectContext'; import { useVersioningStrategyMatchesRepoTags } from '../hooks/useVersioningStrategyMatchesRepoTags'; import { validateTagName } from '../helpers/tagParts/validateTagName'; +import { ErrorBoundary, Progress } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + export function Features({ features, }: { diff --git a/plugins/git-release-manager/src/features/Info/Info.tsx b/plugins/git-release-manager/src/features/Info/Info.tsx index 670452a032..965975d1a1 100644 --- a/plugins/git-release-manager/src/features/Info/Info.tsx +++ b/plugins/git-release-manager/src/features/Info/Info.tsx @@ -28,7 +28,7 @@ import { Stats } from '../Stats/Stats'; import { TEST_IDS } from '../../test-helpers/test-ids'; import { useProjectContext } from '../../contexts/ProjectContext'; import flowImage from './flow.png'; -import { Link } from '@backstage/core'; +import { Link } from '@backstage/core-components'; interface InfoCardProps { releaseBranch: GetBranchResult['branch'] | null; diff --git a/plugins/git-release-manager/src/features/Patch/PatchBody.tsx b/plugins/git-release-manager/src/features/Patch/PatchBody.tsx index 6f0f88ae46..72a60216fd 100644 --- a/plugins/git-release-manager/src/features/Patch/PatchBody.tsx +++ b/plugins/git-release-manager/src/features/Patch/PatchBody.tsx @@ -32,7 +32,6 @@ import { } from '@material-ui/core'; import FileCopyIcon from '@material-ui/icons/FileCopy'; import OpenInNewIcon from '@material-ui/icons/OpenInNew'; -import { Link, Progress, useApi } from '@backstage/core'; import { GetBranchResult, @@ -50,6 +49,9 @@ import { TEST_IDS } from '../../test-helpers/test-ids'; import { usePatch } from './hooks/usePatch'; import { useProjectContext } from '../../contexts/ProjectContext'; +import { Link, Progress } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + interface PatchBodyProps { bumpedTag: string; latestRelease: NonNullable; diff --git a/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts b/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts index 506f218842..7915029dc5 100644 --- a/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts +++ b/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts @@ -16,12 +16,11 @@ import { useEffect, useState } from 'react'; import { useAsync, useAsyncFn } from 'react-use'; -import { useApi } from '@backstage/core'; - import { GetLatestReleaseResult, GetRecentCommitsResultSingle, } from '../../../api/GitReleaseClient'; + import { CalverTagParts } from '../../../helpers/tagParts/getCalverTagParts'; import { ComponentConfigPatch, CardHook } from '../../../types/types'; import { getPatchCommitSuffix } from '../helpers/getPatchCommitSuffix'; @@ -31,6 +30,7 @@ import { SemverTagParts } from '../../../helpers/tagParts/getSemverTagParts'; import { TAG_OBJECT_MESSAGE } from '../../../constants/constants'; import { useResponseSteps } from '../../../hooks/useResponseSteps'; import { useUserContext } from '../../../contexts/UserContext'; +import { useApi } from '@backstage/core-plugin-api'; interface Patch { bumpedTag: string; diff --git a/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts b/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts index 8b1ffa089b..5e20d318ed 100644 --- a/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts +++ b/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts @@ -16,9 +16,8 @@ import { useState, useEffect } from 'react'; import { useAsync, useAsyncFn } from 'react-use'; -import { useApi } from '@backstage/core'; - import { CardHook, ComponentConfigPromoteRc } from '../../../types/types'; + import { GetLatestReleaseResult } from '../../../api/GitReleaseClient'; import { gitReleaseManagerApiRef } from '../../../api/serviceApiRef'; import { GitReleaseManagerError } from '../../../errors/GitReleaseManagerError'; @@ -26,6 +25,7 @@ import { TAG_OBJECT_MESSAGE } from '../../../constants/constants'; import { useProjectContext } from '../../../contexts/ProjectContext'; import { useResponseSteps } from '../../../hooks/useResponseSteps'; import { useUserContext } from '../../../contexts/UserContext'; +import { useApi } from '@backstage/core-plugin-api'; interface PromoteRc { rcRelease: NonNullable; diff --git a/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx b/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx index 5d6ea4f75d..c5cb38f4db 100644 --- a/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx +++ b/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx @@ -25,7 +25,6 @@ import { Select, Box, } from '@material-ui/core'; -import { Progress, useApi } from '@backstage/core'; import { gitReleaseManagerApiRef } from '../../api/serviceApiRef'; import { TEST_IDS } from '../../test-helpers/test-ids'; @@ -34,6 +33,9 @@ import { useProjectContext } from '../../contexts/ProjectContext'; import { useQueryHandler } from '../../hooks/useQueryHandler'; import { useUserContext } from '../../contexts/UserContext'; +import { Progress } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + export function Owner() { const pluginApiClient = useApi(gitReleaseManagerApiRef); const { project } = useProjectContext(); diff --git a/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx b/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx index bc713709b1..29f7110bbf 100644 --- a/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx +++ b/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx @@ -25,7 +25,6 @@ import { Select, Box, } from '@material-ui/core'; -import { Progress, useApi } from '@backstage/core'; import { gitReleaseManagerApiRef } from '../../api/serviceApiRef'; import { TEST_IDS } from '../../test-helpers/test-ids'; @@ -33,6 +32,9 @@ import { useFormClasses } from './styles'; import { useProjectContext } from '../../contexts/ProjectContext'; import { useQueryHandler } from '../../hooks/useQueryHandler'; +import { Progress } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + export function Repo() { const pluginApiClient = useApi(gitReleaseManagerApiRef); const { project } = useProjectContext(); diff --git a/plugins/git-release-manager/src/features/Stats/DialogBody.tsx b/plugins/git-release-manager/src/features/Stats/DialogBody.tsx index 219bc2a146..40dd782261 100644 --- a/plugins/git-release-manager/src/features/Stats/DialogBody.tsx +++ b/plugins/git-release-manager/src/features/Stats/DialogBody.tsx @@ -25,9 +25,8 @@ import { TableHead, TableRow, } from '@material-ui/core'; -import { Progress } from '@backstage/core'; - import { getMappedReleases } from './helpers/getMappedReleases'; + import { getReleaseStats } from './helpers/getReleaseStats'; import { Info } from './Info/Info'; import { ReleaseStatsContext } from './contexts/ReleaseStatsContext'; @@ -35,6 +34,7 @@ import { Row } from './Row/Row'; import { useGetStats } from './hooks/useGetStats'; import { useProjectContext } from '../../contexts/ProjectContext'; import { Warn } from './Warn'; +import { Progress } from '@backstage/core-components'; const useStyles = makeStyles({ table: { diff --git a/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx b/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx index 3d1d5c5bb4..6e5335038d 100644 --- a/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx +++ b/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx @@ -17,13 +17,13 @@ import { useEffect, useState } from 'react'; import { useAsync, useAsyncFn } from 'react-use'; import { DateTime } from 'luxon'; -import { useApi } from '@backstage/core'; - import { getReleaseCommitPairs } from '../helpers/getReleaseCommitPairs'; + import { gitReleaseManagerApiRef } from '../../../../api/serviceApiRef'; import { useProjectContext } from '../../../../contexts/ProjectContext'; import { useReleaseStatsContext } from '../../contexts/ReleaseStatsContext'; import { getTagDates } from '../../helpers/getTagDates'; +import { useApi } from '@backstage/core-plugin-api'; export type ReleaseCommitPairs = Array<{ baseVersion: string; diff --git a/plugins/git-release-manager/src/features/Stats/Row/Row.tsx b/plugins/git-release-manager/src/features/Stats/Row/Row.tsx index 1d6e298df0..f46fe89cc2 100644 --- a/plugins/git-release-manager/src/features/Stats/Row/Row.tsx +++ b/plugins/git-release-manager/src/features/Stats/Row/Row.tsx @@ -25,10 +25,10 @@ import { } from '@material-ui/core'; import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown'; import ChevronRightIcon from '@material-ui/icons/ChevronRight'; -import { Link } from '@backstage/core'; - import { ReleaseStats } from '../contexts/ReleaseStatsContext'; + import { RowCollapsed } from './RowCollapsed/RowCollapsed'; +import { Link } from '@backstage/core-components'; const useRowStyles = makeStyles({ root: { diff --git a/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx b/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx index 0a499f5cf6..14a988216b 100644 --- a/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx +++ b/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx @@ -19,7 +19,6 @@ import { useAsync } from 'react-use'; import { DateTime } from 'luxon'; import { Box, Typography } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; -import { Progress, useApi } from '@backstage/core'; import { getDecimalNumber } from '../../helpers/getDecimalNumber'; import { getTagDates } from '../../helpers/getTagDates'; @@ -27,6 +26,9 @@ import { gitReleaseManagerApiRef } from '../../../../api/serviceApiRef'; import { ReleaseStats } from '../../contexts/ReleaseStatsContext'; import { useProjectContext } from '../../../../contexts/ProjectContext'; +import { Progress } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + interface ReleaseTimeProps { releaseStat: ReleaseStats['releases']['0']; } diff --git a/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts b/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts index e87d29c29a..8f68bc93f2 100644 --- a/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts +++ b/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import { useApi } from '@backstage/core'; import { useAsync } from 'react-use'; - import { gitReleaseManagerApiRef } from '../../../api/serviceApiRef'; + import { useProjectContext } from '../../../contexts/ProjectContext'; +import { useApi } from '@backstage/core-plugin-api'; export const useGetStats = () => { const pluginApiClient = useApi(gitReleaseManagerApiRef); diff --git a/plugins/git-release-manager/src/plugin.ts b/plugins/git-release-manager/src/plugin.ts index 6b15b79a9f..f5186aaf79 100644 --- a/plugins/git-release-manager/src/plugin.ts +++ b/plugins/git-release-manager/src/plugin.ts @@ -14,17 +14,17 @@ * limitations under the License. */ +import { gitReleaseManagerApiRef } from './api/serviceApiRef'; + +import { GitReleaseClient } from './api/GitReleaseClient'; +import { rootRouteRef } from './routes'; import { configApiRef, createPlugin, createApiFactory, githubAuthApiRef, createRoutableExtension, -} from '@backstage/core'; - -import { gitReleaseManagerApiRef } from './api/serviceApiRef'; -import { GitReleaseClient } from './api/GitReleaseClient'; -import { rootRouteRef } from './routes'; +} from '@backstage/core-plugin-api'; export { gitReleaseManagerApiRef }; diff --git a/plugins/git-release-manager/src/routes.ts b/plugins/git-release-manager/src/routes.ts index 3b3ea80cc2..d10679094e 100644 --- a/plugins/git-release-manager/src/routes.ts +++ b/plugins/git-release-manager/src/routes.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createRouteRef } from '@backstage/core'; +import { createRouteRef } from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ title: 'git-release-manager', diff --git a/plugins/github-actions/src/api/GithubActionsApi.ts b/plugins/github-actions/src/api/GithubActionsApi.ts index 1a3a5ed562..b58661e88b 100644 --- a/plugins/github-actions/src/api/GithubActionsApi.ts +++ b/plugins/github-actions/src/api/GithubActionsApi.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; import { RestEndpointMethodTypes } from '@octokit/rest'; +import { createApiRef } from '@backstage/core-plugin-api'; export const githubActionsApiRef = createApiRef({ id: 'plugin.githubactions.service', diff --git a/plugins/github-actions/src/api/GithubActionsClient.ts b/plugins/github-actions/src/api/GithubActionsClient.ts index 7803a3149e..8e1ae2a666 100644 --- a/plugins/github-actions/src/api/GithubActionsClient.ts +++ b/plugins/github-actions/src/api/GithubActionsClient.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import { ConfigApi, OAuthApi } from '@backstage/core'; import { readGitHubIntegrationConfigs } from '@backstage/integration'; import { GithubActionsApi } from './GithubActionsApi'; import { Octokit, RestEndpointMethodTypes } from '@octokit/rest'; +import { ConfigApi, OAuthApi } from '@backstage/core-plugin-api'; export class GithubActionsClient implements GithubActionsApi { private readonly configApi: ConfigApi; diff --git a/plugins/github-actions/src/components/Cards/Cards.tsx b/plugins/github-actions/src/components/Cards/Cards.tsx index c2eaaf885e..e9a09c0ee1 100644 --- a/plugins/github-actions/src/components/Cards/Cards.tsx +++ b/plugins/github-actions/src/components/Cards/Cards.tsx @@ -14,14 +14,6 @@ * limitations under the License. */ import { Entity } from '@backstage/catalog-model'; -import { - configApiRef, - errorApiRef, - InfoCard, - InfoCardVariants, - StructuredMetadataTable, - useApi, -} from '@backstage/core'; import { readGitHubIntegrationConfigs } from '@backstage/integration'; import { useEntity } from '@backstage/plugin-catalog-react'; import { @@ -38,6 +30,13 @@ import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns'; import { WorkflowRunsTable } from '../WorkflowRunsTable'; import { WorkflowRunStatus } from '../WorkflowRunStatus'; +import { configApiRef, errorApiRef, useApi } from '@backstage/core-plugin-api'; +import { + InfoCard, + InfoCardVariants, + StructuredMetadataTable, +} from '@backstage/core-components'; + const useStyles = makeStyles({ externalLinkIcon: { fontSize: 'inherit', diff --git a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx index 18cc59439b..944a92ccab 100644 --- a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx +++ b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx @@ -14,14 +14,6 @@ * limitations under the License. */ -import { - ApiProvider, - ApiRegistry, - errorApiRef, - configApiRef, - ConfigApi, - ConfigReader, -} from '@backstage/core'; import { EntityProvider } from '@backstage/plugin-catalog-react'; import { lightTheme } from '@backstage/theme'; import { ThemeProvider } from '@material-ui/core'; @@ -32,6 +24,17 @@ import { useWorkflowRuns } from '../useWorkflowRuns'; import type { Props as RecentWorkflowRunsCardProps } from './RecentWorkflowRunsCard'; import { RecentWorkflowRunsCard } from './RecentWorkflowRunsCard'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; +import { + errorApiRef, + configApiRef, + ConfigApi, +} from '@backstage/core-plugin-api'; + jest.mock('../useWorkflowRuns', () => ({ useWorkflowRuns: jest.fn(), })); diff --git a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx index f0366e5590..3015291ca1 100644 --- a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx +++ b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.tsx @@ -14,15 +14,6 @@ * limitations under the License. */ import { Entity } from '@backstage/catalog-model'; -import { - configApiRef, - errorApiRef, - InfoCard, - InfoCardVariants, - Link, - Table, - useApi, -} from '@backstage/core'; import { readGitHubIntegrationConfigs } from '@backstage/integration'; import { useEntity } from '@backstage/plugin-catalog-react'; import React, { useEffect } from 'react'; @@ -32,6 +23,14 @@ import { useWorkflowRuns } from '../useWorkflowRuns'; import { WorkflowRunStatus } from '../WorkflowRunStatus'; import { Typography } from '@material-ui/core'; +import { configApiRef, errorApiRef, useApi } from '@backstage/core-plugin-api'; +import { + InfoCard, + InfoCardVariants, + Link, + Table, +} from '@backstage/core-components'; + const firstLine = (message: string): string => message.split('\n')[0]; export type Props = { diff --git a/plugins/github-actions/src/components/Router.tsx b/plugins/github-actions/src/components/Router.tsx index 52cd66375f..f07857c2f7 100644 --- a/plugins/github-actions/src/components/Router.tsx +++ b/plugins/github-actions/src/components/Router.tsx @@ -21,7 +21,7 @@ import { rootRouteRef, buildRouteRef } from '../routes'; import { WorkflowRunDetails } from './WorkflowRunDetails'; import { WorkflowRunsTable } from './WorkflowRunsTable'; import { GITHUB_ACTIONS_ANNOTATION } from './useProjectName'; -import { MissingAnnotationEmptyState } from '@backstage/core'; +import { MissingAnnotationEmptyState } from '@backstage/core-components'; export const isGithubActionsAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION]); diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx b/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx index f29fbd80bb..5ec922f3db 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx +++ b/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import { Entity } from '@backstage/catalog-model'; -import { configApiRef, Breadcrumbs, Link, useApi } from '@backstage/core'; import { readGitHubIntegrationConfigs } from '@backstage/integration'; import { Accordion, @@ -46,6 +45,9 @@ import { useWorkflowRunJobs } from './useWorkflowRunJobs'; import { useWorkflowRunsDetails } from './useWorkflowRunsDetails'; import { WorkflowRunLogs } from '../WorkflowRunLogs'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; +import { Breadcrumbs, Link } from '@backstage/core-components'; + const useStyles = makeStyles(theme => ({ root: { maxWidth: 720, diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts index ff498f3f2c..70959ae564 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts +++ b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts @@ -14,9 +14,9 @@ * limitations under the License. */ import { useAsync } from 'react-use'; -import { useApi, useRouteRefParams } from '@backstage/core'; import { githubActionsApiRef } from '../../api'; import { buildRouteRef } from '../../routes'; +import { useApi, useRouteRefParams } from '@backstage/core-plugin-api'; export const useWorkflowRunJobs = ({ hostname, diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts index 124b8e8a87..5050c117eb 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts +++ b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useApi, useRouteRefParams } from '@backstage/core'; import { useAsync } from 'react-use'; import { githubActionsApiRef } from '../../api'; import { buildRouteRef } from '../../routes'; +import { useApi, useRouteRefParams } from '@backstage/core-plugin-api'; export const useWorkflowRunsDetails = ({ hostname, diff --git a/plugins/github-actions/src/components/WorkflowRunLogs/WorkflowRunLogs.tsx b/plugins/github-actions/src/components/WorkflowRunLogs/WorkflowRunLogs.tsx index f24b6cea17..f3434b19ac 100644 --- a/plugins/github-actions/src/components/WorkflowRunLogs/WorkflowRunLogs.tsx +++ b/plugins/github-actions/src/components/WorkflowRunLogs/WorkflowRunLogs.tsx @@ -34,8 +34,8 @@ import { useProjectName } from '../useProjectName'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import DescriptionIcon from '@material-ui/icons/Description'; import { Entity } from '@backstage/catalog-model'; -import { configApiRef, useApi } from '@backstage/core'; import { readGitHubIntegrationConfigs } from '@backstage/integration'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; const LazyLog = React.lazy(() => import('react-lazylog/build/LazyLog')); const LinePart = React.lazy(() => import('react-lazylog/build/LinePart')); diff --git a/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts b/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts index ac53f01cfe..6d4266f765 100644 --- a/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts +++ b/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import { useApi } from '@backstage/core'; import { useAsync } from 'react-use'; import { githubActionsApiRef } from '../../api'; +import { useApi } from '@backstage/core-plugin-api'; export const useDownloadWorkflowRunLogs = ({ hostname, diff --git a/plugins/github-actions/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx b/plugins/github-actions/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx index c6beff00cd..c2e32710d1 100644 --- a/plugins/github-actions/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx +++ b/plugins/github-actions/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import React from 'react'; import { StatusPending, StatusRunning, @@ -21,8 +22,7 @@ import { StatusWarning, StatusAborted, StatusError, -} from '@backstage/core'; -import React from 'react'; +} from '@backstage/core-components'; export const WorkflowRunStatus = ({ status, diff --git a/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx b/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx index bec2503562..a5215bf07a 100644 --- a/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx +++ b/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx @@ -25,13 +25,6 @@ import { import RetryIcon from '@material-ui/icons/Replay'; import GitHubIcon from '@material-ui/icons/GitHub'; import { Link as RouterLink, generatePath } from 'react-router-dom'; -import { - EmptyState, - Table, - TableColumn, - configApiRef, - useApi, -} from '@backstage/core'; import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns'; import { WorkflowRunStatus } from '../WorkflowRunStatus'; import SyncIcon from '@material-ui/icons/Sync'; @@ -40,6 +33,9 @@ import { useProjectName } from '../useProjectName'; import { Entity } from '@backstage/catalog-model'; import { readGitHubIntegrationConfigs } from '@backstage/integration'; +import { EmptyState, Table, TableColumn } from '@backstage/core-components'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; + const generatedColumns: TableColumn[] = [ { title: 'ID', diff --git a/plugins/github-actions/src/components/useWorkflowRuns.ts b/plugins/github-actions/src/components/useWorkflowRuns.ts index f62b03f506..d225010656 100644 --- a/plugins/github-actions/src/components/useWorkflowRuns.ts +++ b/plugins/github-actions/src/components/useWorkflowRuns.ts @@ -16,7 +16,7 @@ import { useState } from 'react'; import { useAsyncRetry } from 'react-use'; import { githubActionsApiRef } from '../api/GithubActionsApi'; -import { useApi, errorApiRef } from '@backstage/core'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export type WorkflowRun = { workflowName: string; diff --git a/plugins/github-actions/src/plugin.ts b/plugins/github-actions/src/plugin.ts index a34428e18c..9105d18d3d 100644 --- a/plugins/github-actions/src/plugin.ts +++ b/plugins/github-actions/src/plugin.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { githubActionsApiRef, GithubActionsClient } from './api'; +import { rootRouteRef } from './routes'; import { configApiRef, createPlugin, @@ -21,9 +23,7 @@ import { githubAuthApiRef, createRoutableExtension, createComponentExtension, -} from '@backstage/core'; -import { githubActionsApiRef, GithubActionsClient } from './api'; -import { rootRouteRef } from './routes'; +} from '@backstage/core-plugin-api'; export const githubActionsPlugin = createPlugin({ id: 'github-actions', diff --git a/plugins/github-actions/src/routes.ts b/plugins/github-actions/src/routes.ts index e576379d6c..f84ffcd728 100644 --- a/plugins/github-actions/src/routes.ts +++ b/plugins/github-actions/src/routes.ts @@ -14,9 +14,8 @@ * limitations under the License. */ -import { createRouteRef } from '@backstage/core'; +import { createRouteRef } from '@backstage/core-plugin-api'; -// TODO(freben): This is just a demo route for now export const rootRouteRef = createRouteRef({ path: '', title: 'GitHub Actions', diff --git a/plugins/github-deployments/src/api/index.ts b/plugins/github-deployments/src/api/index.ts index 6f1b7e4772..bc857e9996 100644 --- a/plugins/github-deployments/src/api/index.ts +++ b/plugins/github-deployments/src/api/index.ts @@ -14,10 +14,10 @@ * limitations under the License. */ import { parseLocationReference } from '@backstage/catalog-model'; -import { createApiRef, OAuthApi } from '@backstage/core'; import { InputError } from '@backstage/errors'; import { ScmIntegrationRegistry } from '@backstage/integration'; import { graphql } from '@octokit/graphql'; +import { createApiRef, OAuthApi } from '@backstage/core-plugin-api'; const getBaseUrl = ( scmIntegrationsApi: ScmIntegrationRegistry, diff --git a/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx b/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx index 68f5b5df43..ec148c237a 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx @@ -14,15 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { - ApiProvider, - ApiRegistry, - errorApiRef, - configApiRef, - ConfigReader, - ConfigApi, - OAuthApi, -} from '@backstage/core'; import { fireEvent } from '@testing-library/react'; import { msw, renderInTestApp } from '@backstage/test-utils'; @@ -48,6 +39,18 @@ import { Entity } from '@backstage/catalog-model'; import { GithubDeploymentsTable } from './GithubDeploymentsTable'; import { Box } from '@material-ui/core'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; +import { + errorApiRef, + configApiRef, + ConfigApi, + OAuthApi, +} from '@backstage/core-plugin-api'; + let entity: { entity: Entity }; jest.mock('@backstage/plugin-catalog-react', () => ({ diff --git a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx index 597b800cf5..de3a4cee9e 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx @@ -14,12 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { - MissingAnnotationEmptyState, - ResponseErrorPanel, - TableColumn, - useApi, -} from '@backstage/core'; import { useAsyncRetry } from 'react-use'; import { GithubDeployment, githubDeploymentsApiRef } from '../api'; import { useEntity } from '@backstage/plugin-catalog-react'; @@ -33,6 +27,13 @@ import { SOURCE_LOCATION_ANNOTATION, } from '@backstage/catalog-model'; +import { + MissingAnnotationEmptyState, + ResponseErrorPanel, + TableColumn, +} from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + const GithubDeploymentsComponent = ({ projectSlug, last, diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx b/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx index e13b8aeb18..086643e93b 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/GithubDeploymentsTable.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ import React from 'react'; -import { Table, TableColumn } from '@backstage/core'; import { GithubDeployment } from '../../api'; import { Typography, makeStyles } from '@material-ui/core'; import SyncIcon from '@material-ui/icons/Sync'; import * as columnFactories from './columns'; import { defaultDeploymentColumns } from './presets'; +import { Table, TableColumn } from '@backstage/core-components'; const useStyles = makeStyles(theme => ({ empty: { diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx index a4aad47657..adf8cb546d 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx @@ -14,6 +14,9 @@ * limitations under the License. */ import React from 'react'; +import { GithubDeployment } from '../../api'; +import { DateTime } from 'luxon'; +import { Box, Typography } from '@material-ui/core'; import { StatusPending, StatusRunning, @@ -22,10 +25,7 @@ import { StatusAborted, StatusError, Link, -} from '@backstage/core'; -import { GithubDeployment } from '../../api'; -import { DateTime } from 'luxon'; -import { Box, Typography } from '@material-ui/core'; +} from '@backstage/core-components'; export const GithubStateIndicator = ({ state }: { state: string }) => { switch (state) { diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/presets.ts b/plugins/github-deployments/src/components/GithubDeploymentsTable/presets.ts index b50e11dcb6..5b568830f4 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/presets.ts +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/presets.ts @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { TableColumn } from '@backstage/core'; import { GithubDeployment } from '../../api'; import { createEnvironmentColumn, @@ -22,6 +21,7 @@ import { createLastUpdatedColumn, createCreatorColumn, } from './columns'; +import { TableColumn } from '@backstage/core-components'; export const defaultDeploymentColumns: TableColumn[] = [ createEnvironmentColumn(), diff --git a/plugins/github-deployments/src/plugin.ts b/plugins/github-deployments/src/plugin.ts index 943d5e0bc6..17f1621b3c 100644 --- a/plugins/github-deployments/src/plugin.ts +++ b/plugins/github-deployments/src/plugin.ts @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { scmIntegrationsApiRef } from '@backstage/integration-react'; +import { githubDeploymentsApiRef, GithubDeploymentsApiClient } from './api'; import { createApiFactory, createComponentExtension, createPlugin, githubAuthApiRef, -} from '@backstage/core'; -import { scmIntegrationsApiRef } from '@backstage/integration-react'; -import { githubDeploymentsApiRef, GithubDeploymentsApiClient } from './api'; +} from '@backstage/core-plugin-api'; export const githubDeploymentsPlugin = createPlugin({ id: 'github-deployments', diff --git a/plugins/gitops-profiles/src/api.ts b/plugins/gitops-profiles/src/api.ts index 3a14dea837..e08b29a360 100644 --- a/plugins/gitops-profiles/src/api.ts +++ b/plugins/gitops-profiles/src/api.ts @@ -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; diff --git a/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx b/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx index ec689865c3..0b9fb0bc6e 100644 --- a/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx +++ b/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx @@ -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); diff --git a/plugins/gitops-profiles/src/components/ClusterPage/ClusterPage.tsx b/plugins/gitops-profiles/src/components/ClusterPage/ClusterPage.tsx index 0d304753c4..d056ee310d 100644 --- a/plugins/gitops-profiles/src/components/ClusterPage/ClusterPage.tsx +++ b/plugins/gitops-profiles/src/components/ClusterPage/ClusterPage.tsx @@ -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 }; diff --git a/plugins/gitops-profiles/src/components/ClusterTable/ClusterTable.tsx b/plugins/gitops-profiles/src/components/ClusterTable/ClusterTable.tsx index a3393a8ddb..3b9386f9d0 100644 --- a/plugins/gitops-profiles/src/components/ClusterTable/ClusterTable.tsx +++ b/plugins/gitops-profiles/src/components/ClusterTable/ClusterTable.tsx @@ -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[] = [ { diff --git a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.test.tsx b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.test.tsx index 046fa58600..2b194a702e 100644 --- a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.test.tsx +++ b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.test.tsx @@ -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(); diff --git a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx index 394b0126d5..7374d2dc41 100644 --- a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx +++ b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx @@ -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) diff --git a/plugins/gitops-profiles/src/plugin.ts b/plugins/gitops-profiles/src/plugin.ts index df19087199..67e039ee8d 100644 --- a/plugins/gitops-profiles/src/plugin.ts +++ b/plugins/gitops-profiles/src/plugin.ts @@ -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', diff --git a/plugins/gitops-profiles/src/routes.ts b/plugins/gitops-profiles/src/routes.ts index 28be85bd38..23000a4d4c 100644 --- a/plugins/gitops-profiles/src/routes.ts +++ b/plugins/gitops-profiles/src/routes.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createRouteRef } from '@backstage/core'; +import { createRouteRef } from '@backstage/core-plugin-api'; const NoIcon = () => null; diff --git a/plugins/graphiql/src/components/GraphiQLBrowser/GraphiQLBrowser.tsx b/plugins/graphiql/src/components/GraphiQLBrowser/GraphiQLBrowser.tsx index 35dcb1eb3b..30a4a33ad6 100644 --- a/plugins/graphiql/src/components/GraphiQLBrowser/GraphiQLBrowser.tsx +++ b/plugins/graphiql/src/components/GraphiQLBrowser/GraphiQLBrowser.tsx @@ -19,8 +19,8 @@ import { Tabs, Tab, makeStyles, Typography, Divider } from '@material-ui/core'; import 'graphiql/graphiql.css'; import { StorageBucket } from '../../lib/storage'; import { GraphQLEndpoint } from '../../lib/api'; -import { Progress } from '@backstage/core'; import { BackstageTheme } from '@backstage/theme'; +import { Progress } from '@backstage/core-components'; const GraphiQL = React.lazy(() => import('graphiql')); diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.test.tsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.test.tsx index 7bf48eb7f6..a4d3062f5b 100644 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.test.tsx +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.test.tsx @@ -18,10 +18,10 @@ import React from 'react'; import { GraphiQLPage } from './GraphiQLPage'; import { ThemeProvider } from '@material-ui/core'; import { lightTheme } from '@backstage/theme'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { act } from 'react-dom/test-utils'; import { renderWithEffects } from '@backstage/test-utils'; import { GraphQLBrowseApi, graphQlBrowseApiRef } from '../../lib/api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; jest.mock('../GraphiQLBrowser', () => ({ GraphiQLBrowser: () => '', diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx index 8c3c90fe1d..8899dcfcc6 100644 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx @@ -14,13 +14,19 @@ * limitations under the License. */ import React from 'react'; -import { Content, Header, HeaderLabel, Page, Progress } from '@backstage/core'; import { useApi } from '@backstage/core-plugin-api'; import { useAsync } from 'react-use'; import 'graphiql/graphiql.css'; import { graphQlBrowseApiRef } from '../../lib/api'; import { GraphiQLBrowser } from '../GraphiQLBrowser'; import { Typography } from '@material-ui/core'; +import { + Content, + Header, + HeaderLabel, + Page, + Progress, +} from '@backstage/core-components'; export const GraphiQLPage = () => { const graphQlBrowseApi = useApi(graphQlBrowseApiRef); diff --git a/plugins/graphiql/src/index.ts b/plugins/graphiql/src/index.ts index 10149e37a2..bd13acbf3b 100644 --- a/plugins/graphiql/src/index.ts +++ b/plugins/graphiql/src/index.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { IconComponent } from '@backstage/core'; import GraphiQLIconComponent from './assets/graphiql.icon.svg'; +import { IconComponent } from '@backstage/core-plugin-api'; export { graphiqlPlugin, diff --git a/plugins/ilert/src/api/client.ts b/plugins/ilert/src/api/client.ts index ed1e671bc0..7a460f9ba3 100644 --- a/plugins/ilert/src/api/client.ts +++ b/plugins/ilert/src/api/client.ts @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { ConfigApi, createApiRef, DiscoveryApi } from '@backstage/core'; import { AuthenticationError, ResponseError } from '@backstage/errors'; import { AlertSource, @@ -34,6 +33,11 @@ import { EventRequest, } from './types'; import { DateTime as dt } from 'luxon'; +import { + ConfigApi, + createApiRef, + DiscoveryApi, +} from '@backstage/core-plugin-api'; export const ilertApiRef = createApiRef({ id: 'plugin.ilert.service', diff --git a/plugins/ilert/src/api/types.ts b/plugins/ilert/src/api/types.ts index ab9cca3dc6..eef015abfd 100644 --- a/plugins/ilert/src/api/types.ts +++ b/plugins/ilert/src/api/types.ts @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { DiscoveryApi } from '@backstage/core'; import { AlertSource, Incident, @@ -26,6 +25,7 @@ import { IncidentAction, OnCall, } from '../types'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; export type TableState = { page: number; diff --git a/plugins/ilert/src/components/AlertSource/AlertSourceLink.tsx b/plugins/ilert/src/components/AlertSource/AlertSourceLink.tsx index f7f6dbb78c..39bbd01ed6 100644 --- a/plugins/ilert/src/components/AlertSource/AlertSourceLink.tsx +++ b/plugins/ilert/src/components/AlertSource/AlertSourceLink.tsx @@ -14,13 +14,15 @@ * limitations under the License. */ import React from 'react'; -import { useApi, Link } from '@backstage/core'; import Grid from '@material-ui/core/Grid'; import { AlertSource } from '../../types'; import { ilertApiRef } from '../../api'; import { makeStyles } from '@material-ui/core/styles'; import useMediaQuery from '@material-ui/core/useMediaQuery'; +import { useApi } from '@backstage/core-plugin-api'; +import { Link } from '@backstage/core-components'; + const useStyles = makeStyles({ root: { display: 'flex', diff --git a/plugins/ilert/src/components/Errors/MissingAuthorizationHeaderError.tsx b/plugins/ilert/src/components/Errors/MissingAuthorizationHeaderError.tsx index 6b3d463d2a..613a7384bb 100644 --- a/plugins/ilert/src/components/Errors/MissingAuthorizationHeaderError.tsx +++ b/plugins/ilert/src/components/Errors/MissingAuthorizationHeaderError.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ import React from 'react'; -import { EmptyState } from '@backstage/core'; import { Button } from '@material-ui/core'; +import { EmptyState } from '@backstage/core-components'; export const MissingAuthorizationHeaderError = () => ( Boolean(entity.metadata.annotations?.[ILERT_INTEGRATION_KEY_ANNOTATION]); diff --git a/plugins/ilert/src/components/ILertCard/ILertCardActionsHeader.tsx b/plugins/ilert/src/components/ILertCard/ILertCardActionsHeader.tsx index c19c31839a..edab8cd12e 100644 --- a/plugins/ilert/src/components/ILertCard/ILertCardActionsHeader.tsx +++ b/plugins/ilert/src/components/ILertCard/ILertCardActionsHeader.tsx @@ -14,12 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { - HeaderIconLinkRow, - IconLinkVerticalProps, - useApi, - alertApiRef, -} from '@backstage/core'; import Alert from '@material-ui/lab/Alert'; import Button from '@material-ui/core/Button'; import Dialog from '@material-ui/core/Dialog'; @@ -36,6 +30,12 @@ import Typography from '@material-ui/core/Typography'; import { ilertApiRef } from '../../api'; import { AlertSource, UptimeMonitor } from '../../types'; +import { + HeaderIconLinkRow, + IconLinkVerticalProps, +} from '@backstage/core-components'; +import { useApi, alertApiRef } from '@backstage/core-plugin-api'; + export const ILertCardActionsHeader = ({ alertSource, setAlertSource, diff --git a/plugins/ilert/src/components/ILertCard/ILertCardEmptyState.tsx b/plugins/ilert/src/components/ILertCard/ILertCardEmptyState.tsx index 955d514564..8c83714229 100644 --- a/plugins/ilert/src/components/ILertCard/ILertCardEmptyState.tsx +++ b/plugins/ilert/src/components/ILertCard/ILertCardEmptyState.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { CodeSnippet } from '@backstage/core'; import { BackstageTheme } from '@backstage/theme'; import Card from '@material-ui/core/Card'; import CardContent from '@material-ui/core/CardContent'; @@ -24,6 +23,7 @@ import Divider from '@material-ui/core/Divider'; import Typography from '@material-ui/core/Typography'; import { makeStyles } from '@material-ui/core/styles'; import React from 'react'; +import { CodeSnippet } from '@backstage/core-components'; const ENTITY_YAML = `apiVersion: backstage.io/v1alpha1 kind: Component diff --git a/plugins/ilert/src/components/ILertCard/ILertCardMaintenanceModal.tsx b/plugins/ilert/src/components/ILertCard/ILertCardMaintenanceModal.tsx index 54d465a83c..75e3608f85 100644 --- a/plugins/ilert/src/components/ILertCard/ILertCardMaintenanceModal.tsx +++ b/plugins/ilert/src/components/ILertCard/ILertCardMaintenanceModal.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { alertApiRef, useApi } from '@backstage/core'; import Button from '@material-ui/core/Button'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '@material-ui/core/DialogActions'; @@ -25,6 +24,7 @@ import MenuItem from '@material-ui/core/MenuItem'; import TextField from '@material-ui/core/TextField'; import { ilertApiRef } from '../../api'; import { AlertSource } from '../../types'; +import { alertApiRef, useApi } from '@backstage/core-plugin-api'; export const ILertCardMaintenanceModal = ({ alertSource, diff --git a/plugins/ilert/src/components/ILertCard/ILertCardOnCall.tsx b/plugins/ilert/src/components/ILertCard/ILertCardOnCall.tsx index 8f28790375..a80b8cb0a8 100644 --- a/plugins/ilert/src/components/ILertCard/ILertCardOnCall.tsx +++ b/plugins/ilert/src/components/ILertCard/ILertCardOnCall.tsx @@ -24,9 +24,9 @@ import ReplayIcon from '@material-ui/icons/Replay'; import { makeStyles } from '@material-ui/core/styles'; import { AlertSource } from '../../types'; import { useAlertSourceOnCalls } from '../../hooks/useAlertSourceOnCalls'; -import { Progress } from '@backstage/core'; import { ILertCardOnCallEmptyState } from './ILertCardOnCallEmptyState'; import { ILertCardOnCallItem } from './ILertCardOnCallItem'; +import { Progress } from '@backstage/core-components'; const useStyles = makeStyles(theme => ({ repeatText: { diff --git a/plugins/ilert/src/components/ILertCard/ILertCardOnCallItem.tsx b/plugins/ilert/src/components/ILertCard/ILertCardOnCallItem.tsx index 994666084b..1eab035208 100644 --- a/plugins/ilert/src/components/ILertCard/ILertCardOnCallItem.tsx +++ b/plugins/ilert/src/components/ILertCard/ILertCardOnCallItem.tsx @@ -27,9 +27,9 @@ import EmailIcon from '@material-ui/icons/Email'; import PhoneIcon from '@material-ui/icons/Phone'; import { makeStyles } from '@material-ui/core/styles'; import { OnCall } from '../../types'; -import { useApi } from '@backstage/core'; import { ilertApiRef } from '../../api'; import { DateTime as dt } from 'luxon'; +import { useApi } from '@backstage/core-plugin-api'; const useStyles = makeStyles({ listItemPrimary: { diff --git a/plugins/ilert/src/components/ILertPage/ILertPage.tsx b/plugins/ilert/src/components/ILertPage/ILertPage.tsx index 40934bfdfb..fad41b18d2 100644 --- a/plugins/ilert/src/components/ILertPage/ILertPage.tsx +++ b/plugins/ilert/src/components/ILertPage/ILertPage.tsx @@ -14,16 +14,16 @@ * limitations under the License. */ import React from 'react'; +import { IncidentsPage } from '../IncidentsPage'; +import { UptimeMonitorsPage } from '../UptimeMonitorsPage'; +import { OnCallSchedulesPage } from '../OnCallSchedulesPage'; import { Page, Header, HeaderTabs, HeaderLabel, Content, -} from '@backstage/core'; -import { IncidentsPage } from '../IncidentsPage'; -import { UptimeMonitorsPage } from '../UptimeMonitorsPage'; -import { OnCallSchedulesPage } from '../OnCallSchedulesPage'; +} from '@backstage/core-components'; export const ILertPage = () => { const [selectedTab, setSelectedTab] = React.useState(0); diff --git a/plugins/ilert/src/components/Incident/IncidentActionsMenu.tsx b/plugins/ilert/src/components/Incident/IncidentActionsMenu.tsx index 5b06cc4eb6..499b1fcc17 100644 --- a/plugins/ilert/src/components/Incident/IncidentActionsMenu.tsx +++ b/plugins/ilert/src/components/Incident/IncidentActionsMenu.tsx @@ -14,13 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { - alertApiRef, - Progress, - useApi, - identityApiRef, - Link, -} from '@backstage/core'; import { IconButton, Menu, MenuItem, Typography } from '@material-ui/core'; import MoreVertIcon from '@material-ui/icons/MoreVert'; import { ilertApiRef } from '../../api'; @@ -28,6 +21,13 @@ import { Incident, IncidentAction } from '../../types'; import { IncidentAssignModal } from './IncidentAssignModal'; import { useIncidentActions } from '../../hooks/useIncidentActions'; +import { + alertApiRef, + useApi, + identityApiRef, +} from '@backstage/core-plugin-api'; +import { Progress, Link } from '@backstage/core-components'; + export const IncidentActionsMenu = ({ incident, onIncidentChanged, diff --git a/plugins/ilert/src/components/Incident/IncidentAssignModal.tsx b/plugins/ilert/src/components/Incident/IncidentAssignModal.tsx index edac5e4e0e..65aa71057d 100644 --- a/plugins/ilert/src/components/Incident/IncidentAssignModal.tsx +++ b/plugins/ilert/src/components/Incident/IncidentAssignModal.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { alertApiRef, useApi } from '@backstage/core'; import { makeStyles } from '@material-ui/core/styles'; import Alert from '@material-ui/lab/Alert'; import Button from '@material-ui/core/Button'; @@ -28,6 +27,7 @@ import { useAssignIncident } from '../../hooks/useAssignIncident'; import { Typography } from '@material-ui/core'; import { ilertApiRef } from '../../api'; import { Incident } from '../../types'; +import { alertApiRef, useApi } from '@backstage/core-plugin-api'; const useStyles = makeStyles(() => ({ container: { diff --git a/plugins/ilert/src/components/Incident/IncidentLink.tsx b/plugins/ilert/src/components/Incident/IncidentLink.tsx index 7bfe08b7a9..36536b3771 100644 --- a/plugins/ilert/src/components/Incident/IncidentLink.tsx +++ b/plugins/ilert/src/components/Incident/IncidentLink.tsx @@ -14,11 +14,13 @@ * limitations under the License. */ import React from 'react'; -import { useApi, Link } from '@backstage/core'; import { makeStyles } from '@material-ui/core/styles'; import { Incident } from '../../types'; import { ilertApiRef } from '../../api'; +import { useApi } from '@backstage/core-plugin-api'; +import { Link } from '@backstage/core-components'; + const useStyles = makeStyles({ link: { lineHeight: '22px', diff --git a/plugins/ilert/src/components/Incident/IncidentNewModal.tsx b/plugins/ilert/src/components/Incident/IncidentNewModal.tsx index 8ff33e6319..a48c2e3026 100644 --- a/plugins/ilert/src/components/Incident/IncidentNewModal.tsx +++ b/plugins/ilert/src/components/Incident/IncidentNewModal.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { alertApiRef, identityApiRef, useApi } from '@backstage/core'; import { makeStyles } from '@material-ui/core/styles'; import Alert from '@material-ui/lab/Alert'; import Button from '@material-ui/core/Button'; @@ -29,6 +28,11 @@ import { Typography } from '@material-ui/core'; import useMediaQuery from '@material-ui/core/useMediaQuery'; import { ilertApiRef } from '../../api'; import { AlertSource } from '../../types'; +import { + alertApiRef, + identityApiRef, + useApi, +} from '@backstage/core-plugin-api'; const useStyles = makeStyles(() => ({ container: { diff --git a/plugins/ilert/src/components/Incident/IncidentStatus.tsx b/plugins/ilert/src/components/Incident/IncidentStatus.tsx index 931a472ec6..26a4e26f46 100644 --- a/plugins/ilert/src/components/Incident/IncidentStatus.tsx +++ b/plugins/ilert/src/components/Incident/IncidentStatus.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ import React from 'react'; -import { StatusError, StatusOK } from '@backstage/core'; import { makeStyles } from '@material-ui/core/styles'; import Tooltip from '@material-ui/core/Tooltip'; import { ACCEPTED, Incident, PENDING, RESOLVED } from '../../types'; +import { StatusError, StatusOK } from '@backstage/core-components'; const useStyles = makeStyles({ denseListIcon: { diff --git a/plugins/ilert/src/components/IncidentsPage/IncidentsPage.tsx b/plugins/ilert/src/components/IncidentsPage/IncidentsPage.tsx index 782848645e..f54b5d360a 100644 --- a/plugins/ilert/src/components/IncidentsPage/IncidentsPage.tsx +++ b/plugins/ilert/src/components/IncidentsPage/IncidentsPage.tsx @@ -14,12 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { - Content, - ContentHeader, - SupportButton, - ResponseErrorPanel, -} from '@backstage/core'; import { AuthenticationError } from '@backstage/errors'; import Button from '@material-ui/core/Button'; import AddIcon from '@material-ui/icons/Add'; @@ -27,6 +21,12 @@ import { IncidentsTable } from './IncidentsTable'; import { MissingAuthorizationHeaderError } from '../Errors'; import { useIncidents } from '../../hooks/useIncidents'; import { IncidentNewModal } from '../Incident/IncidentNewModal'; +import { + Content, + ContentHeader, + SupportButton, + ResponseErrorPanel, +} from '@backstage/core-components'; export const IncidentsPage = () => { const [ diff --git a/plugins/ilert/src/components/IncidentsPage/IncidentsTable.tsx b/plugins/ilert/src/components/IncidentsPage/IncidentsTable.tsx index 087b2bfd40..946ae70e32 100644 --- a/plugins/ilert/src/components/IncidentsPage/IncidentsTable.tsx +++ b/plugins/ilert/src/components/IncidentsPage/IncidentsTable.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { Table, TableColumn, useApi } from '@backstage/core'; import { makeStyles } from '@material-ui/core/styles'; import { ilertApiRef, TableState } from '../../api'; import { Incident, IncidentStatus } from '../../types'; @@ -27,6 +26,9 @@ import humanizeDuration from 'humanize-duration'; import { IncidentActionsMenu } from '../Incident/IncidentActionsMenu'; import { IncidentLink } from '../Incident/IncidentLink'; +import { Table, TableColumn } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + const useStyles = makeStyles(theme => ({ empty: { padding: theme.spacing(2), diff --git a/plugins/ilert/src/components/OnCallSchedulesPage/OnCallSchedulesGrid.tsx b/plugins/ilert/src/components/OnCallSchedulesPage/OnCallSchedulesGrid.tsx index 31da9c1097..697d2a44f1 100644 --- a/plugins/ilert/src/components/OnCallSchedulesPage/OnCallSchedulesGrid.tsx +++ b/plugins/ilert/src/components/OnCallSchedulesPage/OnCallSchedulesGrid.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { useApi, ItemCardGrid, Progress, Link } from '@backstage/core'; import { makeStyles } from '@material-ui/core/styles'; import Card from '@material-ui/core/Card'; import CardContent from '@material-ui/core/CardContent'; @@ -24,6 +23,9 @@ import { Schedule } from '../../types'; import { ilertApiRef } from '../../api'; import { OnCallShiftItem } from './OnCallShiftItem'; +import { useApi } from '@backstage/core-plugin-api'; +import { ItemCardGrid, Progress, Link } from '@backstage/core-components'; + const useStyles = makeStyles(() => ({ card: { margin: 16, diff --git a/plugins/ilert/src/components/OnCallSchedulesPage/OnCallSchedulesPage.tsx b/plugins/ilert/src/components/OnCallSchedulesPage/OnCallSchedulesPage.tsx index bb0cd0218e..c26053c878 100644 --- a/plugins/ilert/src/components/OnCallSchedulesPage/OnCallSchedulesPage.tsx +++ b/plugins/ilert/src/components/OnCallSchedulesPage/OnCallSchedulesPage.tsx @@ -14,16 +14,16 @@ * limitations under the License. */ import React from 'react'; +import { AuthenticationError } from '@backstage/errors'; +import { OnCallSchedulesGrid } from './OnCallSchedulesGrid'; +import { MissingAuthorizationHeaderError } from '../Errors'; +import { useOnCallSchedules } from '../../hooks/useOnCallSchedules'; import { Content, ContentHeader, SupportButton, ResponseErrorPanel, -} from '@backstage/core'; -import { AuthenticationError } from '@backstage/errors'; -import { OnCallSchedulesGrid } from './OnCallSchedulesGrid'; -import { MissingAuthorizationHeaderError } from '../Errors'; -import { useOnCallSchedules } from '../../hooks/useOnCallSchedules'; +} from '@backstage/core-components'; export const OnCallSchedulesPage = () => { const [ diff --git a/plugins/ilert/src/components/Shift/ShiftOverrideModal.tsx b/plugins/ilert/src/components/Shift/ShiftOverrideModal.tsx index 47e13f9b7e..1dbefc8b0a 100644 --- a/plugins/ilert/src/components/Shift/ShiftOverrideModal.tsx +++ b/plugins/ilert/src/components/Shift/ShiftOverrideModal.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import React from 'react'; -import { alertApiRef, useApi } from '@backstage/core'; import { makeStyles } from '@material-ui/core/styles'; import Button from '@material-ui/core/Button'; import TextField from '@material-ui/core/TextField'; @@ -29,6 +28,7 @@ import { useShiftOverride } from '../../hooks/useShiftOverride'; import { Shift } from '../../types'; import { DateTimePicker, MuiPickersUtilsProvider } from '@material-ui/pickers'; import LuxonUtils from '@date-io/luxon'; +import { alertApiRef, useApi } from '@backstage/core-plugin-api'; const useStyles = makeStyles(() => ({ container: { diff --git a/plugins/ilert/src/components/UptimeMonitor/UptimeMonitorActionsMenu.tsx b/plugins/ilert/src/components/UptimeMonitor/UptimeMonitorActionsMenu.tsx index 36671bff90..9cc2459f67 100644 --- a/plugins/ilert/src/components/UptimeMonitor/UptimeMonitorActionsMenu.tsx +++ b/plugins/ilert/src/components/UptimeMonitor/UptimeMonitorActionsMenu.tsx @@ -14,13 +14,15 @@ * limitations under the License. */ import React from 'react'; -import { alertApiRef, useApi, Link } from '@backstage/core'; import { IconButton, Menu, MenuItem, Typography } from '@material-ui/core'; import MoreVertIcon from '@material-ui/icons/MoreVert'; import { ilertApiRef } from '../../api'; import { UptimeMonitor } from '../../types'; +import { alertApiRef, useApi } from '@backstage/core-plugin-api'; +import { Link } from '@backstage/core-components'; + export const UptimeMonitorActionsMenu = ({ uptimeMonitor, onUptimeMonitorChanged, diff --git a/plugins/ilert/src/components/UptimeMonitor/UptimeMonitorLink.tsx b/plugins/ilert/src/components/UptimeMonitor/UptimeMonitorLink.tsx index 507e0208e2..656b0542d0 100644 --- a/plugins/ilert/src/components/UptimeMonitor/UptimeMonitorLink.tsx +++ b/plugins/ilert/src/components/UptimeMonitor/UptimeMonitorLink.tsx @@ -14,11 +14,13 @@ * limitations under the License. */ import React from 'react'; -import { useApi, Link } from '@backstage/core'; import { makeStyles } from '@material-ui/core/styles'; import { UptimeMonitor } from '../../types'; import { ilertApiRef } from '../../api'; +import { useApi } from '@backstage/core-plugin-api'; +import { Link } from '@backstage/core-components'; + const useStyles = makeStyles({ link: { lineHeight: '22px', diff --git a/plugins/ilert/src/components/UptimeMonitorsPage/UptimeMonitorsPage.tsx b/plugins/ilert/src/components/UptimeMonitorsPage/UptimeMonitorsPage.tsx index 9769fa408d..1d23eb91a5 100644 --- a/plugins/ilert/src/components/UptimeMonitorsPage/UptimeMonitorsPage.tsx +++ b/plugins/ilert/src/components/UptimeMonitorsPage/UptimeMonitorsPage.tsx @@ -14,16 +14,16 @@ * limitations under the License. */ import React from 'react'; +import { AuthenticationError } from '@backstage/errors'; +import { UptimeMonitorsTable } from './UptimeMonitorsTable'; +import { MissingAuthorizationHeaderError } from '../Errors'; +import { useUptimeMonitors } from '../../hooks/useUptimeMonitors'; import { Content, ContentHeader, SupportButton, ResponseErrorPanel, -} from '@backstage/core'; -import { AuthenticationError } from '@backstage/errors'; -import { UptimeMonitorsTable } from './UptimeMonitorsTable'; -import { MissingAuthorizationHeaderError } from '../Errors'; -import { useUptimeMonitors } from '../../hooks/useUptimeMonitors'; +} from '@backstage/core-components'; export const UptimeMonitorsPage = () => { const [ diff --git a/plugins/ilert/src/components/UptimeMonitorsPage/UptimeMonitorsTable.tsx b/plugins/ilert/src/components/UptimeMonitorsPage/UptimeMonitorsTable.tsx index 2173f8e1b7..6329b31a8a 100644 --- a/plugins/ilert/src/components/UptimeMonitorsPage/UptimeMonitorsTable.tsx +++ b/plugins/ilert/src/components/UptimeMonitorsPage/UptimeMonitorsTable.tsx @@ -15,7 +15,6 @@ */ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import { Table, TableColumn } from '@backstage/core'; import { TableState } from '../../api'; import { UptimeMonitor } from '../../types'; import { StatusChip } from './StatusChip'; @@ -26,6 +25,7 @@ import { EscalationPolicyLink } from '../EscalationPolicy/EscalationPolicyLink'; import { UptimeMonitorCheckType } from './UptimeMonitorCheckType'; import { UptimeMonitorActionsMenu } from '../UptimeMonitor/UptimeMonitorActionsMenu'; import { UptimeMonitorLink } from '../UptimeMonitor/UptimeMonitorLink'; +import { Table, TableColumn } from '@backstage/core-components'; const useStyles = makeStyles(theme => ({ empty: { diff --git a/plugins/ilert/src/hooks/useAlertSource.ts b/plugins/ilert/src/hooks/useAlertSource.ts index 15cc213b48..0c99a0a2be 100644 --- a/plugins/ilert/src/hooks/useAlertSource.ts +++ b/plugins/ilert/src/hooks/useAlertSource.ts @@ -15,10 +15,10 @@ */ import React from 'react'; import { ilertApiRef } from '../api'; -import { useApi, errorApiRef } from '@backstage/core'; import { AuthenticationError } from '@backstage/errors'; import { useAsyncRetry } from 'react-use'; import { AlertSource, UptimeMonitor } from '../types'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export const useAlertSource = (integrationKey: string) => { const ilertApi = useApi(ilertApiRef); diff --git a/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts b/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts index 0fbb190a02..cfa9783f46 100644 --- a/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts +++ b/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts @@ -15,10 +15,10 @@ */ import React from 'react'; import { ilertApiRef } from '../api'; -import { useApi, errorApiRef } from '@backstage/core'; import { AuthenticationError } from '@backstage/errors'; import { useAsyncRetry } from 'react-use'; import { AlertSource, OnCall } from '../types'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export const useAlertSourceOnCalls = (alertSource?: AlertSource | null) => { const ilertApi = useApi(ilertApiRef); diff --git a/plugins/ilert/src/hooks/useAssignIncident.ts b/plugins/ilert/src/hooks/useAssignIncident.ts index 8f0f663d2b..9d91518c73 100644 --- a/plugins/ilert/src/hooks/useAssignIncident.ts +++ b/plugins/ilert/src/hooks/useAssignIncident.ts @@ -15,10 +15,10 @@ */ import React from 'react'; import { ilertApiRef } from '../api'; -import { useApi, errorApiRef } from '@backstage/core'; import { AuthenticationError } from '@backstage/errors'; import { useAsyncRetry } from 'react-use'; import { Incident, IncidentResponder } from '../types'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export const useAssignIncident = (incident: Incident | null, open: boolean) => { const ilertApi = useApi(ilertApiRef); diff --git a/plugins/ilert/src/hooks/useIncidentActions.ts b/plugins/ilert/src/hooks/useIncidentActions.ts index e23341ed9e..69e0b14b20 100644 --- a/plugins/ilert/src/hooks/useIncidentActions.ts +++ b/plugins/ilert/src/hooks/useIncidentActions.ts @@ -15,10 +15,10 @@ */ import React from 'react'; import { ilertApiRef } from '../api'; -import { useApi, errorApiRef } from '@backstage/core'; import { AuthenticationError } from '@backstage/errors'; import { useAsyncRetry } from 'react-use'; import { Incident, IncidentAction } from '../types'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export const useIncidentActions = ( incident: Incident | null, diff --git a/plugins/ilert/src/hooks/useIncidents.ts b/plugins/ilert/src/hooks/useIncidents.ts index 5f130fb20c..417930b1ea 100644 --- a/plugins/ilert/src/hooks/useIncidents.ts +++ b/plugins/ilert/src/hooks/useIncidents.ts @@ -15,7 +15,6 @@ */ import React from 'react'; import { GetIncidentsOpts, ilertApiRef, TableState } from '../api'; -import { useApi, errorApiRef } from '@backstage/core'; import { AuthenticationError } from '@backstage/errors'; import { useAsyncRetry } from 'react-use'; import { @@ -25,6 +24,7 @@ import { IncidentStatus, AlertSource, } from '../types'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export const useIncidents = ( paging: boolean, diff --git a/plugins/ilert/src/hooks/useNewIncident.ts b/plugins/ilert/src/hooks/useNewIncident.ts index 6fbcfbb5a5..1747fc7452 100644 --- a/plugins/ilert/src/hooks/useNewIncident.ts +++ b/plugins/ilert/src/hooks/useNewIncident.ts @@ -15,10 +15,10 @@ */ import React from 'react'; import { ilertApiRef } from '../api'; -import { useApi, errorApiRef } from '@backstage/core'; import { AuthenticationError } from '@backstage/errors'; import { useAsyncRetry } from 'react-use'; import { AlertSource } from '../types'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export const useNewIncident = ( open: boolean, diff --git a/plugins/ilert/src/hooks/useOnCallSchedules.ts b/plugins/ilert/src/hooks/useOnCallSchedules.ts index ce76a0770c..b24d51a415 100644 --- a/plugins/ilert/src/hooks/useOnCallSchedules.ts +++ b/plugins/ilert/src/hooks/useOnCallSchedules.ts @@ -15,10 +15,10 @@ */ import React from 'react'; import { ilertApiRef } from '../api'; -import { useApi, errorApiRef } from '@backstage/core'; import { AuthenticationError } from '@backstage/errors'; import { useAsyncRetry } from 'react-use'; import { Schedule } from '../types'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export const useOnCallSchedules = () => { const ilertApi = useApi(ilertApiRef); diff --git a/plugins/ilert/src/hooks/useShiftOverride.ts b/plugins/ilert/src/hooks/useShiftOverride.ts index 136d20d286..1a17bf6471 100644 --- a/plugins/ilert/src/hooks/useShiftOverride.ts +++ b/plugins/ilert/src/hooks/useShiftOverride.ts @@ -15,10 +15,10 @@ */ import React from 'react'; import { ilertApiRef } from '../api'; -import { useApi, errorApiRef } from '@backstage/core'; import { AuthenticationError } from '@backstage/errors'; import { useAsyncRetry } from 'react-use'; import { User, Shift } from '../types'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export const useShiftOverride = (s: Shift, isModalOpened: boolean) => { const ilertApi = useApi(ilertApiRef); diff --git a/plugins/ilert/src/hooks/useUptimeMonitors.ts b/plugins/ilert/src/hooks/useUptimeMonitors.ts index fa1576642a..aa6aab4287 100644 --- a/plugins/ilert/src/hooks/useUptimeMonitors.ts +++ b/plugins/ilert/src/hooks/useUptimeMonitors.ts @@ -15,10 +15,10 @@ */ import React from 'react'; import { ilertApiRef, TableState } from '../api'; -import { useApi, errorApiRef } from '@backstage/core'; import { AuthenticationError } from '@backstage/errors'; import { useAsyncRetry } from 'react-use'; import { UptimeMonitor } from '../types'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; export const useUptimeMonitors = () => { const ilertApi = useApi(ilertApiRef); diff --git a/plugins/ilert/src/index.ts b/plugins/ilert/src/index.ts index 2e5301f151..1dc4a1fb0d 100644 --- a/plugins/ilert/src/index.ts +++ b/plugins/ilert/src/index.ts @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { IconComponent } from '@backstage/core'; import ILertIconComponent from './assets/ilert.icon.svg'; +import { IconComponent } from '@backstage/core-plugin-api'; export { ilertPlugin, diff --git a/plugins/ilert/src/plugin.ts b/plugins/ilert/src/plugin.ts index 546b77911d..2180376e29 100644 --- a/plugins/ilert/src/plugin.ts +++ b/plugins/ilert/src/plugin.ts @@ -13,6 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { ILertClient, ilertApiRef } from './api'; +import { iLertRouteRef } from './route-refs'; import { configApiRef, createApiFactory, @@ -21,9 +23,7 @@ import { identityApiRef, createRoutableExtension, createComponentExtension, -} from '@backstage/core'; -import { ILertClient, ilertApiRef } from './api'; -import { iLertRouteRef } from './route-refs'; +} from '@backstage/core-plugin-api'; export const ilertPlugin = createPlugin({ id: 'ilert', diff --git a/plugins/ilert/src/route-refs.tsx b/plugins/ilert/src/route-refs.tsx index b63ba15315..eb920dbcbf 100644 --- a/plugins/ilert/src/route-refs.tsx +++ b/plugins/ilert/src/route-refs.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ -import { createRouteRef } from '@backstage/core'; import ILertIcon from './assets/ilert.icon.svg'; +import { createRouteRef } from '@backstage/core-plugin-api'; export const iLertRouteRef = createRouteRef({ icon: ILertIcon, diff --git a/plugins/jenkins/src/api/JenkinsApi.ts b/plugins/jenkins/src/api/JenkinsApi.ts index ed70607c27..52e82b224b 100644 --- a/plugins/jenkins/src/api/JenkinsApi.ts +++ b/plugins/jenkins/src/api/JenkinsApi.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { createApiRef, DiscoveryApi } from '@backstage/core'; import { CITableBuildInfo } from '../components/BuildsPage/lib/CITable'; +import { createApiRef, DiscoveryApi } from '@backstage/core-plugin-api'; const jenkins = require('jenkins'); diff --git a/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx b/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx index 192f84458d..6863ee76ef 100644 --- a/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx +++ b/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Breadcrumbs, Content, Link, useRouteRefParams } from '@backstage/core'; import { Box, Link as MaterialLink, @@ -33,6 +32,9 @@ import { JenkinsRunStatus } from '../BuildsPage/lib/Status'; import { useBuildWithSteps } from '../useBuildWithSteps'; import { useProjectSlugFromEntity } from '../useProjectSlugFromEntity'; +import { Breadcrumbs, Content, Link } from '@backstage/core-components'; +import { useRouteRefParams } from '@backstage/core-plugin-api'; + const useStyles = makeStyles(theme => ({ root: { maxWidth: 720, diff --git a/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx b/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx index 12d221d928..c14d6af209 100644 --- a/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx +++ b/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx @@ -18,11 +18,11 @@ import { Box, IconButton, Link, Typography, Tooltip } from '@material-ui/core'; import RetryIcon from '@material-ui/icons/Replay'; import JenkinsLogo from '../../../../assets/JenkinsLogo.svg'; import { generatePath, Link as RouterLink } from 'react-router-dom'; -import { Table, TableColumn } from '@backstage/core'; import { JenkinsRunStatus } from '../Status'; import { useBuilds } from '../../../useBuilds'; import { useProjectSlugFromEntity } from '../../../useProjectSlugFromEntity'; import { buildRouteRef } from '../../../../plugin'; +import { Table, TableColumn } from '@backstage/core-components'; export type CITableBuildInfo = { id: string; diff --git a/plugins/jenkins/src/components/BuildsPage/lib/Status/JenkinsRunStatus.tsx b/plugins/jenkins/src/components/BuildsPage/lib/Status/JenkinsRunStatus.tsx index 1b22015a59..800c089752 100644 --- a/plugins/jenkins/src/components/BuildsPage/lib/Status/JenkinsRunStatus.tsx +++ b/plugins/jenkins/src/components/BuildsPage/lib/Status/JenkinsRunStatus.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import React from 'react'; import { StatusPending, StatusRunning, @@ -21,8 +22,7 @@ import { StatusWarning, StatusAborted, StatusError, -} from '@backstage/core'; -import React from 'react'; +} from '@backstage/core-components'; export const JenkinsRunStatus = ({ status, diff --git a/plugins/jenkins/src/components/Cards/Cards.test.tsx b/plugins/jenkins/src/components/Cards/Cards.test.tsx index 67996f4dde..5ec2cb493e 100644 --- a/plugins/jenkins/src/components/Cards/Cards.test.tsx +++ b/plugins/jenkins/src/components/Cards/Cards.test.tsx @@ -18,8 +18,8 @@ import React from 'react'; import { renderInTestApp } from '@backstage/test-utils'; import { LatestRunCard } from './Cards'; import { EntityProvider } from '@backstage/plugin-catalog-react'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { JenkinsApi, jenkinsApiRef } from '../../api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('', () => { const entity = { diff --git a/plugins/jenkins/src/components/Cards/Cards.tsx b/plugins/jenkins/src/components/Cards/Cards.tsx index 010afa8990..aea2510532 100644 --- a/plugins/jenkins/src/components/Cards/Cards.tsx +++ b/plugins/jenkins/src/components/Cards/Cards.tsx @@ -13,12 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { - InfoCard, - InfoCardVariants, - StructuredMetadataTable, - WarningPanel, -} from '@backstage/core'; import { LinearProgress, Link, makeStyles, Theme } from '@material-ui/core'; import ExternalLinkIcon from '@material-ui/icons/Launch'; import { DateTime, Duration } from 'luxon'; @@ -26,6 +20,12 @@ import React from 'react'; import { JenkinsRunStatus } from '../BuildsPage/lib/Status'; import { ErrorType, useBuilds } from '../useBuilds'; import { useProjectSlugFromEntity } from '../useProjectSlugFromEntity'; +import { + InfoCard, + InfoCardVariants, + StructuredMetadataTable, + WarningPanel, +} from '@backstage/core-components'; const useStyles = makeStyles({ externalLinkIcon: { diff --git a/plugins/jenkins/src/components/Router.tsx b/plugins/jenkins/src/components/Router.tsx index 85f06bb0e1..1f717af7d1 100644 --- a/plugins/jenkins/src/components/Router.tsx +++ b/plugins/jenkins/src/components/Router.tsx @@ -20,8 +20,8 @@ import { buildRouteRef, rootRouteRef } from '../plugin'; import { DetailedViewPage } from './BuildWithStepsPage/'; import { JENKINS_ANNOTATION } from '../constants'; import { Entity } from '@backstage/catalog-model'; -import { MissingAnnotationEmptyState } from '@backstage/core'; import { CITable } from './BuildsPage/lib/CITable'; +import { MissingAnnotationEmptyState } from '@backstage/core-components'; export const isJenkinsAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[JENKINS_ANNOTATION]); diff --git a/plugins/jenkins/src/components/useBuildWithSteps.ts b/plugins/jenkins/src/components/useBuildWithSteps.ts index 86d8162612..b5bb41f00e 100644 --- a/plugins/jenkins/src/components/useBuildWithSteps.ts +++ b/plugins/jenkins/src/components/useBuildWithSteps.ts @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { errorApiRef, useApi } from '@backstage/core'; import { useCallback } from 'react'; import { useAsyncRetry } from 'react-use'; import { jenkinsApiRef } from '../api'; import { useAsyncPolling } from './useAsyncPolling'; +import { errorApiRef, useApi } from '@backstage/core-plugin-api'; const INTERVAL_AMOUNT = 1500; export function useBuildWithSteps(buildName: string) { diff --git a/plugins/jenkins/src/components/useBuilds.ts b/plugins/jenkins/src/components/useBuilds.ts index be573ef605..9d55a32311 100644 --- a/plugins/jenkins/src/components/useBuilds.ts +++ b/plugins/jenkins/src/components/useBuilds.ts @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { errorApiRef, useApi } from '@backstage/core'; import { useState } from 'react'; import { useAsyncRetry } from 'react-use'; import { jenkinsApiRef } from '../api'; +import { errorApiRef, useApi } from '@backstage/core-plugin-api'; export enum ErrorType { CONNECTION_ERROR, diff --git a/plugins/jenkins/src/plugin.ts b/plugins/jenkins/src/plugin.ts index db4122349c..063ee24801 100644 --- a/plugins/jenkins/src/plugin.ts +++ b/plugins/jenkins/src/plugin.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { JenkinsApi, jenkinsApiRef } from './api'; import { createApiFactory, createComponentExtension, @@ -21,8 +22,7 @@ import { createRoutableExtension, createRouteRef, discoveryApiRef, -} from '@backstage/core'; -import { JenkinsApi, jenkinsApiRef } from './api'; +} from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ path: '', diff --git a/plugins/kafka/src/Router.tsx b/plugins/kafka/src/Router.tsx index 13503fefe8..01a41d1961 100644 --- a/plugins/kafka/src/Router.tsx +++ b/plugins/kafka/src/Router.tsx @@ -21,7 +21,7 @@ import { useEntity } from '@backstage/plugin-catalog-react'; import { rootCatalogKafkaRouteRef } from './plugin'; import { KAFKA_CONSUMER_GROUP_ANNOTATION } from './constants'; import { KafkaTopicsForConsumer } from './components/ConsumerGroupOffsets/ConsumerGroupOffsets'; -import { MissingAnnotationEmptyState } from '@backstage/core'; +import { MissingAnnotationEmptyState } from '@backstage/core-components'; export const isPluginApplicableToEntity = (entity: Entity) => Boolean(entity.metadata.annotations?.[KAFKA_CONSUMER_GROUP_ANNOTATION]); diff --git a/plugins/kafka/src/api/KafkaBackendClient.ts b/plugins/kafka/src/api/KafkaBackendClient.ts index 8166da4601..d3ee308c38 100644 --- a/plugins/kafka/src/api/KafkaBackendClient.ts +++ b/plugins/kafka/src/api/KafkaBackendClient.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { DiscoveryApi } from '@backstage/core'; import { KafkaApi, ConsumerGroupOffsetsResponse } from './types'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; export class KafkaBackendClient implements KafkaApi { private readonly discoveryApi: DiscoveryApi; diff --git a/plugins/kafka/src/api/types.ts b/plugins/kafka/src/api/types.ts index c4307d5c1f..fc501aad88 100644 --- a/plugins/kafka/src/api/types.ts +++ b/plugins/kafka/src/api/types.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; +import { createApiRef } from '@backstage/core-plugin-api'; export const kafkaApiRef = createApiRef({ id: 'plugin.kafka.service', diff --git a/plugins/kafka/src/components/ConsumerGroupOffsets/ConsumerGroupOffsets.tsx b/plugins/kafka/src/components/ConsumerGroupOffsets/ConsumerGroupOffsets.tsx index 90a99be015..205b587648 100644 --- a/plugins/kafka/src/components/ConsumerGroupOffsets/ConsumerGroupOffsets.tsx +++ b/plugins/kafka/src/components/ConsumerGroupOffsets/ConsumerGroupOffsets.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ -import { Table, TableColumn } from '@backstage/core'; import { Box, Grid, Typography } from '@material-ui/core'; import RetryIcon from '@material-ui/icons/Replay'; import React from 'react'; import { useConsumerGroupsOffsetsForEntity } from './useConsumerGroupsOffsetsForEntity'; +import { Table, TableColumn } from '@backstage/core-components'; export type TopicPartitionInfo = { topic: string; diff --git a/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.test.tsx b/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.test.tsx index 9609654a90..b65b714b57 100644 --- a/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.test.tsx +++ b/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.test.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import { Entity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core'; import { EntityContext } from '@backstage/plugin-catalog-react'; import { renderHook } from '@testing-library/react-hooks'; import { when } from 'jest-when'; @@ -27,6 +26,9 @@ import { import { useConsumerGroupsOffsetsForEntity } from './useConsumerGroupsOffsetsForEntity'; import * as data from './__fixtures__/consumer-group-offsets.json'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { errorApiRef } from '@backstage/core-plugin-api'; + const consumerGroupOffsets = data as ConsumerGroupOffsetsResponse; const mockErrorApi: jest.Mocked = { diff --git a/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts b/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts index 8cb30040e9..4b37c0e1ee 100644 --- a/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts +++ b/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import { errorApiRef, useApi } from '@backstage/core'; import { useAsyncRetry } from 'react-use'; import { kafkaApiRef } from '../../api/types'; import { useConsumerGroupsForEntity } from './useConsumerGroupsForEntity'; +import { errorApiRef, useApi } from '@backstage/core-plugin-api'; export const useConsumerGroupsOffsetsForEntity = () => { const consumers = useConsumerGroupsForEntity(); diff --git a/plugins/kafka/src/plugin.ts b/plugins/kafka/src/plugin.ts index 832099a30c..d17e605f08 100644 --- a/plugins/kafka/src/plugin.ts +++ b/plugins/kafka/src/plugin.ts @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { KafkaBackendClient } from './api/KafkaBackendClient'; +import { kafkaApiRef } from './api/types'; import { createApiFactory, createPlugin, createRoutableExtension, createRouteRef, discoveryApiRef, -} from '@backstage/core'; -import { KafkaBackendClient } from './api/KafkaBackendClient'; -import { kafkaApiRef } from './api/types'; +} from '@backstage/core-plugin-api'; export const rootCatalogKafkaRouteRef = createRouteRef({ path: '*', diff --git a/plugins/kubernetes/src/Router.tsx b/plugins/kubernetes/src/Router.tsx index 838bfef60a..0257d49ba8 100644 --- a/plugins/kubernetes/src/Router.tsx +++ b/plugins/kubernetes/src/Router.tsx @@ -20,8 +20,8 @@ import { useEntity } from '@backstage/plugin-catalog-react'; import { Route, Routes } from 'react-router-dom'; import { rootCatalogKubernetesRouteRef } from './plugin'; import { KubernetesContent } from './components/KubernetesContent'; -import { MissingAnnotationEmptyState } from '@backstage/core'; import { Button } from '@material-ui/core'; +import { MissingAnnotationEmptyState } from '@backstage/core-components'; const KUBERNETES_ANNOTATION = 'backstage.io/kubernetes-id'; const KUBERNETES_LABEL_SELECTOR_QUERY_ANNOTATION = diff --git a/plugins/kubernetes/src/api/KubernetesBackendClient.ts b/plugins/kubernetes/src/api/KubernetesBackendClient.ts index 19f1602143..704507d3b9 100644 --- a/plugins/kubernetes/src/api/KubernetesBackendClient.ts +++ b/plugins/kubernetes/src/api/KubernetesBackendClient.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import { DiscoveryApi, IdentityApi } from '@backstage/core'; import { KubernetesApi } from './types'; import { KubernetesRequestBody, ObjectsByEntityResponse, } from '@backstage/plugin-kubernetes-common'; +import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api'; export class KubernetesBackendClient implements KubernetesApi { private readonly discoveryApi: DiscoveryApi; diff --git a/plugins/kubernetes/src/api/types.ts b/plugins/kubernetes/src/api/types.ts index 2e91783132..a3ccc3d29f 100644 --- a/plugins/kubernetes/src/api/types.ts +++ b/plugins/kubernetes/src/api/types.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; import { KubernetesRequestBody, ObjectsByEntityResponse, } from '@backstage/plugin-kubernetes-common'; +import { createApiRef } from '@backstage/core-plugin-api'; export const kubernetesApiRef = createApiRef({ id: 'plugin.kubernetes.service', diff --git a/plugins/kubernetes/src/components/CustomResources/ArgoRollouts/Rollout.tsx b/plugins/kubernetes/src/components/CustomResources/ArgoRollouts/Rollout.tsx index 32848b4fb5..4a714afbbc 100644 --- a/plugins/kubernetes/src/components/CustomResources/ArgoRollouts/Rollout.tsx +++ b/plugins/kubernetes/src/components/CustomResources/ArgoRollouts/Rollout.tsx @@ -25,7 +25,6 @@ import { } from '@material-ui/core'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { V1Pod, V1HorizontalPodAutoscaler } from '@kubernetes/client-node'; -import { StatusError, StatusOK } from '@backstage/core'; import { PodsTable } from '../../Pods'; import { HorizontalPodAutoscalerDrawer } from '../../HorizontalPodAutoscalers'; import { RolloutDrawer } from './RolloutDrawer'; @@ -41,6 +40,7 @@ import { getMatchingHpa, getOwnedPodsThroughReplicaSets, } from '../../../utils/owner'; +import { StatusError, StatusOK } from '@backstage/core-components'; type RolloutAccordionsProps = { rollouts: any[]; diff --git a/plugins/kubernetes/src/components/CustomResources/DefaultCustomResource.tsx b/plugins/kubernetes/src/components/CustomResources/DefaultCustomResource.tsx index 136a7cd2a8..aff5ac593b 100644 --- a/plugins/kubernetes/src/components/CustomResources/DefaultCustomResource.tsx +++ b/plugins/kubernetes/src/components/CustomResources/DefaultCustomResource.tsx @@ -24,7 +24,7 @@ import { } from '@material-ui/core'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { DefaultCustomResourceDrawer } from './DefaultCustomResourceDrawer'; -import { StructuredMetadataTable } from '@backstage/core'; +import { StructuredMetadataTable } from '@backstage/core-components'; type DefaultCustomResourceAccordionsProps = { customResources: any[]; diff --git a/plugins/kubernetes/src/components/DeploymentsAccordions/DeploymentsAccordions.tsx b/plugins/kubernetes/src/components/DeploymentsAccordions/DeploymentsAccordions.tsx index 00d62b71d5..e0c4649240 100644 --- a/plugins/kubernetes/src/components/DeploymentsAccordions/DeploymentsAccordions.tsx +++ b/plugins/kubernetes/src/components/DeploymentsAccordions/DeploymentsAccordions.tsx @@ -29,7 +29,6 @@ import { V1Pod, V1HorizontalPodAutoscaler, } from '@kubernetes/client-node'; -import { StatusError, StatusOK } from '@backstage/core'; import { PodsTable } from '../Pods'; import { DeploymentDrawer } from './DeploymentDrawer'; import { HorizontalPodAutoscalerDrawer } from '../HorizontalPodAutoscalers'; @@ -41,6 +40,7 @@ import { GroupedResponsesContext, PodNamesWithErrorsContext, } from '../../hooks'; +import { StatusError, StatusOK } from '@backstage/core-components'; type DeploymentsAccordionsProps = { children?: React.ReactNode; diff --git a/plugins/kubernetes/src/components/ErrorReporting/ErrorReporting.tsx b/plugins/kubernetes/src/components/ErrorReporting/ErrorReporting.tsx index e33ded1fac..e669f8070b 100644 --- a/plugins/kubernetes/src/components/ErrorReporting/ErrorReporting.tsx +++ b/plugins/kubernetes/src/components/ErrorReporting/ErrorReporting.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ import * as React from 'react'; -import { Table, TableColumn, InfoCard } from '@backstage/core'; import { DetectedError, DetectedErrorsByCluster } from '../../error-detection'; import { Chip, Typography, Grid } from '@material-ui/core'; import EmptyStateImage from '../../assets/emptystate.svg'; +import { Table, TableColumn, InfoCard } from '@backstage/core-components'; type ErrorReportingProps = { detectedErrors: DetectedErrorsByCluster; diff --git a/plugins/kubernetes/src/components/IngressesAccordions/IngressesAccordions.tsx b/plugins/kubernetes/src/components/IngressesAccordions/IngressesAccordions.tsx index 9291c4533f..94d2dfdc01 100644 --- a/plugins/kubernetes/src/components/IngressesAccordions/IngressesAccordions.tsx +++ b/plugins/kubernetes/src/components/IngressesAccordions/IngressesAccordions.tsx @@ -24,9 +24,9 @@ import { } from '@material-ui/core'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { ExtensionsV1beta1Ingress } from '@kubernetes/client-node'; -import { StructuredMetadataTable } from '@backstage/core'; import { IngressDrawer } from './IngressDrawer'; import { GroupedResponsesContext } from '../../hooks'; +import { StructuredMetadataTable } from '@backstage/core-components'; type IngressesAccordionsProps = {}; diff --git a/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx b/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx index ba0026ac47..4a135acd21 100644 --- a/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx +++ b/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx @@ -15,9 +15,9 @@ */ import React from 'react'; -import { WarningPanel } from '@backstage/core'; import { Typography } from '@material-ui/core'; import { ClusterObjects } from '@backstage/plugin-kubernetes-common'; +import { WarningPanel } from '@backstage/core-components'; const clustersWithErrorsToErrorMessage = ( clustersWithErrors: ClusterObjects[], diff --git a/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx b/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx index 1461f52112..0cdd09c55e 100644 --- a/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx +++ b/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx @@ -23,13 +23,6 @@ import { Grid, Typography, } from '@material-ui/core'; -import { - Content, - Page, - Progress, - StatusError, - StatusOK, -} from '@backstage/core'; import { Entity } from '@backstage/catalog-model'; import { ClusterObjects } from '@backstage/plugin-kubernetes-common'; import { ErrorPanel } from './ErrorPanel'; @@ -42,13 +35,20 @@ import { IngressesAccordions } from '../IngressesAccordions'; import { ServicesAccordions } from '../ServicesAccordions'; import { CustomResources } from '../CustomResources'; import EmptyStateImage from '../../assets/emptystate.svg'; - import { GroupedResponsesContext, PodNamesWithErrorsContext, useKubernetesObjects, } from '../../hooks'; +import { + Content, + Page, + Progress, + StatusError, + StatusOK, +} from '@backstage/core-components'; + type ClusterSummaryProps = { clusterName: string; totalNumberOfPods: number; diff --git a/plugins/kubernetes/src/components/KubernetesDrawer/KubernetesDrawer.tsx b/plugins/kubernetes/src/components/KubernetesDrawer/KubernetesDrawer.tsx index 68321cd589..15409f212e 100644 --- a/plugins/kubernetes/src/components/KubernetesDrawer/KubernetesDrawer.tsx +++ b/plugins/kubernetes/src/components/KubernetesDrawer/KubernetesDrawer.tsx @@ -30,8 +30,11 @@ import { import Close from '@material-ui/icons/Close'; import { V1ObjectMeta } from '@kubernetes/client-node'; import { withStyles } from '@material-ui/core/styles'; -import { CodeSnippet, StructuredMetadataTable } from '@backstage/core'; import jsYaml from 'js-yaml'; +import { + CodeSnippet, + StructuredMetadataTable, +} from '@backstage/core-components'; const useDrawerStyles = makeStyles((theme: Theme) => createStyles({ diff --git a/plugins/kubernetes/src/components/Pods/PodsTable.tsx b/plugins/kubernetes/src/components/Pods/PodsTable.tsx index 0a219bef89..073ab9c339 100644 --- a/plugins/kubernetes/src/components/Pods/PodsTable.tsx +++ b/plugins/kubernetes/src/components/Pods/PodsTable.tsx @@ -15,7 +15,6 @@ */ import React from 'react'; -import { Table, TableColumn } from '@backstage/core'; import { V1Pod } from '@kubernetes/client-node'; import { PodDrawer } from './PodDrawer'; import { @@ -23,6 +22,7 @@ import { containerStatuses, totalRestarts, } from '../../utils/pod'; +import { Table, TableColumn } from '@backstage/core-components'; const columns: TableColumn[] = [ { diff --git a/plugins/kubernetes/src/components/ServicesAccordions/ServicesAccordions.tsx b/plugins/kubernetes/src/components/ServicesAccordions/ServicesAccordions.tsx index 6bfec6f44d..0856bcb943 100644 --- a/plugins/kubernetes/src/components/ServicesAccordions/ServicesAccordions.tsx +++ b/plugins/kubernetes/src/components/ServicesAccordions/ServicesAccordions.tsx @@ -25,9 +25,9 @@ import { } from '@material-ui/core'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { V1Service } from '@kubernetes/client-node'; -import { StructuredMetadataTable } from '@backstage/core'; import { ServiceDrawer } from './ServiceDrawer'; import { GroupedResponsesContext } from '../../hooks'; +import { StructuredMetadataTable } from '@backstage/core-components'; type ServiceSummaryProps = { service: V1Service; diff --git a/plugins/kubernetes/src/hooks/useKubernetesObjects.test.ts b/plugins/kubernetes/src/hooks/useKubernetesObjects.test.ts index 0e9de6e4c0..67e674fc60 100644 --- a/plugins/kubernetes/src/hooks/useKubernetesObjects.test.ts +++ b/plugins/kubernetes/src/hooks/useKubernetesObjects.test.ts @@ -16,8 +16,8 @@ import { useKubernetesObjects } from './useKubernetesObjects'; import { Entity } from '@backstage/catalog-model'; -import { useApi } from '@backstage/core'; import { renderHook } from '@testing-library/react-hooks'; +import { useApi } from '@backstage/core-plugin-api'; jest.mock('@backstage/core'); diff --git a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts index 1dfe85fe38..8af039ca80 100644 --- a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts +++ b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { useApi } from '@backstage/core'; import { kubernetesApiRef } from '../api/types'; import { kubernetesAuthProvidersApiRef } from '../kubernetes-auth-provider/types'; import { useEffect, useState } from 'react'; @@ -23,6 +22,7 @@ import { KubernetesRequestBody, ObjectsByEntityResponse, } from '@backstage/plugin-kubernetes-common'; +import { useApi } from '@backstage/core-plugin-api'; export interface KubernetesObjects { kubernetesObjects: ObjectsByEntityResponse | undefined; diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts b/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts index 9c9db0b9fc..416fc86df2 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import { OAuthApi } from '@backstage/core'; import { KubernetesAuthProvider } from './types'; import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; +import { OAuthApi } from '@backstage/core-plugin-api'; export class GoogleKubernetesAuthProvider implements KubernetesAuthProvider { authProvider: OAuthApi; diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts b/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts index a96565f0c0..ed8fbb7baa 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import { OAuthApi } from '@backstage/core'; import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; import { KubernetesAuthProvider, KubernetesAuthProvidersApi } from './types'; import { GoogleKubernetesAuthProvider } from './GoogleKubernetesAuthProvider'; import { ServiceAccountKubernetesAuthProvider } from './ServiceAccountKubernetesAuthProvider'; import { AwsKubernetesAuthProvider } from './AwsKubernetesAuthProvider'; +import { OAuthApi } from '@backstage/core-plugin-api'; export class KubernetesAuthProviders implements KubernetesAuthProvidersApi { private readonly kubernetesAuthProviderMap: Map< diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/types.ts b/plugins/kubernetes/src/kubernetes-auth-provider/types.ts index 8d4cead11a..66f8beaf07 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/types.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/types.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; +import { createApiRef } from '@backstage/core-plugin-api'; export interface KubernetesAuthProvider { decorateRequestBodyForAuth( diff --git a/plugins/kubernetes/src/plugin.ts b/plugins/kubernetes/src/plugin.ts index 278bd95e85..42d2e3cbf3 100644 --- a/plugins/kubernetes/src/plugin.ts +++ b/plugins/kubernetes/src/plugin.ts @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { KubernetesBackendClient } from './api/KubernetesBackendClient'; +import { kubernetesApiRef } from './api/types'; +import { kubernetesAuthProvidersApiRef } from './kubernetes-auth-provider/types'; +import { KubernetesAuthProviders } from './kubernetes-auth-provider/KubernetesAuthProviders'; import { createApiFactory, createPlugin, @@ -21,11 +25,7 @@ import { identityApiRef, googleAuthApiRef, createRoutableExtension, -} from '@backstage/core'; -import { KubernetesBackendClient } from './api/KubernetesBackendClient'; -import { kubernetesApiRef } from './api/types'; -import { kubernetesAuthProvidersApiRef } from './kubernetes-auth-provider/types'; -import { KubernetesAuthProviders } from './kubernetes-auth-provider/KubernetesAuthProviders'; +} from '@backstage/core-plugin-api'; export const rootCatalogKubernetesRouteRef = createRouteRef({ path: '*', diff --git a/plugins/kubernetes/src/utils/pod.tsx b/plugins/kubernetes/src/utils/pod.tsx index 59e18e6ecb..7b8e6b2344 100644 --- a/plugins/kubernetes/src/utils/pod.tsx +++ b/plugins/kubernetes/src/utils/pod.tsx @@ -16,14 +16,14 @@ import { V1Pod, V1PodCondition } from '@kubernetes/client-node'; import React, { Fragment, ReactNode } from 'react'; +import { Chip } from '@material-ui/core'; +import { V1DeploymentCondition } from '@kubernetes/client-node/dist/gen/model/v1DeploymentCondition'; import { StatusAborted, StatusError, StatusOK, SubvalueCell, -} from '@backstage/core'; -import { Chip } from '@material-ui/core'; -import { V1DeploymentCondition } from '@kubernetes/client-node/dist/gen/model/v1DeploymentCondition'; +} from '@backstage/core-components'; export const imageChips = (pod: V1Pod): ReactNode => { const containerStatuses = pod.status?.containerStatuses ?? []; diff --git a/plugins/lighthouse/src/Router.tsx b/plugins/lighthouse/src/Router.tsx index 643d30cdc2..dc12931763 100644 --- a/plugins/lighthouse/src/Router.tsx +++ b/plugins/lighthouse/src/Router.tsx @@ -23,7 +23,7 @@ import CreateAudit, { CreateAuditContent } from './components/CreateAudit'; import { Entity } from '@backstage/catalog-model'; import { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../constants'; import { AuditListForEntity } from './components/AuditList/AuditListForEntity'; -import { MissingAnnotationEmptyState } from '@backstage/core'; +import { MissingAnnotationEmptyState } from '@backstage/core-components'; export const isLighthouseAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[LIGHTHOUSE_WEBSITE_URL_ANNOTATION]); diff --git a/plugins/lighthouse/src/api.ts b/plugins/lighthouse/src/api.ts index 2ff7797935..7f229f364a 100644 --- a/plugins/lighthouse/src/api.ts +++ b/plugins/lighthouse/src/api.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; import { Config } from '@backstage/config'; +import { createApiRef } from '@backstage/core-plugin-api'; export type LighthouseCategoryId = | 'pwa' diff --git a/plugins/lighthouse/src/components/AuditList/AuditListForEntity.test.tsx b/plugins/lighthouse/src/components/AuditList/AuditListForEntity.test.tsx index 483d630db8..cb9a86144d 100644 --- a/plugins/lighthouse/src/components/AuditList/AuditListForEntity.test.tsx +++ b/plugins/lighthouse/src/components/AuditList/AuditListForEntity.test.tsx @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core'; import { EntityContext } from '@backstage/plugin-catalog-react'; import { lightTheme } from '@backstage/theme'; import { ThemeProvider } from '@material-ui/core'; @@ -31,6 +30,9 @@ import { useWebsiteForEntity } from '../../hooks/useWebsiteForEntity'; import * as data from '../../__fixtures__/website-list-response.json'; import { AuditListForEntity } from './AuditListForEntity'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { errorApiRef } from '@backstage/core-plugin-api'; + jest.mock('../../hooks/useWebsiteForEntity', () => ({ useWebsiteForEntity: jest.fn(), })); diff --git a/plugins/lighthouse/src/components/AuditList/AuditListForEntity.tsx b/plugins/lighthouse/src/components/AuditList/AuditListForEntity.tsx index 616fd0fa8a..6d560db0b2 100644 --- a/plugins/lighthouse/src/components/AuditList/AuditListForEntity.tsx +++ b/plugins/lighthouse/src/components/AuditList/AuditListForEntity.tsx @@ -15,8 +15,8 @@ */ import React from 'react'; import { AuditListTable } from './AuditListTable'; -import { Progress } from '@backstage/core'; import { useWebsiteForEntity } from '../../hooks/useWebsiteForEntity'; +import { Progress } from '@backstage/core-components'; export const AuditListForEntity = () => { const { value, loading, error } = useWebsiteForEntity(); diff --git a/plugins/lighthouse/src/components/AuditList/AuditListTable.test.tsx b/plugins/lighthouse/src/components/AuditList/AuditListTable.test.tsx index 5c67fec10a..69c62d14f4 100644 --- a/plugins/lighthouse/src/components/AuditList/AuditListTable.test.tsx +++ b/plugins/lighthouse/src/components/AuditList/AuditListTable.test.tsx @@ -17,9 +17,8 @@ import React from 'react'; import { render } from '@testing-library/react'; import { wrapInTestApp, msw } from '@backstage/test-utils'; -import { ApiRegistry, ApiProvider } from '@backstage/core'; - import AuditListTable from './AuditListTable'; + import { WebsiteListResponse, lighthouseApiRef, @@ -27,9 +26,10 @@ import { } from '../../api'; import { formatTime } from '../../utils'; import { setupServer } from 'msw/node'; - import * as data from '../../__fixtures__/website-list-response.json'; +import { ApiRegistry, ApiProvider } from '@backstage/core-app-api'; + const websiteListResponse = data as WebsiteListResponse; describe('AuditListTable', () => { diff --git a/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx b/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx index a85a5bfa0b..4e59d90185 100644 --- a/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx +++ b/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import React, { useState, useEffect } from 'react'; -import { Table, TableColumn, TrendLine, useApi } from '@backstage/core'; import { Website, lighthouseApiRef } from '../../api'; import { useInterval } from 'react-use'; import { @@ -26,6 +25,9 @@ import { import { Link, generatePath } from 'react-router-dom'; import AuditStatusIcon from '../AuditStatusIcon'; +import { Table, TableColumn, TrendLine } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + const columns: TableColumn[] = [ { title: 'Website URL', diff --git a/plugins/lighthouse/src/components/AuditList/index.test.tsx b/plugins/lighthouse/src/components/AuditList/index.test.tsx index cd096053e1..b92fa78139 100644 --- a/plugins/lighthouse/src/components/AuditList/index.test.tsx +++ b/plugins/lighthouse/src/components/AuditList/index.test.tsx @@ -23,7 +23,6 @@ jest.mock('react-router-dom', () => { }; }); -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { msw, wrapInTestApp } from '@backstage/test-utils'; import { fireEvent, render } from '@testing-library/react'; import { rest } from 'msw'; @@ -36,6 +35,7 @@ import { } from '../../api'; import * as data from '../../__fixtures__/website-list-response.json'; import AuditList from './index'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; const { useNavigate } = jest.requireMock('react-router-dom'); const websiteListResponse = data as WebsiteListResponse; diff --git a/plugins/lighthouse/src/components/AuditList/index.tsx b/plugins/lighthouse/src/components/AuditList/index.tsx index 321f5554d8..712b4cb4e1 100644 --- a/plugins/lighthouse/src/components/AuditList/index.tsx +++ b/plugins/lighthouse/src/components/AuditList/index.tsx @@ -14,17 +14,6 @@ * limitations under the License. */ -import { - Content, - ContentHeader, - Header, - HeaderLabel, - InfoCard, - Page, - Progress, - useApi, - WarningPanel, -} from '@backstage/core'; import { Button, Grid } from '@material-ui/core'; import Pagination from '@material-ui/lab/Pagination'; import React, { ReactNode, useMemo, useState } from 'react'; @@ -36,6 +25,19 @@ import LighthouseIntro, { LIGHTHOUSE_INTRO_LOCAL_STORAGE } from '../Intro'; import LighthouseSupportButton from '../SupportButton'; import AuditListTable from './AuditListTable'; +import { + Content, + ContentHeader, + Header, + HeaderLabel, + InfoCard, + Page, + Progress, + WarningPanel, +} from '@backstage/core-components'; + +import { useApi } from '@backstage/core-plugin-api'; + // TODO(freben): move all of this out of index export const LIMIT = 10; diff --git a/plugins/lighthouse/src/components/AuditStatusIcon/index.tsx b/plugins/lighthouse/src/components/AuditStatusIcon/index.tsx index f4a6daba8c..79b107ccbe 100644 --- a/plugins/lighthouse/src/components/AuditStatusIcon/index.tsx +++ b/plugins/lighthouse/src/components/AuditStatusIcon/index.tsx @@ -14,9 +14,13 @@ * limitations under the License. */ -import { StatusError, StatusOK, StatusPending } from '@backstage/core'; import React from 'react'; import { Audit } from '../../api'; +import { + StatusError, + StatusOK, + StatusPending, +} from '@backstage/core-components'; // TODO(freben): move all of this out of index diff --git a/plugins/lighthouse/src/components/AuditView/index.test.tsx b/plugins/lighthouse/src/components/AuditView/index.test.tsx index 42bfecf27f..dff457201d 100644 --- a/plugins/lighthouse/src/components/AuditView/index.test.tsx +++ b/plugins/lighthouse/src/components/AuditView/index.test.tsx @@ -26,7 +26,6 @@ jest.mock('react-router-dom', () => { }; }); -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { msw, wrapInTestApp } from '@backstage/test-utils'; import { render } from '@testing-library/react'; import { rest } from 'msw'; @@ -36,6 +35,7 @@ import { Audit, lighthouseApiRef, LighthouseRestApi, Website } from '../../api'; import { formatTime } from '../../utils'; import * as data from '../../__fixtures__/website-response.json'; import AuditView from './index'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; const { useParams }: { useParams: jest.Mock } = jest.requireMock( 'react-router-dom', diff --git a/plugins/lighthouse/src/components/AuditView/index.tsx b/plugins/lighthouse/src/components/AuditView/index.tsx index 7ccc3de1da..19c9007254 100644 --- a/plugins/lighthouse/src/components/AuditView/index.tsx +++ b/plugins/lighthouse/src/components/AuditView/index.tsx @@ -14,16 +14,6 @@ * limitations under the License. */ -import { - Content, - ContentHeader, - Header, - HeaderLabel, - InfoCard, - Page, - Progress, - useApi, -} from '@backstage/core'; import { Button, Grid, @@ -48,6 +38,17 @@ import { formatTime } from '../../utils'; import AuditStatusIcon from '../AuditStatusIcon'; import LighthouseSupportButton from '../SupportButton'; +import { + Content, + ContentHeader, + Header, + HeaderLabel, + InfoCard, + Page, + Progress, +} from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + // TODO(freben): move all of this out of index const useStyles = makeStyles({ diff --git a/plugins/lighthouse/src/components/Cards/LastLighthouseAuditCard.tsx b/plugins/lighthouse/src/components/Cards/LastLighthouseAuditCard.tsx index 8940bb3773..ca89aeacaa 100644 --- a/plugins/lighthouse/src/components/Cards/LastLighthouseAuditCard.tsx +++ b/plugins/lighthouse/src/components/Cards/LastLighthouseAuditCard.tsx @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import React from 'react'; +import { Audit, AuditCompleted, LighthouseCategoryId } from '../../api'; +import { useWebsiteForEntity } from '../../hooks/useWebsiteForEntity'; +import AuditStatusIcon from '../AuditStatusIcon'; import { InfoCard, InfoCardVariants, @@ -21,11 +25,7 @@ import { StatusOK, StatusWarning, StructuredMetadataTable, -} from '@backstage/core'; -import React from 'react'; -import { Audit, AuditCompleted, LighthouseCategoryId } from '../../api'; -import { useWebsiteForEntity } from '../../hooks/useWebsiteForEntity'; -import AuditStatusIcon from '../AuditStatusIcon'; +} from '@backstage/core-components'; const LighthouseCategoryScoreStatus = ({ score }: { score: number }) => { const scoreAsPercentage = Math.round(score * 100); diff --git a/plugins/lighthouse/src/components/CreateAudit/index.test.tsx b/plugins/lighthouse/src/components/CreateAudit/index.test.tsx index e9ff118fe7..eea2c8dfc3 100644 --- a/plugins/lighthouse/src/components/CreateAudit/index.test.tsx +++ b/plugins/lighthouse/src/components/CreateAudit/index.test.tsx @@ -23,12 +23,6 @@ jest.mock('react-router-dom', () => { }; }); -import { - ApiProvider, - ApiRegistry, - ErrorApi, - errorApiRef, -} from '@backstage/core'; import { msw, wrapInTestApp } from '@backstage/test-utils'; import { fireEvent, render, waitFor } from '@testing-library/react'; import { rest } from 'msw'; @@ -38,6 +32,9 @@ import { Audit, lighthouseApiRef, LighthouseRestApi } from '../../api'; import * as data from '../../__fixtures__/create-audit-response.json'; import CreateAudit from './index'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { ErrorApi, errorApiRef } from '@backstage/core-plugin-api'; + const { useNavigate }: { useNavigate: jest.Mock } = jest.requireMock( 'react-router-dom', ); diff --git a/plugins/lighthouse/src/components/CreateAudit/index.tsx b/plugins/lighthouse/src/components/CreateAudit/index.tsx index 97e22d9909..eba3cfcb26 100644 --- a/plugins/lighthouse/src/components/CreateAudit/index.tsx +++ b/plugins/lighthouse/src/components/CreateAudit/index.tsx @@ -14,16 +14,6 @@ * limitations under the License. */ -import { - Content, - ContentHeader, - errorApiRef, - Header, - HeaderLabel, - InfoCard, - Page, - useApi, -} from '@backstage/core'; import { Button, Grid, @@ -39,6 +29,16 @@ import { lighthouseApiRef } from '../../api'; import { useQuery } from '../../utils'; import LighthouseSupportButton from '../SupportButton'; +import { + Content, + ContentHeader, + Header, + HeaderLabel, + InfoCard, + Page, +} from '@backstage/core-components'; +import { errorApiRef, useApi } from '@backstage/core-plugin-api'; + // TODO(freben): move all of this out of index const useStyles = makeStyles(theme => ({ diff --git a/plugins/lighthouse/src/components/Intro/index.tsx b/plugins/lighthouse/src/components/Intro/index.tsx index 6b0307f9ec..6a7fbe666a 100644 --- a/plugins/lighthouse/src/components/Intro/index.tsx +++ b/plugins/lighthouse/src/components/Intro/index.tsx @@ -14,12 +14,16 @@ * limitations under the License. */ -import { ContentHeader, InfoCard, MarkdownContent } from '@backstage/core'; import { Button, Grid, makeStyles, Tab, Tabs } from '@material-ui/core'; import CloseIcon from '@material-ui/icons/Close'; import React, { useState } from 'react'; import { useLocalStorage } from 'react-use'; import LighthouseSupportButton from '../SupportButton'; +import { + ContentHeader, + InfoCard, + MarkdownContent, +} from '@backstage/core-components'; // TODO(freben): move all of this out of index diff --git a/plugins/lighthouse/src/components/SupportButton/index.tsx b/plugins/lighthouse/src/components/SupportButton/index.tsx index 56a8091199..eaa71f8311 100644 --- a/plugins/lighthouse/src/components/SupportButton/index.tsx +++ b/plugins/lighthouse/src/components/SupportButton/index.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ import React from 'react'; -import { SupportButton } from '@backstage/core'; +import { SupportButton } from '@backstage/core-components'; export default function LighthouseSupportButton() { return ( diff --git a/plugins/lighthouse/src/hooks/useWebsiteForEntity.test.tsx b/plugins/lighthouse/src/hooks/useWebsiteForEntity.test.tsx index e22a64bdc1..ca90c53fd8 100644 --- a/plugins/lighthouse/src/hooks/useWebsiteForEntity.test.tsx +++ b/plugins/lighthouse/src/hooks/useWebsiteForEntity.test.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import { Entity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core'; import { EntityContext } from '@backstage/plugin-catalog-react'; import { renderHook } from '@testing-library/react-hooks'; import React, { PropsWithChildren } from 'react'; @@ -22,6 +21,9 @@ import { lighthouseApiRef, WebsiteListResponse } from '../api'; import * as data from '../__fixtures__/website-list-response.json'; import { useWebsiteForEntity } from './useWebsiteForEntity'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { errorApiRef } from '@backstage/core-plugin-api'; + const websiteListResponse = data as WebsiteListResponse; const website = websiteListResponse.items[0]; diff --git a/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts b/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts index e6713cf320..e7fca4d8f5 100644 --- a/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts +++ b/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { errorApiRef, useApi } from '@backstage/core'; import { useEntity } from '@backstage/plugin-catalog-react'; import { useAsync } from 'react-use'; import { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../../constants'; import { lighthouseApiRef } from '../api'; +import { errorApiRef, useApi } from '@backstage/core-plugin-api'; // For the sake of simplicity we assume that an entity has only one website url. This is to avoid encoding a list // type in an annotation which is a plain string. diff --git a/plugins/lighthouse/src/plugin.ts b/plugins/lighthouse/src/plugin.ts index c2a8521da7..ec587ae8ba 100644 --- a/plugins/lighthouse/src/plugin.ts +++ b/plugins/lighthouse/src/plugin.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { lighthouseApiRef, LighthouseRestApi } from './api'; import { createPlugin, createRouteRef, @@ -21,8 +22,7 @@ import { configApiRef, createRoutableExtension, createComponentExtension, -} from '@backstage/core'; -import { lighthouseApiRef, LighthouseRestApi } from './api'; +} from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ path: '', diff --git a/plugins/newrelic/src/api/index.ts b/plugins/newrelic/src/api/index.ts index d76a87875c..7f52cf425f 100644 --- a/plugins/newrelic/src/api/index.ts +++ b/plugins/newrelic/src/api/index.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createApiRef, DiscoveryApi } from '@backstage/core'; +import { createApiRef, DiscoveryApi } from '@backstage/core-plugin-api'; export type NewRelicApplication = { id: number; diff --git a/plugins/newrelic/src/components/NewRelicComponent/NewRelicComponent.tsx b/plugins/newrelic/src/components/NewRelicComponent/NewRelicComponent.tsx index 27e021e518..ccd9360568 100644 --- a/plugins/newrelic/src/components/NewRelicComponent/NewRelicComponent.tsx +++ b/plugins/newrelic/src/components/NewRelicComponent/NewRelicComponent.tsx @@ -16,6 +16,7 @@ import React from 'react'; import { Grid } from '@material-ui/core'; +import NewRelicFetchComponent from '../NewRelicFetchComponent'; import { Header, Page, @@ -23,8 +24,7 @@ import { ContentHeader, HeaderLabel, SupportButton, -} from '@backstage/core'; -import NewRelicFetchComponent from '../NewRelicFetchComponent'; +} from '@backstage/core-components'; const NewRelicComponent = () => ( diff --git a/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx b/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx index 153a80501f..75e2783683 100644 --- a/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx +++ b/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx @@ -15,11 +15,13 @@ */ import React from 'react'; -import { Progress, Table, TableColumn, useApi } from '@backstage/core'; import Alert from '@material-ui/lab/Alert'; import { useAsync } from 'react-use'; import { newRelicApiRef, NewRelicApplications } from '../../api'; +import { Progress, Table, TableColumn } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + export const NewRelicAPMTable = ({ applications }: NewRelicApplications) => { const columns: TableColumn[] = [ { title: 'Application', field: 'name' }, diff --git a/plugins/newrelic/src/plugin.ts b/plugins/newrelic/src/plugin.ts index a92c051b27..1508ecc732 100644 --- a/plugins/newrelic/src/plugin.ts +++ b/plugins/newrelic/src/plugin.ts @@ -14,14 +14,14 @@ * limitations under the License. */ +import { NewRelicClient, newRelicApiRef } from './api'; import { createApiFactory, createPlugin, createRouteRef, discoveryApiRef, createRoutableExtension, -} from '@backstage/core'; -import { NewRelicClient, newRelicApiRef } from './api'; +} from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ path: '/newrelic', diff --git a/plugins/org/src/components/Cards/Group/GroupProfile/GroupProfileCard.tsx b/plugins/org/src/components/Cards/Group/GroupProfile/GroupProfileCard.tsx index 1e55b1b340..d2d0c3ce96 100644 --- a/plugins/org/src/components/Cards/Group/GroupProfile/GroupProfileCard.tsx +++ b/plugins/org/src/components/Cards/Group/GroupProfile/GroupProfileCard.tsx @@ -19,7 +19,6 @@ import { RELATION_CHILD_OF, RELATION_PARENT_OF, } from '@backstage/catalog-model'; -import { Avatar, InfoCard, InfoCardVariants } from '@backstage/core'; import { EntityRefLinks, getEntityRelations, @@ -40,6 +39,7 @@ import EmailIcon from '@material-ui/icons/Email'; import GroupIcon from '@material-ui/icons/Group'; import Alert from '@material-ui/lab/Alert'; import React from 'react'; +import { Avatar, InfoCard, InfoCardVariants } from '@backstage/core-components'; const CardTitle = ({ title }: { title: string }) => ( diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx index a97237fad6..738cf9c86d 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx @@ -15,7 +15,6 @@ */ import { Entity, GroupEntity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -24,6 +23,7 @@ import { import { renderWithEffects, wrapInTestApp } from '@backstage/test-utils'; import React from 'react'; import { MembersListCard } from './MembersListCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('MemberTab Test', () => { const groupEntity: GroupEntity = { diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx index 58dcefaaa4..7653343835 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx @@ -19,13 +19,6 @@ import { RELATION_MEMBER_OF, UserEntity, } from '@backstage/catalog-model'; -import { - Avatar, - InfoCard, - Progress, - ResponseErrorPanel, - useApi, -} from '@backstage/core'; import { catalogApiRef, entityRouteParams, @@ -45,6 +38,14 @@ import React from 'react'; import { generatePath, Link as RouterLink } from 'react-router-dom'; import { useAsync } from 'react-use'; +import { + Avatar, + InfoCard, + Progress, + ResponseErrorPanel, +} from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + const useStyles = makeStyles((theme: Theme) => createStyles({ card: { diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx index b82886df34..50a53ffbe0 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx @@ -15,7 +15,6 @@ */ import { GroupEntity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef, @@ -25,6 +24,7 @@ import { renderInTestApp } from '@backstage/test-utils'; import { queryByText } from '@testing-library/react'; import React from 'react'; import { OwnershipCard } from './OwnershipCard'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('OwnershipCard', () => { const userEntity: GroupEntity = { diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx index 5b3e6a955c..35fa1ed7c6 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx @@ -15,13 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { - InfoCard, - InfoCardVariants, - Progress, - ResponseErrorPanel, - useApi, -} from '@backstage/core'; import { catalogApiRef, isOwnerOf, @@ -38,6 +31,14 @@ import { import React from 'react'; import { useAsync } from 'react-use'; +import { + InfoCard, + InfoCardVariants, + Progress, + ResponseErrorPanel, +} from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + type EntitiesKinds = 'Component' | 'API'; type EntitiesTypes = | 'service' diff --git a/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.tsx b/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.tsx index 585c0f32e0..394665ed84 100644 --- a/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.tsx +++ b/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import { RELATION_MEMBER_OF, UserEntity } from '@backstage/catalog-model'; -import { Avatar, InfoCard, InfoCardVariants } from '@backstage/core'; import { EntityRefLinks, getEntityRelations, @@ -35,6 +34,7 @@ import GroupIcon from '@material-ui/icons/Group'; import PersonIcon from '@material-ui/icons/Person'; import Alert from '@material-ui/lab/Alert'; import React from 'react'; +import { Avatar, InfoCard, InfoCardVariants } from '@backstage/core-components'; const CardTitle = ({ title }: { title?: string }) => title ? ( diff --git a/plugins/org/src/plugin.ts b/plugins/org/src/plugin.ts index 195e88ea41..68721775ab 100644 --- a/plugins/org/src/plugin.ts +++ b/plugins/org/src/plugin.ts @@ -13,7 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { createComponentExtension, createPlugin } from '@backstage/core'; +import { + createComponentExtension, + createPlugin, +} from '@backstage/core-plugin-api'; export const orgPlugin = createPlugin({ id: 'org', diff --git a/plugins/pagerduty/src/api/client.ts b/plugins/pagerduty/src/api/client.ts index d1220f715f..a1339ee26c 100644 --- a/plugins/pagerduty/src/api/client.ts +++ b/plugins/pagerduty/src/api/client.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -import { createApiRef, DiscoveryApi, ConfigApi } from '@backstage/core'; import { Service, Incident, OnCall } from '../components/types'; import { PagerDutyApi, @@ -25,6 +24,11 @@ import { ClientApiConfig, RequestOptions, } from './types'; +import { + createApiRef, + DiscoveryApi, + ConfigApi, +} from '@backstage/core-plugin-api'; export class UnauthorizedError extends Error {} diff --git a/plugins/pagerduty/src/api/types.ts b/plugins/pagerduty/src/api/types.ts index 733f171489..bc89f6dc19 100644 --- a/plugins/pagerduty/src/api/types.ts +++ b/plugins/pagerduty/src/api/types.ts @@ -15,7 +15,7 @@ */ import { Incident, OnCall, Service } from '../components/types'; -import { DiscoveryApi } from '@backstage/core'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; export type TriggerAlarmRequest = { integrationKey: string; diff --git a/plugins/pagerduty/src/components/Errors/MissingTokenError.tsx b/plugins/pagerduty/src/components/Errors/MissingTokenError.tsx index c22552b7c6..46574f6654 100644 --- a/plugins/pagerduty/src/components/Errors/MissingTokenError.tsx +++ b/plugins/pagerduty/src/components/Errors/MissingTokenError.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ import React from 'react'; -import { EmptyState } from '@backstage/core'; import { Button } from '@material-ui/core'; +import { EmptyState } from '@backstage/core-components'; export const MissingTokenError = () => ( [], diff --git a/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx b/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx index 6fd036330a..f1fc451a33 100644 --- a/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx +++ b/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx @@ -20,9 +20,11 @@ import { EscalationUsersEmptyState } from './EscalationUsersEmptyState'; import { EscalationUser } from './EscalationUser'; import { useAsync } from 'react-use'; import { pagerDutyApiRef } from '../../api'; -import { useApi, Progress } from '@backstage/core'; import { Alert } from '@material-ui/lab'; +import { useApi } from '@backstage/core-plugin-api'; +import { Progress } from '@backstage/core-components'; + type Props = { policyId: string; }; diff --git a/plugins/pagerduty/src/components/Escalation/EscalationUsersEmptyState.tsx b/plugins/pagerduty/src/components/Escalation/EscalationUsersEmptyState.tsx index d587011601..eca67d2019 100644 --- a/plugins/pagerduty/src/components/Escalation/EscalationUsersEmptyState.tsx +++ b/plugins/pagerduty/src/components/Escalation/EscalationUsersEmptyState.tsx @@ -21,7 +21,7 @@ import { ListItemText, makeStyles, } from '@material-ui/core'; -import { StatusWarning } from '@backstage/core'; +import { StatusWarning } from '@backstage/core-components'; const useStyles = makeStyles({ denseListIcon: { diff --git a/plugins/pagerduty/src/components/Incident/Incidents.test.tsx b/plugins/pagerduty/src/components/Incident/Incidents.test.tsx index 88500fbe9b..ab5e8df486 100644 --- a/plugins/pagerduty/src/components/Incident/Incidents.test.tsx +++ b/plugins/pagerduty/src/components/Incident/Incidents.test.tsx @@ -17,9 +17,9 @@ import React from 'react'; import { render, waitFor } from '@testing-library/react'; import { Incidents } from './Incidents'; import { wrapInTestApp } from '@backstage/test-utils'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { pagerDutyApiRef } from '../../api'; import { Incident } from '../types'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; const mockPagerDutyApi = { getIncidentsByServiceId: () => [], diff --git a/plugins/pagerduty/src/components/Incident/Incidents.tsx b/plugins/pagerduty/src/components/Incident/Incidents.tsx index 732a582cdb..cddc1829aa 100644 --- a/plugins/pagerduty/src/components/Incident/Incidents.tsx +++ b/plugins/pagerduty/src/components/Incident/Incidents.tsx @@ -20,9 +20,11 @@ import { IncidentListItem } from './IncidentListItem'; import { IncidentsEmptyState } from './IncidentEmptyState'; import { useAsyncFn } from 'react-use'; import { pagerDutyApiRef } from '../../api'; -import { useApi, Progress } from '@backstage/core'; import { Alert } from '@material-ui/lab'; +import { useApi } from '@backstage/core-plugin-api'; +import { Progress } from '@backstage/core-components'; + type Props = { serviceId: string; refreshIncidents: boolean; diff --git a/plugins/pagerduty/src/components/PagerDutyCard/index.test.tsx b/plugins/pagerduty/src/components/PagerDutyCard/index.test.tsx index 397f897f65..6084279431 100644 --- a/plugins/pagerduty/src/components/PagerDutyCard/index.test.tsx +++ b/plugins/pagerduty/src/components/PagerDutyCard/index.test.tsx @@ -19,15 +19,12 @@ import { PagerDutyCard } from '../PagerDutyCard'; import { Entity } from '@backstage/catalog-model'; import { EntityProvider } from '@backstage/plugin-catalog-react'; import { wrapInTestApp } from '@backstage/test-utils'; -import { - alertApiRef, - ApiProvider, - ApiRegistry, - createApiRef, -} from '@backstage/core'; import { pagerDutyApiRef, UnauthorizedError, PagerDutyClient } from '../../api'; import { Service } from '../types'; +import { alertApiRef, createApiRef } from '@backstage/core-plugin-api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; + const mockPagerDutyApi: Partial = { getServiceByIntegrationKey: async () => [], getOnCallByPolicyId: async () => [], diff --git a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx index 5a361518a7..81b12a59ff 100644 --- a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx +++ b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx @@ -14,12 +14,6 @@ * limitations under the License. */ import React, { useState, useCallback } from 'react'; -import { - useApi, - Progress, - HeaderIconLinkRow, - IconLinkVerticalProps, -} from '@backstage/core'; import { Entity } from '@backstage/catalog-model'; import { Card, CardHeader, Divider, CardContent } from '@material-ui/core'; import { Incidents } from '../Incident'; @@ -34,6 +28,13 @@ import { usePagerdutyEntity } from '../../hooks'; import { PAGERDUTY_INTEGRATION_KEY } from '../constants'; import { TriggerDialog } from '../TriggerDialog'; +import { useApi } from '@backstage/core-plugin-api'; +import { + Progress, + HeaderIconLinkRow, + IconLinkVerticalProps, +} from '@backstage/core-components'; + export const isPluginApplicableToEntity = (entity: Entity) => Boolean(entity.metadata.annotations?.[PAGERDUTY_INTEGRATION_KEY]); diff --git a/plugins/pagerduty/src/components/TriggerButton/index.test.tsx b/plugins/pagerduty/src/components/TriggerButton/index.test.tsx index 1ba6368d72..0b6744fcd2 100644 --- a/plugins/pagerduty/src/components/TriggerButton/index.test.tsx +++ b/plugins/pagerduty/src/components/TriggerButton/index.test.tsx @@ -16,19 +16,19 @@ import React from 'react'; import { act, fireEvent, screen, waitFor } from '@testing-library/react'; import { renderInTestApp } from '@backstage/test-utils'; -import { - ApiRegistry, - alertApiRef, - createApiRef, - ApiProvider, - IdentityApi, - identityApiRef, -} from '@backstage/core'; import { pagerDutyApiRef } from '../../api'; import { Entity } from '@backstage/catalog-model'; import { EntityProvider } from '@backstage/plugin-catalog-react'; import { TriggerButton } from './'; +import { ApiRegistry, ApiProvider } from '@backstage/core-app-api'; +import { + alertApiRef, + createApiRef, + IdentityApi, + identityApiRef, +} from '@backstage/core-plugin-api'; + describe('TriggerButton', () => { const mockIdentityApi: Partial = { getUserId: () => 'guest@example.com', diff --git a/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.test.tsx b/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.test.tsx index c710aae0fa..e726d30bb8 100644 --- a/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.test.tsx +++ b/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.test.tsx @@ -16,19 +16,19 @@ import React from 'react'; import { fireEvent, act } from '@testing-library/react'; import { renderInTestApp } from '@backstage/test-utils'; -import { - ApiRegistry, - alertApiRef, - createApiRef, - ApiProvider, - IdentityApi, - identityApiRef, -} from '@backstage/core'; import { pagerDutyApiRef } from '../../api'; import { Entity } from '@backstage/catalog-model'; import { EntityProvider } from '@backstage/plugin-catalog-react'; import { TriggerDialog } from './TriggerDialog'; +import { ApiRegistry, ApiProvider } from '@backstage/core-app-api'; +import { + alertApiRef, + createApiRef, + IdentityApi, + identityApiRef, +} from '@backstage/core-plugin-api'; + describe('TriggerDialog', () => { const mockIdentityApi: Partial = { getUserId: () => 'guest@example.com', diff --git a/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx b/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx index 3d7d4a19b4..6e245e774e 100644 --- a/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx +++ b/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx @@ -25,11 +25,15 @@ import { Typography, CircularProgress, } from '@material-ui/core'; -import { useApi, alertApiRef, identityApiRef } from '@backstage/core'; import { useAsyncFn } from 'react-use'; import { pagerDutyApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; import { usePagerdutyEntity } from '../../hooks'; +import { + useApi, + alertApiRef, + identityApiRef, +} from '@backstage/core-plugin-api'; type Props = { showDialog: boolean; diff --git a/plugins/pagerduty/src/plugin.ts b/plugins/pagerduty/src/plugin.ts index fbe827b90d..cbd522ad53 100644 --- a/plugins/pagerduty/src/plugin.ts +++ b/plugins/pagerduty/src/plugin.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { pagerDutyApiRef, PagerDutyClient } from './api'; import { createApiFactory, createPlugin, @@ -20,8 +21,7 @@ import { discoveryApiRef, configApiRef, createComponentExtension, -} from '@backstage/core'; -import { pagerDutyApiRef, PagerDutyClient } from './api'; +} from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ path: '/pagerduty', diff --git a/plugins/register-component/src/components/RegisterComponentPage/RegisterComponentPage.test.tsx b/plugins/register-component/src/components/RegisterComponentPage/RegisterComponentPage.test.tsx index c414beca3d..9fc9b5dc93 100644 --- a/plugins/register-component/src/components/RegisterComponentPage/RegisterComponentPage.test.tsx +++ b/plugins/register-component/src/components/RegisterComponentPage/RegisterComponentPage.test.tsx @@ -14,12 +14,6 @@ * limitations under the License. */ -import { - ApiProvider, - ApiRegistry, - createRouteRef, - errorApiRef, -} from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { lightTheme } from '@backstage/theme'; @@ -27,6 +21,9 @@ import { ThemeProvider } from '@material-ui/core'; import React from 'react'; import { RegisterComponentPage } from './RegisterComponentPage'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { createRouteRef, errorApiRef } from '@backstage/core-plugin-api'; + const errorApi: jest.Mocked = { post: jest.fn(), error$: jest.fn(), diff --git a/plugins/register-component/src/components/RegisterComponentPage/RegisterComponentPage.tsx b/plugins/register-component/src/components/RegisterComponentPage/RegisterComponentPage.tsx index 8dbf712559..c0f75485eb 100644 --- a/plugins/register-component/src/components/RegisterComponentPage/RegisterComponentPage.tsx +++ b/plugins/register-component/src/components/RegisterComponentPage/RegisterComponentPage.tsx @@ -15,17 +15,6 @@ */ import { Entity, Location } from '@backstage/catalog-model'; -import { - Content, - ContentHeader, - errorApiRef, - Header, - InfoCard, - Page, - RouteRef, - SupportButton, - useApi, -} from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { Grid, makeStyles } from '@material-ui/core'; import React, { useState } from 'react'; @@ -33,6 +22,16 @@ import { useMountedState } from 'react-use'; import { RegisterComponentForm } from '../RegisterComponentForm'; import { RegisterComponentResultDialog } from '../RegisterComponentResultDialog'; +import { + Content, + ContentHeader, + Header, + InfoCard, + Page, + SupportButton, +} from '@backstage/core-components'; +import { errorApiRef, RouteRef, useApi } from '@backstage/core-plugin-api'; + const useStyles = makeStyles(theme => ({ dialogPaper: { minHeight: 250, diff --git a/plugins/register-component/src/components/RegisterComponentResultDialog/RegisterComponentResultDialog.test.tsx b/plugins/register-component/src/components/RegisterComponentResultDialog/RegisterComponentResultDialog.test.tsx index 5e5e1c52ce..52339e646e 100644 --- a/plugins/register-component/src/components/RegisterComponentResultDialog/RegisterComponentResultDialog.test.tsx +++ b/plugins/register-component/src/components/RegisterComponentResultDialog/RegisterComponentResultDialog.test.tsx @@ -15,13 +15,13 @@ */ import { Entity } from '@backstage/catalog-model'; -import { createRouteRef } from '@backstage/core'; import { lightTheme } from '@backstage/theme'; import { ThemeProvider } from '@material-ui/core'; import { render, screen } from '@testing-library/react'; import React from 'react'; import { MemoryRouter } from 'react-router-dom'; import { RegisterComponentResultDialog } from './RegisterComponentResultDialog'; +import { createRouteRef } from '@backstage/core-plugin-api'; const Wrapper = ({ children }: { children?: React.ReactNode }) => ( diff --git a/plugins/register-component/src/components/RegisterComponentResultDialog/RegisterComponentResultDialog.tsx b/plugins/register-component/src/components/RegisterComponentResultDialog/RegisterComponentResultDialog.tsx index 87248cb6db..2c9018607b 100644 --- a/plugins/register-component/src/components/RegisterComponentResultDialog/RegisterComponentResultDialog.tsx +++ b/plugins/register-component/src/components/RegisterComponentResultDialog/RegisterComponentResultDialog.tsx @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { RouteRef, StructuredMetadataTable } from '@backstage/core'; import { entityRoute, entityRouteParams, @@ -36,6 +35,9 @@ import React, { useState } from 'react'; import { generatePath, resolvePath } from 'react-router'; import { Link as RouterLink } from 'react-router-dom'; +import { RouteRef } from '@backstage/core-plugin-api'; +import { StructuredMetadataTable } from '@backstage/core-components'; + type Props = { onClose: () => void; classes?: Record; diff --git a/plugins/register-component/src/components/Router.tsx b/plugins/register-component/src/components/Router.tsx index 16aa1fa695..f15c1b663f 100644 --- a/plugins/register-component/src/components/Router.tsx +++ b/plugins/register-component/src/components/Router.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { Route, Routes } from 'react-router'; import { RegisterComponentPage } from './RegisterComponentPage'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; // As we don't know which path the catalog's router mounted on // We need to inject this from the app diff --git a/plugins/register-component/src/plugin.ts b/plugins/register-component/src/plugin.ts index d3727158e5..ed0c13faa8 100644 --- a/plugins/register-component/src/plugin.ts +++ b/plugins/register-component/src/plugin.ts @@ -18,7 +18,7 @@ import { createPlugin, createRoutableExtension, createRouteRef, -} from '@backstage/core'; +} from '@backstage/core-plugin-api'; const rootRouteRef = createRouteRef({ title: 'Register Component', diff --git a/plugins/rollbar/src/api/RollbarApi.ts b/plugins/rollbar/src/api/RollbarApi.ts index bde6c5e9f2..38894163af 100644 --- a/plugins/rollbar/src/api/RollbarApi.ts +++ b/plugins/rollbar/src/api/RollbarApi.ts @@ -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({ id: 'plugin.rollbar.service', diff --git a/plugins/rollbar/src/api/RollbarClient.ts b/plugins/rollbar/src/api/RollbarClient.ts index d3ad3d63db..9d1f9c13ae 100644 --- a/plugins/rollbar/src/api/RollbarClient.ts +++ b/plugins/rollbar/src/api/RollbarClient.ts @@ -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; diff --git a/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx b/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx index c22f813dd9..bc771a1faf 100644 --- a/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx +++ b/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx @@ -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[] = [ { diff --git a/plugins/rollbar/src/components/Router.tsx b/plugins/rollbar/src/components/Router.tsx index 7b95a4ec7c..cc88d83468 100644 --- a/plugins/rollbar/src/components/Router.tsx +++ b/plugins/rollbar/src/components/Router.tsx @@ -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]); diff --git a/plugins/rollbar/src/hooks/useCatalogEntity.ts b/plugins/rollbar/src/hooks/useCatalogEntity.ts index e39a7a75f7..0d591ac4a8 100644 --- a/plugins/rollbar/src/hooks/useCatalogEntity.ts +++ b/plugins/rollbar/src/hooks/useCatalogEntity.ts @@ -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); diff --git a/plugins/rollbar/src/hooks/useProject.ts b/plugins/rollbar/src/hooks/useProject.ts index 5d61b63ffb..3770d4c89e 100644 --- a/plugins/rollbar/src/hooks/useProject.ts +++ b/plugins/rollbar/src/hooks/useProject.ts @@ -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); diff --git a/plugins/rollbar/src/hooks/useRollbarEntities.ts b/plugins/rollbar/src/hooks/useRollbarEntities.ts index 3f3415b176..d0968c5775 100644 --- a/plugins/rollbar/src/hooks/useRollbarEntities.ts +++ b/plugins/rollbar/src/hooks/useRollbarEntities.ts @@ -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); diff --git a/plugins/rollbar/src/hooks/useTopActiveItems.ts b/plugins/rollbar/src/hooks/useTopActiveItems.ts index cb1689355f..cb998f48fe 100644 --- a/plugins/rollbar/src/hooks/useTopActiveItems.ts +++ b/plugins/rollbar/src/hooks/useTopActiveItems.ts @@ -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); diff --git a/plugins/rollbar/src/plugin.ts b/plugins/rollbar/src/plugin.ts index dc0ffa259a..b29a9040c1 100644 --- a/plugins/rollbar/src/plugin.ts +++ b/plugins/rollbar/src/plugin.ts @@ -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: '', diff --git a/plugins/scaffolder/dev/index.tsx b/plugins/scaffolder/dev/index.tsx index d2b003e0ca..b46713a513 100644 --- a/plugins/scaffolder/dev/index.tsx +++ b/plugins/scaffolder/dev/index.tsx @@ -15,13 +15,17 @@ */ import { CatalogClient } from '@backstage/catalog-client'; -import { configApiRef, discoveryApiRef, identityApiRef } from '@backstage/core'; import { createDevApp } from '@backstage/dev-utils'; import { scmIntegrationsApiRef } from '@backstage/integration-react'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import React from 'react'; import { scaffolderApiRef, ScaffolderClient } from '../src'; import { ScaffolderPage } from '../src/plugin'; +import { + configApiRef, + discoveryApiRef, + identityApiRef, +} from '@backstage/core-plugin-api'; createDevApp() .registerApi({ diff --git a/plugins/scaffolder/src/api.test.ts b/plugins/scaffolder/src/api.test.ts index 7739371348..9de4132e36 100644 --- a/plugins/scaffolder/src/api.test.ts +++ b/plugins/scaffolder/src/api.test.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import { ConfigReader } from '@backstage/core'; import { ScmIntegrations } from '@backstage/integration'; import { ScaffolderClient } from './api'; +import { ConfigReader } from '@backstage/core-app-api'; describe('api', () => { const discoveryApi = {} as any; diff --git a/plugins/scaffolder/src/api.ts b/plugins/scaffolder/src/api.ts index e7e4bea688..72ce3556be 100644 --- a/plugins/scaffolder/src/api.ts +++ b/plugins/scaffolder/src/api.ts @@ -16,17 +16,17 @@ import { EntityName } from '@backstage/catalog-model'; import { JsonObject, JsonValue } from '@backstage/config'; -import { - createApiRef, - DiscoveryApi, - IdentityApi, - Observable, -} from '@backstage/core'; import { ResponseError } from '@backstage/errors'; import { ScmIntegrationRegistry } from '@backstage/integration'; import { Field, FieldValidation } from '@rjsf/core'; import ObservableImpl from 'zen-observable'; import { ListActionsResponse, ScaffolderTask, Status } from './types'; +import { + createApiRef, + DiscoveryApi, + IdentityApi, + Observable, +} from '@backstage/core-plugin-api'; export const scaffolderApiRef = createApiRef({ id: 'plugin.scaffolder.service', diff --git a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx index 708d08359a..3d45ac88b7 100644 --- a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx +++ b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { ApiRegistry, ApiProvider } from '@backstage/core'; import React from 'react'; import { ScaffolderApi, scaffolderApiRef } from '../../api'; import { ActionsPage } from './ActionsPage'; import { rootRouteRef } from '../../routes'; import { renderInTestApp } from '@backstage/test-utils'; +import { ApiRegistry, ApiProvider } from '@backstage/core-app-api'; const scaffolderApiMock: jest.Mocked = { scaffold: jest.fn(), diff --git a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx index a06ca50736..e33ed4ffe4 100644 --- a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx +++ b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx @@ -15,14 +15,6 @@ */ import React from 'react'; import { useAsync } from 'react-use'; -import { - useApi, - Progress, - Content, - Header, - Page, - ErrorPage, -} from '@backstage/core'; import { scaffolderApiRef } from '../../api'; import { Typography, @@ -40,6 +32,15 @@ import { JSONSchema } from '@backstage/catalog-model'; import { JSONSchema7Definition } from 'json-schema'; import classNames from 'classnames'; +import { useApi } from '@backstage/core-plugin-api'; +import { + Progress, + Content, + Header, + Page, + ErrorPage, +} from '@backstage/core-components'; + const useStyles = makeStyles(theme => ({ code: { fontFamily: 'Menlo, monospace', diff --git a/plugins/scaffolder/src/components/MultistepJsonForm/MultistepJsonForm.tsx b/plugins/scaffolder/src/components/MultistepJsonForm/MultistepJsonForm.tsx index 58f5f5cd11..1a894c24b4 100644 --- a/plugins/scaffolder/src/components/MultistepJsonForm/MultistepJsonForm.tsx +++ b/plugins/scaffolder/src/components/MultistepJsonForm/MultistepJsonForm.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import { JsonObject } from '@backstage/config'; -import { Content, StructuredMetadataTable } from '@backstage/core'; import { Box, Button, @@ -29,6 +28,7 @@ import { FormProps, IChangeEvent, withTheme } from '@rjsf/core'; import { Theme as MuiTheme } from '@rjsf/material-ui'; import React, { useState } from 'react'; import { transformSchemaToProps } from './schema'; +import { Content, StructuredMetadataTable } from '@backstage/core-components'; const Form = withTheme(MuiTheme); type Step = { diff --git a/plugins/scaffolder/src/components/ResultsFilter/ResultsFilter.test.tsx b/plugins/scaffolder/src/components/ResultsFilter/ResultsFilter.test.tsx index 406515985c..102f05abc8 100644 --- a/plugins/scaffolder/src/components/ResultsFilter/ResultsFilter.test.tsx +++ b/plugins/scaffolder/src/components/ResultsFilter/ResultsFilter.test.tsx @@ -16,13 +16,6 @@ import { CatalogApi } from '@backstage/catalog-client'; import { Entity } from '@backstage/catalog-model'; -import { - ApiProvider, - ApiRegistry, - IdentityApi, - identityApiRef, - storageApiRef, -} from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { MockStorageApi, wrapInTestApp } from '@backstage/test-utils'; import { render } from '@testing-library/react'; @@ -30,6 +23,13 @@ import React from 'react'; import { EntityFilterGroupsProvider } from '../../filter'; import { ResultsFilter } from './ResultsFilter'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { + IdentityApi, + identityApiRef, + storageApiRef, +} from '@backstage/core-plugin-api'; + describe('Results Filter', () => { const catalogApi: Partial = { getEntities: () => diff --git a/plugins/scaffolder/src/components/ScaffolderFilter/ScaffolderFilter.test.tsx b/plugins/scaffolder/src/components/ScaffolderFilter/ScaffolderFilter.test.tsx index b5ec45d8bb..9806274253 100644 --- a/plugins/scaffolder/src/components/ScaffolderFilter/ScaffolderFilter.test.tsx +++ b/plugins/scaffolder/src/components/ScaffolderFilter/ScaffolderFilter.test.tsx @@ -17,19 +17,19 @@ import React from 'react'; import { MockStorageApi, wrapInTestApp } from '@backstage/test-utils'; import { fireEvent, render, waitFor } from '@testing-library/react'; -import { - ApiProvider, - ApiRegistry, - IdentityApi, - identityApiRef, - storageApiRef, -} from '@backstage/core'; import { CatalogApi } from '@backstage/catalog-client'; import { Entity } from '@backstage/catalog-model'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { EntityFilterGroupsProvider } from '../../filter'; import { ButtonGroup, ScaffolderFilter } from './ScaffolderFilter'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { + IdentityApi, + identityApiRef, + storageApiRef, +} from '@backstage/core-plugin-api'; + describe('Catalog Filter', () => { const catalogApi: Partial = { getEntities: () => diff --git a/plugins/scaffolder/src/components/ScaffolderFilter/ScaffolderFilter.tsx b/plugins/scaffolder/src/components/ScaffolderFilter/ScaffolderFilter.tsx index 14093462b8..38c914706a 100644 --- a/plugins/scaffolder/src/components/ScaffolderFilter/ScaffolderFilter.tsx +++ b/plugins/scaffolder/src/components/ScaffolderFilter/ScaffolderFilter.tsx @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { IconComponent } from '@backstage/core'; import { Card, List, @@ -35,6 +34,7 @@ import React, { useState, } from 'react'; import { FilterGroup, useEntityFilterGroup } from '../../filter'; +import { IconComponent } from '@backstage/core-plugin-api'; export type ButtonGroup = { name: string; diff --git a/plugins/scaffolder/src/components/ScaffolderPage/ScaffolderPage.tsx b/plugins/scaffolder/src/components/ScaffolderPage/ScaffolderPage.tsx index 10468b07e0..2a3cb71488 100644 --- a/plugins/scaffolder/src/components/ScaffolderPage/ScaffolderPage.tsx +++ b/plugins/scaffolder/src/components/ScaffolderPage/ScaffolderPage.tsx @@ -15,20 +15,6 @@ */ import { EntityMeta, TemplateEntityV1alpha1 } from '@backstage/catalog-model'; -import { - configApiRef, - Content, - ContentHeader, - Header, - ItemCardGrid, - Lifecycle, - Page, - Progress, - SupportButton, - useApi, - useRouteRef, - WarningPanel, -} from '@backstage/core'; import { useStarredEntities } from '@backstage/plugin-catalog-react'; import { Button, Link, makeStyles, Typography } from '@material-ui/core'; import StarIcon from '@material-ui/icons/Star'; @@ -42,6 +28,20 @@ import { ButtonGroup } from '../ScaffolderFilter/ScaffolderFilter'; import SearchToolbar from '../SearchToolbar/SearchToolbar'; import { TemplateCard } from '../TemplateCard'; +import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; + +import { + Content, + ContentHeader, + Header, + ItemCardGrid, + Lifecycle, + Page, + Progress, + SupportButton, + WarningPanel, +} from '@backstage/core-components'; + const useStyles = makeStyles(theme => ({ contentWrapper: { display: 'grid', diff --git a/plugins/scaffolder/src/components/TaskPage/IconLink.tsx b/plugins/scaffolder/src/components/TaskPage/IconLink.tsx index 9bede214c6..e652f9ca59 100644 --- a/plugins/scaffolder/src/components/TaskPage/IconLink.tsx +++ b/plugins/scaffolder/src/components/TaskPage/IconLink.tsx @@ -15,10 +15,12 @@ */ import React from 'react'; -import { IconComponent, Link } from '@backstage/core'; import { Grid, LinkProps, makeStyles, Typography } from '@material-ui/core'; import LanguageIcon from '@material-ui/icons/Language'; +import { IconComponent } from '@backstage/core-plugin-api'; +import { Link } from '@backstage/core-components'; + const useStyles = makeStyles({ svgIcon: { display: 'inline-block', diff --git a/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx b/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx index c19f9ae37f..f9af802c2a 100644 --- a/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx +++ b/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { Page, Header, Lifecycle, Content, ErrorPage } from '@backstage/core'; import React, { useState, useEffect, memo, useMemo } from 'react'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; import Stepper from '@material-ui/core/Stepper'; @@ -40,6 +39,13 @@ import FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord'; import classNames from 'classnames'; import { BackstageTheme } from '@backstage/theme'; import { TaskPageLinks } from './TaskPageLinks'; +import { + Page, + Header, + Lifecycle, + Content, + ErrorPage, +} from '@backstage/core-components'; // typings are wrong for this library, so fallback to not parsing types. const humanizeDuration = require('humanize-duration'); diff --git a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx index db0d583cb8..2acdc4fb5b 100644 --- a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx +++ b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx @@ -18,7 +18,6 @@ import { RELATION_OWNED_BY, TemplateEntityV1alpha1, } from '@backstage/catalog-model'; -import { Button, ItemCardHeader, useApi, useRouteRef } from '@backstage/core'; import { ScmIntegrationIcon, scmIntegrationsApiRef, @@ -49,6 +48,9 @@ import { generatePath } from 'react-router'; import { rootRouteRef } from '../../routes'; import { FavouriteTemplate } from '../FavouriteTemplate/FavouriteTemplate'; +import { Button, ItemCardHeader } from '@backstage/core-components'; +import { useApi, useRouteRef } from '@backstage/core-plugin-api'; + const useStyles = makeStyles(theme => ({ cardHeader: { position: 'relative', diff --git a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.test.tsx b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.test.tsx index 0a946862ef..a63bd0a666 100644 --- a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.test.tsx +++ b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.test.tsx @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core'; import { renderInTestApp, renderWithEffects } from '@backstage/test-utils'; import { lightTheme } from '@backstage/theme'; import { ThemeProvider } from '@material-ui/core'; @@ -25,6 +24,9 @@ import { ScaffolderApi, scaffolderApiRef } from '../../api'; import { rootRouteRef } from '../../routes'; import { TemplatePage } from './TemplatePage'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { errorApiRef } from '@backstage/core-plugin-api'; + jest.mock('react-router-dom', () => { return { ...(jest.requireActual('react-router-dom') as any), diff --git a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx index fec1390171..6c9595071f 100644 --- a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx +++ b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx @@ -14,16 +14,6 @@ * limitations under the License. */ import { JsonObject, JsonValue } from '@backstage/config'; -import { - Content, - errorApiRef, - Header, - InfoCard, - Lifecycle, - Page, - useApi, - useRouteRef, -} from '@backstage/core'; import { LinearProgress } from '@material-ui/core'; import { FieldValidation, FormValidation, IChangeEvent } from '@rjsf/core'; import parseGitUrl from 'git-url-parse'; @@ -36,6 +26,15 @@ import { FieldExtensionOptions } from '../../extensions'; import { rootRouteRef } from '../../routes'; import { MultistepJsonForm } from '../MultistepJsonForm'; +import { + Content, + Header, + InfoCard, + Lifecycle, + Page, +} from '@backstage/core-components'; +import { errorApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; + const useTemplateParameterSchema = (templateName: string) => { const scaffolderApi = useApi(scaffolderApiRef); const { value, loading, error } = useAsync( diff --git a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx index 4c6a45d94c..57e05b3d62 100644 --- a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx @@ -15,13 +15,13 @@ */ import { Entity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { FieldProps } from '@rjsf/core'; import userEvent from '@testing-library/user-event'; import React from 'react'; import { EntityPicker } from './EntityPicker'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; const makeEntity = (kind: string, namespace: string, name: string): Entity => ({ apiVersion: 'backstage.io/v1beta1', diff --git a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx index 47371e9127..164213be24 100644 --- a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx +++ b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useApi } from '@backstage/core'; import { catalogApiRef, formatEntityRefTitle, @@ -24,6 +23,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete'; import { FieldProps } from '@rjsf/core'; import React from 'react'; import { useAsync } from 'react-use'; +import { useApi } from '@backstage/core-plugin-api'; export const EntityPicker = ({ onChange, diff --git a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.test.tsx b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.test.tsx index d618b66504..346f7c3668 100644 --- a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.test.tsx @@ -15,12 +15,12 @@ */ import { Entity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { FieldProps } from '@rjsf/core'; import React from 'react'; import { OwnerPicker } from './OwnerPicker'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; const makeEntity = (kind: string, namespace: string, name: string): Entity => ({ apiVersion: 'backstage.io/v1beta1', diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index 49d16169ac..c762071382 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -15,7 +15,6 @@ */ import React, { useCallback, useEffect } from 'react'; import { FieldProps } from '@rjsf/core'; -import { useApi, Progress } from '@backstage/core'; import { scaffolderApiRef } from '../../../api'; import { useAsync } from 'react-use'; import Select from '@material-ui/core/Select'; @@ -24,6 +23,9 @@ import Input from '@material-ui/core/Input'; import FormControl from '@material-ui/core/FormControl'; import FormHelperText from '@material-ui/core/FormHelperText'; +import { useApi } from '@backstage/core-plugin-api'; +import { Progress } from '@backstage/core-components'; + function splitFormData(url: string | undefined) { let host = undefined; let owner = undefined; diff --git a/plugins/scaffolder/src/components/hooks/useEventStream.ts b/plugins/scaffolder/src/components/hooks/useEventStream.ts index 4d28fabd34..e77e2df4d6 100644 --- a/plugins/scaffolder/src/components/hooks/useEventStream.ts +++ b/plugins/scaffolder/src/components/hooks/useEventStream.ts @@ -17,7 +17,7 @@ import { useImmerReducer } from 'use-immer'; import { useEffect } from 'react'; import { scaffolderApiRef, LogEvent } from '../../api'; import { ScaffolderTask, Status, TaskOutput } from '../../types'; -import { Subscription, useApi } from '@backstage/core'; +import { Subscription, useApi } from '@backstage/core-plugin-api'; type Step = { id: string; diff --git a/plugins/scaffolder/src/extensions/index.tsx b/plugins/scaffolder/src/extensions/index.tsx index bb53329342..8171208862 100644 --- a/plugins/scaffolder/src/extensions/index.tsx +++ b/plugins/scaffolder/src/extensions/index.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ -import { Extension, attachComponentData } from '@backstage/core'; import React from 'react'; import { FieldExtensionOptions } from './types'; +import { Extension, attachComponentData } from '@backstage/core-plugin-api'; export const FIELD_EXTENSION_WRAPPER_KEY = 'scaffolder.extensions.wrapper.v1'; export const FIELD_EXTENSION_KEY = 'scaffolder.extensions.field.v1'; diff --git a/plugins/scaffolder/src/filter/EntityFilterGroupsProvider.tsx b/plugins/scaffolder/src/filter/EntityFilterGroupsProvider.tsx index 9e11525347..999898b4af 100644 --- a/plugins/scaffolder/src/filter/EntityFilterGroupsProvider.tsx +++ b/plugins/scaffolder/src/filter/EntityFilterGroupsProvider.tsx @@ -15,7 +15,6 @@ */ import { TemplateEntityV1alpha1 } from '@backstage/catalog-model'; -import { useApi } from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import { useAsyncFn } from 'react-use'; @@ -26,6 +25,7 @@ import { FilterGroupState, FilterGroupStates, } from './types'; +import { useApi } from '@backstage/core-plugin-api'; /** * Implementation of the shared filter groups state. diff --git a/plugins/scaffolder/src/filter/useEntityFilterGroup.test.tsx b/plugins/scaffolder/src/filter/useEntityFilterGroup.test.tsx index 8a5bf60b06..f7f4aff792 100644 --- a/plugins/scaffolder/src/filter/useEntityFilterGroup.test.tsx +++ b/plugins/scaffolder/src/filter/useEntityFilterGroup.test.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry, storageApiRef } from '@backstage/core'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { MockStorageApi } from '@backstage/test-utils'; import { act, renderHook } from '@testing-library/react-hooks'; @@ -23,6 +22,9 @@ import { EntityFilterGroupsProvider } from './EntityFilterGroupsProvider'; import { FilterGroup, FilterGroupStatesReady } from './types'; import { useEntityFilterGroup } from './useEntityFilterGroup'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { storageApiRef } from '@backstage/core-plugin-api'; + describe('useEntityFilterGroup', () => { let catalogApi: jest.Mocked; let wrapper: ({ children }: { children?: React.ReactNode }) => JSX.Element; diff --git a/plugins/scaffolder/src/plugin.ts b/plugins/scaffolder/src/plugin.ts index 9e751e1bb6..d23a5e0b69 100644 --- a/plugins/scaffolder/src/plugin.ts +++ b/plugins/scaffolder/src/plugin.ts @@ -14,13 +14,6 @@ * limitations under the License. */ -import { - createApiFactory, - createPlugin, - createRoutableExtension, - discoveryApiRef, - identityApiRef, -} from '@backstage/core'; import { scmIntegrationsApiRef } from '@backstage/integration-react'; import { scaffolderApiRef, ScaffolderClient } from './api'; import { EntityPicker } from './components/fields/EntityPicker'; @@ -31,6 +24,13 @@ import { } from './components/fields/RepoUrlPicker'; import { createScaffolderFieldExtension } from './extensions'; import { registerComponentRouteRef, rootRouteRef } from './routes'; +import { + createApiFactory, + createPlugin, + createRoutableExtension, + discoveryApiRef, + identityApiRef, +} from '@backstage/core-plugin-api'; export const scaffolderPlugin = createPlugin({ id: 'scaffolder', diff --git a/plugins/scaffolder/src/routes.ts b/plugins/scaffolder/src/routes.ts index 3cca269b84..69c6573e20 100644 --- a/plugins/scaffolder/src/routes.ts +++ b/plugins/scaffolder/src/routes.ts @@ -13,7 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { createExternalRouteRef, createRouteRef } from '@backstage/core'; +import { + createExternalRouteRef, + createRouteRef, +} from '@backstage/core-plugin-api'; export const registerComponentRouteRef = createExternalRouteRef({ id: 'register-component', diff --git a/plugins/search/src/apis.ts b/plugins/search/src/apis.ts index 8d618116be..795ef15771 100644 --- a/plugins/search/src/apis.ts +++ b/plugins/search/src/apis.ts @@ -14,9 +14,13 @@ * limitations under the License. */ -import { createApiRef, DiscoveryApi, IdentityApi } from '@backstage/core'; import { SearchQuery, SearchResultSet } from '@backstage/search-common'; import qs from 'qs'; +import { + createApiRef, + DiscoveryApi, + IdentityApi, +} from '@backstage/core-plugin-api'; export const searchApiRef = createApiRef({ id: 'plugin.search.queryservice', diff --git a/plugins/search/src/components/DefaultResultListItem/DefaultResultListItem.tsx b/plugins/search/src/components/DefaultResultListItem/DefaultResultListItem.tsx index 5f2d4bf87f..6a16b01520 100644 --- a/plugins/search/src/components/DefaultResultListItem/DefaultResultListItem.tsx +++ b/plugins/search/src/components/DefaultResultListItem/DefaultResultListItem.tsx @@ -15,9 +15,9 @@ */ import React from 'react'; -import { Link } from '@backstage/core'; import { IndexableDocument } from '@backstage/search-common'; import { ListItem, ListItemText, Divider } from '@material-ui/core'; +import { Link } from '@backstage/core-components'; type Props = { result: IndexableDocument; diff --git a/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx b/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx index 7e9d7b205c..7081519824 100644 --- a/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx +++ b/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx @@ -13,12 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Content, Header, Page, useQueryParamState } from '@backstage/core'; import { Grid } from '@material-ui/core'; import React, { useEffect, useState } from 'react'; import { useDebounce } from 'react-use'; import { SearchBar } from './LegacySearchBar'; import { SearchResult } from './LegacySearchResult'; +import { + Content, + Header, + Page, + useQueryParamState, +} from '@backstage/core-components'; /** * @deprecated This SearchPage, powered directly by the Catalog API, will be diff --git a/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx b/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx index b89a05e276..9cd7986ad9 100644 --- a/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx +++ b/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx @@ -13,14 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { - EmptyState, - Link, - Progress, - Table, - TableColumn, - useApi, -} from '@backstage/core'; import { Divider, Grid, makeStyles, Typography } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; import React, { useEffect, useState } from 'react'; @@ -30,6 +22,15 @@ import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { Filters, FiltersButton, FiltersState } from './Filters'; import { Entity, ENTITY_DEFAULT_NAMESPACE } from '@backstage/catalog-model'; +import { + EmptyState, + Link, + Progress, + Table, + TableColumn, +} from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + type Result = { name: string; description: string | undefined; diff --git a/plugins/search/src/components/SearchBar/SearchBar.test.tsx b/plugins/search/src/components/SearchBar/SearchBar.test.tsx index ca85275a5c..08d56cbc94 100644 --- a/plugins/search/src/components/SearchBar/SearchBar.test.tsx +++ b/plugins/search/src/components/SearchBar/SearchBar.test.tsx @@ -17,10 +17,10 @@ import React from 'react'; import { screen, render, waitFor, act } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { useApi } from '@backstage/core'; - import { SearchContextProvider } from '../SearchContext'; + import { SearchBar } from './SearchBar'; +import { useApi } from '@backstage/core-plugin-api'; jest.mock('@backstage/core', () => ({ ...jest.requireActual('@backstage/core'), diff --git a/plugins/search/src/components/SearchContext/SearchContext.test.tsx b/plugins/search/src/components/SearchContext/SearchContext.test.tsx index e4394abe70..42c55a3b29 100644 --- a/plugins/search/src/components/SearchContext/SearchContext.test.tsx +++ b/plugins/search/src/components/SearchContext/SearchContext.test.tsx @@ -18,10 +18,10 @@ import React from 'react'; import { render, screen, waitFor } from '@testing-library/react'; import { renderHook, act } from '@testing-library/react-hooks'; -import { useApi } from '@backstage/core'; - import { useSearch, SearchContextProvider } from './SearchContext'; +import { useApi } from '@backstage/core-plugin-api'; + jest.mock('@backstage/core', () => ({ ...jest.requireActual('@backstage/core'), useApi: jest.fn(), diff --git a/plugins/search/src/components/SearchContext/SearchContext.tsx b/plugins/search/src/components/SearchContext/SearchContext.tsx index 36a5ccde37..68048bc6d3 100644 --- a/plugins/search/src/components/SearchContext/SearchContext.tsx +++ b/plugins/search/src/components/SearchContext/SearchContext.tsx @@ -22,11 +22,11 @@ import React, { useEffect, } from 'react'; import { useAsync, usePrevious } from 'react-use'; -import { useApi } from '@backstage/core'; import { SearchResultSet } from '@backstage/search-common'; import { searchApiRef } from '../../apis'; import { AsyncState } from 'react-use/lib/useAsync'; import { JsonObject } from '@backstage/config'; +import { useApi } from '@backstage/core-plugin-api'; type SearchContextValue = { result: AsyncState; diff --git a/plugins/search/src/components/SearchFilter/SearchFilter.test.tsx b/plugins/search/src/components/SearchFilter/SearchFilter.test.tsx index 2742197d32..b171d0c20f 100644 --- a/plugins/search/src/components/SearchFilter/SearchFilter.test.tsx +++ b/plugins/search/src/components/SearchFilter/SearchFilter.test.tsx @@ -17,10 +17,10 @@ import React from 'react'; import { screen, render, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { useApi } from '@backstage/core'; - import { SearchFilter } from './SearchFilter'; + import { SearchContextProvider } from '../SearchContext'; +import { useApi } from '@backstage/core-plugin-api'; jest.mock('@backstage/core', () => ({ ...jest.requireActual('@backstage/core'), diff --git a/plugins/search/src/components/SearchResult/SearchResult.tsx b/plugins/search/src/components/SearchResult/SearchResult.tsx index 24b582f7e9..06c51cba53 100644 --- a/plugins/search/src/components/SearchResult/SearchResult.tsx +++ b/plugins/search/src/components/SearchResult/SearchResult.tsx @@ -15,12 +15,12 @@ */ import React from 'react'; -import { EmptyState, Progress } from '@backstage/core'; import { SearchResult } from '@backstage/search-common'; import { Alert } from '@material-ui/lab'; - import { useSearch } from '../SearchContext'; +import { EmptyState, Progress } from '@backstage/core-components'; + type Props = { children: (results: { results: SearchResult[] }) => JSX.Element; }; diff --git a/plugins/search/src/components/SidebarSearch/SidebarSearch.tsx b/plugins/search/src/components/SidebarSearch/SidebarSearch.tsx index b422c33e02..c313d22801 100644 --- a/plugins/search/src/components/SidebarSearch/SidebarSearch.tsx +++ b/plugins/search/src/components/SidebarSearch/SidebarSearch.tsx @@ -13,12 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { SidebarSearchField, useRouteRef } from '@backstage/core'; import qs from 'qs'; import React, { useCallback } from 'react'; import { useNavigate } from 'react-router-dom'; import { rootRouteRef } from '../../plugin'; +import { SidebarSearchField } from '@backstage/core-components'; +import { useRouteRef } from '@backstage/core-plugin-api'; + export const SidebarSearch = () => { const searchRoute = useRouteRef(rootRouteRef); const navigate = useNavigate(); diff --git a/plugins/search/src/plugin.ts b/plugins/search/src/plugin.ts index a0f2103c5f..7aeb83c696 100644 --- a/plugins/search/src/plugin.ts +++ b/plugins/search/src/plugin.ts @@ -13,6 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +import { SearchClient, searchApiRef } from './apis'; import { createApiFactory, createPlugin, @@ -21,8 +23,7 @@ import { discoveryApiRef, createComponentExtension, identityApiRef, -} from '@backstage/core'; -import { SearchClient, searchApiRef } from './apis'; +} from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ path: '/search', diff --git a/plugins/sentry/dev/index.tsx b/plugins/sentry/dev/index.tsx index 87e03605e4..5965a862cc 100644 --- a/plugins/sentry/dev/index.tsx +++ b/plugins/sentry/dev/index.tsx @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { Content, Header, Page } from '@backstage/core'; import { createDevApp, EntityGridItem } from '@backstage/dev-utils'; import { EntityProvider } from '@backstage/plugin-catalog-react'; import { Grid } from '@material-ui/core'; @@ -28,6 +27,7 @@ import { sentryApiRef, } from '../src'; import { SENTRY_PROJECT_SLUG_ANNOTATION } from '../src/components/useProjectSlug'; +import { Content, Header, Page } from '@backstage/core-components'; const entity = (name?: string) => ({ diff --git a/plugins/sentry/src/api/production-api.ts b/plugins/sentry/src/api/production-api.ts index bf6fa98bce..98488ab7c7 100644 --- a/plugins/sentry/src/api/production-api.ts +++ b/plugins/sentry/src/api/production-api.ts @@ -16,7 +16,7 @@ import { SentryIssue } from './sentry-issue'; import { SentryApi } from './sentry-api'; -import { DiscoveryApi } from '@backstage/core'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; export class ProductionSentryApi implements SentryApi { constructor( diff --git a/plugins/sentry/src/api/sentry-api.ts b/plugins/sentry/src/api/sentry-api.ts index 1edb550ec4..1989c64c1d 100644 --- a/plugins/sentry/src/api/sentry-api.ts +++ b/plugins/sentry/src/api/sentry-api.ts @@ -15,7 +15,7 @@ */ import { SentryIssue } from './sentry-issue'; -import { createApiRef } from '@backstage/core'; +import { createApiRef } from '@backstage/core-plugin-api'; export const sentryApiRef = createApiRef({ id: 'plugin.sentry.service', diff --git a/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx b/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx index ea040f4130..d523a2d87b 100644 --- a/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx +++ b/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx @@ -15,11 +15,11 @@ */ import React from 'react'; -import { Table, TableColumn } from '@backstage/core'; import { SentryIssue } from '../../api'; import { DateTime } from 'luxon'; import { ErrorCell } from '../ErrorCell/ErrorCell'; import { ErrorGraph } from '../ErrorGraph/ErrorGraph'; +import { Table, TableColumn } from '@backstage/core-components'; const columns: TableColumn[] = [ { diff --git a/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx b/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx index b1ba8c7cc2..91a34e06cd 100644 --- a/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx +++ b/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx @@ -15,16 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { - EmptyState, - ErrorApi, - errorApiRef, - InfoCard, - InfoCardVariants, - MissingAnnotationEmptyState, - Progress, - useApi, -} from '@backstage/core'; import React, { useEffect } from 'react'; import { useAsync } from 'react-use'; import { sentryApiRef } from '../../api'; @@ -34,6 +24,16 @@ import { useProjectSlug, } from '../useProjectSlug'; +import { + EmptyState, + InfoCard, + InfoCardVariants, + MissingAnnotationEmptyState, + Progress, +} from '@backstage/core-components'; + +import { ErrorApi, errorApiRef, useApi } from '@backstage/core-plugin-api'; + export const SentryIssuesWidget = ({ entity, statsFor = '24h', diff --git a/plugins/sentry/src/extensions.tsx b/plugins/sentry/src/extensions.tsx index 9a16a6a7da..61ef883082 100644 --- a/plugins/sentry/src/extensions.tsx +++ b/plugins/sentry/src/extensions.tsx @@ -14,13 +14,13 @@ * limitations under the License. */ -import { - createComponentExtension, - createRoutableExtension, -} from '@backstage/core'; import { useEntity } from '@backstage/plugin-catalog-react'; import React from 'react'; import { sentryPlugin, rootRouteRef } from './plugin'; +import { + createComponentExtension, + createRoutableExtension, +} from '@backstage/core-plugin-api'; export const EntitySentryContent = sentryPlugin.provide( createRoutableExtension({ diff --git a/plugins/sentry/src/plugin.ts b/plugins/sentry/src/plugin.ts index 4c2a00de59..abb3e20482 100644 --- a/plugins/sentry/src/plugin.ts +++ b/plugins/sentry/src/plugin.ts @@ -14,14 +14,14 @@ * limitations under the License. */ +import { ProductionSentryApi, sentryApiRef } from './api'; import { configApiRef, createApiFactory, createPlugin, createRouteRef, discoveryApiRef, -} from '@backstage/core'; -import { ProductionSentryApi, sentryApiRef } from './api'; +} from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ path: '/sentry', diff --git a/plugins/shortcuts/src/AddShortcut.test.tsx b/plugins/shortcuts/src/AddShortcut.test.tsx index 8001cdc293..b42b5a9747 100644 --- a/plugins/shortcuts/src/AddShortcut.test.tsx +++ b/plugins/shortcuts/src/AddShortcut.test.tsx @@ -19,7 +19,7 @@ import { screen, fireEvent, waitFor } from '@testing-library/react'; import { AddShortcut } from './AddShortcut'; import { LocalStoredShortcuts } from './api'; import { MockStorageApi, renderInTestApp } from '@backstage/test-utils'; -import { AlertDisplay } from '@backstage/core'; +import { AlertDisplay } from '@backstage/core-components'; describe('AddShortcut', () => { const api = new LocalStoredShortcuts(MockStorageApi.create()); diff --git a/plugins/shortcuts/src/AddShortcut.tsx b/plugins/shortcuts/src/AddShortcut.tsx index 74a0653b4c..5175ddd64d 100644 --- a/plugins/shortcuts/src/AddShortcut.tsx +++ b/plugins/shortcuts/src/AddShortcut.tsx @@ -17,7 +17,6 @@ import React, { useState } from 'react'; import { useLocation } from 'react-router'; import { SubmitHandler } from 'react-hook-form'; -import { alertApiRef, useApi } from '@backstage/core'; import { Button, Card, @@ -28,6 +27,7 @@ import { import { ShortcutForm } from './ShortcutForm'; import { FormValues, Shortcut } from './types'; import { ShortcutApi } from './api'; +import { alertApiRef, useApi } from '@backstage/core-plugin-api'; const useStyles = makeStyles(theme => ({ card: { diff --git a/plugins/shortcuts/src/EditShortcut.test.tsx b/plugins/shortcuts/src/EditShortcut.test.tsx index eaab6cf609..e962f100cb 100644 --- a/plugins/shortcuts/src/EditShortcut.test.tsx +++ b/plugins/shortcuts/src/EditShortcut.test.tsx @@ -20,7 +20,7 @@ import { EditShortcut } from './EditShortcut'; import { Shortcut } from './types'; import { LocalStoredShortcuts } from './api'; import { MockStorageApi, renderInTestApp } from '@backstage/test-utils'; -import { AlertDisplay } from '@backstage/core'; +import { AlertDisplay } from '@backstage/core-components'; describe('EditShortcut', () => { const shortcut: Shortcut = { diff --git a/plugins/shortcuts/src/EditShortcut.tsx b/plugins/shortcuts/src/EditShortcut.tsx index efe8726992..b8a20b85c3 100644 --- a/plugins/shortcuts/src/EditShortcut.tsx +++ b/plugins/shortcuts/src/EditShortcut.tsx @@ -16,7 +16,6 @@ import React from 'react'; import { SubmitHandler } from 'react-hook-form'; -import { alertApiRef, useApi } from '@backstage/core'; import { Button, Card, @@ -28,6 +27,7 @@ import { ShortcutForm } from './ShortcutForm'; import { FormValues, Shortcut } from './types'; import DeleteIcon from '@material-ui/icons/Delete'; import { ShortcutApi } from './api'; +import { alertApiRef, useApi } from '@backstage/core-plugin-api'; const useStyles = makeStyles(theme => ({ card: { diff --git a/plugins/shortcuts/src/ShortcutItem.test.tsx b/plugins/shortcuts/src/ShortcutItem.test.tsx index 080f847952..e8063f384b 100644 --- a/plugins/shortcuts/src/ShortcutItem.test.tsx +++ b/plugins/shortcuts/src/ShortcutItem.test.tsx @@ -18,7 +18,6 @@ import React from 'react'; import { screen, waitFor } from '@testing-library/react'; import { ShortcutItem } from './ShortcutItem'; import { Shortcut } from './types'; -import { SidebarContext } from '@backstage/core'; import { LocalStoredShortcuts } from './api'; import { MockStorageApi, @@ -26,6 +25,7 @@ import { wrapInTestApp, } from '@backstage/test-utils'; import { pageTheme } from '@backstage/theme'; +import { SidebarContext } from '@backstage/core-components'; describe('ShortcutItem', () => { const shortcut: Shortcut = { diff --git a/plugins/shortcuts/src/ShortcutItem.tsx b/plugins/shortcuts/src/ShortcutItem.tsx index f9868182f0..ab5a60a494 100644 --- a/plugins/shortcuts/src/ShortcutItem.tsx +++ b/plugins/shortcuts/src/ShortcutItem.tsx @@ -15,13 +15,13 @@ */ import React from 'react'; -import { SidebarItem } from '@backstage/core'; import { IconButton, makeStyles } from '@material-ui/core'; import EditIcon from '@material-ui/icons/Edit'; import { ShortcutIcon } from './ShortcutIcon'; import { EditShortcut } from './EditShortcut'; import { ShortcutApi } from './api'; import { Shortcut } from './types'; +import { SidebarItem } from '@backstage/core-components'; const useStyles = makeStyles({ root: { diff --git a/plugins/shortcuts/src/Shortcuts.test.tsx b/plugins/shortcuts/src/Shortcuts.test.tsx index b697f9ed27..0383bba8d2 100644 --- a/plugins/shortcuts/src/Shortcuts.test.tsx +++ b/plugins/shortcuts/src/Shortcuts.test.tsx @@ -15,12 +15,14 @@ */ import React from 'react'; -import { SidebarContext, ApiProvider, ApiRegistry } from '@backstage/core'; import { MockStorageApi, renderInTestApp } from '@backstage/test-utils'; import { screen, waitFor } from '@testing-library/react'; import { Shortcuts } from './Shortcuts'; import { LocalStoredShortcuts, shortcutsApiRef } from './api'; +import { SidebarContext } from '@backstage/core-components'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; + const apis = ApiRegistry.from([ [shortcutsApiRef, new LocalStoredShortcuts(MockStorageApi.create())], ]); diff --git a/plugins/shortcuts/src/Shortcuts.tsx b/plugins/shortcuts/src/Shortcuts.tsx index 2e94497380..daa80d190d 100644 --- a/plugins/shortcuts/src/Shortcuts.tsx +++ b/plugins/shortcuts/src/Shortcuts.tsx @@ -16,13 +16,15 @@ import React, { useMemo } from 'react'; import { useObservable } from 'react-use'; -import { Progress, SidebarItem, useApi } from '@backstage/core'; import { makeStyles } from '@material-ui/core'; import PlayListAddIcon from '@material-ui/icons/PlaylistAdd'; import { ShortcutItem } from './ShortcutItem'; import { AddShortcut } from './AddShortcut'; import { shortcutsApiRef } from './api'; +import { Progress, SidebarItem } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + const useStyles = makeStyles({ root: { flex: '1 1 auto', diff --git a/plugins/shortcuts/src/api/LocalStoredShortcuts.ts b/plugins/shortcuts/src/api/LocalStoredShortcuts.ts index ee8735edb4..17e4b020a2 100644 --- a/plugins/shortcuts/src/api/LocalStoredShortcuts.ts +++ b/plugins/shortcuts/src/api/LocalStoredShortcuts.ts @@ -14,12 +14,12 @@ * limitations under the License. */ -import { StorageApi } from '@backstage/core'; import { pageTheme } from '@backstage/theme'; import ObservableImpl from 'zen-observable'; import { v4 as uuid } from 'uuid'; import { ShortcutApi } from './ShortcutApi'; import { Shortcut } from '../types'; +import { StorageApi } from '@backstage/core-plugin-api'; /** * Implementation of the ShortcutApi that uses the StorageApi to store shortcuts. diff --git a/plugins/shortcuts/src/api/ShortcutApi.ts b/plugins/shortcuts/src/api/ShortcutApi.ts index 74b6aaf777..361468679c 100644 --- a/plugins/shortcuts/src/api/ShortcutApi.ts +++ b/plugins/shortcuts/src/api/ShortcutApi.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { createApiRef, Observable } from '@backstage/core'; import { Shortcut } from '../types'; +import { createApiRef, Observable } from '@backstage/core-plugin-api'; export const shortcutsApiRef = createApiRef({ id: 'plugin.shortcuts.api', diff --git a/plugins/shortcuts/src/plugin.ts b/plugins/shortcuts/src/plugin.ts index e2cd819fc6..681f8537c7 100644 --- a/plugins/shortcuts/src/plugin.ts +++ b/plugins/shortcuts/src/plugin.ts @@ -14,13 +14,13 @@ * limitations under the License. */ +import { LocalStoredShortcuts, shortcutsApiRef } from './api'; import { createApiFactory, createComponentExtension, createPlugin, storageApiRef, -} from '@backstage/core'; -import { LocalStoredShortcuts, shortcutsApiRef } from './api'; +} from '@backstage/core-plugin-api'; export const shortcutsPlugin = createPlugin({ id: 'shortcuts', diff --git a/plugins/sonarqube/dev/index.tsx b/plugins/sonarqube/dev/index.tsx index 2dd9236547..0e0f804dc9 100644 --- a/plugins/sonarqube/dev/index.tsx +++ b/plugins/sonarqube/dev/index.tsx @@ -15,13 +15,13 @@ */ import { Entity } from '@backstage/catalog-model'; -import { Content, Header, Page } from '@backstage/core'; import { createDevApp, EntityGridItem } from '@backstage/dev-utils'; import { Grid } from '@material-ui/core'; import React from 'react'; import { EntitySonarQubeCard, sonarQubePlugin } from '../src'; import { FindingSummary, SonarQubeApi, sonarQubeApiRef } from '../src/api'; import { SONARQUBE_PROJECT_KEY_ANNOTATION } from '../src/components/useProjectKey'; +import { Content, Header, Page } from '@backstage/core-components'; const entity = (name?: string) => ({ diff --git a/plugins/sonarqube/src/api/SonarQubeApi.ts b/plugins/sonarqube/src/api/SonarQubeApi.ts index 0715d1fd02..ca3b80f3ac 100644 --- a/plugins/sonarqube/src/api/SonarQubeApi.ts +++ b/plugins/sonarqube/src/api/SonarQubeApi.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { createApiRef } from '@backstage/core'; import { MetricKey, SonarUrlProcessorFunc } from './types'; +import { createApiRef } from '@backstage/core-plugin-api'; /** * Define a type to make sure that all metrics are used diff --git a/plugins/sonarqube/src/api/SonarQubeClient.test.ts b/plugins/sonarqube/src/api/SonarQubeClient.test.ts index 74df48a9e8..6fc0aac233 100644 --- a/plugins/sonarqube/src/api/SonarQubeClient.test.ts +++ b/plugins/sonarqube/src/api/SonarQubeClient.test.ts @@ -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 { FindingSummary, SonarQubeClient } from './index'; import { ComponentWrapper, MeasuresWrapper } from './types'; +import { UrlPatternDiscovery } from '@backstage/core-app-api'; const server = setupServer(); diff --git a/plugins/sonarqube/src/api/SonarQubeClient.ts b/plugins/sonarqube/src/api/SonarQubeClient.ts index 10b9def200..e2a009f7ce 100644 --- a/plugins/sonarqube/src/api/SonarQubeClient.ts +++ b/plugins/sonarqube/src/api/SonarQubeClient.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import { DiscoveryApi } from '@backstage/core'; import fetch from 'cross-fetch'; import { FindingSummary, Metrics, SonarQubeApi } from './SonarQubeApi'; import { ComponentWrapper, MeasuresWrapper } from './types'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; export class SonarQubeClient implements SonarQubeApi { discoveryApi: DiscoveryApi; diff --git a/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx b/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx index 14b8ae1af6..fab8352bb2 100644 --- a/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx +++ b/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx @@ -15,14 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { - EmptyState, - InfoCard, - InfoCardVariants, - MissingAnnotationEmptyState, - Progress, - useApi, -} from '@backstage/core'; import { useEntity } from '@backstage/plugin-catalog-react'; import { Chip, Grid } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; @@ -42,6 +34,16 @@ import { Rating } from './Rating'; import { RatingCard } from './RatingCard'; import { Value } from './Value'; +import { + EmptyState, + InfoCard, + InfoCardVariants, + MissingAnnotationEmptyState, + Progress, +} from '@backstage/core-components'; + +import { useApi } from '@backstage/core-plugin-api'; + const useStyles = makeStyles(theme => ({ badgeLabel: { color: theme.palette.common.white, diff --git a/plugins/sonarqube/src/plugin.ts b/plugins/sonarqube/src/plugin.ts index 3f58b24abf..4b1c86771a 100644 --- a/plugins/sonarqube/src/plugin.ts +++ b/plugins/sonarqube/src/plugin.ts @@ -14,14 +14,14 @@ * limitations under the License. */ +import { sonarQubeApiRef, SonarQubeClient } from './api'; import { configApiRef, createApiFactory, createComponentExtension, createPlugin, discoveryApiRef, -} from '@backstage/core'; -import { sonarQubeApiRef, SonarQubeClient } from './api'; +} from '@backstage/core-plugin-api'; export const sonarQubePlugin = createPlugin({ id: 'sonarqube', diff --git a/plugins/splunk-on-call/src/api/client.ts b/plugins/splunk-on-call/src/api/client.ts index 045ea04d63..f138694f50 100644 --- a/plugins/splunk-on-call/src/api/client.ts +++ b/plugins/splunk-on-call/src/api/client.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -import { createApiRef, DiscoveryApi, ConfigApi } from '@backstage/core'; import { Incident, OnCall, @@ -32,6 +31,11 @@ import { ListUserResponse, EscalationPolicyResponse, } from './types'; +import { + createApiRef, + DiscoveryApi, + ConfigApi, +} from '@backstage/core-plugin-api'; export class UnauthorizedError extends Error {} diff --git a/plugins/splunk-on-call/src/api/types.ts b/plugins/splunk-on-call/src/api/types.ts index b42ab6a287..df48dc23c6 100644 --- a/plugins/splunk-on-call/src/api/types.ts +++ b/plugins/splunk-on-call/src/api/types.ts @@ -21,7 +21,7 @@ import { Team, User, } from '../components/types'; -import { DiscoveryApi } from '@backstage/core'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; export type MessageType = | 'CRITICAL' diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx index 838d9e4e4b..aa46a06063 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx @@ -16,15 +16,6 @@ import React from 'react'; import { act, fireEvent, render, waitFor } from '@testing-library/react'; import { Entity } from '@backstage/catalog-model'; -import { - alertApiRef, - ApiProvider, - ApiRegistry, - ConfigApi, - configApiRef, - ConfigReader, - createApiRef, -} from '@backstage/core'; import { EntityContext } from '@backstage/plugin-catalog-react'; import { wrapInTestApp } from '@backstage/test-utils'; import { @@ -42,6 +33,18 @@ import { } from '../api/mocks'; import { EntitySplunkOnCallCard } from './EntitySplunkOnCallCard'; +import { + alertApiRef, + ConfigApi, + configApiRef, + createApiRef, +} from '@backstage/core-plugin-api'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; + const mockSplunkOnCallApi: Partial = { getUsers: async () => [], getIncidents: async () => [MOCK_INCIDENT], diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 43907b5186..8f4ef67336 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -15,15 +15,6 @@ */ import React, { useCallback, useState } from 'react'; import { useAsync } from 'react-use'; -import { - configApiRef, - EmptyState, - HeaderIconLinkRow, - IconLinkVerticalProps, - MissingAnnotationEmptyState, - Progress, - useApi, -} from '@backstage/core'; import { Entity } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; import { @@ -43,6 +34,16 @@ import { Incidents } from './Incident'; import { TriggerDialog } from './TriggerDialog'; import { User } from './types'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; + +import { + EmptyState, + HeaderIconLinkRow, + IconLinkVerticalProps, + MissingAnnotationEmptyState, + Progress, +} from '@backstage/core-components'; + export const SPLUNK_ON_CALL_TEAM = 'splunk.com/on-call-team'; export const MissingTeamAnnotation = () => ( diff --git a/plugins/splunk-on-call/src/components/Errors/MissingApiKeyOrApiIdError.tsx b/plugins/splunk-on-call/src/components/Errors/MissingApiKeyOrApiIdError.tsx index ea72b6ca51..5bfe3a18d0 100644 --- a/plugins/splunk-on-call/src/components/Errors/MissingApiKeyOrApiIdError.tsx +++ b/plugins/splunk-on-call/src/components/Errors/MissingApiKeyOrApiIdError.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ import React from 'react'; -import { EmptyState } from '@backstage/core'; import { Button } from '@material-ui/core'; +import { EmptyState } from '@backstage/core-components'; export const MissingApiKeyOrApiIdError = () => ( [], diff --git a/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx b/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx index fb7061437f..8c9409aaab 100644 --- a/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx +++ b/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx @@ -26,10 +26,12 @@ import { EscalationUsersEmptyState } from './EscalationUsersEmptyState'; import { EscalationUser } from './EscalationUser'; import { useAsync } from 'react-use'; import { splunkOnCallApiRef } from '../../api'; -import { useApi, Progress } from '@backstage/core'; import { Alert } from '@material-ui/lab'; import { User } from '../types'; +import { useApi } from '@backstage/core-plugin-api'; +import { Progress } from '@backstage/core-components'; + const useStyles = makeStyles((theme: Theme) => createStyles({ root: { diff --git a/plugins/splunk-on-call/src/components/Escalation/EscalationUsersEmptyState.tsx b/plugins/splunk-on-call/src/components/Escalation/EscalationUsersEmptyState.tsx index d587011601..eca67d2019 100644 --- a/plugins/splunk-on-call/src/components/Escalation/EscalationUsersEmptyState.tsx +++ b/plugins/splunk-on-call/src/components/Escalation/EscalationUsersEmptyState.tsx @@ -21,7 +21,7 @@ import { ListItemText, makeStyles, } from '@material-ui/core'; -import { StatusWarning } from '@backstage/core'; +import { StatusWarning } from '@backstage/core-components'; const useStyles = makeStyles({ denseListIcon: { diff --git a/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx b/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx index 7bd8081226..27b0044ea9 100644 --- a/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx +++ b/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx @@ -27,13 +27,6 @@ import { } from '@material-ui/core'; import DoneIcon from '@material-ui/icons/Done'; import DoneAllIcon from '@material-ui/icons/DoneAll'; -import { - StatusError, - StatusWarning, - StatusOK, - useApi, - alertApiRef, -} from '@backstage/core'; import { DateTime, Duration } from 'luxon'; import { Incident, IncidentPhase } from '../types'; import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser'; @@ -41,6 +34,13 @@ import { splunkOnCallApiRef } from '../../api/client'; import { useAsyncFn } from 'react-use'; import { TriggerAlarmRequest } from '../../api/types'; +import { + StatusError, + StatusWarning, + StatusOK, +} from '@backstage/core-components'; +import { useApi, alertApiRef } from '@backstage/core-plugin-api'; + const useStyles = makeStyles({ denseListIcon: { marginRight: 0, diff --git a/plugins/splunk-on-call/src/components/Incident/Incidents.test.tsx b/plugins/splunk-on-call/src/components/Incident/Incidents.test.tsx index d0171df985..f6ac30081b 100644 --- a/plugins/splunk-on-call/src/components/Incident/Incidents.test.tsx +++ b/plugins/splunk-on-call/src/components/Incident/Incidents.test.tsx @@ -17,16 +17,16 @@ import React from 'react'; import { render, waitFor } from '@testing-library/react'; import { Incidents } from './Incidents'; import { wrapInTestApp } from '@backstage/test-utils'; +import { splunkOnCallApiRef } from '../../api'; +import { MOCK_TEAM, MOCK_INCIDENT } from '../../api/mocks'; + import { alertApiRef, - ApiProvider, - ApiRegistry, createApiRef, IdentityApi, identityApiRef, -} from '@backstage/core'; -import { splunkOnCallApiRef } from '../../api'; -import { MOCK_TEAM, MOCK_INCIDENT } from '../../api/mocks'; +} from '@backstage/core-plugin-api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; const mockIdentityApi: Partial = { getUserId: () => 'test', diff --git a/plugins/splunk-on-call/src/components/Incident/Incidents.tsx b/plugins/splunk-on-call/src/components/Incident/Incidents.tsx index e705152d73..c0c516b14b 100644 --- a/plugins/splunk-on-call/src/components/Incident/Incidents.tsx +++ b/plugins/splunk-on-call/src/components/Incident/Incidents.tsx @@ -26,9 +26,11 @@ import { IncidentListItem } from './IncidentListItem'; import { IncidentsEmptyState } from './IncidentEmptyState'; import { useAsyncFn } from 'react-use'; import { splunkOnCallApiRef } from '../../api'; -import { useApi, Progress } from '@backstage/core'; import { Alert } from '@material-ui/lab'; +import { useApi } from '@backstage/core-plugin-api'; +import { Progress } from '@backstage/core-components'; + const useStyles = makeStyles((theme: Theme) => createStyles({ root: { diff --git a/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx b/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx index 40695a87e9..5bfb0a7044 100644 --- a/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx +++ b/plugins/splunk-on-call/src/components/SplunkOnCallPage.tsx @@ -16,14 +16,14 @@ import React from 'react'; import { Grid, makeStyles } from '@material-ui/core'; +import { EntitySplunkOnCallCard } from './EntitySplunkOnCallCard'; import { Content, ContentHeader, Page, Header, SupportButton, -} from '@backstage/core'; -import { EntitySplunkOnCallCard } from './EntitySplunkOnCallCard'; +} from '@backstage/core-components'; const useStyles = makeStyles(() => ({ overflowXScroll: { diff --git a/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.test.tsx b/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.test.tsx index c85821d3f6..70c66b253f 100644 --- a/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.test.tsx +++ b/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.test.tsx @@ -16,15 +16,12 @@ import React from 'react'; import { render, fireEvent, act } from '@testing-library/react'; import { wrapInTestApp } from '@backstage/test-utils'; -import { - ApiRegistry, - alertApiRef, - createApiRef, - ApiProvider, -} from '@backstage/core'; import { splunkOnCallApiRef } from '../../api'; import { TriggerDialog } from './TriggerDialog'; +import { ApiRegistry, ApiProvider } from '@backstage/core-app-api'; +import { alertApiRef, createApiRef } from '@backstage/core-plugin-api'; + describe('TriggerDialog', () => { const mockTriggerAlarmFn = jest.fn(); const mockSplunkOnCallApi = { diff --git a/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx b/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx index 2872c80ba0..a1cdb651cb 100644 --- a/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx +++ b/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx @@ -32,11 +32,11 @@ import { FormControl, InputLabel, } from '@material-ui/core'; -import { useApi, alertApiRef } from '@backstage/core'; import { useAsyncFn } from 'react-use'; import { splunkOnCallApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; import { TriggerAlarmRequest } from '../../api/types'; +import { useApi, alertApiRef } from '@backstage/core-plugin-api'; type Props = { team: string; diff --git a/plugins/splunk-on-call/src/plugin.ts b/plugins/splunk-on-call/src/plugin.ts index cae413eda9..155827c737 100644 --- a/plugins/splunk-on-call/src/plugin.ts +++ b/plugins/splunk-on-call/src/plugin.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { splunkOnCallApiRef, SplunkOnCallClient } from './api'; import { createApiFactory, createPlugin, @@ -21,8 +22,7 @@ import { configApiRef, createRoutableExtension, createComponentExtension, -} from '@backstage/core'; -import { splunkOnCallApiRef, SplunkOnCallClient } from './api'; +} from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ title: 'splunk-on-call', diff --git a/plugins/tech-radar/src/api.ts b/plugins/tech-radar/src/api.ts index 6f2a1a5cb1..52ddf5b301 100644 --- a/plugins/tech-radar/src/api.ts +++ b/plugins/tech-radar/src/api.ts @@ -15,7 +15,7 @@ */ import { MovedState } from './utils/types'; -import { createApiRef } from '@backstage/core'; +import { createApiRef } from '@backstage/core-plugin-api'; export const techRadarApiRef = createApiRef({ id: 'plugin.techradar.service', diff --git a/plugins/tech-radar/src/components/RadarComponent.test.tsx b/plugins/tech-radar/src/components/RadarComponent.test.tsx index 4b740597b5..2d8fef47c8 100644 --- a/plugins/tech-radar/src/components/RadarComponent.test.tsx +++ b/plugins/tech-radar/src/components/RadarComponent.test.tsx @@ -18,7 +18,6 @@ import React from 'react'; import { render, waitForElement } from '@testing-library/react'; import { ThemeProvider } from '@material-ui/core'; import { lightTheme } from '@backstage/theme'; -import { ApiRegistry, ApiProvider, errorApiRef } from '@backstage/core'; import { act } from 'react-dom/test-utils'; import { withLogCollector } from '@backstage/test-utils'; @@ -26,6 +25,9 @@ import GetBBoxPolyfill from '../utils/polyfills/getBBox'; import RadarComponent from './RadarComponent'; import { TechRadarLoaderResponse, techRadarApiRef, TechRadarApi } from '../api'; +import { ApiRegistry, ApiProvider } from '@backstage/core-app-api'; +import { errorApiRef } from '@backstage/core-plugin-api'; + describe('RadarComponent', () => { beforeAll(() => { GetBBoxPolyfill.create(0, 0, 1000, 500); diff --git a/plugins/tech-radar/src/components/RadarComponent.tsx b/plugins/tech-radar/src/components/RadarComponent.tsx index 39746e48fe..a5e569f8ed 100644 --- a/plugins/tech-radar/src/components/RadarComponent.tsx +++ b/plugins/tech-radar/src/components/RadarComponent.tsx @@ -15,7 +15,6 @@ */ import React, { useEffect } from 'react'; -import { Progress, useApi, errorApiRef } from '@backstage/core'; import { useAsync } from 'react-use'; import Radar from '../components/Radar'; import { @@ -25,6 +24,9 @@ import { } from '../api'; import { Entry } from '../utils/types'; +import { Progress } from '@backstage/core-components'; +import { useApi, errorApiRef } from '@backstage/core-plugin-api'; + const useTechRadarLoader = () => { const errorApi = useApi(errorApiRef); const techRadarApi = useApi(techRadarApiRef); diff --git a/plugins/tech-radar/src/components/RadarDescription/RadarDescription.tsx b/plugins/tech-radar/src/components/RadarDescription/RadarDescription.tsx index 3ac4f153be..07ac165b10 100644 --- a/plugins/tech-radar/src/components/RadarDescription/RadarDescription.tsx +++ b/plugins/tech-radar/src/components/RadarDescription/RadarDescription.tsx @@ -19,7 +19,7 @@ import Dialog from '@material-ui/core/Dialog'; import DialogTitle from '@material-ui/core/DialogTitle'; import { Button, DialogActions, DialogContent } from '@material-ui/core'; import LinkIcon from '@material-ui/icons/Link'; -import { MarkdownContent } from '@backstage/core'; +import { MarkdownContent } from '@backstage/core-components'; export type Props = { open: boolean; diff --git a/plugins/tech-radar/src/components/RadarPage.test.tsx b/plugins/tech-radar/src/components/RadarPage.test.tsx index b5169fadd9..bc22ca0866 100644 --- a/plugins/tech-radar/src/components/RadarPage.test.tsx +++ b/plugins/tech-radar/src/components/RadarPage.test.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core'; import { MockErrorApi, renderInTestApp, @@ -29,6 +28,9 @@ import GetBBoxPolyfill from '../utils/polyfills/getBBox'; import { RadarPage } from './RadarPage'; import { TechRadarLoaderResponse, techRadarApiRef, TechRadarApi } from '../api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { errorApiRef } from '@backstage/core-plugin-api'; + describe('RadarPage', () => { beforeAll(() => { GetBBoxPolyfill.create(0, 0, 1000, 500); diff --git a/plugins/tech-radar/src/components/RadarPage.tsx b/plugins/tech-radar/src/components/RadarPage.tsx index 992266a77b..e30625d1c4 100644 --- a/plugins/tech-radar/src/components/RadarPage.tsx +++ b/plugins/tech-radar/src/components/RadarPage.tsx @@ -16,15 +16,15 @@ import React from 'react'; import { Grid, makeStyles } from '@material-ui/core'; +import RadarComponent from '../components/RadarComponent'; +import { TechRadarComponentProps } from '../api'; import { Content, ContentHeader, Page, Header, SupportButton, -} from '@backstage/core'; -import RadarComponent from '../components/RadarComponent'; -import { TechRadarComponentProps } from '../api'; +} from '@backstage/core-components'; const useStyles = makeStyles(() => ({ overflowXScroll: { diff --git a/plugins/tech-radar/src/plugin.ts b/plugins/tech-radar/src/plugin.ts index e128600094..1a5c7a0f0d 100644 --- a/plugins/tech-radar/src/plugin.ts +++ b/plugins/tech-radar/src/plugin.ts @@ -14,15 +14,15 @@ * limitations under the License. */ +import { techRadarApiRef } from './api'; + +import { SampleTechRadarApi } from './sample'; import { createPlugin, createRouteRef, createRoutableExtension, createApiFactory, -} from '@backstage/core'; - -import { techRadarApiRef } from './api'; -import { SampleTechRadarApi } from './sample'; +} from '@backstage/core-plugin-api'; const rootRouteRef = createRouteRef({ title: 'Tech Radar', diff --git a/plugins/techdocs/dev/index.tsx b/plugins/techdocs/dev/index.tsx index a778161b35..7d98172c5e 100644 --- a/plugins/techdocs/dev/index.tsx +++ b/plugins/techdocs/dev/index.tsx @@ -14,14 +14,6 @@ * limitations under the License. */ -import { - configApiRef, - discoveryApiRef, - Header, - identityApiRef, - Page, - TabbedLayout, -} from '@backstage/core'; import { createDevApp } from '@backstage/dev-utils'; import { NotFoundError } from '@backstage/errors'; import React from 'react'; @@ -32,6 +24,13 @@ import { techdocsStorageApiRef, } from '../src'; +import { + configApiRef, + discoveryApiRef, + identityApiRef, +} from '@backstage/core-plugin-api'; +import { Header, Page, TabbedLayout } from '@backstage/core-components'; + // used so each route can provide it's own implementation in the constructor of the react component let apiHolder: TechDocsStorageApi | undefined = undefined; diff --git a/plugins/techdocs/src/Router.tsx b/plugins/techdocs/src/Router.tsx index f834af14dc..1cc30ecb06 100644 --- a/plugins/techdocs/src/Router.tsx +++ b/plugins/techdocs/src/Router.tsx @@ -18,7 +18,6 @@ import React from 'react'; import { Entity } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; import { Route, Routes } from 'react-router-dom'; -import { MissingAnnotationEmptyState } from '@backstage/core'; import { rootRouteRef, rootDocsRouteRef, @@ -27,6 +26,7 @@ import { import { TechDocsHome } from './home/components/TechDocsHome'; import { TechDocsPage } from './reader/components/TechDocsPage'; import { EntityPageDocs } from './EntityPageDocs'; +import { MissingAnnotationEmptyState } from '@backstage/core-components'; const TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref'; diff --git a/plugins/techdocs/src/api.ts b/plugins/techdocs/src/api.ts index b9c8725ce9..198079682e 100644 --- a/plugins/techdocs/src/api.ts +++ b/plugins/techdocs/src/api.ts @@ -15,8 +15,8 @@ */ import { EntityName } from '@backstage/catalog-model'; -import { createApiRef } from '@backstage/core'; import { TechDocsEntityMetadata, TechDocsMetadata } from './types'; +import { createApiRef } from '@backstage/core-plugin-api'; export const techdocsStorageApiRef = createApiRef({ id: 'plugin.techdocs.storageservice', diff --git a/plugins/techdocs/src/client.test.ts b/plugins/techdocs/src/client.test.ts index e8fc8f042f..a91e51bd41 100644 --- a/plugins/techdocs/src/client.test.ts +++ b/plugins/techdocs/src/client.test.ts @@ -14,8 +14,8 @@ * limitations under the License. */ import { Config } from '@backstage/config'; -import { UrlPatternDiscovery } from '@backstage/core'; import { TechDocsStorageClient } from './client'; +import { UrlPatternDiscovery } from '@backstage/core-app-api'; const mockEntity = { kind: 'Component', diff --git a/plugins/techdocs/src/client.ts b/plugins/techdocs/src/client.ts index 83cfc88d56..619d09d0ac 100644 --- a/plugins/techdocs/src/client.ts +++ b/plugins/techdocs/src/client.ts @@ -16,10 +16,10 @@ import { EntityName } from '@backstage/catalog-model'; import { Config } from '@backstage/config'; -import { DiscoveryApi, IdentityApi } from '@backstage/core'; import { NotFoundError } from '@backstage/errors'; import { SyncResult, TechDocsApi, TechDocsStorageApi } from './api'; import { TechDocsEntityMetadata, TechDocsMetadata } from './types'; +import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api'; /** * API to talk to techdocs-backend. diff --git a/plugins/techdocs/src/home/components/DocsCardGrid.tsx b/plugins/techdocs/src/home/components/DocsCardGrid.tsx index 3b561967e6..82dfee69a7 100644 --- a/plugins/techdocs/src/home/components/DocsCardGrid.tsx +++ b/plugins/techdocs/src/home/components/DocsCardGrid.tsx @@ -18,11 +18,15 @@ import React from 'react'; import { generatePath } from 'react-router-dom'; import { Entity } from '@backstage/catalog-model'; -import { Button, ItemCardGrid, ItemCardHeader } from '@backstage/core'; import { Card, CardActions, CardContent, CardMedia } from '@material-ui/core'; - import { rootDocsRouteRef } from '../../routes'; +import { + Button, + ItemCardGrid, + ItemCardHeader, +} from '@backstage/core-components'; + export const DocsCardGrid = ({ entities, }: { diff --git a/plugins/techdocs/src/home/components/DocsTable.tsx b/plugins/techdocs/src/home/components/DocsTable.tsx index e964a9cf00..37df35d42c 100644 --- a/plugins/techdocs/src/home/components/DocsTable.tsx +++ b/plugins/techdocs/src/home/components/DocsTable.tsx @@ -20,9 +20,15 @@ import { generatePath } from 'react-router-dom'; import { IconButton, Tooltip } from '@material-ui/core'; import ShareIcon from '@material-ui/icons/Share'; -import { Table, EmptyState, Button, SubvalueCell, Link } from '@backstage/core'; import { Entity } from '@backstage/catalog-model'; import { rootDocsRouteRef } from '../../routes'; +import { + Table, + EmptyState, + Button, + SubvalueCell, + Link, +} from '@backstage/core-components'; export const DocsTable = ({ entities, diff --git a/plugins/techdocs/src/home/components/TechDocsCustomHome.test.tsx b/plugins/techdocs/src/home/components/TechDocsCustomHome.test.tsx index 1b9085349f..be0de2c273 100644 --- a/plugins/techdocs/src/home/components/TechDocsCustomHome.test.tsx +++ b/plugins/techdocs/src/home/components/TechDocsCustomHome.test.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { screen } from '@testing-library/react'; import React from 'react'; import { TechDocsCustomHome, PanelType } from './TechDocsCustomHome'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; jest.mock('@backstage/plugin-catalog-react', () => { const actual = jest.requireActual('@backstage/plugin-catalog-react'); diff --git a/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx b/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx index afe209f70c..043b6f8fde 100644 --- a/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx +++ b/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx @@ -25,22 +25,22 @@ import { useOwnUser, } from '@backstage/plugin-catalog-react'; import { Entity } from '@backstage/catalog-model'; +import { DocsTable } from './DocsTable'; +import { DocsCardGrid } from './DocsCardGrid'; + import { CodeSnippet, Content, - ConfigApi, - configApiRef, Header, HeaderTabs, Page, Progress, - useApi, WarningPanel, SupportButton, ContentHeader, -} from '@backstage/core'; -import { DocsTable } from './DocsTable'; -import { DocsCardGrid } from './DocsCardGrid'; +} from '@backstage/core-components'; + +import { ConfigApi, configApiRef, useApi } from '@backstage/core-plugin-api'; const panels = { DocsTable: DocsTable, diff --git a/plugins/techdocs/src/home/components/TechDocsHome.test.tsx b/plugins/techdocs/src/home/components/TechDocsHome.test.tsx index 8135c4d894..733a42335d 100644 --- a/plugins/techdocs/src/home/components/TechDocsHome.test.tsx +++ b/plugins/techdocs/src/home/components/TechDocsHome.test.tsx @@ -14,19 +14,19 @@ * limitations under the License. */ -import { - ApiProvider, - ApiRegistry, - ConfigApi, - configApiRef, - ConfigReader, -} from '@backstage/core'; import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import { screen } from '@testing-library/react'; import React from 'react'; import { TechDocsHome } from './TechDocsHome'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; +import { ConfigApi, configApiRef } from '@backstage/core-plugin-api'; + jest.mock('@backstage/plugin-catalog-react', () => { const actual = jest.requireActual('@backstage/plugin-catalog-react'); return { diff --git a/plugins/techdocs/src/plugin.ts b/plugins/techdocs/src/plugin.ts index f974fbe2de..74cdb8c8c4 100644 --- a/plugins/techdocs/src/plugin.ts +++ b/plugins/techdocs/src/plugin.ts @@ -14,6 +14,13 @@ * limitations under the License. */ +import { techdocsApiRef, techdocsStorageApiRef } from './api'; +import { TechDocsClient, TechDocsStorageClient } from './client'; +import { + rootDocsRouteRef, + rootRouteRef, + rootCatalogDocsRouteRef, +} from './routes'; import { configApiRef, createApiFactory, @@ -22,14 +29,7 @@ import { createRoutableExtension, discoveryApiRef, identityApiRef, -} from '@backstage/core'; -import { techdocsApiRef, techdocsStorageApiRef } from './api'; -import { TechDocsClient, TechDocsStorageClient } from './client'; -import { - rootDocsRouteRef, - rootRouteRef, - rootCatalogDocsRouteRef, -} from './routes'; +} from '@backstage/core-plugin-api'; export const techdocsPlugin = createPlugin({ id: 'techdocs', diff --git a/plugins/techdocs/src/reader/components/Reader.test.tsx b/plugins/techdocs/src/reader/components/Reader.test.tsx index fbdac95658..b4140df3c8 100644 --- a/plugins/techdocs/src/reader/components/Reader.test.tsx +++ b/plugins/techdocs/src/reader/components/Reader.test.tsx @@ -15,7 +15,6 @@ */ import { ConfigReader } from '@backstage/config'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { ScmIntegrationsApi, scmIntegrationsApiRef, @@ -25,6 +24,7 @@ import { act, render } from '@testing-library/react'; import React from 'react'; import { TechDocsStorageApi, techdocsStorageApiRef } from '../../api'; import { Reader } from './Reader'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; jest.mock('react-router-dom', () => { const actual = jest.requireActual('react-router-dom'); diff --git a/plugins/techdocs/src/reader/components/Reader.tsx b/plugins/techdocs/src/reader/components/Reader.tsx index 75dade20fa..4aed2a6904 100644 --- a/plugins/techdocs/src/reader/components/Reader.tsx +++ b/plugins/techdocs/src/reader/components/Reader.tsx @@ -15,7 +15,6 @@ */ import { EntityName } from '@backstage/catalog-model'; -import { useApi } from '@backstage/core'; import { scmIntegrationsApiRef } from '@backstage/integration-react'; import { BackstageTheme } from '@backstage/theme'; import { useTheme } from '@material-ui/core'; @@ -38,6 +37,7 @@ import { import { TechDocsNotFound } from './TechDocsNotFound'; import TechDocsProgressBar from './TechDocsProgressBar'; import { useReaderState } from './useReaderState'; +import { useApi } from '@backstage/core-plugin-api'; type Props = { entityId: EntityName; diff --git a/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx b/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx index cdacc1cb7e..610f8b8fdc 100644 --- a/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx @@ -15,7 +15,8 @@ */ import React from 'react'; -import { ErrorPage, useApi, configApiRef } from '@backstage/core'; +import { useApi, configApiRef } from '@backstage/core-plugin-api'; +import { ErrorPage } from '@backstage/core-components'; type Props = { errorMessage?: string; diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx index 5b638ff668..9458ede7c3 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx @@ -22,13 +22,13 @@ import { scmIntegrationsApiRef, } from '@backstage/integration-react'; import { wrapInTestApp } from '@backstage/test-utils'; -import { ApiRegistry, ApiProvider } from '@backstage/core'; import { techdocsApiRef, TechDocsApi, techdocsStorageApiRef, TechDocsStorageApi, } from '../../api'; +import { ApiRegistry, ApiProvider } from '@backstage/core-app-api'; jest.mock('react-router-dom', () => { const actual = jest.requireActual('react-router-dom'); diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.tsx index 338088be4d..2579c3c0b2 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPage.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPage.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { Content, Page, useApi } from '@backstage/core'; import React, { useCallback, useState } from 'react'; import { useParams } from 'react-router-dom'; import { useAsync } from 'react-use'; @@ -22,6 +21,9 @@ import { techdocsApiRef } from '../../api'; import { Reader } from './Reader'; import { TechDocsPageHeader } from './TechDocsPageHeader'; +import { Content, Page } from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + export const TechDocsPage = () => { const [documentReady, setDocumentReady] = useState(false); const { namespace, kind, name } = useParams(); diff --git a/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx b/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx index 11529a24fe..73e02e409a 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx @@ -15,7 +15,6 @@ */ import { EntityName, RELATION_OWNED_BY } from '@backstage/catalog-model'; -import { Header, HeaderLabel, useRouteRef } from '@backstage/core'; import { EntityRefLink, EntityRefLinks, @@ -27,6 +26,9 @@ import { AsyncState } from 'react-use/lib/useAsync'; import { rootRouteRef } from '../../routes'; import { TechDocsMetadata } from '../../types'; +import { Header, HeaderLabel } from '@backstage/core-components'; +import { useRouteRef } from '@backstage/core-plugin-api'; + type TechDocsPageHeaderProps = { entityId: EntityName; metadataRequest: { diff --git a/plugins/techdocs/src/reader/components/TechDocsProgressBar.tsx b/plugins/techdocs/src/reader/components/TechDocsProgressBar.tsx index c7caa125bc..66a21e32e0 100644 --- a/plugins/techdocs/src/reader/components/TechDocsProgressBar.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsProgressBar.tsx @@ -16,8 +16,8 @@ import React, { useState, useEffect } from 'react'; import { useMountedState } from 'react-use'; -import { Progress } from '@backstage/core'; import { Typography } from '@material-ui/core'; +import { Progress } from '@backstage/core-components'; const TechDocsProgressBar = () => { const isMounted = useMountedState(); diff --git a/plugins/techdocs/src/reader/components/useRawPage.ts b/plugins/techdocs/src/reader/components/useRawPage.ts index 1bc23d2a45..d3119f47fc 100644 --- a/plugins/techdocs/src/reader/components/useRawPage.ts +++ b/plugins/techdocs/src/reader/components/useRawPage.ts @@ -14,10 +14,10 @@ * limitations under the License. */ import { EntityName } from '@backstage/catalog-model'; -import { useApi } from '@backstage/core'; import { useAsyncRetry } from 'react-use'; import { AsyncState } from 'react-use/lib/useAsync'; import { techdocsStorageApiRef } from '../../api'; +import { useApi } from '@backstage/core-plugin-api'; export type RawPage = { content: string; diff --git a/plugins/techdocs/src/reader/components/useReaderState.test.tsx b/plugins/techdocs/src/reader/components/useReaderState.test.tsx index 8a09241588..cdfe709c65 100644 --- a/plugins/techdocs/src/reader/components/useReaderState.test.tsx +++ b/plugins/techdocs/src/reader/components/useReaderState.test.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { ApiProvider, ApiRegistry } from '@backstage/core'; import { NotFoundError } from '@backstage/errors'; import { act, renderHook } from '@testing-library/react-hooks'; import React from 'react'; @@ -24,6 +23,7 @@ import { reducer, useReaderState, } from './useReaderState'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('useReaderState', () => { let Wrapper: React.ComponentType; diff --git a/plugins/techdocs/src/reader/components/useReaderState.ts b/plugins/techdocs/src/reader/components/useReaderState.ts index 1dc4bc2677..40638fbf4a 100644 --- a/plugins/techdocs/src/reader/components/useReaderState.ts +++ b/plugins/techdocs/src/reader/components/useReaderState.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -import { useApi } from '@backstage/core'; import { useEffect, useMemo, useReducer, useRef } from 'react'; import { useAsync, useAsyncRetry } from 'react-use'; import { techdocsStorageApiRef } from '../../api'; +import { useApi } from '@backstage/core-plugin-api'; /** * A state representation that is used to configure the UI of diff --git a/plugins/techdocs/src/routes.ts b/plugins/techdocs/src/routes.ts index 209669d64f..c5c2e54d9b 100644 --- a/plugins/techdocs/src/routes.ts +++ b/plugins/techdocs/src/routes.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createRouteRef } from '@backstage/core'; +import { createRouteRef } from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ path: '', diff --git a/plugins/user-settings/src/components/AuthProviders/AuthProviders.test.tsx b/plugins/user-settings/src/components/AuthProviders/AuthProviders.test.tsx index e299b30594..42026ef9e1 100644 --- a/plugins/user-settings/src/components/AuthProviders/AuthProviders.test.tsx +++ b/plugins/user-settings/src/components/AuthProviders/AuthProviders.test.tsx @@ -14,18 +14,18 @@ * limitations under the License. */ -import { - ApiProvider, - ApiRegistry, - configApiRef, - ConfigReader, - googleAuthApiRef, -} from '@backstage/core'; import { renderWithEffects, wrapInTestApp } from '@backstage/test-utils'; import { fireEvent } from '@testing-library/react'; import React from 'react'; import { AuthProviders } from './AuthProviders'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; +import { configApiRef, googleAuthApiRef } from '@backstage/core-plugin-api'; + const mockSignInHandler = jest.fn().mockReturnValue(''); const mockGoogleAuth = { sessionState$: () => ({ diff --git a/plugins/user-settings/src/components/AuthProviders/AuthProviders.tsx b/plugins/user-settings/src/components/AuthProviders/AuthProviders.tsx index bc2a68578d..b8b541c352 100644 --- a/plugins/user-settings/src/components/AuthProviders/AuthProviders.tsx +++ b/plugins/user-settings/src/components/AuthProviders/AuthProviders.tsx @@ -16,10 +16,12 @@ import React from 'react'; import { List } from '@material-ui/core'; -import { configApiRef, InfoCard, useApi } from '@backstage/core'; import { EmptyProviders } from './EmptyProviders'; import { DefaultProviderSettings } from './DefaultProviderSettings'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; +import { InfoCard } from '@backstage/core-components'; + type Props = { providerSettings?: JSX.Element; }; diff --git a/plugins/user-settings/src/components/AuthProviders/DefaultProviderSettings.tsx b/plugins/user-settings/src/components/AuthProviders/DefaultProviderSettings.tsx index d9fa996d85..ea8a615d19 100644 --- a/plugins/user-settings/src/components/AuthProviders/DefaultProviderSettings.tsx +++ b/plugins/user-settings/src/components/AuthProviders/DefaultProviderSettings.tsx @@ -13,6 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import Star from '@material-ui/icons/Star'; +import React from 'react'; +import { ProviderSettingsItem } from './ProviderSettingsItem'; import { auth0AuthApiRef, githubAuthApiRef, @@ -21,10 +24,7 @@ import { oauth2ApiRef, oktaAuthApiRef, microsoftAuthApiRef, -} from '@backstage/core'; -import Star from '@material-ui/icons/Star'; -import React from 'react'; -import { ProviderSettingsItem } from './ProviderSettingsItem'; +} from '@backstage/core-plugin-api'; type Props = { configuredProviders: string[]; diff --git a/plugins/user-settings/src/components/AuthProviders/EmptyProviders.tsx b/plugins/user-settings/src/components/AuthProviders/EmptyProviders.tsx index 55c83eff3e..84b054cae7 100644 --- a/plugins/user-settings/src/components/AuthProviders/EmptyProviders.tsx +++ b/plugins/user-settings/src/components/AuthProviders/EmptyProviders.tsx @@ -15,8 +15,8 @@ */ import React from 'react'; -import { CodeSnippet, EmptyState } from '@backstage/core'; import { Button, Typography } from '@material-ui/core'; +import { CodeSnippet, EmptyState } from '@backstage/core-components'; const EXAMPLE = `auth: providers: diff --git a/plugins/user-settings/src/components/AuthProviders/ProviderSettingsItem.tsx b/plugins/user-settings/src/components/AuthProviders/ProviderSettingsItem.tsx index 4bae3dbfbb..79c5e59c02 100644 --- a/plugins/user-settings/src/components/AuthProviders/ProviderSettingsItem.tsx +++ b/plugins/user-settings/src/components/AuthProviders/ProviderSettingsItem.tsx @@ -14,13 +14,6 @@ * limitations under the License. */ import React, { useEffect, useState } from 'react'; -import { - ApiRef, - SessionApi, - useApi, - IconComponent, - SessionState, -} from '@backstage/core'; import { Button, ListItem, @@ -29,6 +22,13 @@ import { ListItemText, Tooltip, } from '@material-ui/core'; +import { + ApiRef, + SessionApi, + useApi, + IconComponent, + SessionState, +} from '@backstage/core-plugin-api'; type Props = { title: string; diff --git a/plugins/user-settings/src/components/FeatureFlags/EmptyFlags.tsx b/plugins/user-settings/src/components/FeatureFlags/EmptyFlags.tsx index 985a67189b..8c9b702f95 100644 --- a/plugins/user-settings/src/components/FeatureFlags/EmptyFlags.tsx +++ b/plugins/user-settings/src/components/FeatureFlags/EmptyFlags.tsx @@ -15,8 +15,8 @@ */ import React from 'react'; -import { CodeSnippet, EmptyState } from '@backstage/core'; import { Button, Typography } from '@material-ui/core'; +import { CodeSnippet, EmptyState } from '@backstage/core-components'; const EXAMPLE = `import { createPlugin } from '@backstage/core'; diff --git a/plugins/user-settings/src/components/FeatureFlags/FeatureFlags.tsx b/plugins/user-settings/src/components/FeatureFlags/FeatureFlags.tsx index 0a9a22659c..6ceb0ae73e 100644 --- a/plugins/user-settings/src/components/FeatureFlags/FeatureFlags.tsx +++ b/plugins/user-settings/src/components/FeatureFlags/FeatureFlags.tsx @@ -15,16 +15,17 @@ */ import React, { useCallback, useState } from 'react'; -import { - featureFlagsApiRef, - FeatureFlagState, - InfoCard, - useApi, -} from '@backstage/core'; import { List } from '@material-ui/core'; import { EmptyFlags } from './EmptyFlags'; import { FlagItem } from './FeatureFlagsItem'; +import { + featureFlagsApiRef, + FeatureFlagState, + useApi, +} from '@backstage/core-plugin-api'; +import { InfoCard } from '@backstage/core-components'; + export const FeatureFlags = () => { const featureFlagsApi = useApi(featureFlagsApiRef); const featureFlags = featureFlagsApi.getRegisteredFlags(); diff --git a/plugins/user-settings/src/components/FeatureFlags/FeatureFlagsItem.tsx b/plugins/user-settings/src/components/FeatureFlags/FeatureFlagsItem.tsx index 603f63ef73..6929c9f585 100644 --- a/plugins/user-settings/src/components/FeatureFlags/FeatureFlagsItem.tsx +++ b/plugins/user-settings/src/components/FeatureFlags/FeatureFlagsItem.tsx @@ -22,7 +22,7 @@ import { Switch, Tooltip, } from '@material-ui/core'; -import { FeatureFlag } from '@backstage/core'; +import { FeatureFlag } from '@backstage/core-plugin-api'; type Props = { flag: FeatureFlag; diff --git a/plugins/user-settings/src/components/General/General.tsx b/plugins/user-settings/src/components/General/General.tsx index b5054217e4..86cf01fb11 100644 --- a/plugins/user-settings/src/components/General/General.tsx +++ b/plugins/user-settings/src/components/General/General.tsx @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { InfoCard } from '@backstage/core'; import { Grid, List } from '@material-ui/core'; import React from 'react'; import { PinButton } from './PinButton'; import { Profile } from './Profile'; import { ThemeToggle } from './ThemeToggle'; +import { InfoCard } from '@backstage/core-components'; export const General = () => { return ( diff --git a/plugins/user-settings/src/components/General/PinButton.test.tsx b/plugins/user-settings/src/components/General/PinButton.test.tsx index 939588a9ee..a9d9ed5d1f 100644 --- a/plugins/user-settings/src/components/General/PinButton.test.tsx +++ b/plugins/user-settings/src/components/General/PinButton.test.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ -import { SidebarPinStateContext } from '@backstage/core'; import { renderWithEffects, wrapInTestApp } from '@backstage/test-utils'; import { fireEvent } from '@testing-library/react'; import React from 'react'; import { PinButton } from './PinButton'; +import { SidebarPinStateContext } from '@backstage/core-components'; describe('', () => { it('toggles the pin sidebar button', async () => { diff --git a/plugins/user-settings/src/components/General/PinButton.tsx b/plugins/user-settings/src/components/General/PinButton.tsx index d44e5c9a3b..f3c90317ee 100644 --- a/plugins/user-settings/src/components/General/PinButton.tsx +++ b/plugins/user-settings/src/components/General/PinButton.tsx @@ -22,7 +22,7 @@ import { Switch, Tooltip, } from '@material-ui/core'; -import { SidebarPinStateContext } from '@backstage/core'; +import { SidebarPinStateContext } from '@backstage/core-components'; export const PinButton = () => { const { isPinned, toggleSidebarPinState } = useContext( diff --git a/plugins/user-settings/src/components/General/Profile.tsx b/plugins/user-settings/src/components/General/Profile.tsx index c8034085bd..60d2f27e48 100644 --- a/plugins/user-settings/src/components/General/Profile.tsx +++ b/plugins/user-settings/src/components/General/Profile.tsx @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { InfoCard } from '@backstage/core'; import { Grid, Typography } from '@material-ui/core'; import React from 'react'; import { SignInAvatar } from './SignInAvatar'; import { UserSettingsMenu } from './UserSettingsMenu'; import { useUserProfile } from '../useUserProfileInfo'; +import { InfoCard } from '@backstage/core-components'; export const Profile = () => { const { profile, displayName } = useUserProfile(); diff --git a/plugins/user-settings/src/components/General/SignInAvatar.tsx b/plugins/user-settings/src/components/General/SignInAvatar.tsx index 8a5bbd75bf..2f22ae5eb8 100644 --- a/plugins/user-settings/src/components/General/SignInAvatar.tsx +++ b/plugins/user-settings/src/components/General/SignInAvatar.tsx @@ -18,7 +18,7 @@ import React from 'react'; import { BackstageTheme } from '@backstage/theme'; import { makeStyles, Avatar } from '@material-ui/core'; import { useUserProfile } from '../useUserProfileInfo'; -import { sidebarConfig } from '@backstage/core'; +import { sidebarConfig } from '@backstage/core-components'; const useStyles = makeStyles(theme => ({ avatar: { diff --git a/plugins/user-settings/src/components/General/ThemeToggle.test.tsx b/plugins/user-settings/src/components/General/ThemeToggle.test.tsx index a4f9ea6af3..46ac3b5607 100644 --- a/plugins/user-settings/src/components/General/ThemeToggle.test.tsx +++ b/plugins/user-settings/src/components/General/ThemeToggle.test.tsx @@ -14,18 +14,17 @@ * limitations under the License. */ -import { - ApiProvider, - ApiRegistry, - appThemeApiRef, - AppThemeSelector, -} from '@backstage/core'; -import { AppTheme } from '@backstage/core-plugin-api'; +import { AppTheme, appThemeApiRef } from '@backstage/core-plugin-api'; import { renderWithEffects, wrapInTestApp } from '@backstage/test-utils'; import { lightTheme } from '@backstage/theme'; import { fireEvent } from '@testing-library/react'; import React from 'react'; import { ThemeToggle } from './ThemeToggle'; +import { + ApiProvider, + ApiRegistry, + AppThemeSelector, +} from '@backstage/core-app-api'; const mockTheme: AppTheme = { id: 'light-theme', diff --git a/plugins/user-settings/src/components/General/ThemeToggle.tsx b/plugins/user-settings/src/components/General/ThemeToggle.tsx index 0a3f9ababa..5c359919d3 100644 --- a/plugins/user-settings/src/components/General/ThemeToggle.tsx +++ b/plugins/user-settings/src/components/General/ThemeToggle.tsx @@ -17,7 +17,6 @@ import React, { cloneElement } from 'react'; import { useObservable } from 'react-use'; import AutoIcon from '@material-ui/icons/BrightnessAuto'; -import { appThemeApiRef, useApi } from '@backstage/core'; import ToggleButton from '@material-ui/lab/ToggleButton'; import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup'; import { @@ -27,6 +26,7 @@ import { Tooltip, makeStyles, } from '@material-ui/core'; +import { appThemeApiRef, useApi } from '@backstage/core-plugin-api'; type ThemeIconProps = { id: string; diff --git a/plugins/user-settings/src/components/General/UserSettingsMenu.tsx b/plugins/user-settings/src/components/General/UserSettingsMenu.tsx index 19c3ee4e2d..908bcd42ed 100644 --- a/plugins/user-settings/src/components/General/UserSettingsMenu.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsMenu.tsx @@ -15,10 +15,10 @@ */ import React from 'react'; -import { identityApiRef, useApi } from '@backstage/core'; import { IconButton, ListItemIcon, Menu, MenuItem } from '@material-ui/core'; import SignOutIcon from '@material-ui/icons/MeetingRoom'; import MoreVertIcon from '@material-ui/icons/MoreVert'; +import { identityApiRef, useApi } from '@backstage/core-plugin-api'; export const UserSettingsMenu = () => { const identityApi = useApi(identityApiRef); diff --git a/plugins/user-settings/src/components/Settings.tsx b/plugins/user-settings/src/components/Settings.tsx index 25559299a8..2a5c8822c4 100644 --- a/plugins/user-settings/src/components/Settings.tsx +++ b/plugins/user-settings/src/components/Settings.tsx @@ -15,9 +15,9 @@ */ import React from 'react'; -import { SidebarItem } from '@backstage/core'; import SettingsIcon from '@material-ui/icons/Settings'; import { settingsRouteRef } from '../plugin'; +import { SidebarItem } from '@backstage/core-components'; export const Settings = () => { return ( diff --git a/plugins/user-settings/src/components/SettingsPage.tsx b/plugins/user-settings/src/components/SettingsPage.tsx index 9fb576b200..1c26a596cb 100644 --- a/plugins/user-settings/src/components/SettingsPage.tsx +++ b/plugins/user-settings/src/components/SettingsPage.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ -import { Header, Page, TabbedLayout } from '@backstage/core'; import React from 'react'; import { AuthProviders } from './AuthProviders'; import { FeatureFlags } from './FeatureFlags'; import { General } from './General'; +import { Header, Page, TabbedLayout } from '@backstage/core-components'; type Props = { providerSettings?: JSX.Element; diff --git a/plugins/user-settings/src/components/useUserProfileInfo.ts b/plugins/user-settings/src/components/useUserProfileInfo.ts index 428719160d..5a491ee306 100644 --- a/plugins/user-settings/src/components/useUserProfileInfo.ts +++ b/plugins/user-settings/src/components/useUserProfileInfo.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useApi, identityApiRef } from '@backstage/core'; +import { useApi, identityApiRef } from '@backstage/core-plugin-api'; export const useUserProfile = () => { const identityApi = useApi(identityApiRef); diff --git a/plugins/user-settings/src/plugin.ts b/plugins/user-settings/src/plugin.ts index 36d2254c11..ac02bf2496 100644 --- a/plugins/user-settings/src/plugin.ts +++ b/plugins/user-settings/src/plugin.ts @@ -18,7 +18,7 @@ import { createPlugin, createRoutableExtension, createRouteRef, -} from '@backstage/core'; +} from '@backstage/core-plugin-api'; export const settingsRouteRef = createRouteRef({ path: '/settings', diff --git a/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx b/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx index 210cdcf921..50693951ec 100644 --- a/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx +++ b/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx @@ -14,19 +14,19 @@ * limitations under the License. */ -import { - ApiProvider, - ApiRegistry, - configApiRef, - ConfigReader, - errorApiRef, -} from '@backstage/core'; import { renderInTestApp } from '@backstage/test-utils'; import { lightTheme } from '@backstage/theme'; import { ThemeProvider } from '@material-ui/core'; import React from 'react'; import WelcomePage from './WelcomePage'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; +import { configApiRef, errorApiRef } from '@backstage/core-plugin-api'; + describe('WelcomePage', () => { it('should render', async () => { const { baseElement } = await renderInTestApp( diff --git a/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx b/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx index 4cd2c34ec1..6089864c8e 100644 --- a/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx +++ b/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx @@ -24,6 +24,7 @@ import { ListItemText, Link, } from '@material-ui/core'; + import { Content, InfoCard, @@ -33,9 +34,9 @@ import { ContentHeader, SupportButton, WarningPanel, - useApi, - configApiRef, -} from '@backstage/core'; +} from '@backstage/core-components'; + +import { useApi, configApiRef } from '@backstage/core-plugin-api'; const WelcomePage = () => { const appTitle = diff --git a/plugins/welcome/src/plugin.ts b/plugins/welcome/src/plugin.ts index 54a7cd93d1..56d1df649c 100644 --- a/plugins/welcome/src/plugin.ts +++ b/plugins/welcome/src/plugin.ts @@ -18,7 +18,7 @@ import { createPlugin, createRoutableExtension, createRouteRef, -} from '@backstage/core'; +} from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ title: 'Welcome',