Merge pull request #6094 from backstage/rugvip/mod
migrate all packages away from @backstage/core
This commit is contained in:
@@ -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`.
|
||||
@@ -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",
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
oneloginAuthApiRef,
|
||||
oauth2ApiRef,
|
||||
oidcAuthApiRef,
|
||||
} from '@backstage/core';
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
export const providers = [
|
||||
{
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -18,6 +18,15 @@ import chalk from 'chalk';
|
||||
import { diffLines } from 'diff';
|
||||
import { FileDiff, PromptFunc, FileHandler, WriteFileFunc } from './types';
|
||||
|
||||
function sortObjectKeys(obj: Record<string, unknown>) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import {
|
||||
ContentHeader,
|
||||
HeaderLabel,
|
||||
SupportButton,
|
||||
} from '@backstage/core';
|
||||
} from '@backstage/core-components';
|
||||
import { ExampleFetchComponent } from '../ExampleFetchComponent';
|
||||
|
||||
export const ExampleComponent = () => (
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createPlugin, createRoutableExtension } from '@backstage/core';
|
||||
import { createPlugin, createRoutableExtension } from '@backstage/core-plugin-api';
|
||||
|
||||
import { rootRouteRef } from './routes';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createRouteRef } from '@backstage/core';
|
||||
import { createRouteRef } from '@backstage/core-plugin-api';
|
||||
|
||||
export const rootRouteRef = createRouteRef({
|
||||
title: '{{ id }}',
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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'}}",
|
||||
|
||||
@@ -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 }) {
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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: {
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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: {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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<ScmIntegration>;
|
||||
}) => {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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 => (
|
||||
<ApiProvider apis={apis}>
|
||||
<ThemeProvider theme={useDarkMode() ? darkTheme : lightTheme}>
|
||||
|
||||
@@ -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): {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -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\(...\)/,
|
||||
),
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -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<ExternalRouteRef, RouteRef>();
|
||||
|
||||
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 }) => (
|
||||
<MemoryRouter initialEntries={routeEntries} children={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(
|
||||
|
||||
@@ -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()),
|
||||
];
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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('<ApiDefinitionCard />', () => {
|
||||
const apiDocsConfig: jest.Mocked<ApiDocsConfig> = {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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('<ApiTypeTitle />', () => {
|
||||
const apiDocsConfig: jest.Mocked<ApiDocsConfig> = {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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<CatalogApi> = {
|
||||
getEntities: () =>
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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('<ConsumedApisCard />', () => {
|
||||
const apiDocsConfig: jest.Mocked<ApiDocsConfig> = {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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('<HasApisCard />', () => {
|
||||
const apiDocsConfig: jest.Mocked<ApiDocsConfig> = {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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('<ProvidedApisCard />', () => {
|
||||
const apiDocsConfig: jest.Mocked<ApiDocsConfig> = {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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<ApiEntity> {
|
||||
return {
|
||||
|
||||
@@ -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('<ConsumingComponentsCard />', () => {
|
||||
const catalogApi: jest.Mocked<CatalogApi> = {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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('<ProvidingComponentsCard />', () => {
|
||||
const catalogApi: jest.Mocked<CatalogApi> = {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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'));
|
||||
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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<ApiDocsConfig>({
|
||||
id: 'plugin.api-docs.config',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
```ts
|
||||
|
||||
import { BackstagePlugin } from '@backstage/core';
|
||||
import { BackstagePlugin } from '@backstage/core-plugin-api';
|
||||
|
||||
// @public (undocumented)
|
||||
export const badgesPlugin: BackstagePlugin<{}, {}>;
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<BadgesApi>({
|
||||
id: 'plugin.badges.client',
|
||||
|
||||
@@ -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<BadgesApi> = {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { UrlPatternDiscovery } from '@backstage/core';
|
||||
import { msw } from '@backstage/test-utils';
|
||||
import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import { BitriseClientApi } from './bitriseApi.client';
|
||||
import { BitriseApi } from './bitriseApi';
|
||||
import { UrlPatternDiscovery } from '@backstage/core-app-api';
|
||||
|
||||
const server = setupServer();
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DiscoveryApi } from '@backstage/core';
|
||||
import { BitriseApi } from './bitriseApi';
|
||||
import {
|
||||
BitriseBuildResponseItem,
|
||||
@@ -28,6 +27,7 @@ import {
|
||||
import qs from 'qs';
|
||||
import { DateTime, Interval } from 'luxon';
|
||||
import { pickBy, identity } from 'lodash';
|
||||
import { DiscoveryApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export class BitriseClientApi implements BitriseApi {
|
||||
constructor(private readonly discoveryApi: DiscoveryApi) {}
|
||||
|
||||
+1
-1
@@ -17,7 +17,6 @@
|
||||
import React from 'react';
|
||||
import { BitriseBuildResult } from '../../api/bitriseApi.model';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
import { Progress } from '@backstage/core';
|
||||
import { BitriseDownloadArtifactComponent } from '../BitriseDownloadArtifactComponent';
|
||||
import { useBitriseArtifacts } from '../useBitriseArtifacts';
|
||||
import {
|
||||
@@ -26,6 +25,7 @@ import {
|
||||
ListItemSecondaryAction,
|
||||
ListItemText,
|
||||
} from '@material-ui/core';
|
||||
import { Progress } from '@backstage/core-components';
|
||||
|
||||
type BitriseArtifactsComponentComponentProps = {
|
||||
build: BitriseBuildResult;
|
||||
|
||||
@@ -15,18 +15,18 @@
|
||||
*/
|
||||
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import {
|
||||
Content,
|
||||
ContentHeader,
|
||||
MissingAnnotationEmptyState,
|
||||
Page,
|
||||
} from '@backstage/core';
|
||||
import { useEntity } from '@backstage/plugin-catalog-react';
|
||||
import React, { useState } from 'react';
|
||||
import { useBitriseBuildWorkflows } from '../../hooks/useBitriseBuildWorkflows';
|
||||
import { AsyncState } from 'react-use/lib/useAsync';
|
||||
import { BitriseBuildsTable } from '../BitriseBuildsTableComponent';
|
||||
import { Item, Select } from '../Select';
|
||||
import {
|
||||
Content,
|
||||
ContentHeader,
|
||||
MissingAnnotationEmptyState,
|
||||
Page,
|
||||
} from '@backstage/core-components';
|
||||
|
||||
export type Props = {
|
||||
entity: Entity;
|
||||
|
||||
+5
-1
@@ -15,13 +15,17 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { ApiProvider, ApiRegistry, UrlPatternDiscovery } from '@backstage/core';
|
||||
import { bitriseApiRef } from '../../plugin';
|
||||
import { BitriseClientApi } from '../../api/bitriseApi.client';
|
||||
import { setupServer } from 'msw/node';
|
||||
import { msw, renderInTestApp } from '@backstage/test-utils';
|
||||
import { useBitriseBuilds } from '../../hooks/useBitriseBuilds';
|
||||
import { BitriseBuildsTable } from './BitriseBuildsTableComponent';
|
||||
import {
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
UrlPatternDiscovery,
|
||||
} from '@backstage/core-app-api';
|
||||
|
||||
jest.mock('../../hooks/useBitriseBuilds', () => ({
|
||||
useBitriseBuilds: jest.fn(),
|
||||
|
||||
+11
-11
@@ -15,17 +15,6 @@
|
||||
*/
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Table,
|
||||
TableColumn,
|
||||
Link,
|
||||
SubvalueCell,
|
||||
StatusOK,
|
||||
StatusWarning,
|
||||
StatusAborted,
|
||||
StatusError,
|
||||
StatusRunning,
|
||||
} from '@backstage/core';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
import { Button } from '@material-ui/core';
|
||||
import GitHubIcon from '@material-ui/icons/GitHub';
|
||||
@@ -36,6 +25,17 @@ import {
|
||||
} from '../../api/bitriseApi.model';
|
||||
import { BitriseBuildDetailsDialog } from '../BitriseBuildDetailsDialog';
|
||||
import { DateTime } from 'luxon';
|
||||
import {
|
||||
Table,
|
||||
TableColumn,
|
||||
Link,
|
||||
SubvalueCell,
|
||||
StatusOK,
|
||||
StatusWarning,
|
||||
StatusAborted,
|
||||
StatusError,
|
||||
StatusRunning,
|
||||
} from '@backstage/core-components';
|
||||
|
||||
type BitriseBuildsProps = {
|
||||
appName: string;
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { useApi } from '@backstage/core';
|
||||
import { useAsync } from 'react-use';
|
||||
import { BitriseBuildArtifactDetails } from '../api/bitriseApi.model';
|
||||
import { bitriseApiRef } from '../plugin';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export const useBitriseArtifactDetails = (
|
||||
appSlug: string,
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { useApi } from '@backstage/core';
|
||||
import { useAsync } from 'react-use';
|
||||
import { BitriseBuildArtifact } from '../api/bitriseApi.model';
|
||||
import { bitriseApiRef } from '../plugin';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export const useBitriseArtifacts = (appSlug: string, buildSlug: string) => {
|
||||
const bitriseApi = useApi(bitriseApiRef);
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createComponentExtension } from '@backstage/core';
|
||||
import { bitrisePlugin } from './plugin';
|
||||
import { createComponentExtension } from '@backstage/core-plugin-api';
|
||||
|
||||
export const EntityBitriseContent = bitrisePlugin.provide(
|
||||
createComponentExtension({
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { useApi } from '@backstage/core';
|
||||
import { useAsync } from 'react-use';
|
||||
import { bitriseApiRef } from '../plugin';
|
||||
import { AsyncState } from 'react-use/lib/useAsync';
|
||||
import { BitriseApp } from '../api/bitriseApi.model';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export const useBitriseBuildWorkflows = (
|
||||
appName: string,
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { useApi } from '@backstage/core';
|
||||
import { useAsync } from 'react-use';
|
||||
import {
|
||||
BitriseApp,
|
||||
@@ -23,6 +22,7 @@ import {
|
||||
} from '../api/bitriseApi.model';
|
||||
import { bitriseApiRef } from '../plugin';
|
||||
import { AsyncState } from 'react-use/lib/useAsync';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
export const useBitriseBuilds = (
|
||||
appName: string,
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BitriseClientApi } from './api/bitriseApi.client';
|
||||
|
||||
import { BitriseApi } from './api/bitriseApi';
|
||||
import {
|
||||
discoveryApiRef,
|
||||
createApiRef,
|
||||
createApiFactory,
|
||||
createPlugin,
|
||||
} from '@backstage/core';
|
||||
|
||||
import { BitriseClientApi } from './api/bitriseApi.client';
|
||||
import { BitriseApi } from './api/bitriseApi';
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
export const bitriseApiRef = createApiRef<BitriseApi>({
|
||||
id: 'plugin.bitrise.service',
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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[] => [
|
||||
{
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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<CatalogImportApi>({
|
||||
id: 'plugin.catalog-import.service',
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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('<ImportComponentPage />', () => {
|
||||
const identityApi = {
|
||||
getUserId: () => {
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user