diff --git a/.changeset/stupid-scissors-brake.md b/.changeset/stupid-scissors-brake.md new file mode 100644 index 0000000000..25c948a632 --- /dev/null +++ b/.changeset/stupid-scissors-brake.md @@ -0,0 +1,51 @@ +--- +'@backstage/catalog-model': patch +'@backstage/cli': patch +'@backstage/create-app': patch +'@backstage/dev-utils': patch +'@backstage/integration-react': patch +'@backstage/test-utils': patch +'@backstage/plugin-api-docs': patch +'@backstage/plugin-badges': patch +'@backstage/plugin-bitrise': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-catalog-react': patch +'@backstage/plugin-circleci': patch +'@backstage/plugin-cloudbuild': patch +'@backstage/plugin-code-coverage': patch +'@backstage/plugin-config-schema': patch +'@backstage/plugin-cost-insights': patch +'@backstage/plugin-explore': patch +'@backstage/plugin-explore-react': patch +'@backstage/plugin-fossa': patch +'@backstage/plugin-gcp-projects': patch +'@backstage/plugin-git-release-manager': patch +'@backstage/plugin-github-actions': patch +'@backstage/plugin-github-deployments': patch +'@backstage/plugin-gitops-profiles': patch +'@backstage/plugin-graphiql': patch +'@backstage/plugin-ilert': patch +'@backstage/plugin-jenkins': patch +'@backstage/plugin-kafka': patch +'@backstage/plugin-kubernetes': patch +'@backstage/plugin-lighthouse': patch +'@backstage/plugin-newrelic': patch +'@backstage/plugin-org': patch +'@backstage/plugin-pagerduty': patch +'@backstage/plugin-register-component': patch +'@backstage/plugin-rollbar': patch +'@backstage/plugin-scaffolder': patch +'@backstage/plugin-search': patch +'@backstage/plugin-sentry': patch +'@backstage/plugin-shortcuts': patch +'@backstage/plugin-sonarqube': patch +'@backstage/plugin-splunk-on-call': patch +'@backstage/plugin-tech-radar': patch +'@backstage/plugin-techdocs': patch +'@backstage/plugin-todo': patch +'@backstage/plugin-user-settings': patch +'@backstage/plugin-welcome': patch +--- + +Migrated to use the new `@backstage/core-*` packages rather than `@backstage/core`. diff --git a/packages/app/package.json b/packages/app/package.json index 9d22f6bf28..1a9f0c4add 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -6,10 +6,10 @@ "dependencies": { "@backstage/catalog-model": "^0.8.3", "@backstage/cli": "^0.7.1", - "@backstage/core": "^0.7.13", - "@backstage/integration-react": "^0.1.3", "@backstage/core-app-api": "^0.1.2", - "@backstage/core-components": "^0.1.1", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", + "@backstage/integration-react": "^0.1.3", "@backstage/plugin-api-docs": "^0.5.0", "@backstage/plugin-badges": "^0.2.2", "@backstage/plugin-catalog": "^0.6.3", diff --git a/packages/app/src/apis.ts b/packages/app/src/apis.ts index 8b27e52717..08ff781319 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 5596f20da1..09ee571cf6 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 2daf7a49bc..955e477f3c 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 39ba1afd6f..16107a6cc0 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 b38a702330..35c4a4ac1c 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 0ab67b6867..4cc7bab91a 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/cli/package.json b/packages/cli/package.json index f3a5f4b478..1d8628e771 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -120,7 +120,9 @@ "devDependencies": { "@backstage/backend-common": "^0.8.3", "@backstage/config": "^0.1.5", - "@backstage/core": "^0.7.13", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@backstage/theme": "^0.2.8", diff --git a/packages/cli/src/lib/diff/handlers.ts b/packages/cli/src/lib/diff/handlers.ts index 77bd0e78d2..5cbddde0ec 100644 --- a/packages/cli/src/lib/diff/handlers.ts +++ b/packages/cli/src/lib/diff/handlers.ts @@ -18,6 +18,15 @@ import chalk from 'chalk'; import { diffLines } from 'diff'; import { FileDiff, PromptFunc, FileHandler, WriteFileFunc } from './types'; +function sortObjectKeys(obj: Record) { + const sortedKeys = Object.keys(obj).sort(); + for (const key of sortedKeys) { + const value = obj[key]; + delete obj[key]; + obj[key] = value; + } +} + class PackageJsonHandler { static async handler( { path, write, missing, targetContents, templateContents }: FileDiff, @@ -74,6 +83,7 @@ class PackageJsonHandler { obj: any = this.pkg, targetObj: any = this.targetPkg, prefix?: string, + sort?: boolean, ) { const fullFieldName = chalk.cyan( prefix ? `${prefix}[${fieldName}]` : fieldName, @@ -91,6 +101,9 @@ class PackageJsonHandler { const msg = `package.json has mismatched field, ${fullFieldName}, change from ${coloredOldValue} to ${coloredNewValue}?`; if (await this.prompt(msg)) { targetObj[fieldName] = newValue; + if (sort) { + sortObjectKeys(targetObj); + } await this.write(); } } else if (fieldName in obj) { @@ -100,6 +113,9 @@ class PackageJsonHandler { ) ) { targetObj[fieldName] = newValue; + if (sort) { + sortObjectKeys(targetObj); + } await this.write(); } } @@ -168,16 +184,22 @@ class PackageJsonHandler { return; } + // Hardcoded removal of these during migration + await this.syncField('@backstage/core', {}, targetDeps, fieldName, true); + await this.syncField( + '@backstage/core-api', + {}, + targetDeps, + fieldName, + true, + ); + for (const key of Object.keys(pkgDeps)) { if (this.variant === 'app' && key.startsWith('plugin-')) { continue; } - // Skip checking of the core packages, since we're migrating over - if (key.startsWith('@backstage/core')) { - continue; - } - await this.syncField(key, pkgDeps, targetDeps, fieldName); + await this.syncField(key, pkgDeps, targetDeps, fieldName, true); } } diff --git a/packages/cli/src/lib/version.ts b/packages/cli/src/lib/version.ts index e50a0b5c60..61ee4003fc 100644 --- a/packages/cli/src/lib/version.ts +++ b/packages/cli/src/lib/version.ts @@ -34,7 +34,9 @@ leaving any imports in place. import { version as backendCommon } from '@backstage/backend-common/package.json'; import { version as cli } from '@backstage/cli/package.json'; import { version as config } from '@backstage/config/package.json'; -import { version as core } from '@backstage/core/package.json'; +import { version as coreAppApi } from '@backstage/core-app-api/package.json'; +import { version as coreComponents } from '@backstage/core-components/package.json'; +import { version as corePluginApi } from '@backstage/core-plugin-api/package.json'; import { version as devUtils } from '@backstage/dev-utils/package.json'; import { version as testUtils } from '@backstage/test-utils/package.json'; import { version as theme } from '@backstage/theme/package.json'; @@ -43,7 +45,9 @@ export const packageVersions = { '@backstage/backend-common': backendCommon, '@backstage/cli': cli, '@backstage/config': config, - '@backstage/core': core, + '@backstage/core-app-api': coreAppApi, + '@backstage/core-components': coreComponents, + '@backstage/core-plugin-api': corePluginApi, '@backstage/dev-utils': devUtils, '@backstage/test-utils': testUtils, '@backstage/theme': theme, diff --git a/packages/cli/templates/default-plugin/package.json.hbs b/packages/cli/templates/default-plugin/package.json.hbs index 1d2766eab4..f5249e7918 100644 --- a/packages/cli/templates/default-plugin/package.json.hbs +++ b/packages/cli/templates/default-plugin/package.json.hbs @@ -24,7 +24,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^{{version '@backstage/core'}}", + "@backstage/core-components": "^{{version '@backstage/core-components'}}", + "@backstage/core-plugin-api": "^{{version '@backstage/core-plugin-api'}}", "@backstage/theme": "^{{version '@backstage/theme'}}", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -35,6 +36,7 @@ }, "devDependencies": { "@backstage/cli": "^{{version '@backstage/cli'}}", + "@backstage/core-app-api": "^{{version '@backstage/core-app-api'}}", "@backstage/dev-utils": "^{{version '@backstage/dev-utils'}}", "@backstage/test-utils": "^{{version '@backstage/test-utils'}}", "@testing-library/jest-dom": "^5.10.1", diff --git a/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.tsx.hbs b/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.tsx.hbs index dcecebdf46..1820671fa5 100644 --- a/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.tsx.hbs +++ b/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.tsx.hbs @@ -8,7 +8,7 @@ import { ContentHeader, HeaderLabel, SupportButton, -} from '@backstage/core'; +} from '@backstage/core-components'; import { ExampleFetchComponent } from '../ExampleFetchComponent'; export const ExampleComponent = () => ( diff --git a/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs b/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs index 20dd6d1f57..a7663567d9 100644 --- a/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs +++ b/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs @@ -1,6 +1,6 @@ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import { Table, TableColumn, Progress } from '@backstage/core'; +import { Table, TableColumn, Progress } from '@backstage/core-components'; import Alert from '@material-ui/lab/Alert'; import { useAsync } from 'react-use'; diff --git a/packages/cli/templates/default-plugin/src/plugin.ts.hbs b/packages/cli/templates/default-plugin/src/plugin.ts.hbs index 0ae5356fd1..dcf35fc5d2 100644 --- a/packages/cli/templates/default-plugin/src/plugin.ts.hbs +++ b/packages/cli/templates/default-plugin/src/plugin.ts.hbs @@ -1,4 +1,4 @@ -import { createPlugin, createRoutableExtension } from '@backstage/core'; +import { createPlugin, createRoutableExtension } from '@backstage/core-plugin-api'; import { rootRouteRef } from './routes'; diff --git a/packages/cli/templates/default-plugin/src/routes.ts.hbs b/packages/cli/templates/default-plugin/src/routes.ts.hbs index b2afba074d..a5a278e8a7 100644 --- a/packages/cli/templates/default-plugin/src/routes.ts.hbs +++ b/packages/cli/templates/default-plugin/src/routes.ts.hbs @@ -1,4 +1,4 @@ -import { createRouteRef } from '@backstage/core'; +import { createRouteRef } from '@backstage/core-plugin-api'; export const rootRouteRef = createRouteRef({ title: '{{ id }}', diff --git a/packages/create-app/src/lib/versions.ts b/packages/create-app/src/lib/versions.ts index f3196d3675..97904cc15b 100644 --- a/packages/create-app/src/lib/versions.ts +++ b/packages/create-app/src/lib/versions.ts @@ -35,7 +35,9 @@ import { version as catalogClient } from '../../../catalog-client/package.json'; import { version as catalogModel } from '../../../catalog-model/package.json'; import { version as cli } from '../../../cli/package.json'; import { version as config } from '../../../config/package.json'; -import { version as core } from '../../../core/package.json'; +import { version as coreAppApi } from '../../../core-app-api/package.json'; +import { version as coreComponents } from '../../../core-components/package.json'; +import { version as corePluginApi } from '../../../core-plugin-api/package.json'; import { version as errors } from '../../../errors/package.json'; import { version as integrationReact } from '../../../integration-react/package.json'; import { version as testUtils } from '../../../test-utils/package.json'; @@ -71,7 +73,9 @@ export const packageVersions = { '@backstage/catalog-model': catalogModel, '@backstage/cli': cli, '@backstage/config': config, - '@backstage/core': core, + '@backstage/core-app-api': coreAppApi, + '@backstage/core-components': coreComponents, + '@backstage/core-plugin-api': corePluginApi, '@backstage/errors': errors, '@backstage/integration-react': integrationReact, '@backstage/plugin-api-docs': pluginApiDocs, diff --git a/packages/create-app/templates/default-app/packages/app/package.json.hbs b/packages/create-app/templates/default-app/packages/app/package.json.hbs index 6038f7c8b9..71cc86ba34 100644 --- a/packages/create-app/templates/default-app/packages/app/package.json.hbs +++ b/packages/create-app/templates/default-app/packages/app/package.json.hbs @@ -6,7 +6,9 @@ "dependencies": { "@backstage/catalog-model": "^{{version '@backstage/catalog-model'}}", "@backstage/cli": "^{{version '@backstage/cli'}}", - "@backstage/core": "^{{version '@backstage/core'}}", + "@backstage/core-app-api": "^{{version '@backstage/core-app-api'}}", + "@backstage/core-components": "^{{version '@backstage/core-components'}}", + "@backstage/core-plugin-api": "^{{version '@backstage/core-plugin-api'}}", "@backstage/integration-react": "^{{version '@backstage/integration-react'}}", "@backstage/plugin-api-docs": "^{{version '@backstage/plugin-api-docs'}}", "@backstage/plugin-catalog": "^{{version '@backstage/plugin-catalog'}}", 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 adcaed9152..5e5a71a635 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 5581b7dff1..e3dd5be3c7 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/api-report.md b/packages/dev-utils/api-report.md index d3e6447cd5..d3852b1c95 100644 --- a/packages/dev-utils/api-report.md +++ b/packages/dev-utils/api-report.md @@ -4,12 +4,12 @@ ```ts -import { ApiFactory } from '@backstage/core'; +import { ApiFactory } from '@backstage/core-plugin-api'; import { ComponentType } from 'react'; -import { createPlugin } from '@backstage/core'; +import { createPlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { GridProps } from '@material-ui/core'; -import { IconComponent } from '@backstage/core'; +import { IconComponent } from '@backstage/core-plugin-api'; import { ReactNode } from 'react'; // @public diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 100d06b1a0..1f3a408e04 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -29,7 +29,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.7.12", + "@backstage/core-app-api": "^0.1.2", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/catalog-model": "^0.8.2", "@backstage/integration-react": "^0.1.3", "@backstage/plugin-catalog-react": "^0.2.2", diff --git a/packages/dev-utils/src/devApp/render.test.tsx b/packages/dev-utils/src/devApp/render.test.tsx index e098b69736..83a24bd9b2 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 4f1713d797..508eb105f1 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/api-report.md b/packages/integration-react/api-report.md index 63a538213c..fee08efe6f 100644 --- a/packages/integration-react/api-report.md +++ b/packages/integration-react/api-report.md @@ -4,7 +4,7 @@ ```ts -import { ApiRef } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; import { Config } from '@backstage/config'; import { ScmIntegrationRegistry } from '@backstage/integration'; diff --git a/packages/integration-react/dev/DevPage.tsx b/packages/integration-react/dev/DevPage.tsx index dd4063804a..07afbcd660 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 f7894fd9d1..5ce9ebecda 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/package.json b/packages/integration-react/package.json index 313e5b8783..edc6acf110 100644 --- a/packages/integration-react/package.json +++ b/packages/integration-react/package.json @@ -21,7 +21,8 @@ }, "dependencies": { "@backstage/config": "^0.1.2", - "@backstage/core": "^0.7.9", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/integration": "^0.5.6", "@backstage/theme": "^0.2.3", "@material-ui/core": "^4.11.0", diff --git a/packages/integration-react/src/api/ScmIntegrationsApi.ts b/packages/integration-react/src/api/ScmIntegrationsApi.ts index 4196aaf68f..982989540a 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 598b14188b..80567d5cc3 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/packages/test-utils/api-report.md b/packages/test-utils/api-report.md index dcac9b64a7..078fa14399 100644 --- a/packages/test-utils/api-report.md +++ b/packages/test-utils/api-report.md @@ -5,16 +5,16 @@ ```ts import { ComponentType } from 'react'; -import { ErrorApi } from '@backstage/core-api'; -import { ErrorContext } from '@backstage/core-api'; -import { ExternalRouteRef } from '@backstage/core-api'; -import { Observable } from '@backstage/core-api'; +import { ErrorApi } from '@backstage/core-plugin-api'; +import { ErrorContext } from '@backstage/core-plugin-api'; +import { ExternalRouteRef } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/core-plugin-api'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; import { RenderResult } from '@testing-library/react'; -import { RouteRef } from '@backstage/core-api'; -import { StorageApi } from '@backstage/core-api'; -import { StorageValueChange } from '@backstage/core-api'; +import { RouteRef } from '@backstage/core-plugin-api'; +import { StorageApi } from '@backstage/core-plugin-api'; +import { StorageValueChange } from '@backstage/core-plugin-api'; // @public (undocumented) export function mockBreakpoint(initialBreakpoint?: Breakpoint): { diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index cb6e13d7df..6791d9c132 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -29,7 +29,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-api": "^0.2.22", + "@backstage/core-app-api": "^0.1.2", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/test-utils-core": "^0.1.1", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", diff --git a/packages/test-utils/src/testUtils/apis/ErrorApi/MockErrorApi.ts b/packages/test-utils/src/testUtils/apis/ErrorApi/MockErrorApi.ts index 979cd74365..20b6bd1724 100644 --- a/packages/test-utils/src/testUtils/apis/ErrorApi/MockErrorApi.ts +++ b/packages/test-utils/src/testUtils/apis/ErrorApi/MockErrorApi.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { ErrorApi, ErrorContext, Observable } from '@backstage/core-api'; +import { ErrorApi, ErrorContext, Observable } from '@backstage/core-plugin-api'; type Options = { collect?: boolean; diff --git a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.test.ts b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.test.ts index 724ae8ffe7..fabfa989e2 100644 --- a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.test.ts +++ b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { MockStorageApi } from './MockStorageApi'; -import { StorageApi } from '@backstage/core-api'; +import { StorageApi } from '@backstage/core-plugin-api'; describe('WebStorage Storage API', () => { const createMockStorage = (): StorageApi => { diff --git a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts index c1aa938d05..9f21b4e4c8 100644 --- a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts +++ b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts @@ -18,7 +18,7 @@ import { Observable, StorageApi, StorageValueChange, -} from '@backstage/core-api'; +} from '@backstage/core-plugin-api'; import ObservableImpl from 'zen-observable'; export type MockStorageBucket = { [key: string]: any }; diff --git a/packages/test-utils/src/testUtils/appWrappers.test.tsx b/packages/test-utils/src/testUtils/appWrappers.test.tsx index 3f17eb904b..a5a60130f2 100644 --- a/packages/test-utils/src/testUtils/appWrappers.test.tsx +++ b/packages/test-utils/src/testUtils/appWrappers.test.tsx @@ -14,16 +14,15 @@ * limitations under the License. */ +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; import { - ApiProvider, - ApiRegistry, createExternalRouteRef, createRouteRef, createSubRouteRef, errorApiRef, useApi, useRouteRef, -} from '@backstage/core-api'; +} from '@backstage/core-plugin-api'; import { withLogCollector } from '@backstage/test-utils-core'; import { render } from '@testing-library/react'; import React, { useEffect } from 'react'; @@ -53,6 +52,9 @@ describe('wrapInTestApp', () => { expect.stringMatching( /^Warning: An update to %s inside a test was not wrapped in act\(...\)/, ), + expect.stringMatching( + /^Warning: An update to %s inside a test was not wrapped in act\(...\)/, + ), ]); }); diff --git a/packages/test-utils/src/testUtils/appWrappers.tsx b/packages/test-utils/src/testUtils/appWrappers.tsx index ce869fd774..b884efd00d 100644 --- a/packages/test-utils/src/testUtils/appWrappers.tsx +++ b/packages/test-utils/src/testUtils/appWrappers.tsx @@ -18,20 +18,21 @@ import React, { ComponentType, ReactNode, ReactElement } from 'react'; import { MemoryRouter } from 'react-router'; import { Route } from 'react-router-dom'; import { lightTheme } from '@backstage/theme'; -import privateExports, { - defaultSystemIcons, +import { createApp } from '@backstage/core-app-api'; +import { BootErrorPageProps, RouteRef, ExternalRouteRef, attachComponentData, createRouteRef, -} from '@backstage/core-api'; +} from '@backstage/core-plugin-api'; import { RenderResult } from '@testing-library/react'; import { renderWithEffects } from '@backstage/test-utils-core'; import { mockApis } from './mockApis'; -const { PrivateAppImpl } = privateExports; - +const ErrorBoundaryFallback = ({ error }: { error: Error }) => { + throw new Error(`Reached ErrorBoundaryFallback Page with error, ${error}`); +}; const NotFoundErrorPage = () => { throw new Error('Reached NotFound Page'); }; @@ -87,17 +88,20 @@ export function wrapInTestApp( const { routeEntries = ['/'] } = options; const boundRoutes = new Map(); - const app = new PrivateAppImpl({ - apis: [], + const app = createApp({ + apis: mockApis, + // Bit of a hack to make sure that the default config loader isn't used + // as that would force every single test to wait for config loading. + configLoader: (false as unknown) as undefined, components: { - NotFoundErrorPage, - BootErrorPage, Progress, + BootErrorPage, + NotFoundErrorPage, + ErrorBoundaryFallback, Router: ({ children }) => ( ), }, - icons: defaultSystemIcons, plugins: [], themes: [ { @@ -107,7 +111,6 @@ export function wrapInTestApp( variant: 'light', }, ], - defaultApis: mockApis, bindRoutes: ({ bind }) => { for (const [externalRef, absoluteRef] of boundRoutes) { bind( diff --git a/packages/test-utils/src/testUtils/mockApis.ts b/packages/test-utils/src/testUtils/mockApis.ts index 7754376eeb..99260d80f9 100644 --- a/packages/test-utils/src/testUtils/mockApis.ts +++ b/packages/test-utils/src/testUtils/mockApis.ts @@ -18,13 +18,10 @@ import { storageApiRef, errorApiRef, createApiFactory, - AlertApiForwarder, - alertApiRef, -} from '@backstage/core-api'; +} from '@backstage/core-plugin-api'; import { MockErrorApi, MockStorageApi } from './apis'; export const mockApis = [ createApiFactory(errorApiRef, new MockErrorApi()), createApiFactory(storageApiRef, MockStorageApi.create()), - createApiFactory(alertApiRef, new AlertApiForwarder()), ]; diff --git a/plugins/api-docs/api-report.md b/plugins/api-docs/api-report.md index 5a09cfceea..c7d3fdc694 100644 --- a/plugins/api-docs/api-report.md +++ b/plugins/api-docs/api-report.md @@ -5,14 +5,14 @@ ```ts import { ApiEntity } from '@backstage/catalog-model'; -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { CatalogTableRow } from '@backstage/plugin-catalog'; import { Entity } from '@backstage/catalog-model'; -import { ExternalRouteRef } from '@backstage/core'; +import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { default as React_2 } from 'react'; -import { RouteRef } from '@backstage/core'; -import { TableColumn } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; +import { TableColumn } from '@backstage/core-components'; import { UserListFilterKind } from '@backstage/plugin-catalog-react'; // @public (undocumented) diff --git a/plugins/api-docs/dev/index.tsx b/plugins/api-docs/dev/index.tsx index 4c6e678f0d..bbbfe4a516 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/package.json b/plugins/api-docs/package.json index 417764768e..4097175a51 100644 --- a/plugins/api-docs/package.json +++ b/plugins/api-docs/package.json @@ -31,7 +31,8 @@ "dependencies": { "@asyncapi/react-component": "^0.23.0", "@backstage/catalog-model": "^0.8.3", - "@backstage/core": "^0.7.13", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog": "^0.6.3", "@backstage/plugin-catalog-react": "^0.2.3", "@backstage/theme": "^0.2.8", @@ -51,6 +52,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.test.tsx b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionCard.test.tsx index 649dc53dd4..56ffe6fc55 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 0502513458..2ad5a4aca7 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 873195be06..450e9e57ac 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 81658fe8e6..787c91f12b 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 1ac0f5838b..5638c23634 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 7846b24d40..518c3c7001 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 f35e081bcf..9a8b725ffc 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 a13177d757..340a1b4559 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 29af152a8b..56b8559537 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 cd711120d0..e7a53446bc 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 ae89b270d7..71300eee7d 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 af2cc40522..afc81c2e84 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 759626b349..efdc88b2e1 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 a99031782c..07fcb45b72 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 8afa1eb82d..5c47ec1476 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 6f91c1f9f2..20fa7021cc 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 1cba7dd6cf..77cc75535c 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 da6ee5d65f..286a360e9a 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 49729162bf..8d15ba08a2 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 4135e90c83..efdd882564 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 c796952e6f..e035bcfbd1 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 6c37ca744e..162dc02632 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 3fc03d54cf..ab976dbf18 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/api-report.md b/plugins/badges/api-report.md index dfe7cbdae8..1dbb256fd1 100644 --- a/plugins/badges/api-report.md +++ b/plugins/badges/api-report.md @@ -4,7 +4,7 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; // @public (undocumented) export const badgesPlugin: BackstagePlugin<{}, {}>; diff --git a/plugins/badges/package.json b/plugins/badges/package.json index 4de0681b34..a7b10ca69a 100644 --- a/plugins/badges/package.json +++ b/plugins/badges/package.json @@ -21,7 +21,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/errors": "^0.1.1", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", @@ -35,6 +36,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/badges/src/api/BadgesClient.ts b/plugins/badges/src/api/BadgesClient.ts index 7dda4921c3..8f65e1b9de 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 7998fde928..499c144fca 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 737f30197d..7901a69cbd 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 0e4a2e12f7..a1840e75c0 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 cc87054545..815ef0f660 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/api-report.md b/plugins/bitrise/api-report.md index c07178111d..15c3c74c99 100644 --- a/plugins/bitrise/api-report.md +++ b/plugins/bitrise/api-report.md @@ -4,7 +4,7 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; // @public (undocumented) diff --git a/plugins/bitrise/dev/index.tsx b/plugins/bitrise/dev/index.tsx index c8c7c7b6e5..7fdee01478 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/package.json b/plugins/bitrise/package.json index 454630f723..e74b3c0684 100644 --- a/plugins/bitrise/package.json +++ b/plugins/bitrise/package.json @@ -21,7 +21,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -38,6 +39,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/bitrise/src/api/bitriseApi.client.test.ts b/plugins/bitrise/src/api/bitriseApi.client.test.ts index e201dbce84..dde4e1ef69 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 487049ca79..f04f86c84d 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 4619645723..cdc425ae53 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 8b2fab9e2f..f805f050fa 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 3b2eab4ac5..43e596e8d7 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 5ac37e44f3..d6c7ab166b 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 8ffd45dd8e..3370f3c600 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 1b8c54328b..16f03c5805 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 98f73f44ba..05bc220189 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 1e09f84679..fe56dc5480 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 7268ab84b9..a13b2db25f 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 96a36c8eb2..a6f0706999 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/api-report.md b/plugins/catalog-import/api-report.md index 34baed46b5..f388c24a55 100644 --- a/plugins/catalog-import/api-report.md +++ b/plugins/catalog-import/api-report.md @@ -4,20 +4,20 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; -import { ConfigApi } from '@backstage/core'; +import { ConfigApi } from '@backstage/core-plugin-api'; import { Control } from 'react-hook-form'; -import { DiscoveryApi } from '@backstage/core'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { EntityName } from '@backstage/catalog-model'; import { FieldErrors } from 'react-hook-form'; -import { IdentityApi } from '@backstage/core'; -import { InfoCardVariants } from '@backstage/core'; -import { OAuthApi } from '@backstage/core'; +import { IdentityApi } from '@backstage/core-plugin-api'; +import { InfoCardVariants } from '@backstage/core-components'; +import { OAuthApi } from '@backstage/core-plugin-api'; import { default as React_2 } from 'react'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; import { ScmIntegrationRegistry } from '@backstage/integration'; import { SubmitHandler } from 'react-hook-form'; import { TextFieldProps } from '@material-ui/core/TextField/TextField'; diff --git a/plugins/catalog-import/dev/index.tsx b/plugins/catalog-import/dev/index.tsx index d2855ed40a..48d9320ca9 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/package.json b/plugins/catalog-import/package.json index 70c3f79b21..3374622f07 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -30,9 +30,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.8.3", "@backstage/catalog-client": "^0.3.13", - "@backstage/core": "^0.7.13", + "@backstage/catalog-model": "^0.8.3", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/integration": "^0.5.6", "@backstage/integration-react": "^0.1.3", "@backstage/plugin-catalog-react": "^0.2.3", @@ -54,6 +55,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/catalog-import/src/api/CatalogImportApi.ts b/plugins/catalog-import/src/api/CatalogImportApi.ts index 4dc317680d..04e98f3d7c 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 cd25d47cca..8ab8f75db1 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 c7196bfc3f..f53570617e 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 6356e7ccc7..2e572c8936 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 6cec383f27..6bf5af24ef 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 1b8b55a183..48ee23e444 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 739908b173..51524dae26 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 cd33e15b11..423a60cef0 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 0e3305d594..69f58751b8 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 1ec9cd1f7e..07d0d3b9fd 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 ec779b596a..0327b7e792 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 4e7985e187..7b6653e4ca 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 ff68808234..d6014b329c 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 bed8f477f7..41db6f600c 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 947f3c566e..ff3276aa65 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 9a8b27a495..3ab999ac07 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/package.json b/plugins/catalog-react/package.json index c5a871620b..c9af3c75e8 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -30,7 +30,8 @@ "dependencies": { "@backstage/catalog-client": "^0.3.13", "@backstage/catalog-model": "^0.8.3", - "@backstage/core": "^0.7.13", + "@backstage/core-app-api": "^0.1.2", + "@backstage/core-components": "^0.1.3", "@backstage/core-plugin-api": "^0.1.2", "@backstage/integration": "^0.5.6", "@material-ui/core": "^4.11.0", @@ -45,7 +46,6 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", - "@backstage/core": "^0.7.13", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/catalog-react/src/components/EntityRefLink/EntityRefLink.tsx b/plugins/catalog-react/src/components/EntityRefLink/EntityRefLink.tsx index c3d93722ff..e220acc543 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 bb782b1629..4a990f4028 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 f4996a5cdf..43da2b3612 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 f6ff185c75..37b1c383c7 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 051cf0f6c1..2ddffb0b7a 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 2780cbe573..29ec36d625 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 6000fb988f..52b8ec8ff1 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 07534d63bf..fb70c72d5d 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 08c44fb65d..52127a63bc 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 38926699f7..57e1c08a23 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 29c9825a82..7ad5b1c228 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 8188f158d0..a6802a6d87 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 9fc9f90731..55d9f9ca95 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 f41e4150f9..f630549b0d 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 ef5b2dbd6e..50662312da 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 56450122d2..14ab140fce 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/package.json b/plugins/catalog/package.json index 0af476b95a..ddbe2c5764 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -32,7 +32,7 @@ "dependencies": { "@backstage/catalog-client": "^0.3.13", "@backstage/catalog-model": "^0.8.3", - "@backstage/core": "^0.7.13", + "@backstage/core-components": "^0.1.3", "@backstage/core-plugin-api": "^0.1.2", "@backstage/errors": "^0.1.1", "@backstage/integration": "^0.5.6", diff --git a/plugins/catalog/src/CatalogClientWrapper.test.ts b/plugins/catalog/src/CatalogClientWrapper.test.ts index af1d3199b6..0e9da8d8c8 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 074539acfd..a10b968216 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 c69d952381..70b9781ec8 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 0cf9746713..d6227f9344 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 9acde1a5ca..2471ac9df2 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 5082f0b6c2..584eea0850 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx @@ -20,16 +20,7 @@ import { RELATION_MEMBER_OF, RELATION_OWNED_BY, } from '@backstage/catalog-model'; -import { - ApiProvider, - ApiRegistry, - IdentityApi, - identityApiRef, - ProfileInfo, - storageApiRef, - TableColumn, - TableProps, -} from '@backstage/core'; +import { TableColumn, TableProps } from '@backstage/core-components'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { MockStorageApi, @@ -43,6 +34,14 @@ import { EntityRow } from '../CatalogTable/types'; import { CatalogPage } from './CatalogPage'; import DashboardIcon from '@material-ui/icons/Dashboard'; +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 c4b3cf1c70..ba19d6036c 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -16,13 +16,6 @@ import React from 'react'; import { makeStyles } from '@material-ui/core'; -import { - Content, - ContentHeader, - SupportButton, - TableColumn, - TableProps, -} from '@backstage/core'; import { EntityKindPicker, EntityLifecyclePicker, @@ -33,11 +26,18 @@ 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, + TableProps, +} 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 3374c85a3a..1aaa50a7bf 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 5674d4e59c..bde116ea09 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 41c03474fc..60493d1847 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'; type NameColumnProps = { defaultKind?: string; diff --git a/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx b/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx index 43063aac1a..482a0c0a3c 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 b395ed451c..7f703ef912 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 b39720da0c..f57d3c5e4d 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 f2d41557f9..d224356300 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 4d72ec8aaa..05d93078b4 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 60bd68a680..e040c6a67f 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 b8c42ba170..9513050400 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/EntityLinksCard.tsx b/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx index ae7e312785..20229ceb14 100644 --- a/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx +++ b/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { IconComponent, IconKey, InfoCard, useApp } from '@backstage/core'; import { useEntity } from '@backstage/plugin-catalog-react'; import LanguageIcon from '@material-ui/icons/Language'; import React from 'react'; @@ -23,6 +22,9 @@ import { EntityLinksEmptyState } from './EntityLinksEmptyState'; import { LinksGridList } from './LinksGridList'; import { ColumnBreakpoints } from './types'; +import { IconComponent, useApp } from '@backstage/core-plugin-api'; +import { InfoCard } from '@backstage/core-components'; + type Props = { /** @deprecated The entity is now grabbed from context instead */ entity?: Entity; @@ -34,7 +36,7 @@ export const EntityLinksCard = ({ cols = undefined, variant }: Props) => { const { entity } = useEntity(); const app = useApp(); - const iconResolver = (key: IconKey | undefined): IconComponent => + const iconResolver = (key?: string): IconComponent => key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon; const links = entity?.metadata?.links; diff --git a/plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx b/plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx index 36fb04694a..b0e8ee5d74 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 c1bc8c5fc0..b114268e2e 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 { makeStyles, Box, 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 90731b4439..ea2c7ffcdc 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 f6ee67a009..862ef9504b 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 f7bc3611e7..cb5ea98031 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 12a990b5ff..9e26184a8d 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 f387d035e4..c9d2d94609 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 272cf7baf9..99052e51f0 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 e408d42a22..59271d2c60 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 8ba2340444..b3169802a2 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 80ae4f9aee..60793b9196 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 d9d8834869..ef74b49cef 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 fba7c88ac1..3e10788ab5 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 17d7de71c0..13dc4c9d55 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 8829bc3b57..8e3040ccf9 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 a7b1f18e36..d0e0d5dcce 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 491f8edba3..2b35d0f3b6 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 540ebb1071..5af4755bcb 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 113372b2c7..55ee42f253 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 8fce101bf2..abec90bad1 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 4b8384c2a0..52b04020a9 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 3ce3f0460d..9b2e68cc5d 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 e8cf014186..c375e76239 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 394fe6ba97..d1ee3e520a 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/api-report.md b/plugins/circleci/api-report.md index 6c774cc6b0..00b575efb8 100644 --- a/plugins/circleci/api-report.md +++ b/plugins/circleci/api-report.md @@ -4,18 +4,18 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { BuildStepAction } from 'circleci-api'; import { BuildSummary } from 'circleci-api'; import { BuildSummaryResponse } from 'circleci-api'; import { BuildWithSteps } from 'circleci-api'; import { CircleCIOptions } from 'circleci-api'; -import { DiscoveryApi } from '@backstage/core'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { GitType } from 'circleci-api'; import { Me } from 'circleci-api'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; export { BuildStepAction } diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json index 90e8b71174..1425e07e95 100644 --- a/plugins/circleci/package.json +++ b/plugins/circleci/package.json @@ -32,7 +32,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.3", - "@backstage/core": "^0.7.13", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.3", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -50,6 +51,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/circleci/src/api/CircleCIApi.ts b/plugins/circleci/src/api/CircleCIApi.ts index 24e0bed6f0..498cbb588a 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 8cc3d43970..3cdc0eea7a 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 42a59f56bd..40829e7e66 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 50de7f3298..1bc13d6327 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 d50a061fd5..740596ea2f 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 dcfa32ef37..197fab4a7b 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/api-report.md b/plugins/cloudbuild/api-report.md index 58dc59c175..2ebc1eb737 100644 --- a/plugins/cloudbuild/api-report.md +++ b/plugins/cloudbuild/api-report.md @@ -4,11 +4,11 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { OAuthApi } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { OAuthApi } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export type ActionsGetWorkflowResponseData = { diff --git a/plugins/cloudbuild/package.json b/plugins/cloudbuild/package.json index ffd765fbcd..46a02fdf27 100644 --- a/plugins/cloudbuild/package.json +++ b/plugins/cloudbuild/package.json @@ -31,8 +31,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", - "@backstage/core": "^0.7.11", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -48,6 +49,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/cloudbuild/src/api/CloudbuildApi.ts b/plugins/cloudbuild/src/api/CloudbuildApi.ts index ddc80ee0fb..2b09d24e64 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 e1be58cce5..ce9dfb700c 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 dd7dd6a697..a1c9b3c076 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 8a449d7d77..f9b9a8974f 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 6a2b6c851d..a6a63770ca 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 4c4beb2cd6..c074a24a86 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 a1ea661cf3..3f43d84ce4 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 8663643add..acacc8bec5 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 784592bee8..b1efeecbbe 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 c28a6c829f..62cf1ad01d 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 eaf996a733..5e3525c529 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/api-report.md b/plugins/code-coverage/api-report.md index bade5ddb8a..dffbaeec2a 100644 --- a/plugins/code-coverage/api-report.md +++ b/plugins/code-coverage/api-report.md @@ -4,9 +4,9 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const codeCoveragePlugin: BackstagePlugin<{ diff --git a/plugins/code-coverage/package.json b/plugins/code-coverage/package.json index 9d963ee50b..9b0da3b72c 100644 --- a/plugins/code-coverage/package.json +++ b/plugins/code-coverage/package.json @@ -22,14 +22,15 @@ "dependencies": { "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.4", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/errors": "^0.1.1", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", - "@material-ui/styles": "^4.11.0", "@material-ui/lab": "4.0.0-alpha.45", + "@material-ui/styles": "^4.11.0", "highlight.js": "^10.6.0", "react": "^16.13.1", "react-dom": "^16.13.1", @@ -40,6 +41,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/code-coverage/src/api.ts b/plugins/code-coverage/src/api.ts index e65ec0da3e..a4a7bba37c 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 89219ce323..1c321dd7c5 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 da64900a85..61dc7d7158 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 2e14248a75..06dbd19999 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 4b4ea2dc83..21052c0793 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 fb772f80c7..d3342b86eb 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 572a42aa10..9f413892b1 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 705c79025c..bf600ab92e 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/api-report.md b/plugins/config-schema/api-report.md index 67497be6b6..f623789076 100644 --- a/plugins/config-schema/api-report.md +++ b/plugins/config-schema/api-report.md @@ -4,10 +4,10 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { Observable } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; import { Schema } from 'jsonschema'; // @public (undocumented) diff --git a/plugins/config-schema/package.json b/plugins/config-schema/package.json index 50749bb1a7..f733744b50 100644 --- a/plugins/config-schema/package.json +++ b/plugins/config-schema/package.json @@ -21,20 +21,22 @@ }, "dependencies": { "@backstage/config": "^0.1.4", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/errors": "^0.1.1", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", "jsonschema": "^1.2.6", - "zen-observable": "^0.8.15", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-use": "^17.2.4" + "react-use": "^17.2.4", + "zen-observable": "^0.8.15" }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", @@ -42,8 +44,8 @@ "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", - "msw": "^0.21.2", - "cross-fetch": "^3.0.6" + "cross-fetch": "^3.0.6", + "msw": "^0.21.2" }, "files": [ "dist" diff --git a/plugins/config-schema/src/api/StaticSchemaLoader.ts b/plugins/config-schema/src/api/StaticSchemaLoader.ts index da82849d6e..8958f4cb5b 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 1a53c285c9..464ef970fb 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 0764e346a0..2eae3805c2 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 e14be3681d..49a209bc9e 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 c475c63b3f..ebbbdd129c 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/api-report.md b/plugins/cost-insights/api-report.md index 7476f75cad..d21159a845 100644 --- a/plugins/cost-insights/api-report.md +++ b/plugins/cost-insights/api-report.md @@ -4,9 +4,9 @@ ```ts -import { ApiRef } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePalette } from '@backstage/theme'; -import { BackstagePlugin } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { BackstageTheme } from '@backstage/theme'; import { ContentRenderer } from 'recharts'; import { Dispatch } from 'react'; @@ -16,7 +16,7 @@ import { PropsWithChildren } from 'react'; import { ReactNode } from 'react'; import { RechartsFunction } from 'recharts'; import { RefAttributes } from 'react'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; import { SetStateAction } from 'react'; import { TooltipProps } from 'recharts'; import { TypographyProps } from '@material-ui/core'; diff --git a/plugins/cost-insights/package.json b/plugins/cost-insights/package.json index 5ffb4c6f49..dd1e9536bf 100644 --- a/plugins/cost-insights/package.json +++ b/plugins/cost-insights/package.json @@ -31,7 +31,8 @@ }, "dependencies": { "@backstage/config": "^0.1.5", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -55,6 +56,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/cost-insights/src/api/CostInsightsApi.ts b/plugins/cost-insights/src/api/CostInsightsApi.ts index 684efe8413..40882ebd95 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 3da8600377..3749763fad 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 e5465e5bf3..4a38af3dbc 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 83de2f5f90..3d94ec19a2 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 40d488a2a1..93614bd64f 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 ed02028286..db5666768e 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 e47d086ead..0e096be5b3 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 d1e433dfd2..8a6fcded77 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 3361b18e7f..2247908fb3 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 bca5663fe1..50b2ff993c 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 1ae8193079..95ba4f2f2d 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 8a6adba0fc..a75141a7a3 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 4bf8647b6e..c8fa430c44 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 3601986ce6..89d2f28a45 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 3e56aacc0f..af44f434bf 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 7e1711fa59..e9d5877bf0 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 2b3279651d..bc61ffbf2b 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 bc8b4a0ee4..a2a33b0c92 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 f7ee46674e..6cbd0f7cd1 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 f91d5945ad..471debbaac 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 971537dca6..17a512ae9c 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 5c61a9df2f..6d2152b0a6 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 bed7ff5fbe..ee92909141 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,11 @@ import { import { ScrollContext, ScrollContextProps } from '../hooks/useScroll'; import { Group, Duration } from '../types'; +// TODO(Rugvip): Could be good to have a clear place to put test utils that is linted accordingly +// eslint-disable-next-line import/no-extraneous-dependencies +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/api-report.md b/plugins/explore-react/api-report.md index aaf272a06a..cb09408f4b 100644 --- a/plugins/explore-react/api-report.md +++ b/plugins/explore-react/api-report.md @@ -4,7 +4,7 @@ ```ts -import { ApiRef } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; // @public (undocumented) export type ExploreTool = { diff --git a/plugins/explore-react/package.json b/plugins/explore-react/package.json index cb178e9ae6..e19653ba89 100644 --- a/plugins/explore-react/package.json +++ b/plugins/explore-react/package.json @@ -28,7 +28,7 @@ "postpack": "backstage-cli postpack" }, "dependencies": { - "@backstage/core": "^0.7.9" + "@backstage/core-plugin-api": "^0.1.2" }, "devDependencies": { "@backstage/cli": "^0.7.0", diff --git a/plugins/explore-react/src/tools/api.ts b/plugins/explore-react/src/tools/api.ts index 28d037b9c1..33b4b7b66c 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/api-report.md b/plugins/explore/api-report.md index 4116247061..6755b0cfc2 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -4,10 +4,10 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { default } from 'react'; -import { ExternalRouteRef } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { ExternalRouteRef } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; import { TabProps } from '@material-ui/core'; // @public (undocumented) diff --git a/plugins/explore/package.json b/plugins/explore/package.json index 156a3f621e..4783dc7681 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -31,7 +31,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/plugin-explore-react": "^0.0.5", "@backstage/theme": "^0.2.8", @@ -48,6 +49,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx index 60c4f55e49..fc12a7f660 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 6914d19850..54beb59619 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 e2c9d40155..6c531d1db1 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 fe854507fe..db44631c4c 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 8137996d88..ca1a0a1a20 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 45117121ea..c28238427f 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 1265a03f3e..5044b09f83 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 b953e3a063..53e55b96bf 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 2eda8ec7a0..6953cf57a2 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 c4bef3334c..71252e319c 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 e2a6a4a407..8accf8fd30 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 72c650344f..afeeb28f6e 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 f178478e71..29904edd02 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 86e9d04a91..cefb884834 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 a7be8e2948..783d334749 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/api-report.md b/plugins/fossa/api-report.md index edb2cfdd0a..a02fba732f 100644 --- a/plugins/fossa/api-report.md +++ b/plugins/fossa/api-report.md @@ -4,9 +4,9 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; -import { InfoCardVariants } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { InfoCardVariants } from '@backstage/core-components'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntityFossaCard: ({ variant }: { diff --git a/plugins/fossa/dev/index.tsx b/plugins/fossa/dev/index.tsx index e6b38d7229..83fa209c31 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/package.json b/plugins/fossa/package.json index e45f0f2789..29cf7d5969 100644 --- a/plugins/fossa/package.json +++ b/plugins/fossa/package.json @@ -32,7 +32,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/errors": "^0.1.1", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", @@ -48,6 +49,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/fossa/src/api/FossaApi.ts b/plugins/fossa/src/api/FossaApi.ts index b15c876dfd..918eab62a4 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 8a680a93ad..7cb359f979 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 cc5e39cc1c..e2a21f3ef6 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 50e1c32124..3c771bd7d6 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 a3e162c3c5..a6cedfb931 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 999fb7b40c..1baeb36465 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 c8ffe260ca..3e16085968 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 1a58dc0ff5..ee11edeade 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 ce1c79dc8f..a586d6d8a6 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 ab9cef4b2d..3f1b7e290f 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/api-report.md b/plugins/gcp-projects/api-report.md index 22812822c0..bbe8d3edac 100644 --- a/plugins/gcp-projects/api-report.md +++ b/plugins/gcp-projects/api-report.md @@ -4,10 +4,10 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { OAuthApi } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { OAuthApi } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export type GcpApi = { diff --git a/plugins/gcp-projects/package.json b/plugins/gcp-projects/package.json index 6eab528ff6..400d793195 100644 --- a/plugins/gcp-projects/package.json +++ b/plugins/gcp-projects/package.json @@ -30,7 +30,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -42,6 +43,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/gcp-projects/src/api/GcpApi.ts b/plugins/gcp-projects/src/api/GcpApi.ts index c07dc5f401..5626796a05 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 6764ed3d69..f226e3b20c 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 eaa121777c..584cffc50c 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 e0c04d46a0..0acc191e8a 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 b0413d6e92..db3999272a 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 5861b7969d..4aa86a111d 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 2f6de68d54..2d302a178d 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/api-report.md b/plugins/git-release-manager/api-report.md index d898f83dd6..2948f441bc 100644 --- a/plugins/git-release-manager/api-report.md +++ b/plugins/git-release-manager/api-report.md @@ -4,9 +4,9 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const gitReleaseManagerApiRef: ApiRef; diff --git a/plugins/git-release-manager/package.json b/plugins/git-release-manager/package.json index 3a492d7562..19925d7282 100644 --- a/plugins/git-release-manager/package.json +++ b/plugins/git-release-manager/package.json @@ -20,32 +20,34 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/integration": "^0.5.6", "@backstage/theme": "^0.2.8", - "recharts": "^1.8.5", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", "@octokit/rest": "^18.5.3", "luxon": "^1.26.0", "qs": "^6.10.1", + "react": "^16.13.1", "react-dom": "^16.13.1", "react-router": "6.0.0-beta.0", "react-use": "^17.2.4", - "react": "^16.13.1" + "recharts": "^1.8.5" }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", - "@types/recharts": "^1.8.15", - "@testing-library/react-hooks": "^3.4.2", "@testing-library/react": "^11.2.5", + "@testing-library/react-hooks": "^3.4.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", + "@types/recharts": "^1.8.15", "cross-fetch": "^3.0.6", "msw": "^0.21.2" }, diff --git a/plugins/git-release-manager/src/GitReleaseManager.tsx b/plugins/git-release-manager/src/GitReleaseManager.tsx index 54981e5164..44669f9bc7 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 b1c4623cb2..9125cb6110 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 d32a4f1f4e..b0f1a163a9 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 dd0f08f1c5..75f0203e47 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 7c1c61d701..bd0b79ba37 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 745c0a04ab..360ebc8169 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.test.tsx b/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.test.tsx index 632540d819..b1427058dd 100644 --- a/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.test.tsx +++ b/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.test.tsx @@ -26,8 +26,8 @@ import { } from '../../../test-helpers/test-helpers'; import { useCreateReleaseCandidate } from './useCreateReleaseCandidate'; -jest.mock('@backstage/core', () => ({ - ...jest.requireActual('@backstage/core'), +jest.mock('@backstage/core-plugin-api', () => ({ + ...jest.requireActual('@backstage/core-plugin-api'), useApi: () => mockApiClient, })); jest.mock('../../../contexts/UserContext', () => ({ 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 89ff77105f..0d6d4ebb4f 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.test.tsx b/plugins/git-release-manager/src/features/Features.test.tsx index e8e9097c98..ac3004f690 100644 --- a/plugins/git-release-manager/src/features/Features.test.tsx +++ b/plugins/git-release-manager/src/features/Features.test.tsx @@ -21,8 +21,8 @@ import { Features } from './Features'; import { mockApiClient, mockCalverProject } from '../test-helpers/test-helpers'; import { TEST_IDS } from '../test-helpers/test-ids'; -jest.mock('@backstage/core', () => ({ - ...jest.requireActual('@backstage/core'), +jest.mock('@backstage/core-plugin-api', () => ({ + ...jest.requireActual('@backstage/core-plugin-api'), useApi: () => mockApiClient, })); jest.mock('../contexts/ProjectContext', () => ({ diff --git a/plugins/git-release-manager/src/features/Features.tsx b/plugins/git-release-manager/src/features/Features.tsx index 8a2009fb3e..4014f26f73 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 c05fb2528a..7a834ca5d4 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.test.tsx b/plugins/git-release-manager/src/features/Patch/PatchBody.test.tsx index 524779cf88..85c8194be0 100644 --- a/plugins/git-release-manager/src/features/Patch/PatchBody.test.tsx +++ b/plugins/git-release-manager/src/features/Patch/PatchBody.test.tsx @@ -29,8 +29,8 @@ import { import { PatchBody } from './PatchBody'; import { TEST_IDS } from '../../test-helpers/test-ids'; -jest.mock('@backstage/core', () => ({ - ...jest.requireActual('@backstage/core'), +jest.mock('@backstage/core-plugin-api', () => ({ + ...jest.requireActual('@backstage/core-plugin-api'), useApi: () => mockApiClient, })); jest.mock('../../contexts/ProjectContext', () => ({ diff --git a/plugins/git-release-manager/src/features/Patch/PatchBody.tsx b/plugins/git-release-manager/src/features/Patch/PatchBody.tsx index b957a48fc1..b4e705fa58 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.test.ts b/plugins/git-release-manager/src/features/Patch/hooks/usePatch.test.ts index a86a51bc00..05e3a4dd2f 100644 --- a/plugins/git-release-manager/src/features/Patch/hooks/usePatch.test.ts +++ b/plugins/git-release-manager/src/features/Patch/hooks/usePatch.test.ts @@ -28,8 +28,8 @@ import { } from '../../../test-helpers/test-helpers'; import { usePatch } from './usePatch'; -jest.mock('@backstage/core', () => ({ - ...jest.requireActual('@backstage/core'), +jest.mock('@backstage/core-plugin-api', () => ({ + ...jest.requireActual('@backstage/core-plugin-api'), useApi: () => mockApiClient, })); jest.mock('../../../contexts/UserContext', () => ({ 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 22a179f2a2..5d3f9829ad 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.test.ts b/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.test.ts index 6c62557852..a2e64fcd38 100644 --- a/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.test.ts +++ b/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.test.ts @@ -25,8 +25,8 @@ import { } from '../../../test-helpers/test-helpers'; import { usePromoteRc } from './usePromoteRc'; -jest.mock('@backstage/core', () => ({ - ...jest.requireActual('@backstage/core'), +jest.mock('@backstage/core-plugin-api', () => ({ + ...jest.requireActual('@backstage/core-plugin-api'), useApi: () => mockApiClient, })); jest.mock('../../../contexts/ProjectContext', () => ({ 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 b419f0840c..357ba1e0a6 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.test.tsx b/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.test.tsx index 68a4124637..201577268c 100644 --- a/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.test.tsx +++ b/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.test.tsx @@ -33,8 +33,8 @@ jest.mock('react-router', () => ({ search: mockSearchCalver, })), })); -jest.mock('@backstage/core', () => ({ - ...jest.requireActual('@backstage/core'), +jest.mock('@backstage/core-plugin-api', () => ({ + ...jest.requireActual('@backstage/core-plugin-api'), useApi: () => mockApiClient, })); jest.mock('../../contexts/ProjectContext', () => ({ diff --git a/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx b/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx index c8905a7e99..2774bfbc5e 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.test.tsx b/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.test.tsx index a4a2779188..0fc05fddf2 100644 --- a/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.test.tsx +++ b/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.test.tsx @@ -32,8 +32,8 @@ jest.mock('react-router', () => ({ search: mockSearchCalver, })), })); -jest.mock('@backstage/core', () => ({ - ...jest.requireActual('@backstage/core'), +jest.mock('@backstage/core-plugin-api', () => ({ + ...jest.requireActual('@backstage/core-plugin-api'), useApi: () => mockApiClient, })); jest.mock('../../contexts/ProjectContext', () => ({ diff --git a/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx b/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx index 3e298476f1..2b3ebb5058 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 d008c1ed18..3d0e80ba81 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 b16f859cc8..8707fc0920 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 c99b5a2f8b..a8e3e81642 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 d984a66076..d05240a652 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 5c174fadab..0af0dcb343 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 4eb5b5dd87..511fd4b92e 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 d2e79d9b6e..01e4cdf7ff 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/api-report.md b/plugins/github-actions/api-report.md index 1795bbdbea..d3fe532c7b 100644 --- a/plugins/github-actions/api-report.md +++ b/plugins/github-actions/api-report.md @@ -4,14 +4,14 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { ConfigApi } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { ConfigApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { InfoCardVariants } from '@backstage/core'; -import { OAuthApi } from '@backstage/core'; +import { InfoCardVariants } from '@backstage/core-components'; +import { OAuthApi } from '@backstage/core-plugin-api'; import { RestEndpointMethodTypes } from '@octokit/rest'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export enum BuildStatus { diff --git a/plugins/github-actions/package.json b/plugins/github-actions/package.json index ebbf82ccce..b01208a670 100644 --- a/plugins/github-actions/package.json +++ b/plugins/github-actions/package.json @@ -33,9 +33,10 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/plugin-catalog-react": "^0.2.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/integration": "^0.5.6", + "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -51,6 +52,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/github-actions/src/api/GithubActionsApi.ts b/plugins/github-actions/src/api/GithubActionsApi.ts index 4323f24d80..e30145c4b3 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 94554ab94a..97ee1860a1 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 ef6831279f..6f6531044e 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 abd402a1d7..4a4452be5c 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 f7c214614b..3423bea84d 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 a399fb7d5d..cbf29d1d9d 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 e88d504237..4b5da51ce8 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 88370ed06e..a27e3725f2 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 6b2a770400..e62b4f1529 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 78e88ba9a8..ce33ae3781 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 e46eedd7da..e1717509f5 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 90eabb2e00..2eb01462b9 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 a5c0fbad0e..34191bd307 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 bfaf9bf2c9..4610db07e9 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 6605e3dd97..89333e52d5 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 59e75cd738..6e1d8a885a 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/package.json b/plugins/github-deployments/package.json index cc98232b2d..52dc70d9aa 100644 --- a/plugins/github-deployments/package.json +++ b/plugins/github-deployments/package.json @@ -21,7 +21,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/errors": "^0.1.1", "@backstage/integration": "^0.5.6", "@backstage/integration-react": "^0.1.3", @@ -38,6 +39,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/github-deployments/src/api/index.ts b/plugins/github-deployments/src/api/index.ts index 607df6b309..bec0167f63 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 04239545d0..474b4a5941 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 34b4b993fc..19cc9ac6e8 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 86863f272e..2de7cdf419 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 a2cb5b1895..e892b12427 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 22fb8ca53e..ba48857c3c 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 4422f2f7c4..dad016781e 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/api-report.md b/plugins/gitops-profiles/api-report.md index aad08f2b43..4690e41414 100644 --- a/plugins/gitops-profiles/api-report.md +++ b/plugins/gitops-profiles/api-report.md @@ -4,9 +4,9 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export interface ApplyProfileRequest { diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json index 8171e2ae83..cdb0cfa18a 100644 --- a/plugins/gitops-profiles/package.json +++ b/plugins/gitops-profiles/package.json @@ -31,7 +31,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -43,6 +44,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/gitops-profiles/src/api.ts b/plugins/gitops-profiles/src/api.ts index 2aeee8d9fc..86cfd805c9 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 91ba3d1099..401a6d00d0 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 de898705a8..117159cc56 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 d6b7fabfe2..28c4bb65f3 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 b5f1fa8e62..8dba498507 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 2b0874ee8b..79ab73afdc 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 eccfae2782..3232c644d4 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 a390109ad6..d57edcca2c 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/api-report.md b/plugins/graphiql/api-report.md index 7c73b6a985..4e78e34f6a 100644 --- a/plugins/graphiql/api-report.md +++ b/plugins/graphiql/api-report.md @@ -7,7 +7,7 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { ErrorApi } from '@backstage/core-plugin-api'; -import { IconComponent } from '@backstage/core'; +import { IconComponent } from '@backstage/core-plugin-api'; import { OAuthApi } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; diff --git a/plugins/graphiql/dev/index.tsx b/plugins/graphiql/dev/index.tsx index b97a977f51..163b4d0512 100644 --- a/plugins/graphiql/dev/index.tsx +++ b/plugins/graphiql/dev/index.tsx @@ -16,7 +16,11 @@ import React from 'react'; import { createDevApp } from '@backstage/dev-utils'; -import { githubAuthApiRef, errorApiRef } from '@backstage/core-plugin-api'; +import { + githubAuthApiRef, + errorApiRef, + IconComponent, +} from '@backstage/core-plugin-api'; import GraphiQLIcon from '../src/assets/graphiql.icon.svg'; import { graphiqlPlugin, @@ -56,7 +60,7 @@ createDevApp() }) .addPage({ title: 'GraphiQL', - icon: GraphiQLIcon, + icon: GraphiQLIcon as IconComponent, element: , }) .render(); diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json index 4a8f7ec366..6ec5ae1168 100644 --- a/plugins/graphiql/package.json +++ b/plugins/graphiql/package.json @@ -31,7 +31,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -45,6 +45,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/graphiql/src/components/GraphiQLBrowser/GraphiQLBrowser.tsx b/plugins/graphiql/src/components/GraphiQLBrowser/GraphiQLBrowser.tsx index 8d12ec8f89..b4321343a1 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 165fe1911c..4e426d4364 100644 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.test.tsx +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.test.tsx @@ -18,10 +18,15 @@ 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 { configApiRef } from '@backstage/core-plugin-api'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; jest.mock('../GraphiQLBrowser', () => ({ GraphiQLBrowser: () => '', @@ -38,7 +43,12 @@ describe('GraphiQLPage', () => { }; const rendered = await renderWithEffects( - + @@ -61,7 +71,12 @@ describe('GraphiQLPage', () => { }; const rendered = await renderWithEffects( - + @@ -80,7 +95,12 @@ describe('GraphiQLPage', () => { }; const rendered = await renderWithEffects( - + diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx index 32371c894e..58cf332615 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 b8f836fcb9..8efb4461d7 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, @@ -25,4 +25,4 @@ export { export { GraphiQLPage as Router } from './components'; export * from './lib/api'; export * from './route-refs'; -export const GraphiQLIcon: IconComponent = GraphiQLIconComponent; +export const GraphiQLIcon: IconComponent = GraphiQLIconComponent as IconComponent; diff --git a/plugins/ilert/api-report.md b/plugins/ilert/api-report.md index f61b43b90b..376e7e4dfd 100644 --- a/plugins/ilert/api-report.md +++ b/plugins/ilert/api-report.md @@ -4,13 +4,13 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { ConfigApi } from '@backstage/core'; -import { DiscoveryApi } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { ConfigApi } from '@backstage/core-plugin-api'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { IconComponent } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { IconComponent } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntityILertCard: () => JSX.Element; diff --git a/plugins/ilert/package.json b/plugins/ilert/package.json index cb7fec1721..4813dc2bbf 100644 --- a/plugins/ilert/package.json +++ b/plugins/ilert/package.json @@ -21,7 +21,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/errors": "^0.1.1", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", @@ -38,6 +39,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/ilert/src/api/client.ts b/plugins/ilert/src/api/client.ts index 99491cae74..f05e58878f 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 f604d5d39a..3a085bdb5b 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 f895e1c037..e195791eec 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 4cd632e5f8..d698b9c2d1 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 4ea0779b32..4e0b562369 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 7e4dcaa596..b386cb628b 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 7cc1409b63..4155a9f24b 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 60d48fedc0..a0b236cf8f 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 0a3167701b..6ed66086ea 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 6839271f9a..c532cd7f64 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 761da8d848..8d167819d4 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 4065709362..5fd8a97df3 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 6298012358..381a656b72 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 c81b46039a..006abec1e4 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 5b60e31a26..e6eb1525f7 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 aa8b68cefd..3dc0907777 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 332e552de0..de819c4cc2 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 c16fd0d421..dec981ce01 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 5647da5735..2cde7a0bf2 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 82d7685347..618c35dbc3 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 94c042cbcd..2d25f8e50e 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 7202ae955f..c70a8a40f0 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 1be2771fcc..33612d492b 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 aafe0b46e9..6d93385eb2 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 b32ee31778..c26aecff6a 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 962ff3810e..c4aeb59527 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 d0a3ac42ae..d43f6dca6d 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 d262aea5ad..4e20e3b56a 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 289b6f33e8..286c53a5c5 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 967bb246cf..af812ec060 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 e4644e9551..c11327ffe8 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 26133936c2..33470f9607 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 1e543a7c53..6efaf86be8 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 27703f1c54..c28153c27e 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, @@ -30,4 +30,4 @@ export { } from './components'; export * from './api'; export * from './route-refs'; -export const ILertIcon: IconComponent = ILertIconComponent; +export const ILertIcon: IconComponent = ILertIconComponent as IconComponent; diff --git a/plugins/ilert/src/plugin.ts b/plugins/ilert/src/plugin.ts index 4bf93a8d59..5caaa21f71 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 7994c9a117..97d11df98a 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/api-report.md b/plugins/jenkins/api-report.md index 4c88aab70c..1a1c77479d 100644 --- a/plugins/jenkins/api-report.md +++ b/plugins/jenkins/api-report.md @@ -4,12 +4,12 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { DiscoveryApi } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { InfoCardVariants } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { InfoCardVariants } from '@backstage/core-components'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntityJenkinsContent: (_props: { diff --git a/plugins/jenkins/package.json b/plugins/jenkins/package.json index bf65ed381c..f9fb4e9a23 100644 --- a/plugins/jenkins/package.json +++ b/plugins/jenkins/package.json @@ -32,7 +32,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.3", - "@backstage/core": "^0.7.13", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.3", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -48,6 +49,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/jenkins/src/api/JenkinsApi.ts b/plugins/jenkins/src/api/JenkinsApi.ts index d7a38abd02..c378e15693 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 5400069268..0bfd2bb5d8 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 14392bd36f..6e456bd281 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 4380daeb9b..b3c8a95b07 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 38ebb800aa..a2f3009099 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 9a5b2ddd1a..21044a194d 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 9ff3212df7..bb5d7b9108 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 638d984f59..9625d8abbb 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 68110813e0..49be4893a7 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 ea3a87b68a..2548612896 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/api-report.md b/plugins/kafka/api-report.md index acb213fd53..66551aa71e 100644 --- a/plugins/kafka/api-report.md +++ b/plugins/kafka/api-report.md @@ -4,9 +4,9 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntityKafkaContent: (_props: { diff --git a/plugins/kafka/package.json b/plugins/kafka/package.json index 4cfe3f1e0b..96e55372e6 100644 --- a/plugins/kafka/package.json +++ b/plugins/kafka/package.json @@ -21,7 +21,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -34,6 +35,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/kafka/src/Router.tsx b/plugins/kafka/src/Router.tsx index 1f1389b7e9..977c71712e 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 b2966a75f3..988939ff1a 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 daa2f46223..80a0866290 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 dc59ecee10..79f38af42f 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 8905cb09f2..193d821ac9 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 506eb33d9b..866b63b8bf 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 7f193ad520..8569c1d089 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/api-report.md b/plugins/kubernetes/api-report.md index 2f1b5155fd..9c8a1fe537 100644 --- a/plugins/kubernetes/api-report.md +++ b/plugins/kubernetes/api-report.md @@ -4,12 +4,12 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; -import { OAuthApi } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { OAuthApi } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntityKubernetesContent: (_props: { diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json index a370335c20..c0c9217497 100644 --- a/plugins/kubernetes/package.json +++ b/plugins/kubernetes/package.json @@ -32,7 +32,8 @@ "dependencies": { "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/plugin-kubernetes-common": "^0.1.1", "@backstage/theme": "^0.2.8", @@ -50,6 +51,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/kubernetes/src/Router.tsx b/plugins/kubernetes/src/Router.tsx index 624387cdaa..11c9b488fb 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 bba52989a7..3f6a0394d3 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 8bc0a8747f..5132c8794d 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 4410223b78..ae98e4e668 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 5fee27574f..f0bd92c5bf 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 860dedafa0..5bbeee1c64 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 80f65ce330..29107ac210 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 799edb4aee..d8632488ad 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 073fc67a82..fcdeeef393 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 2f876f98c8..004473dd63 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 b46bb05ecd..274643b2da 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 ee589cd152..7b5497ff37 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 07df38ef3b..f96bdc8e0b 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 59d1e5cd3c..0acbef8af3 100644 --- a/plugins/kubernetes/src/hooks/useKubernetesObjects.test.ts +++ b/plugins/kubernetes/src/hooks/useKubernetesObjects.test.ts @@ -16,10 +16,10 @@ 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'); +jest.mock('@backstage/core-plugin-api'); const entity = { metadata: { diff --git a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts index 9b9ca38a0c..0c4fbdef54 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 bbb5643d54..058ecf07a3 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 150c28bdf1..118d5904a4 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 d3aa506f63..fb6f773d84 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 ad394bc60e..a544ed722a 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 196c6d1c2a..8be2d839c3 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/api-report.md b/plugins/lighthouse/api-report.md index 18d8358257..1a2295f891 100644 --- a/plugins/lighthouse/api-report.md +++ b/plugins/lighthouse/api-report.md @@ -4,12 +4,12 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Config } from '@backstage/config'; import { Entity } from '@backstage/catalog-model'; -import { InfoCardVariants } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { InfoCardVariants } from '@backstage/core-components'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export type Audit = AuditRunning | AuditFailed | AuditCompleted; diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index 6a2148b00b..5fd6eeaaea 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -33,7 +33,8 @@ "dependencies": { "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.4", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -47,6 +48,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/lighthouse/src/Router.tsx b/plugins/lighthouse/src/Router.tsx index 7ab3f23b0a..917001c591 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 9527e812db..7dbd48b960 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 620389e515..c4bd898f89 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 56bbae012b..6251a9ba34 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 cfda69096b..e9a70bd54b 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 0f072a020f..ef9ec34a6a 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 ed87acea8b..2781bc4c5b 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 abb74a3d2d..5739c1fd7b 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 ddfde7f3cf..52ba2e00cf 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 bf8fd68a7f..0614f5f183 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 da32bf228a..7f9e7e7113 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 8466c4e38d..fc44397330 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 2448fed9be..6bdf6d779f 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 bcedb6bf25..f83ad6a8a3 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 a9cead41b3..b569429b03 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 1ff3cdb2dc..5eeff7a748 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 25a26041c4..85ed149b0e 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 8e1a4699f0..dc6695eccc 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 c3f80f5f16..5919f39bc4 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/api-report.md b/plugins/newrelic/api-report.md index e472405e22..db5dd073df 100644 --- a/plugins/newrelic/api-report.md +++ b/plugins/newrelic/api-report.md @@ -4,8 +4,8 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const NewRelicPage: () => JSX.Element; diff --git a/plugins/newrelic/package.json b/plugins/newrelic/package.json index 6a26dccca1..483001913d 100644 --- a/plugins/newrelic/package.json +++ b/plugins/newrelic/package.json @@ -31,7 +31,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -42,6 +43,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/newrelic/src/api/index.ts b/plugins/newrelic/src/api/index.ts index cb1fc53531..980a690d40 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 9d1418d62a..e11649e520 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 b76e8b15d5..72945155fc 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 d977679921..7e35c06dd4 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/api-report.md b/plugins/org/api-report.md index cb3fa445f0..fa8d3ea80e 100644 --- a/plugins/org/api-report.md +++ b/plugins/org/api-report.md @@ -4,10 +4,10 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { GroupEntity } from '@backstage/catalog-model'; -import { InfoCardVariants } from '@backstage/core'; +import { InfoCardVariants } from '@backstage/core-components'; import { UserEntity } from '@backstage/catalog-model'; // @public (undocumented) diff --git a/plugins/org/package.json b/plugins/org/package.json index 0314bf2e03..58570d1dd9 100644 --- a/plugins/org/package.json +++ b/plugins/org/package.json @@ -21,8 +21,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", - "@backstage/core-api": "^0.2.22", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -36,6 +36,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/org/src/components/Cards/Group/GroupProfile/GroupProfileCard.tsx b/plugins/org/src/components/Cards/Group/GroupProfile/GroupProfileCard.tsx index f6a9325603..853dbc53e8 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.stories.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.stories.tsx index 35d8fbe6a2..f3dae18e77 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.stories.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.stories.tsx @@ -15,7 +15,7 @@ */ import { Entity, GroupEntity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core-api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; import { catalogApiRef, EntityContext } from '@backstage/plugin-catalog-react'; import { Grid } from '@material-ui/core'; import React from 'react'; 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 f65b1daafc..75cb9efd7f 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 ba20d04439..31b5c3f5c0 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.stories.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.stories.tsx index a4dcd12694..b40ef6d54b 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.stories.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.stories.tsx @@ -15,7 +15,7 @@ */ import { GroupEntity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry } from '@backstage/core-api'; +import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; import { CatalogApi, catalogApiRef, diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx index 0dc31d146f..bfaca73bc0 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 0d320f182b..b00ecb5566 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 672a992b19..30709fe68b 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 2f3ffdc069..29696fe0e0 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/api-report.md b/plugins/pagerduty/api-report.md index b3457ccb12..bb3853ae49 100644 --- a/plugins/pagerduty/api-report.md +++ b/plugins/pagerduty/api-report.md @@ -4,10 +4,10 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { ConfigApi } from '@backstage/core'; -import { DiscoveryApi } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { ConfigApi } from '@backstage/core-plugin-api'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { PropsWithChildren } from 'react'; diff --git a/plugins/pagerduty/package.json b/plugins/pagerduty/package.json index 8d07d8b1de..2557748844 100644 --- a/plugins/pagerduty/package.json +++ b/plugins/pagerduty/package.json @@ -31,7 +31,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -47,6 +48,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/pagerduty/src/api/client.ts b/plugins/pagerduty/src/api/client.ts index 6ed96973d4..a642ae6711 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 e2de65a3c8..d5911b4bde 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 047acb48e2..800f2db064 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 796792f8ab..7dc3c3d118 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 1f315bb21e..b4c10ddcf8 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 716da8ff69..d66acc0879 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 5dcacf53b0..d7ce1b13a3 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 983b5ac190..1b3ec47336 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 436ec7c925..7d370d9b87 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 9e698b72cc..21f0dd5f1d 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 23abd55371..3e873d704c 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 e35f35d492..c5b62de15a 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 12d64e984a..439d1ce63d 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/api-report.md b/plugins/register-component/api-report.md index 401031d0ac..b41bf50f05 100644 --- a/plugins/register-component/api-report.md +++ b/plugins/register-component/api-report.md @@ -4,8 +4,8 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const RegisterComponentPage: ({ catalogRouteRef, }: { diff --git a/plugins/register-component/package.json b/plugins/register-component/package.json index e7c10681ba..af01167e2c 100644 --- a/plugins/register-component/package.json +++ b/plugins/register-component/package.json @@ -31,7 +31,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -46,6 +47,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/register-component/src/components/RegisterComponentPage/RegisterComponentPage.test.tsx b/plugins/register-component/src/components/RegisterComponentPage/RegisterComponentPage.test.tsx index dcef342fb0..c04ce43732 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 2df90dca2a..27ed7346ea 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 e276b1e755..db185d111b 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 5999a60f33..e13f2ac229 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 b519e6cb46..88f8d22f38 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 b544beb76f..61e998c94f 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/api-report.md b/plugins/rollbar/api-report.md index 7049414389..44bd9d0d5e 100644 --- a/plugins/rollbar/api-report.md +++ b/plugins/rollbar/api-report.md @@ -4,12 +4,12 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { DiscoveryApi } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { IdentityApi } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { IdentityApi } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntityPageRollbar: (_props: Props) => JSX.Element; diff --git a/plugins/rollbar/package.json b/plugins/rollbar/package.json index e0e5011a59..18574ca1d3 100644 --- a/plugins/rollbar/package.json +++ b/plugins/rollbar/package.json @@ -32,7 +32,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -48,6 +49,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/rollbar/src/api/RollbarApi.ts b/plugins/rollbar/src/api/RollbarApi.ts index f2b74aa1f9..4c28630db6 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 20deda6535..d3a88be46d 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 021d48fb01..45d1ab8e4f 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 7acf7ca3f2..845da22a20 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 67d770f833..eeb2a6eded 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 46b8a0c9f2..7e1626e6b4 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 bda8599812..150b611fae 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 7530468e06..1277678af7 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 394f2f71e7..d134bf5112 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/api-report.md b/plugins/scaffolder/api-report.md index 85c2142d5e..5da1869fc2 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -4,21 +4,21 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { DiscoveryApi } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; import { EntityName } from '@backstage/catalog-model'; -import { Extension } from '@backstage/core'; -import { ExternalRouteRef } from '@backstage/core'; +import { Extension } from '@backstage/core-plugin-api'; +import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { FieldProps } from '@rjsf/core'; import { FieldValidation } from '@rjsf/core'; -import { IdentityApi } from '@backstage/core'; +import { IdentityApi } from '@backstage/core-plugin-api'; import { JsonObject } from '@backstage/config'; import { JSONSchema } from '@backstage/catalog-model'; import { JsonValue } from '@backstage/config'; -import { Observable } from '@backstage/core'; +import { Observable } from '@backstage/core-plugin-api'; import { default as React_2 } from 'react'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; import { ScmIntegrationRegistry } from '@backstage/integration'; // @public (undocumented) diff --git a/plugins/scaffolder/dev/index.tsx b/plugins/scaffolder/dev/index.tsx index 10ef291dcb..3a749792f1 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/package.json b/plugins/scaffolder/package.json index 120cd7e297..1afa6241fc 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -33,12 +33,12 @@ "@backstage/catalog-client": "^0.3.13", "@backstage/catalog-model": "^0.8.2", "@backstage/config": "^0.1.5", - "@backstage/core": "^0.7.12", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", + "@backstage/errors": "^0.1.1", "@backstage/integration": "^0.5.6", "@backstage/integration-react": "^0.1.3", "@backstage/plugin-catalog-react": "^0.2.2", - "@backstage/core-plugin-api": "^0.1.2", - "@backstage/errors": "^0.1.1", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -63,6 +63,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/scaffolder/src/api.test.ts b/plugins/scaffolder/src/api.test.ts index f42ede8390..cc4b70283c 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 57d70a7be6..85df77f2f5 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 3fbc0fcee5..77c8240974 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 6230bd17ac..78960c8297 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 9891dcc11c..0fc998f82e 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 ace262c19f..3b85125da0 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 e97d814a46..5875646fae 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 0236eca339..2637a1f95c 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 afe6d23cc0..1d16e50568 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 aa9e73605a..dd0b3da876 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 d9e308e8e0..aeb47b2789 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/TaskPage/TaskPageLinks.tsx b/plugins/scaffolder/src/components/TaskPage/TaskPageLinks.tsx index b495df01dd..2adec564a1 100644 --- a/plugins/scaffolder/src/components/TaskPage/TaskPageLinks.tsx +++ b/plugins/scaffolder/src/components/TaskPage/TaskPageLinks.tsx @@ -15,13 +15,13 @@ */ import { parseEntityName } from '@backstage/catalog-model'; -import { IconComponent, IconKey, useApp, useRouteRef } from '@backstage/core'; import { entityRouteRef } from '@backstage/plugin-catalog-react'; import { Box } from '@material-ui/core'; import LanguageIcon from '@material-ui/icons/Language'; import React from 'react'; import { TaskOutput } from '../../types'; import { IconLink } from './IconLink'; +import { IconComponent, useApp, useRouteRef } from '@backstage/core-plugin-api'; type TaskPageLinksProps = { output: TaskOutput; @@ -33,7 +33,7 @@ export const TaskPageLinks = ({ output }: TaskPageLinksProps) => { const app = useApp(); const entityRoute = useRouteRef(entityRouteRef); - const iconResolver = (key: IconKey | undefined): IconComponent => + const iconResolver = (key?: string): IconComponent => key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon; if (remoteUrl) { diff --git a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx index 1a51cdb06c..ad91fc6cfd 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 522f94ac4d..51e1ee5fbc 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 f6a051ff9e..3caece4878 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 c5bf76c319..380a5e810e 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 8354311344..04693a94cd 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 1ee7f816c2..5e47f9f0f9 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 dcf9fc7253..4287d1147b 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 3bd20da851..9eb1666db4 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 ec0ac4adc4..f53052cb67 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 c4da1ab103..7aa1a21643 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 7843ef2d48..5a03ecb425 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 149388f8d1..e12305639e 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 43b5b02f68..9b4861fc1e 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/api-report.md b/plugins/search/api-report.md index 181f049f63..5451ed9adb 100644 --- a/plugins/search/api-report.md +++ b/plugins/search/api-report.md @@ -4,14 +4,14 @@ ```ts -import { ApiRef } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; import { AsyncState } from 'react-use/lib/useAsync'; -import { BackstagePlugin } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { IndexableDocument } from '@backstage/search-common'; import { JsonObject } from '@backstage/config'; import { default as React_2 } from 'react'; import { ReactElement } from 'react'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; import { SearchQuery } from '@backstage/search-common'; import { SearchResult as SearchResult_2 } from '@backstage/search-common'; import { SearchResultSet } from '@backstage/search-common'; diff --git a/plugins/search/package.json b/plugins/search/package.json index 5c84748e06..4c43b55f38 100644 --- a/plugins/search/package.json +++ b/plugins/search/package.json @@ -29,11 +29,12 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.7.11", "@backstage/catalog-model": "^0.8.2", + "@backstage/config": "^0.1.5", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", "@backstage/search-common": "^0.1.2", - "@backstage/config": "^0.1.5", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -48,15 +49,16 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", "@testing-library/react-hooks": "^3.4.2", "@testing-library/user-event": "^13.1.8", - "@types/react": "^16.9", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", + "@types/react": "^16.9", "cross-fetch": "^3.0.6", "msw": "^0.21.2" }, diff --git a/plugins/search/src/apis.ts b/plugins/search/src/apis.ts index 7b4be36e9f..da8332bd44 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 e6927cd947..8cb560b7e5 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 45feaa3580..c8f2e538cb 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 9a6c1db400..95148c1a76 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 da6975b6f3..b99b375252 100644 --- a/plugins/search/src/components/SearchBar/SearchBar.test.tsx +++ b/plugins/search/src/components/SearchBar/SearchBar.test.tsx @@ -17,13 +17,13 @@ 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'; -jest.mock('@backstage/core', () => ({ - ...jest.requireActual('@backstage/core'), +import { SearchBar } from './SearchBar'; +import { useApi } from '@backstage/core-plugin-api'; + +jest.mock('@backstage/core-plugin-api', () => ({ + ...jest.requireActual('@backstage/core-plugin-api'), useApi: jest.fn().mockReturnValue({}), })); diff --git a/plugins/search/src/components/SearchContext/SearchContext.test.tsx b/plugins/search/src/components/SearchContext/SearchContext.test.tsx index 0914af4c38..4de2a8f0a6 100644 --- a/plugins/search/src/components/SearchContext/SearchContext.test.tsx +++ b/plugins/search/src/components/SearchContext/SearchContext.test.tsx @@ -18,12 +18,12 @@ 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'; -jest.mock('@backstage/core', () => ({ - ...jest.requireActual('@backstage/core'), +import { useApi } from '@backstage/core-plugin-api'; + +jest.mock('@backstage/core-plugin-api', () => ({ + ...jest.requireActual('@backstage/core-plugin-api'), useApi: jest.fn(), })); diff --git a/plugins/search/src/components/SearchContext/SearchContext.tsx b/plugins/search/src/components/SearchContext/SearchContext.tsx index 64512b3887..eee72d9fc5 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 0ba91cc715..e8c2f048b9 100644 --- a/plugins/search/src/components/SearchFilter/SearchFilter.test.tsx +++ b/plugins/search/src/components/SearchFilter/SearchFilter.test.tsx @@ -17,13 +17,13 @@ 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'; -jest.mock('@backstage/core', () => ({ - ...jest.requireActual('@backstage/core'), +import { SearchContextProvider } from '../SearchContext'; +import { useApi } from '@backstage/core-plugin-api'; + +jest.mock('@backstage/core-plugin-api', () => ({ + ...jest.requireActual('@backstage/core-plugin-api'), useApi: jest.fn().mockReturnValue({}), })); diff --git a/plugins/search/src/components/SearchResult/SearchResult.tsx b/plugins/search/src/components/SearchResult/SearchResult.tsx index a713ae3372..7ca5964d21 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 342e278ba3..883829d44e 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 1bed6734f5..d89bb566e9 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/api-report.md b/plugins/sentry/api-report.md index ffd3071b92..c3cce9ed7c 100644 --- a/plugins/sentry/api-report.md +++ b/plugins/sentry/api-report.md @@ -4,12 +4,12 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { DiscoveryApi } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { InfoCardVariants } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { InfoCardVariants } from '@backstage/core-components'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntitySentryCard: () => JSX.Element; diff --git a/plugins/sentry/dev/index.tsx b/plugins/sentry/dev/index.tsx index 8b4cd26eb5..b2eb617cf4 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/package.json b/plugins/sentry/package.json index 0aea331aba..7f8c838aec 100644 --- a/plugins/sentry/package.json +++ b/plugins/sentry/package.json @@ -32,7 +32,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.3", - "@backstage/core": "^0.7.13", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.3", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -47,6 +48,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/sentry/src/api/production-api.ts b/plugins/sentry/src/api/production-api.ts index 4a87264f5f..0e7f5b784d 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 dfda3d3875..a755ca0941 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 75bb345232..67cd354d93 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 0e10bcc799..01a2b8be1b 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 220bdd9455..9d1fbf8b2a 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 f48922ea31..75de6ba6dc 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/api-report.md b/plugins/shortcuts/api-report.md index 4c0b3132d6..b29328d2e6 100644 --- a/plugins/shortcuts/api-report.md +++ b/plugins/shortcuts/api-report.md @@ -4,11 +4,11 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { Observable } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/core-plugin-api'; import ObservableImpl from 'zen-observable'; -import { StorageApi } from '@backstage/core'; +import { StorageApi } from '@backstage/core-plugin-api'; // @public export class LocalStoredShortcuts implements ShortcutApi { diff --git a/plugins/shortcuts/package.json b/plugins/shortcuts/package.json index cd5384c215..2fad8c4929 100644 --- a/plugins/shortcuts/package.json +++ b/plugins/shortcuts/package.json @@ -20,7 +20,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -36,6 +37,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/shortcuts/src/AddShortcut.test.tsx b/plugins/shortcuts/src/AddShortcut.test.tsx index 68dd63eb37..b35b4c588d 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 7f07b726b7..4429dbaeb0 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 270589008a..a08299055b 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 272a87ddf1..702275e90e 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 f1b2d54faa..0b5c5fc919 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 d51cec0599..ce0af3d08b 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 7f259a93ff..9182bcb47d 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 1be85a6d6a..775b0b3809 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 bf8646cc61..8a713b9b8f 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 37881fab2e..c7802a0385 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 42947e5916..de1e706f8e 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/api-report.md b/plugins/sonarqube/api-report.md index 6d4af3d548..46bffb0a44 100644 --- a/plugins/sonarqube/api-report.md +++ b/plugins/sonarqube/api-report.md @@ -4,9 +4,9 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { InfoCardVariants } from '@backstage/core'; +import { InfoCardVariants } from '@backstage/core-components'; // @public (undocumented) export const EntitySonarQubeCard: ({ variant, duplicationRatings, }: { diff --git a/plugins/sonarqube/dev/index.tsx b/plugins/sonarqube/dev/index.tsx index 0860ef3ad5..bba859195f 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/package.json b/plugins/sonarqube/package.json index 115d8e1f61..b86f51c66c 100644 --- a/plugins/sonarqube/package.json +++ b/plugins/sonarqube/package.json @@ -33,8 +33,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.2", - "@backstage/core": "^0.7.11", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -48,6 +49,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/sonarqube/src/api/SonarQubeApi.ts b/plugins/sonarqube/src/api/SonarQubeApi.ts index a3093f52ee..5bafd87ca8 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 0639504af5..816cf19b5e 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 64c89e5835..f7f1cac92d 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 5f3e9b836a..03c952a384 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 9316e4314e..d542d40b17 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/api-report.md b/plugins/splunk-on-call/api-report.md index 3a2f085b0b..8ffe13660d 100644 --- a/plugins/splunk-on-call/api-report.md +++ b/plugins/splunk-on-call/api-report.md @@ -4,12 +4,12 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { ConfigApi } from '@backstage/core'; -import { DiscoveryApi } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { ConfigApi } from '@backstage/core-plugin-api'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const EntitySplunkOnCallCard: () => JSX.Element; diff --git a/plugins/splunk-on-call/package.json b/plugins/splunk-on-call/package.json index 714283d5b4..510a9620bd 100644 --- a/plugins/splunk-on-call/package.json +++ b/plugins/splunk-on-call/package.json @@ -31,7 +31,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.3", - "@backstage/core": "^0.7.13", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/plugin-catalog-react": "^0.2.3", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", @@ -46,6 +47,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/splunk-on-call/src/api/client.ts b/plugins/splunk-on-call/src/api/client.ts index 3454572ce3..a0256fcf07 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 de5a8123fe..0bdd093ad1 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 143df527dd..4ca86ee412 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 f133aec8c0..98a706d67f 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 eea4264da6..bc8aa05813 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 f81bc5d852..53b37b0a7a 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 1f315bb21e..b4c10ddcf8 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 54cf202cea..fac8f5e2f7 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 ac9abaa195..df4254d3ad 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 9614ffb3a5..7dd95179dd 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 55f32c8cfe..1f5bb49410 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 120a33bb31..94fd40bfe5 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 b970d17bdc..4d2c60f7b2 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 18828f06c1..0be25b3787 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/api-report.md b/plugins/tech-radar/api-report.md index 20367c5525..f8bcc84d3a 100644 --- a/plugins/tech-radar/api-report.md +++ b/plugins/tech-radar/api-report.md @@ -4,9 +4,9 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export interface RadarEntry { diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json index efc99d8890..824c8ba211 100644 --- a/plugins/tech-radar/package.json +++ b/plugins/tech-radar/package.json @@ -30,7 +30,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.7.12", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -44,6 +45,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/tech-radar/src/api.ts b/plugins/tech-radar/src/api.ts index 995e380d83..fe574fcfd1 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 a4d89f5bd0..bbed3028e7 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 8312ccff6c..fe42ad8e78 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 5dbf5e48c3..320e85f8bf 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 f2099718e2..f4b768d369 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 4733c8beec..2393ccc9c6 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 8f1b5bc8c0..de8a82df3f 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/api-report.md b/plugins/techdocs/api-report.md index 69a62b4362..dbd5e3ab26 100644 --- a/plugins/techdocs/api-report.md +++ b/plugins/techdocs/api-report.md @@ -4,16 +4,16 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; import { Config } from '@backstage/config'; import { CSSProperties } from '@material-ui/styles'; -import { DiscoveryApi } from '@backstage/core'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { EntityName } from '@backstage/catalog-model'; -import { IdentityApi } from '@backstage/core'; +import { IdentityApi } from '@backstage/core-plugin-api'; import { Location as Location_2 } from '@backstage/catalog-model'; -import { RouteRef } from '@backstage/core'; +import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) export const DocsCardGrid: ({ entities, }: { diff --git a/plugins/techdocs/dev/index.tsx b/plugins/techdocs/dev/index.tsx index d7268f2cc9..cdc81caa5a 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/package.json b/plugins/techdocs/package.json index bc336ec976..e7f5f914bc 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -31,14 +31,15 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.5", "@backstage/catalog-model": "^0.8.3", - "@backstage/core": "^0.7.13", + "@backstage/config": "^0.1.5", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", + "@backstage/errors": "^0.1.1", "@backstage/integration": "^0.5.6", "@backstage/integration-react": "^0.1.3", "@backstage/plugin-catalog-react": "^0.2.3", "@backstage/theme": "^0.2.8", - "@backstage/errors": "^0.1.1", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -52,15 +53,16 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", "@testing-library/react-hooks": "^3.4.2", "@testing-library/user-event": "^13.1.8", - "@types/react": "^16.9", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", + "@types/react": "^16.9", "canvas": "^2.6.1", "cross-fetch": "^3.0.6", "msw": "^0.21.2" diff --git a/plugins/techdocs/src/Router.tsx b/plugins/techdocs/src/Router.tsx index 46894b4899..6218f7520d 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 df953bbbf9..739c5fc133 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 416e24f96b..329d3cbcb6 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 08fe2d4cac..19fc565a2f 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 2cd81c69bc..500debaf2d 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 c840bc3253..031f09868f 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 c159cd21f5..304daeee87 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 028d0f673b..9b106c94ce 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 f18b05f12f..f90b35e181 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 aea459757c..39544500bd 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 e1069e8814..7824754231 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 68b575d728..f80cf6cc4c 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 c434703c79..430b8e6c05 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 431e6aa9c9..1d80683d63 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 fe103cf4cf..88c53a38a7 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 5339411d88..38e122e9cb 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 42624a7a41..7089f5ae08 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 828a525690..377a2d23ef 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 a081cd8a95..1edf41af30 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 3cadcf4702..ac5145ee49 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 473e49b1bf..d10a464d8a 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/todo/package.json b/plugins/todo/package.json index 035efb6eac..34f381f340 100644 --- a/plugins/todo/package.json +++ b/plugins/todo/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "@backstage/catalog-model": "^0.8.2", - "@backstage/core-components": "^0.1.2", + "@backstage/core-components": "^0.1.3", "@backstage/core-plugin-api": "^0.1.2", "@backstage/errors": "^0.1.1", "@backstage/plugin-catalog-react": "^0.2.2", diff --git a/plugins/user-settings/api-report.md b/plugins/user-settings/api-report.md index 2f882f3742..3c417f7a0b 100644 --- a/plugins/user-settings/api-report.md +++ b/plugins/user-settings/api-report.md @@ -4,11 +4,11 @@ ```ts -import { ApiRef } from '@backstage/core'; -import { BackstagePlugin } from '@backstage/core'; -import { IconComponent } from '@backstage/core'; -import { RouteRef } from '@backstage/core'; -import { SessionApi } from '@backstage/core'; +import { ApiRef } from '@backstage/core-plugin-api'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { IconComponent } from '@backstage/core-plugin-api'; +import { RouteRef } from '@backstage/core-plugin-api'; +import { SessionApi } from '@backstage/core-plugin-api'; // @public (undocumented) export const AuthProviders: ({ providerSettings }: Props_2) => JSX.Element; diff --git a/plugins/user-settings/package.json b/plugins/user-settings/package.json index bdf1a0026c..97a88f5150 100644 --- a/plugins/user-settings/package.json +++ b/plugins/user-settings/package.json @@ -30,7 +30,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.7.13", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -42,6 +43,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/core-plugin-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", diff --git a/plugins/user-settings/src/components/AuthProviders/AuthProviders.test.tsx b/plugins/user-settings/src/components/AuthProviders/AuthProviders.test.tsx index 5235777b7f..abb2f2f42c 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 dcf50984b1..1456380d55 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 d9abd20e30..91438e5a5d 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 208849350d..082cb5e8ac 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 f4d6b34cfd..53fa127e36 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 edfbe3ae26..878141f7dc 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 2834af2999..2fee2157e2 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 8b03c922aa..62861d99a9 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 a277ef84ea..a9a09a98f5 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 da7d33daea..67f2326c14 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 9fcfd97c7a..acf9891dec 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 fc605071f1..97391e8372 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 e7f223dcab..68e65fdffe 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 7ca4ad7af0..b69cd8d53e 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 950895cd6e..fd255969a5 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 518c47f572..d9fc3ea107 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 af2a54b5f0..deb8dddf58 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 25bc5f6091..433f24c2c8 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 bf7d93d84c..336ea34ee4 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 1ec4126d21..29d718f66a 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/api-report.md b/plugins/welcome/api-report.md index 8d6e1cb156..727be3ad75 100644 --- a/plugins/welcome/api-report.md +++ b/plugins/welcome/api-report.md @@ -4,7 +4,7 @@ ```ts -import { BackstagePlugin } from '@backstage/core'; +import { BackstagePlugin } from '@backstage/core-plugin-api'; // @public (undocumented) export const WelcomePage: () => JSX.Element; diff --git a/plugins/welcome/package.json b/plugins/welcome/package.json index a5c00bfc9e..df0ceeecf4 100644 --- a/plugins/welcome/package.json +++ b/plugins/welcome/package.json @@ -30,7 +30,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.7.11", + "@backstage/core-components": "^0.1.3", + "@backstage/core-plugin-api": "^0.1.2", "@backstage/theme": "^0.2.8", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -42,6 +43,7 @@ }, "devDependencies": { "@backstage/cli": "^0.7.1", + "@backstage/core-app-api": "^0.1.2", "@backstage/dev-utils": "^0.1.17", "@backstage/test-utils": "^0.1.13", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx b/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx index 053ed080d1..22be84a4bf 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 2585db9203..ce45b1b031 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 c996ce2b87..bd52b67318 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',