Merge remote-tracking branch 'origin/master' into orkohunter/techdocs-publish-to-cloud-storage

This commit is contained in:
Himanshu Mishra
2020-12-10 21:12:31 +01:00
258 changed files with 2283 additions and 1315 deletions
+149
View File
@@ -1,5 +1,154 @@
# @backstage/create-app
## 0.2.4
### Patch Changes
- 94348441e: Add `"files": ["dist"]` to both app and backend packages. This ensures that packaged versions of these packages do not contain unnecessary files.
To apply this change to an existing app, add the following to `packages/app/package.json` and `packages/backend/package.json`:
```json
"files": [
"dist"
]
```
- cb5fc4b29: Adjust template to the latest changes in the `api-docs` plugin.
## Template Changes
While updating to the latest `api-docs` plugin, the following changes are
necessary for the `create-app` template in your
`app/src/components/catalog/EntityPage.tsx`. This adds:
- A custom entity page for API entities
- Changes the API tab to include the new `ConsumedApisCard` and
`ProvidedApisCard` that link to the API entity.
```diff
import {
+ ApiDefinitionCard,
- Router as ApiDocsRouter,
+ ConsumedApisCard,
+ ProvidedApisCard,
+ ConsumedApisCard,
+ ConsumingComponentsCard,
+ ProvidedApisCard,
+ ProvidingComponentsCard
} from '@backstage/plugin-api-docs';
...
+const ComponentApisContent = ({ entity }: { entity: Entity }) => (
+ <Grid container spacing={3} alignItems="stretch">
+ <Grid item md={6}>
+ <ProvidedApisCard entity={entity} />
+ </Grid>
+ <Grid item md={6}>
+ <ConsumedApisCard entity={entity} />
+ </Grid>
+ </Grid>
+);
const ServiceEntityPage = ({ entity }: { entity: Entity }) => (
<EntityPageLayout>
<EntityPageLayout.Content
path="/"
title="Overview"
element={<OverviewContent entity={entity} />}
/>
<EntityPageLayout.Content
path="/ci-cd/*"
title="CI/CD"
element={<CICDSwitcher entity={entity} />}
/>
<EntityPageLayout.Content
path="/api/*"
title="API"
- element={<ApiDocsRouter entity={entity} />}
+ element={<ComponentApisContent entity={entity} />}
/>
...
-export const EntityPage = () => {
- const { entity } = useEntity();
- switch (entity?.spec?.type) {
- case 'service':
- return <ServiceEntityPage entity={entity} />;
- case 'website':
- return <WebsiteEntityPage entity={entity} />;
- default:
- return <DefaultEntityPage entity={entity} />;
- }
-};
+export const ComponentEntityPage = ({ entity }: { entity: Entity }) => {
+ switch (entity?.spec?.type) {
+ case 'service':
+ return <ServiceEntityPage entity={entity} />;
+ case 'website':
+ return <WebsiteEntityPage entity={entity} />;
+ default:
+ return <DefaultEntityPage entity={entity} />;
+ }
+};
+
+const ApiOverviewContent = ({ entity }: { entity: Entity }) => (
+ <Grid container spacing={3}>
+ <Grid item md={6}>
+ <AboutCard entity={entity} />
+ </Grid>
+ <Grid container item md={12}>
+ <Grid item md={6}>
+ <ProvidingComponentsCard entity={entity} />
+ </Grid>
+ <Grid item md={6}>
+ <ConsumingComponentsCard entity={entity} />
+ </Grid>
+ </Grid>
+ </Grid>
+);
+
+const ApiDefinitionContent = ({ entity }: { entity: ApiEntity }) => (
+ <Grid container spacing={3}>
+ <Grid item xs={12}>
+ <ApiDefinitionCard apiEntity={entity} />
+ </Grid>
+ </Grid>
+);
+
+const ApiEntityPage = ({ entity }: { entity: Entity }) => (
+ <EntityPageLayout>
+ <EntityPageLayout.Content
+ path="/*"
+ title="Overview"
+ element={<ApiOverviewContent entity={entity} />}
+ />
+ <EntityPageLayout.Content
+ path="/definition/*"
+ title="Definition"
+ element={<ApiDefinitionContent entity={entity as ApiEntity} />}
+ />
+ </EntityPageLayout>
+);
+
+export const EntityPage = () => {
+ const { entity } = useEntity();
+
+ switch (entity?.kind?.toLowerCase()) {
+ case 'component':
+ return <ComponentEntityPage entity={entity} />;
+ case 'api':
+ return <ApiEntityPage entity={entity} />;
+ default:
+ return <DefaultEntityPage entity={entity} />;
+ }
+};
```
- 1e22f8e0b: Unify `dockerode` library and type dependency versions
## 0.2.3
### Patch Changes
+26 -26
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/create-app",
"description": "Create app package for Backstage",
"version": "0.2.3",
"version": "0.2.4",
"private": false,
"publishConfig": {
"access": "public"
@@ -37,31 +37,31 @@
"recursive-readdir": "^2.2.2"
},
"devDependencies": {
"@backstage/backend-common": "^0.3.3",
"@backstage/catalog-model": "^0.4.0",
"@backstage/cli": "^0.4.0",
"@backstage/config": "^0.1.1",
"@backstage/core": "^0.3.2",
"@backstage/plugin-api-docs": "^0.3.1",
"@backstage/plugin-app-backend": "^0.3.2",
"@backstage/plugin-auth-backend": "^0.2.5",
"@backstage/plugin-catalog": "^0.2.5",
"@backstage/plugin-catalog-backend": "^0.3.0",
"@backstage/plugin-circleci": "^0.2.3",
"@backstage/plugin-explore": "^0.2.1",
"@backstage/plugin-github-actions": "^0.2.3",
"@backstage/plugin-lighthouse": "^0.2.4",
"@backstage/plugin-proxy-backend": "^0.2.2",
"@backstage/plugin-register-component": "^0.2.3",
"@backstage/plugin-rollbar-backend": "^0.1.4",
"@backstage/plugin-scaffolder": "^0.3.2",
"@backstage/plugin-scaffolder-backend": "^0.3.3",
"@backstage/plugin-tech-radar": "^0.3.0",
"@backstage/plugin-techdocs": "^0.3.1",
"@backstage/plugin-techdocs-backend": "^0.3.1",
"@backstage/plugin-user-settings": "^0.2.2",
"@backstage/test-utils": "^0.1.4",
"@backstage/theme": "^0.2.1",
"@backstage/backend-common": "^0.4.0",
"@backstage/catalog-model": "^0.5.0",
"@backstage/cli": "^0.4.1",
"@backstage/config": "^0.1.2",
"@backstage/core": "^0.4.0",
"@backstage/plugin-api-docs": "^0.4.0",
"@backstage/plugin-app-backend": "^0.3.3",
"@backstage/plugin-auth-backend": "^0.2.6",
"@backstage/plugin-catalog": "^0.2.6",
"@backstage/plugin-catalog-backend": "^0.4.0",
"@backstage/plugin-circleci": "^0.2.4",
"@backstage/plugin-explore": "^0.2.2",
"@backstage/plugin-github-actions": "^0.2.4",
"@backstage/plugin-lighthouse": "^0.2.5",
"@backstage/plugin-proxy-backend": "^0.2.3",
"@backstage/plugin-register-component": "^0.2.4",
"@backstage/plugin-rollbar-backend": "^0.1.5",
"@backstage/plugin-scaffolder": "^0.3.3",
"@backstage/plugin-scaffolder-backend": "^0.3.4",
"@backstage/plugin-tech-radar": "^0.3.1",
"@backstage/plugin-techdocs": "^0.4.0",
"@backstage/plugin-techdocs-backend": "^0.3.2",
"@backstage/plugin-user-settings": "^0.2.3",
"@backstage/test-utils": "^0.1.5",
"@backstage/theme": "^0.2.2",
"@types/fs-extra": "^9.0.1",
"@types/inquirer": "^7.3.1",
"@types/ora": "^3.2.0",
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import React from 'react';
import {
createApp,
AlertDisplay,
@@ -32,7 +32,7 @@ const catalogRouteRef = createRouteRef({
});
const App: FC<{}> = () => (
const App = () => (
<AppProvider>
<AlertDisplay />
<OAuthRequestDialog />
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { FC } from 'react';
import React from 'react';
import { makeStyles } from '@material-ui/core';
const useStyles = makeStyles({
@@ -26,7 +26,7 @@ const useStyles = makeStyles({
fill: '#7df3e1',
},
});
const LogoFull: FC<{}> = () => {
const LogoFull = () => {
const classes = useStyles();
return (
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { FC } from 'react';
import React from 'react';
import { makeStyles } from '@material-ui/core';
const useStyles = makeStyles({
@@ -27,7 +27,7 @@ const useStyles = makeStyles({
},
});
const LogoIcon: FC<{}> = () => {
const LogoIcon = () => {
const classes = useStyles();
return (
@@ -1,4 +1,4 @@
import React, { FC, useContext } from 'react';
import React, { useContext } from 'react';
import HomeIcon from '@material-ui/icons/Home';
import LibraryBooks from '@material-ui/icons/LibraryBooks';
import ExtensionIcon from '@material-ui/icons/Extension';
@@ -57,7 +57,7 @@ const useSidebarLogoStyles = makeStyles({
},
});
const SidebarLogo: FC<{}> = () => {
const SidebarLogo = () => {
const classes = useSidebarLogoStyles();
const { isOpen } = useContext(SidebarContext);